Commit 01d77d8d authored by Brajesh Dave's avatar Brajesh Dave Committed by David S. Miller

libertas: separate mesh connectivity from that of the main interface

The transmit and receive traffic as soon as the mesh interface is
brought up.

Test case 1:  Bring up only the mesh interface and ping.  No need for
any iwconfig commands on the main interface.

$ ifconfig msh0 192.168.5.3
$ iwconfig msh0 channel X
$ ping 192.168.5.2
If ping succeeds, PASS

Test case 2:  Associate with the main interface, and turn off AP.  Mesh
interface should not lose connectivity.

$ iwconfig eth0 mode managed essid "my_ssid"
$ ifconfig msh0 192.168.5.3
$ ping 192.168.5.2
<turn off access point>
If ping continues uninterrupted, PASS

This feature requires firmware version 5.110.19.p0 or newer, available
here: http://dev.laptop.org/pub/firmware/libertas/Signed-off-by: default avatarAshish Shukla <ashishs@marvell.com>
Signed-off-by: default avatarJavier Cardona <javier@cozybit.com>
Signed-off-by: default avatarDan Williams <dcbw@redhat.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 798fbfec
...@@ -1755,7 +1755,8 @@ int lbs_execute_next_command(lbs_private * priv) ...@@ -1755,7 +1755,8 @@ int lbs_execute_next_command(lbs_private * priv)
*/ */
if ((adapter->psmode != LBS802_11POWERMODECAM) && if ((adapter->psmode != LBS802_11POWERMODECAM) &&
(adapter->psstate == PS_STATE_FULL_POWER) && (adapter->psstate == PS_STATE_FULL_POWER) &&
(adapter->connect_status == LBS_CONNECTED)) { ((adapter->connect_status == LBS_CONNECTED) ||
(adapter->mesh_connect_status == LBS_CONNECTED))) {
if (adapter->secinfo.WPAenabled || if (adapter->secinfo.WPAenabled ||
adapter->secinfo.WPA2enabled) { adapter->secinfo.WPA2enabled) {
/* check for valid WPA group keys */ /* check for valid WPA group keys */
......
...@@ -979,7 +979,7 @@ int lbs_process_event(lbs_private * priv) ...@@ -979,7 +979,7 @@ int lbs_process_event(lbs_private * priv)
break; break;
} }
lbs_pr_info("EVENT: MESH_AUTO_STARTED\n"); lbs_pr_info("EVENT: MESH_AUTO_STARTED\n");
adapter->connect_status = LBS_CONNECTED; adapter->mesh_connect_status = LBS_CONNECTED;
if (priv->mesh_open == 1) { if (priv->mesh_open == 1) {
netif_wake_queue(priv->mesh_dev); netif_wake_queue(priv->mesh_dev);
netif_carrier_on(priv->mesh_dev); netif_carrier_on(priv->mesh_dev);
......
...@@ -291,6 +291,7 @@ struct _lbs_adapter { ...@@ -291,6 +291,7 @@ struct _lbs_adapter {
/** NIC Operation characteristics */ /** NIC Operation characteristics */
u16 currentpacketfilter; u16 currentpacketfilter;
u32 connect_status; u32 connect_status;
u32 mesh_connect_status;
u16 regioncode; u16 regioncode;
u16 txpowerlevel; u16 txpowerlevel;
......
...@@ -73,11 +73,12 @@ static void if_usb_write_bulk_callback(struct urb *urb) ...@@ -73,11 +73,12 @@ static void if_usb_write_bulk_callback(struct urb *urb)
if (!adapter->cur_cmd) if (!adapter->cur_cmd)
wake_up_interruptible(&priv->waitq); wake_up_interruptible(&priv->waitq);
if ((adapter->connect_status == LBS_CONNECTED)) { if (adapter->connect_status == LBS_CONNECTED)
netif_wake_queue(dev); netif_wake_queue(dev);
if (priv->mesh_dev && (adapter->mesh_connect_status == LBS_CONNECTED))
netif_wake_queue(priv->mesh_dev); netif_wake_queue(priv->mesh_dev);
} }
}
} else { } else {
/* print the failure status number for debug */ /* print the failure status number for debug */
lbs_pr_info("URB in failure status: %d\n", urb->status); lbs_pr_info("URB in failure status: %d\n", urb->status);
......
...@@ -795,10 +795,6 @@ int lbs_ret_80211_associate(lbs_private *priv, ...@@ -795,10 +795,6 @@ int lbs_ret_80211_associate(lbs_private *priv,
netif_carrier_on(priv->dev); netif_carrier_on(priv->dev);
netif_wake_queue(priv->dev); netif_wake_queue(priv->dev);
if (priv->mesh_dev) {
netif_carrier_on(priv->mesh_dev);
netif_wake_queue(priv->mesh_dev);
}
memcpy(wrqu.ap_addr.sa_data, adapter->curbssparams.bssid, ETH_ALEN); memcpy(wrqu.ap_addr.sa_data, adapter->curbssparams.bssid, ETH_ALEN);
wrqu.ap_addr.sa_family = ARPHRD_ETHER; wrqu.ap_addr.sa_family = ARPHRD_ETHER;
...@@ -884,11 +880,6 @@ int lbs_ret_80211_ad_hoc_start(lbs_private *priv, ...@@ -884,11 +880,6 @@ int lbs_ret_80211_ad_hoc_start(lbs_private *priv,
netif_carrier_on(priv->dev); netif_carrier_on(priv->dev);
netif_wake_queue(priv->dev); netif_wake_queue(priv->dev);
if (priv->mesh_dev) {
netif_carrier_on(priv->mesh_dev);
netif_wake_queue(priv->mesh_dev);
}
memset(&wrqu, 0, sizeof(wrqu)); memset(&wrqu, 0, sizeof(wrqu));
memcpy(wrqu.ap_addr.sa_data, adapter->curbssparams.bssid, ETH_ALEN); memcpy(wrqu.ap_addr.sa_data, adapter->curbssparams.bssid, ETH_ALEN);
wrqu.ap_addr.sa_family = ARPHRD_ETHER; wrqu.ap_addr.sa_family = ARPHRD_ETHER;
......
...@@ -406,13 +406,15 @@ static int lbs_dev_open(struct net_device *dev) ...@@ -406,13 +406,15 @@ static int lbs_dev_open(struct net_device *dev)
priv->open = 1; priv->open = 1;
if (adapter->connect_status == LBS_CONNECTED) { if (adapter->connect_status == LBS_CONNECTED)
netif_carrier_on(priv->dev); netif_carrier_on(priv->dev);
if (priv->mesh_dev) else
netif_carrier_on(priv->mesh_dev);
} else {
netif_carrier_off(priv->dev); netif_carrier_off(priv->dev);
if (priv->mesh_dev)
if (priv->mesh_dev) {
if (adapter->mesh_connect_status == LBS_CONNECTED)
netif_carrier_on(priv->mesh_dev);
else
netif_carrier_off(priv->mesh_dev); netif_carrier_off(priv->mesh_dev);
} }
...@@ -433,6 +435,11 @@ static int lbs_mesh_open(struct net_device *dev) ...@@ -433,6 +435,11 @@ static int lbs_mesh_open(struct net_device *dev)
return -1; return -1;
priv->mesh_open = 1 ; priv->mesh_open = 1 ;
netif_wake_queue(priv->mesh_dev); netif_wake_queue(priv->mesh_dev);
priv->adapter->mesh_connect_status = LBS_CONNECTED;
netif_carrier_on(priv->mesh_dev);
netif_wake_queue(priv->mesh_dev);
if (priv->infra_open == 0) if (priv->infra_open == 0)
return lbs_dev_open(priv->dev) ; return lbs_dev_open(priv->dev) ;
return 0; return 0;
...@@ -548,7 +555,7 @@ static int lbs_mesh_pre_start_xmit(struct sk_buff *skb, ...@@ -548,7 +555,7 @@ static int lbs_mesh_pre_start_xmit(struct sk_buff *skb,
SET_MESH_FRAME(skb); SET_MESH_FRAME(skb);
ret = lbs_hard_start_xmit(skb, priv->dev); ret = lbs_hard_start_xmit(skb, priv->mesh_dev);
lbs_deb_leave_args(LBS_DEB_MESH, "ret %d", ret); lbs_deb_leave_args(LBS_DEB_MESH, "ret %d", ret);
return ret; return ret;
} }
...@@ -595,9 +602,12 @@ static void lbs_tx_timeout(struct net_device *dev) ...@@ -595,9 +602,12 @@ static void lbs_tx_timeout(struct net_device *dev)
lbs_send_tx_feedback(priv); lbs_send_tx_feedback(priv);
} else } else
wake_up_interruptible(&priv->waitq); wake_up_interruptible(&priv->waitq);
} else if (priv->adapter->connect_status == LBS_CONNECTED) { } else if (dev == priv->dev) {
if (priv->adapter->connect_status == LBS_CONNECTED)
netif_wake_queue(priv->dev); netif_wake_queue(priv->dev);
if (priv->mesh_dev)
} else if (dev == priv->mesh_dev) {
if (priv->adapter->mesh_connect_status == LBS_CONNECTED)
netif_wake_queue(priv->mesh_dev); netif_wake_queue(priv->mesh_dev);
} }
...@@ -1054,6 +1064,7 @@ static int lbs_init_adapter(lbs_private *priv) ...@@ -1054,6 +1064,7 @@ static int lbs_init_adapter(lbs_private *priv)
memset(adapter->current_addr, 0xff, ETH_ALEN); memset(adapter->current_addr, 0xff, ETH_ALEN);
adapter->connect_status = LBS_DISCONNECTED; adapter->connect_status = LBS_DISCONNECTED;
adapter->mesh_connect_status = LBS_DISCONNECTED;
adapter->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM; adapter->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
adapter->mode = IW_MODE_INFRA; adapter->mode = IW_MODE_INFRA;
adapter->curbssparams.channel = DEFAULT_AD_HOC_CHANNEL; adapter->curbssparams.channel = DEFAULT_AD_HOC_CHANNEL;
......
...@@ -297,7 +297,8 @@ static void lbs_scan_create_channel_list(lbs_private *priv, ...@@ -297,7 +297,8 @@ static void lbs_scan_create_channel_list(lbs_private *priv,
for (rgnidx = 0; rgnidx < ARRAY_SIZE(adapter->region_channel); rgnidx++) { for (rgnidx = 0; rgnidx < ARRAY_SIZE(adapter->region_channel); rgnidx++) {
if (priv->adapter->enable11d && if (priv->adapter->enable11d &&
adapter->connect_status != LBS_CONNECTED) { (adapter->connect_status != LBS_CONNECTED) &&
(adapter->mesh_connect_status != LBS_CONNECTED)) {
/* Scan all the supported chan for the first scan */ /* Scan all the supported chan for the first scan */
if (!adapter->universal_channel[rgnidx].valid) if (!adapter->universal_channel[rgnidx].valid)
continue; continue;
...@@ -897,14 +898,15 @@ int lbs_scan_networks(lbs_private *priv, ...@@ -897,14 +898,15 @@ int lbs_scan_networks(lbs_private *priv,
mutex_unlock(&adapter->lock); mutex_unlock(&adapter->lock);
#endif #endif
if (priv->adapter->connect_status == LBS_CONNECTED) { if (adapter->connect_status == LBS_CONNECTED) {
netif_carrier_on(priv->dev); netif_carrier_on(priv->dev);
netif_wake_queue(priv->dev); netif_wake_queue(priv->dev);
if (priv->mesh_dev) { }
if (priv->mesh_dev && (adapter->mesh_connect_status == LBS_CONNECTED)) {
netif_carrier_on(priv->mesh_dev); netif_carrier_on(priv->mesh_dev);
netif_wake_queue(priv->mesh_dev); netif_wake_queue(priv->mesh_dev);
} }
}
out: out:
if (scan_cfg) if (scan_cfg)
......
...@@ -273,10 +273,11 @@ void lbs_send_tx_feedback(lbs_private *priv) ...@@ -273,10 +273,11 @@ void lbs_send_tx_feedback(lbs_private *priv)
lbs_upload_rx_packet(priv, adapter->currenttxskb); lbs_upload_rx_packet(priv, adapter->currenttxskb);
adapter->currenttxskb = NULL; adapter->currenttxskb = NULL;
priv->adapter->TxLockFlag = 0; priv->adapter->TxLockFlag = 0;
if (priv->adapter->connect_status == LBS_CONNECTED) {
if (adapter->connect_status == LBS_CONNECTED)
netif_wake_queue(priv->dev); netif_wake_queue(priv->dev);
if (priv->mesh_dev)
if (priv->mesh_dev && (adapter->mesh_connect_status == LBS_CONNECTED))
netif_wake_queue(priv->mesh_dev); netif_wake_queue(priv->mesh_dev);
}
} }
EXPORT_SYMBOL_GPL(lbs_send_tx_feedback); EXPORT_SYMBOL_GPL(lbs_send_tx_feedback);
...@@ -154,7 +154,8 @@ static void copy_active_data_rates(lbs_adapter *adapter, u8 *rates) ...@@ -154,7 +154,8 @@ static void copy_active_data_rates(lbs_adapter *adapter, u8 *rates)
{ {
lbs_deb_enter(LBS_DEB_WEXT); lbs_deb_enter(LBS_DEB_WEXT);
if (adapter->connect_status != LBS_CONNECTED) if ((adapter->connect_status != LBS_CONNECTED) &&
(adapter->mesh_connect_status != LBS_CONNECTED))
memcpy(rates, lbs_bg_rates, MAX_RATES); memcpy(rates, lbs_bg_rates, MAX_RATES);
else else
memcpy(rates, adapter->curbssparams.rates, MAX_RATES); memcpy(rates, adapter->curbssparams.rates, MAX_RATES);
...@@ -274,7 +275,7 @@ static int mesh_get_nick(struct net_device *dev, struct iw_request_info *info, ...@@ -274,7 +275,7 @@ static int mesh_get_nick(struct net_device *dev, struct iw_request_info *info,
/* Use nickname to indicate that mesh is on */ /* Use nickname to indicate that mesh is on */
if (adapter->connect_status == LBS_CONNECTED) { if (adapter->mesh_connect_status == LBS_CONNECTED) {
strncpy(extra, "Mesh", 12); strncpy(extra, "Mesh", 12);
extra[12] = '\0'; extra[12] = '\0';
dwrq->length = strlen(extra); dwrq->length = strlen(extra);
...@@ -589,7 +590,8 @@ static int lbs_get_range(struct net_device *dev, struct iw_request_info *info, ...@@ -589,7 +590,8 @@ static int lbs_get_range(struct net_device *dev, struct iw_request_info *info,
range->num_frequency = 0; range->num_frequency = 0;
if (priv->adapter->enable11d && if (priv->adapter->enable11d &&
adapter->connect_status == LBS_CONNECTED) { (adapter->connect_status == LBS_CONNECTED ||
adapter->mesh_connect_status == LBS_CONNECTED)) {
u8 chan_no; u8 chan_no;
u8 band; u8 band;
...@@ -827,7 +829,8 @@ static struct iw_statistics *lbs_get_wireless_stats(struct net_device *dev) ...@@ -827,7 +829,8 @@ static struct iw_statistics *lbs_get_wireless_stats(struct net_device *dev)
priv->wstats.status = adapter->mode; priv->wstats.status = adapter->mode;
/* If we're not associated, all quality values are meaningless */ /* If we're not associated, all quality values are meaningless */
if (adapter->connect_status != LBS_CONNECTED) if ((adapter->connect_status != LBS_CONNECTED) &&
(adapter->mesh_connect_status != LBS_CONNECTED))
goto out; goto out;
/* Quality by RSSI */ /* Quality by RSSI */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment