/* reception packet. */ static struct pbuf *mrvl_wlan_rx(rt_device_t dev) { WlanCard *card; Rx_Pbuf_List *RxListHead; struct pbuf* p; rt_base_t level; RT_ASSERT(dev != RT_NULL); card = WLAN_CARD(dev); __again: p = RT_NULL; RxListHead = RT_NULL; level = rt_hw_interrupt_disable(); if (card->RxList.next != &card->RxList) { RxListHead=card->RxList.next; p=RxListHead->p; card->RxList.next=RxListHead->next; RxListHead->next->pre=RxListHead->pre; card->RxQueueCount-- ; } rt_hw_interrupt_enable(level); if (RxListHead != RT_NULL) { rt_free(RxListHead); RxListHead = RT_NULL; } if ((p != RT_NULL) && (is_ieee802_11(p) == RT_TRUE)) goto __again; if (p != RT_NULL) { hexdump("Rx Packet: \n", p->payload, p->len); } return p; }
/* reception packet. */ struct pbuf *rt_wlan_dev_rx(rt_device_t dev) { struct rt_wlan_dev* netdev=(struct rt_wlan_dev*)(dev->user_data); WlanInfo* wlan=netdev->priv; WlanCard * card=wlan->card; Rx_Pbuf_List *RxListHead; struct pbuf* p; rt_base_t level; __again: p = RT_NULL; RxListHead = RT_NULL; level = rt_hw_interrupt_disable(); if (card->RxList.next != &card->RxList) { RxListHead=card->RxList.next; p=RxListHead->p; card->RxList.next=RxListHead->next; RxListHead->next->pre=RxListHead->pre; card->RxQueueCount-- ; } rt_hw_interrupt_enable(level); if (RxListHead != RT_NULL) { rt_free(RxListHead); RxListHead = RT_NULL; } if ((p != RT_NULL) && (is_ieee802_11(p) == RT_TRUE)) goto __again; if (p != RT_NULL) { hexdump("Rx Packet: \n", p->payload, p->len); } return p; }