]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
prism54: set carrier flags correctly
authorLuis R. Rodriguez <mcgrof@gmail.com>
Tue, 1 Apr 2008 19:17:36 +0000 (15:17 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 8 Apr 2008 19:05:57 +0000 (15:05 -0400)
> prism54 should set the carrier flags correctly when it thinks the
> link can be used.

Agreed, so sure, this is OK but I rather we turn the carrier on
or off *before* sending an event, like this.

Signed-off-by: Roy Marples <uberlord@gentoo.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/prism54/isl_ioctl.c
drivers/net/wireless/prism54/islpci_dev.c

index 2e25e190f334fc57e4567c32e6c5409913bf3a8b..e5b3c282009ce8c7824efbb102ae398cfce97ecc 100644 (file)
@@ -2081,6 +2081,7 @@ link_changed(struct net_device *ndev, u32 bitrate)
        islpci_private *priv = netdev_priv(ndev);
 
        if (bitrate) {
+               netif_carrier_on(ndev);
                if (priv->iw_mode == IW_MODE_INFRA) {
                        union iwreq_data uwrq;
                        prism54_get_wap(ndev, NULL, (struct sockaddr *) &uwrq,
@@ -2089,8 +2090,10 @@ link_changed(struct net_device *ndev, u32 bitrate)
                } else
                        send_simple_event(netdev_priv(ndev),
                                          "Link established");
-       } else
+       } else {
+               netif_carrier_off(ndev);
                send_simple_event(netdev_priv(ndev), "Link lost");
+       }
 }
 
 /* Beacon/ProbeResp payload header */
index eb7c1c6bcd8a7564b1216a399b356b054f24babb..04c2638d75ad335c1f70fec3dbffbe48908c1042 100644 (file)
@@ -387,7 +387,9 @@ islpci_open(struct net_device *ndev)
        }
 
        netif_start_queue(ndev);
-/*      netif_mark_up( ndev ); */
+
+       /* Turn off carrier unless we know we have associated */
+       netif_carrier_off(ndev);
 
        return 0;
 }