diff options
author | Brajesh Dave <brajeshd@marvell.com> | 2007-11-20 17:44:14 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:04:52 -0500 |
commit | 01d77d8d4747d73cfb6daf35cdc906a2db8ded9d (patch) | |
tree | 2b6263df131d602fae21365ecb10f0c1a1e88ea0 /drivers/net/wireless/libertas/main.c | |
parent | 798fbfec9ca1dfd656963debb14d049868d24465 (diff) |
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: Ashish Shukla <ashishs@marvell.com>
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/main.c')
-rw-r--r-- | drivers/net/wireless/libertas/main.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c index f0da18c331db..769117916fb3 100644 --- a/drivers/net/wireless/libertas/main.c +++ b/drivers/net/wireless/libertas/main.c | |||
@@ -406,13 +406,15 @@ static int lbs_dev_open(struct net_device *dev) | |||
406 | 406 | ||
407 | priv->open = 1; | 407 | priv->open = 1; |
408 | 408 | ||
409 | if (adapter->connect_status == LBS_CONNECTED) { | 409 | if (adapter->connect_status == LBS_CONNECTED) |
410 | netif_carrier_on(priv->dev); | 410 | netif_carrier_on(priv->dev); |
411 | if (priv->mesh_dev) | 411 | else |
412 | netif_carrier_on(priv->mesh_dev); | ||
413 | } else { | ||
414 | netif_carrier_off(priv->dev); | 412 | netif_carrier_off(priv->dev); |
415 | if (priv->mesh_dev) | 413 | |
414 | if (priv->mesh_dev) { | ||
415 | if (adapter->mesh_connect_status == LBS_CONNECTED) | ||
416 | netif_carrier_on(priv->mesh_dev); | ||
417 | else | ||
416 | netif_carrier_off(priv->mesh_dev); | 418 | netif_carrier_off(priv->mesh_dev); |
417 | } | 419 | } |
418 | 420 | ||
@@ -433,6 +435,11 @@ static int lbs_mesh_open(struct net_device *dev) | |||
433 | return -1; | 435 | return -1; |
434 | priv->mesh_open = 1 ; | 436 | priv->mesh_open = 1 ; |
435 | netif_wake_queue(priv->mesh_dev); | 437 | netif_wake_queue(priv->mesh_dev); |
438 | |||
439 | priv->adapter->mesh_connect_status = LBS_CONNECTED; | ||
440 | |||
441 | netif_carrier_on(priv->mesh_dev); | ||
442 | netif_wake_queue(priv->mesh_dev); | ||
436 | if (priv->infra_open == 0) | 443 | if (priv->infra_open == 0) |
437 | return lbs_dev_open(priv->dev) ; | 444 | return lbs_dev_open(priv->dev) ; |
438 | return 0; | 445 | return 0; |
@@ -548,7 +555,7 @@ static int lbs_mesh_pre_start_xmit(struct sk_buff *skb, | |||
548 | 555 | ||
549 | SET_MESH_FRAME(skb); | 556 | SET_MESH_FRAME(skb); |
550 | 557 | ||
551 | ret = lbs_hard_start_xmit(skb, priv->dev); | 558 | ret = lbs_hard_start_xmit(skb, priv->mesh_dev); |
552 | lbs_deb_leave_args(LBS_DEB_MESH, "ret %d", ret); | 559 | lbs_deb_leave_args(LBS_DEB_MESH, "ret %d", ret); |
553 | return ret; | 560 | return ret; |
554 | } | 561 | } |
@@ -595,9 +602,12 @@ static void lbs_tx_timeout(struct net_device *dev) | |||
595 | lbs_send_tx_feedback(priv); | 602 | lbs_send_tx_feedback(priv); |
596 | } else | 603 | } else |
597 | wake_up_interruptible(&priv->waitq); | 604 | wake_up_interruptible(&priv->waitq); |
598 | } else if (priv->adapter->connect_status == LBS_CONNECTED) { | 605 | } else if (dev == priv->dev) { |
599 | netif_wake_queue(priv->dev); | 606 | if (priv->adapter->connect_status == LBS_CONNECTED) |
600 | if (priv->mesh_dev) | 607 | netif_wake_queue(priv->dev); |
608 | |||
609 | } else if (dev == priv->mesh_dev) { | ||
610 | if (priv->adapter->mesh_connect_status == LBS_CONNECTED) | ||
601 | netif_wake_queue(priv->mesh_dev); | 611 | netif_wake_queue(priv->mesh_dev); |
602 | } | 612 | } |
603 | 613 | ||
@@ -1054,6 +1064,7 @@ static int lbs_init_adapter(lbs_private *priv) | |||
1054 | memset(adapter->current_addr, 0xff, ETH_ALEN); | 1064 | memset(adapter->current_addr, 0xff, ETH_ALEN); |
1055 | 1065 | ||
1056 | adapter->connect_status = LBS_DISCONNECTED; | 1066 | adapter->connect_status = LBS_DISCONNECTED; |
1067 | adapter->mesh_connect_status = LBS_DISCONNECTED; | ||
1057 | adapter->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM; | 1068 | adapter->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM; |
1058 | adapter->mode = IW_MODE_INFRA; | 1069 | adapter->mode = IW_MODE_INFRA; |
1059 | adapter->curbssparams.channel = DEFAULT_AD_HOC_CHANNEL; | 1070 | adapter->curbssparams.channel = DEFAULT_AD_HOC_CHANNEL; |