diff options
author | David Vrabel <david.vrabel@csr.com> | 2008-11-17 11:16:51 -0500 |
---|---|---|
committer | David Vrabel <david.vrabel@csr.com> | 2008-11-19 09:47:04 -0500 |
commit | e8e1594c8126b1b773988fa2e3bfec76cff88336 (patch) | |
tree | afa666ce45d8652880855b04a26755e4e5182e01 /drivers/uwb/wlp | |
parent | 6fae35f9cea92793a98b2d9ab21235e5ae035581 (diff) |
wlp: start/stop radio on network interface up/down
Signed-off-by: David Vrabel <david.vrabel@csr.com>
Diffstat (limited to 'drivers/uwb/wlp')
-rw-r--r-- | drivers/uwb/wlp/wlp-lc.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/uwb/wlp/wlp-lc.c b/drivers/uwb/wlp/wlp-lc.c index 7e5eb49b03b8..e531093c4162 100644 --- a/drivers/uwb/wlp/wlp-lc.c +++ b/drivers/uwb/wlp/wlp-lc.c | |||
@@ -526,7 +526,17 @@ void wlp_uwb_notifs_cb(void *_wlp, struct uwb_dev *uwb_dev, | |||
526 | } | 526 | } |
527 | } | 527 | } |
528 | 528 | ||
529 | int wlp_setup(struct wlp *wlp, struct uwb_rc *rc) | 529 | static void wlp_channel_changed(struct uwb_pal *pal, int channel) |
530 | { | ||
531 | struct wlp *wlp = container_of(pal, struct wlp, pal); | ||
532 | |||
533 | if (channel < 0) | ||
534 | netif_carrier_off(wlp->ndev); | ||
535 | else | ||
536 | netif_carrier_on(wlp->ndev); | ||
537 | } | ||
538 | |||
539 | int wlp_setup(struct wlp *wlp, struct uwb_rc *rc, struct net_device *ndev) | ||
530 | { | 540 | { |
531 | struct device *dev = &rc->uwb_dev.dev; | 541 | struct device *dev = &rc->uwb_dev.dev; |
532 | int result; | 542 | int result; |
@@ -537,6 +547,7 @@ int wlp_setup(struct wlp *wlp, struct uwb_rc *rc) | |||
537 | BUG_ON(wlp->stop_queue == NULL); | 547 | BUG_ON(wlp->stop_queue == NULL); |
538 | BUG_ON(wlp->start_queue == NULL); | 548 | BUG_ON(wlp->start_queue == NULL); |
539 | wlp->rc = rc; | 549 | wlp->rc = rc; |
550 | wlp->ndev = ndev; | ||
540 | wlp_eda_init(&wlp->eda);/* Set up address cache */ | 551 | wlp_eda_init(&wlp->eda);/* Set up address cache */ |
541 | wlp->uwb_notifs_handler.cb = wlp_uwb_notifs_cb; | 552 | wlp->uwb_notifs_handler.cb = wlp_uwb_notifs_cb; |
542 | wlp->uwb_notifs_handler.data = wlp; | 553 | wlp->uwb_notifs_handler.data = wlp; |
@@ -544,6 +555,7 @@ int wlp_setup(struct wlp *wlp, struct uwb_rc *rc) | |||
544 | 555 | ||
545 | uwb_pal_init(&wlp->pal); | 556 | uwb_pal_init(&wlp->pal); |
546 | wlp->pal.rc = rc; | 557 | wlp->pal.rc = rc; |
558 | wlp->pal.channel_changed = wlp_channel_changed; | ||
547 | result = uwb_pal_register(&wlp->pal); | 559 | result = uwb_pal_register(&wlp->pal); |
548 | if (result < 0) | 560 | if (result < 0) |
549 | uwb_notifs_deregister(wlp->rc, &wlp->uwb_notifs_handler); | 561 | uwb_notifs_deregister(wlp->rc, &wlp->uwb_notifs_handler); |