- ethinf transmit queue full notification added

This commit is contained in:
Wiesner András 2024-04-23 10:57:04 +02:00
parent c269f4a8bd
commit d8a657a88d

View File

@ -127,8 +127,11 @@ void ethinf_receive(EthInterface *intf, const RawPckt *rawPckt) {
} }
void ethinf_transmit(EthInterface *intf, const RawPckt *rawPckt) { void ethinf_transmit(EthInterface *intf, const RawPckt *rawPckt) {
mq_push(intf->txQ, rawPckt); // push packet onto the message queue if (mq_push(intf->txQ, rawPckt)) { // push packet onto the message queue
ethinf_push_notification(intf, ETH_IIE_TRANSMIT_NOTIFY, 0); // notify processing thread of the peding transmit ethinf_push_notification(intf, ETH_IIE_TRANSMIT_NOTIFY, 0); // notify processing thread of the peding transmit
} else {
ERROR("Interface transmit queue full!\n");
}
} }
void ethinf_push_notification(EthInterface *intf, uint16_t event_code, uint16_t event_data) { void ethinf_push_notification(EthInterface *intf, uint16_t event_code, uint16_t event_data) {
@ -148,7 +151,7 @@ void ethinf_pull_notification(EthInterface *intf, uint16_t *event_code, uint16_t
*event_code = cpd & 0xFFFF; *event_code = cpd & 0xFFFF;
*event_data = (cpd >> 16) & 0xFFFF; *event_data = (cpd >> 16) & 0xFFFF;
//MSG("EC: %d\n", *event_code); // MSG("EC: %d\n", *event_code);
} }
void ethinf_set_capabilities(EthInterface *intf, uint32_t cap) { void ethinf_set_capabilities(EthInterface *intf, uint32_t cap) {