diff options
author | Hante Meuleman <meuleman@broadcom.com> | 2013-01-02 09:22:49 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-01-07 15:16:58 -0500 |
commit | 80fd2dbee00edcd19fb8c04a12dbeefc55533f2e (patch) | |
tree | 5b3b1aa154847461ce81f60d22413dee2bed9f81 | |
parent | 03abad08bb837650feb2bd7581ef14c8a1c51964 (diff) |
brcmfmac: Return correct error on netdev xmit.
Netdev xmit routine brcfm_netdev_start_xmit was defined
incorrectly and used wrong return codes. Always eat the
packet and return ok. Remove drvr_up check since it is not
relevant.
Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c index 285a70ee9350..d655501305b0 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c | |||
@@ -160,7 +160,8 @@ static void brcmf_netdev_set_multicast_list(struct net_device *ndev) | |||
160 | schedule_work(&ifp->multicast_work); | 160 | schedule_work(&ifp->multicast_work); |
161 | } | 161 | } |
162 | 162 | ||
163 | static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *ndev) | 163 | static netdev_tx_t brcmf_netdev_start_xmit(struct sk_buff *skb, |
164 | struct net_device *ndev) | ||
164 | { | 165 | { |
165 | int ret; | 166 | int ret; |
166 | struct brcmf_if *ifp = netdev_priv(ndev); | 167 | struct brcmf_if *ifp = netdev_priv(ndev); |
@@ -169,20 +170,21 @@ static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *ndev) | |||
169 | 170 | ||
170 | brcmf_dbg(TRACE, "Enter\n"); | 171 | brcmf_dbg(TRACE, "Enter\n"); |
171 | 172 | ||
172 | /* Reject if down */ | 173 | /* Can the device send data? */ |
173 | if (!drvr->bus_if->drvr_up || | 174 | if (drvr->bus_if->state != BRCMF_BUS_DATA) { |
174 | (drvr->bus_if->state != BRCMF_BUS_DATA)) { | 175 | brcmf_err("xmit rejected state=%d\n", drvr->bus_if->state); |
175 | brcmf_err("xmit rejected drvup=%d state=%d\n", | ||
176 | drvr->bus_if->drvr_up, | ||
177 | drvr->bus_if->state); | ||
178 | netif_stop_queue(ndev); | 176 | netif_stop_queue(ndev); |
179 | return -ENODEV; | 177 | dev_kfree_skb(skb); |
178 | ret = -ENODEV; | ||
179 | goto done; | ||
180 | } | 180 | } |
181 | 181 | ||
182 | if (!drvr->iflist[ifp->idx]) { | 182 | if (!drvr->iflist[ifp->idx]) { |
183 | brcmf_err("bad ifidx %d\n", ifp->idx); | 183 | brcmf_err("bad ifidx %d\n", ifp->idx); |
184 | netif_stop_queue(ndev); | 184 | netif_stop_queue(ndev); |
185 | return -ENODEV; | 185 | dev_kfree_skb(skb); |
186 | ret = -ENODEV; | ||
187 | goto done; | ||
186 | } | 188 | } |
187 | 189 | ||
188 | /* Make sure there's enough room for any header */ | 190 | /* Make sure there's enough room for any header */ |
@@ -230,7 +232,7 @@ done: | |||
230 | drvr->bus_if->dstats.tx_packets++; | 232 | drvr->bus_if->dstats.tx_packets++; |
231 | 233 | ||
232 | /* Return ok: we always eat the packet */ | 234 | /* Return ok: we always eat the packet */ |
233 | return 0; | 235 | return NETDEV_TX_OK; |
234 | } | 236 | } |
235 | 237 | ||
236 | void brcmf_txflowblock(struct device *dev, bool state) | 238 | void brcmf_txflowblock(struct device *dev, bool state) |