aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorArend van Spriel <arend@broadcom.com>2011-11-22 20:21:37 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-11-28 14:43:27 -0500
commit3030794fcae9b07d62a9ff7649a413dff0c88e01 (patch)
tree44d8eaf5d0cbceb0d35f1bbdf15ed3102ec8f920 /drivers/net
parent0b45bf74f91e781b74bfadb8bb08ef341b6befd3 (diff)
brcm80211: smac: remove skb next pointer usage from the driver
In two places the next pointer was used to process a sk_buff chain but it will always get a single sk_buff so this has been removed. Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com> Reviewed-by: Alwin Beukers <alwin@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/dma.c62
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/main.c2
2 files changed, 24 insertions, 40 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/dma.c b/drivers/net/wireless/brcm80211/brcmsmac/dma.c
index 0bb8c37e979e..b55b1f6bb4ba 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/dma.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/dma.c
@@ -1239,10 +1239,9 @@ bool dma_rxreset(struct dma_pub *pub)
1239 * the error(toss frames) could be fatal and cause many subsequent hard 1239 * the error(toss frames) could be fatal and cause many subsequent hard
1240 * to debug problems 1240 * to debug problems
1241 */ 1241 */
1242int dma_txfast(struct dma_pub *pub, struct sk_buff *p0, bool commit) 1242int dma_txfast(struct dma_pub *pub, struct sk_buff *p, bool commit)
1243{ 1243{
1244 struct dma_info *di = (struct dma_info *)pub; 1244 struct dma_info *di = (struct dma_info *)pub;
1245 struct sk_buff *p, *next;
1246 unsigned char *data; 1245 unsigned char *data;
1247 uint len; 1246 uint len;
1248 u16 txout; 1247 u16 txout;
@@ -1254,50 +1253,37 @@ int dma_txfast(struct dma_pub *pub, struct sk_buff *p0, bool commit)
1254 txout = di->txout; 1253 txout = di->txout;
1255 1254
1256 /* 1255 /*
1257 * Walk the chain of packet buffers 1256 * obtain and initialize transmit descriptor entry.
1258 * allocating and initializing transmit descriptor entries.
1259 */ 1257 */
1260 for (p = p0; p; p = next) { 1258 data = p->data;
1261 data = p->data; 1259 len = p->len;
1262 len = p->len;
1263 next = p->next;
1264
1265 /* return nonzero if out of tx descriptors */
1266 if (nexttxd(di, txout) == di->txin)
1267 goto outoftxd;
1268 1260
1269 if (len == 0) 1261 /* no use to transmit a zero length packet */
1270 continue; 1262 if (len == 0)
1271 1263 return 0;
1272 /* get physical address of buffer start */
1273 pa = pci_map_single(di->pbus, data, len, PCI_DMA_TODEVICE);
1274 1264
1275 flags = 0; 1265 /* return nonzero if out of tx descriptors */
1276 if (p == p0) 1266 if (nexttxd(di, txout) == di->txin)
1277 flags |= D64_CTRL1_SOF; 1267 goto outoftxd;
1278 1268
1279 /* With a DMA segment list, Descriptor table is filled 1269 /* get physical address of buffer start */
1280 * using the segment list instead of looping over 1270 pa = pci_map_single(di->pbus, data, len, PCI_DMA_TODEVICE);
1281 * buffers in multi-chain DMA. Therefore, EOF for SGLIST
1282 * is when end of segment list is reached.
1283 */
1284 if (next == NULL)
1285 flags |= (D64_CTRL1_IOC | D64_CTRL1_EOF);
1286 if (txout == (di->ntxd - 1))
1287 flags |= D64_CTRL1_EOT;
1288 1271
1289 dma64_dd_upd(di, di->txd64, pa, txout, &flags, len); 1272 /* With a DMA segment list, Descriptor table is filled
1273 * using the segment list instead of looping over
1274 * buffers in multi-chain DMA. Therefore, EOF for SGLIST
1275 * is when end of segment list is reached.
1276 */
1277 flags = D64_CTRL1_SOF | D64_CTRL1_IOC | D64_CTRL1_EOF;
1278 if (txout == (di->ntxd - 1))
1279 flags |= D64_CTRL1_EOT;
1290 1280
1291 txout = nexttxd(di, txout); 1281 dma64_dd_upd(di, di->txd64, pa, txout, &flags, len);
1292 }
1293 1282
1294 /* if last txd eof not set, fix it */ 1283 txout = nexttxd(di, txout);
1295 if (!(flags & D64_CTRL1_EOF))
1296 di->txd64[prevtxd(di, txout)].ctrl1 =
1297 cpu_to_le32(flags | D64_CTRL1_IOC | D64_CTRL1_EOF);
1298 1284
1299 /* save the packet */ 1285 /* save the packet */
1300 di->txp[prevtxd(di, txout)] = p0; 1286 di->txp[prevtxd(di, txout)] = p;
1301 1287
1302 /* bump the tx descriptor index */ 1288 /* bump the tx descriptor index */
1303 di->txout = txout; 1289 di->txout = txout;
@@ -1314,7 +1300,7 @@ int dma_txfast(struct dma_pub *pub, struct sk_buff *p0, bool commit)
1314 1300
1315 outoftxd: 1301 outoftxd:
1316 DMA_ERROR("%s: out of txds !!!\n", di->name); 1302 DMA_ERROR("%s: out of txds !!!\n", di->name);
1317 brcmu_pkt_buf_free_skb(p0); 1303 brcmu_pkt_buf_free_skb(p);
1318 di->dma.txavail = 0; 1304 di->dma.txavail = 0;
1319 di->dma.txnobuf++; 1305 di->dma.txnobuf++;
1320 return -1; 1306 return -1;
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c
index 36e3e0638300..897e252bdb57 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
@@ -955,8 +955,6 @@ brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs)
955 brcms_c_txfifo_complete(wlc, queue, 1); 955 brcms_c_txfifo_complete(wlc, queue, 1);
956 956
957 if (lastframe) { 957 if (lastframe) {
958 p->next = NULL;
959 p->prev = NULL;
960 /* remove PLCP & Broadcom tx descriptor header */ 958 /* remove PLCP & Broadcom tx descriptor header */
961 skb_pull(p, D11_PHY_HDR_LEN); 959 skb_pull(p, D11_PHY_HDR_LEN);
962 skb_pull(p, D11_TXH_LEN); 960 skb_pull(p, D11_TXH_LEN);