tasklets on 2.4

This commit is contained in:
solomon 2002-11-14 15:57:11 +00:00
parent 0e5f714244
commit 5ffdd39684
2 changed files with 25 additions and 1 deletions

View File

@ -225,7 +225,11 @@ typedef struct wlandevice
#endif
/* Rx bottom half */
#ifdef DECLARE_TASKLET /* use tasklets */
struct tasklet_struct rx_bh;
#else
struct tq_struct rx_bh;
#endif
struct sk_buff_head nsd_rxq;
/* 802.11 device statistics */

View File

@ -122,7 +122,11 @@ static struct proc_dir_entry *proc_p80211;
static int wlandev_get_index(wlandevice_t *wlandev);
static void wlandev_clear_index(wlandevice_t *wlandev);
#ifdef DECLARE_TASKLET
static void p80211netdev_rx_bh(unsigned long arg);
#else
static void p80211netdev_rx_bh(void *arg);
#endif
/* netdevice method functions */
static int p80211knetdev_init( netdevice_t *netdev);
@ -349,8 +353,12 @@ p80211netdev_rx(wlandevice_t *wlandev, struct sk_buff *skb )
/* Enqueue for post-irq processing */
skb_queue_tail(&wlandev->nsd_rxq, skb);
#ifdef DECLARE_TASKLET
tasklet_schedule(&wlandev->rx_bh);
#else
queue_task(&wlandev->rx_bh, &tq_immediate);
mark_bh(IMMEDIATE_BH);
#endif
DBFEXIT;
return;
@ -369,7 +377,13 @@ p80211netdev_rx(wlandevice_t *wlandev, struct sk_buff *skb )
* Side effects:
*
----------------------------------------------------------------*/
void p80211netdev_rx_bh(void *arg)
#ifdef DECLARE_TASKLET
void
p80211netdev_rx_bh(unsigned long arg)
#else
void
p80211netdev_rx_bh(void *arg)
#endif
{
wlandevice_t *wlandev = (wlandevice_t *) arg;
struct sk_buff *skb = NULL;
@ -850,9 +864,15 @@ int wlan_setup(wlandevice_t *wlandev)
/* Set up the rx queue */
skb_queue_head_init(&wlandev->nsd_rxq);
#ifdef DECLARE_TASKLET
tasklet_init(&wlandev->rx_bh,
p80211netdev_rx_bh,
(unsigned long)wlandev);
#else
INIT_TQUEUE(&wlandev->rx_bh,
p80211netdev_rx_bh,
(void*)wlandev);
#endif
/* Allocate and initialize the struct device */
dev = kmalloc(sizeof(netdevice_t), GFP_ATOMIC);