This patch implements proper transmission flow control on mshX.
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/* 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;
if (!(priv = wlan_add_card(usb_cardp)))
goto dealloc;
+ if (wlan_add_mesh(priv))
+ goto dealloc;
+
if (libertas_activate_card(priv))
goto dealloc;
libertas_found++;
}
- if (wlan_add_mesh(priv))
- goto dealloc;
-
usb_get_dev(udev);
usb_set_intfdata(intf, usb_cardp);
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_deb_usbd(&cardp->udev->dev, "udev pointer is at %p\n",
cardp->udev);
return -1;
netif_device_detach(cardp->eth_dev);
+ netif_device_detach(priv->mesh_dev);
/* Unlink tx & rx urb */
usb_kill_urb(cardp->tx_urb);
static int if_usb_resume(struct usb_interface *intf)
{
struct usb_card_rec *cardp = usb_get_intfdata(intf);
+ wlan_private *priv = cardp->priv;
lbs_deb_enter(LBS_DEB_USB);
if_usb_submit_rx_urb(cardp->priv);
netif_device_attach(cardp->eth_dev);
+ netif_device_attach(priv->mesh_dev);
lbs_deb_leave(LBS_DEB_USB);
return 0;
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_deb_join("ASSOC_RESP: Associated \n");
memcpy(wrqu.ap_addr.sa_data, adapter->curbssparams.bssid, ETH_ALEN);
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;
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);
+ }
lbs_deb_leave(LBS_DEB_NET);
return 0;
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;
lbs_deb_enter(LBS_DEB_NET);
netif_carrier_off(priv->wlan_dev.netdev);
+ netif_carrier_off(priv->mesh_dev);
priv->open = 0;
lbs_deb_leave(LBS_DEB_NET);
}
netif_stop_queue(priv->wlan_dev.netdev);
+ netif_stop_queue(priv->mesh_dev);
if (libertas_process_tx(priv, skb) == 0)
dev->trans_start = jiffies;
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);
+ }
lbs_deb_leave(LBS_DEB_TX);
}
mesh_dev = priv->mesh_dev;
netif_stop_queue(mesh_dev);
+ netif_carrier_off(priv->mesh_dev);
device_remove_file(&(mesh_dev->dev), &dev_attr_libertas_mpp);
unregister_netdev(mesh_dev);
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);
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,
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:
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 {
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);
}
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);
+ }
}