[PATCH] Fixed transmission flow control on the mesh interface.
Javier Cardona
javier at cozybit.com
Fri Mar 2 19:02:02 EST 2007
From: Luis Carlos Cobo <luisca at cozybit.com>
Signed-off-by: Javier Cardona <javier at cozybit.com>
---
drivers/net/wireless/libertas/if_usb.c | 8 +++++++-
drivers/net/wireless/libertas/join.c | 6 ++++++
drivers/net/wireless/libertas/main.c | 14 +++++++++++---
drivers/net/wireless/libertas/scan.c | 6 ++++--
drivers/net/wireless/libertas/tx.c | 12 +++++++++---
5 files changed, 37 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/libertas/if_usb.c
b/drivers/net/wireless/libertas/if_usb.c
index 055e679..1b3c11f 100644
--- a/drivers/net/wireless/libertas/if_usb.c
+++ b/drivers/net/wireless/libertas/if_usb.c
@@ -55,8 +55,10 @@ static void if_usb_write_bulk_callback(s
/* Wake main thread if commands are pending */
if (!adapter->cur_cmd)
wake_up_interruptible(&priv->mainthread.waitq);
- if ((adapter->connect_status == libertas_connected))
+ if ((adapter->connect_status == libertas_connected)) {
netif_wake_queue(dev);
+ netif_wake_queue(priv->mesh_dev);
+ }
}
return;
@@ -771,6 +773,7 @@ int libertas_sbi_register_dev(wlan_priva
priv->hotplug_device = &(cardp->udev->dev);
SET_NETDEV_DEV(cardp->eth_dev, &(cardp->udev->dev));
+ SET_NETDEV_DEV(priv->mesh_dev, &(cardp->udev->dev));
lbs_dev_dbg(1, &cardp->udev->dev, "udev pointer is at %p\n",
cardp->udev);
@@ -886,6 +889,7 @@ static int if_usb_suspend(struct usb_int
return -1;
netif_device_detach(cardp->eth_dev);
+ netif_device_detach(priv->mesh_dev);
/* Unlink tx & rx urb */
usb_kill_urb(cardp->tx_urb);
@@ -900,6 +904,7 @@ static int if_usb_suspend(struct usb_int
static int if_usb_resume(struct usb_interface *intf)
{
struct usb_card_rec *cardp = usb_get_intfdata(intf);
+ wlan_private *priv = cardp->priv;
ENTER();
@@ -908,6 +913,7 @@ static int if_usb_resume(struct usb_inte
if_usb_submit_rx_urb(cardp->priv);
netif_device_attach(cardp->eth_dev);
+ netif_device_attach(priv->mesh_dev);
LEAVE();
return 0;
diff --git a/drivers/net/wireless/libertas/join.c
b/drivers/net/wireless/libertas/join.c
index f0dfa40..abb72b7 100644
--- a/drivers/net/wireless/libertas/join.c
+++ b/drivers/net/wireless/libertas/join.c
@@ -935,6 +935,9 @@ int libertas_ret_80211_associate(wlan_pr
netif_carrier_on(priv->wlan_dev.netdev);
netif_wake_queue(priv->wlan_dev.netdev);
+ netif_carrier_on(priv->mesh_dev);
+ netif_wake_queue(priv->mesh_dev);
+
lbs_pr_debug(1, "ASSOC_RESP: Associated \n");
memcpy(wrqu.ap_addr.sa_data, adapter->curbssparams.bssid, ETH_ALEN);
@@ -1027,6 +1030,9 @@ int libertas_ret_80211_ad_hoc_start(wlan
netif_carrier_on(priv->wlan_dev.netdev);
netif_wake_queue(priv->wlan_dev.netdev);
+ netif_carrier_on(priv->mesh_dev);
+ netif_wake_queue(priv->mesh_dev);
+
memset(&wrqu, 0, sizeof(wrqu));
memcpy(wrqu.ap_addr.sa_data, adapter->curbssparams.bssid, ETH_ALEN);
wrqu.ap_addr.sa_family = ARPHRD_ETHER;
diff --git a/drivers/net/wireless/libertas/main.c
b/drivers/net/wireless/libertas/main.c
index dec6cd7..6e10577 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -255,8 +255,11 @@ static int wlan_dev_open(struct net_devi
if (adapter->connect_status == libertas_connected) {
netif_carrier_on(priv->wlan_dev.netdev);
- } else
+ netif_carrier_on(priv->mesh_dev);
+ } else {
netif_carrier_off(priv->wlan_dev.netdev);
+ netif_carrier_off(priv->mesh_dev);
+ }
LEAVE();
return 0;
@@ -274,7 +277,7 @@ static int mesh_open(struct net_device *
if(pre_open_check(dev) == -1)
return -1;
priv->mesh_open = 1 ;
- netif_start_queue(priv->mesh_dev);
+ netif_wake_queue(priv->mesh_dev);
if (priv->infra_open == 0)
return wlan_dev_open(priv->wlan_dev.netdev) ;
return 0;
@@ -306,6 +309,7 @@ static int wlan_dev_close(struct net_dev
ENTER();
netif_carrier_off(priv->wlan_dev.netdev);
+ netif_carrier_off(priv->mesh_dev);
priv->open = 0;
LEAVE();
@@ -361,6 +365,7 @@ static int wlan_hard_start_xmit(struct s
}
netif_stop_queue(priv->wlan_dev.netdev);
+ netif_stop_queue(priv->mesh_dev);
if (libertas_process_tx(priv, skb) == 0)
dev->trans_start = jiffies;
@@ -413,8 +418,10 @@ static void wlan_tx_timeout(struct net_d
libertas_send_tx_feedback(priv);
} else
wake_up_interruptible(&priv->mainthread.waitq);
- } else if (priv->adapter->connect_status == libertas_connected)
+ } else if (priv->adapter->connect_status == libertas_connected) {
netif_wake_queue(priv->wlan_dev.netdev);
+ netif_wake_queue(priv->mesh_dev);
+ }
LEAVE();
}
@@ -1062,6 +1069,7 @@ void libertas_interrupt(struct net_devic
if (priv->adapter->psstate == PS_STATE_SLEEP) {
priv->adapter->psstate = PS_STATE_AWAKE;
netif_wake_queue(dev);
+ netif_wake_queue(priv->mesh_dev);
}
wake_up_interruptible(&priv->mainthread.waitq);
diff --git a/drivers/net/wireless/libertas/scan.c
b/drivers/net/wireless/libertas/scan.c
index bc05463..c831d73 100644
--- a/drivers/net/wireless/libertas/scan.c
+++ b/drivers/net/wireless/libertas/scan.c
@@ -834,6 +834,8 @@ int wlan_scan_networks(wlan_private * pr
if (!scancurrentchanonly) {
netif_stop_queue(priv->wlan_dev.netdev);
netif_carrier_off(priv->wlan_dev.netdev);
+ netif_stop_queue(priv->mesh_dev);
+ netif_carrier_off(priv->mesh_dev);
}
ret = wlan_scan_channel_list(priv,
@@ -852,8 +854,8 @@ int wlan_scan_networks(wlan_private * pr
wlan_scan_process_results(priv);
if (priv->adapter->connect_status == libertas_connected) {
- netif_carrier_on(priv->wlan_dev.netdev);
- netif_wake_queue(priv->wlan_dev.netdev);
+ netif_carrier_on(priv->mesh_dev);
+ netif_wake_queue(priv->mesh_dev);
}
out:
diff --git a/drivers/net/wireless/libertas/tx.c
b/drivers/net/wireless/libertas/tx.c
index b07e499..6facb41 100644
--- a/drivers/net/wireless/libertas/tx.c
+++ b/drivers/net/wireless/libertas/tx.c
@@ -159,6 +159,7 @@ static int SendSinglePacket(wlan_private
skb_orphan(skb);
/* stop processing outgoing pkts */
netif_stop_queue(priv->wlan_dev.netdev);
+ netif_stop_queue(priv->mesh_dev);
/* freeze any packets already in our queues */
priv->adapter->TxLockFlag = 1;
} else {
@@ -195,10 +196,13 @@ static void wlan_tx_queue(wlan_private *
WARN_ON(priv->adapter->tx_queue_idx >= NR_TX_QUEUE);
adapter->tx_queue_ps[adapter->tx_queue_idx++] = skb;
- if (adapter->tx_queue_idx == NR_TX_QUEUE)
+ if (adapter->tx_queue_idx == NR_TX_QUEUE) {
netif_stop_queue(priv->wlan_dev.netdev);
- else
+ netif_stop_queue(priv->mesh_dev);
+ } else {
netif_start_queue(priv->wlan_dev.netdev);
+ netif_start_queue(priv->mesh_dev);
+ }
spin_unlock(&adapter->txqueue_lock);
}
@@ -280,6 +284,8 @@ #endif
libertas_upload_rx_packet(priv, adapter->currenttxskb);
adapter->currenttxskb = NULL;
priv->adapter->TxLockFlag = 0;
- if (priv->adapter->connect_status == libertas_connected)
+ if (priv->adapter->connect_status == libertas_connected) {
netif_wake_queue(priv->wlan_dev.netdev);
+ netif_wake_queue(priv->mesh_dev);
+ }
}
--
1.4.2
More information about the Devel
mailing list