aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-08-08 18:57:47 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-08 18:57:47 -0400
commit8065be8d032f38da25b54bf077a05a30d9ce9f2a (patch)
tree32a7baf4b40e0240ab4b9dd6f2bbe6129929bb66 /drivers/staging
parent27d438c56009e5ae632de36fe70985d1aab5e344 (diff)
parentecc265fe9e09e32a3573b2ba26e79b2099eb8bbb (diff)
Merge branch 'akpm' (second patchbomb from Andrew Morton)
Merge more incoming from Andrew Morton: "Two new syscalls: memfd_create in "shm: add memfd_create() syscall" kexec_file_load in "kexec: implementation of new syscall kexec_file_load" And: - Most (all?) of the rest of MM - Lots of the usual misc bits - fs/autofs4 - drivers/rtc - fs/nilfs - procfs - fork.c, exec.c - more in lib/ - rapidio - Janitorial work in filesystems: fs/ufs, fs/reiserfs, fs/adfs, fs/cramfs, fs/romfs, fs/qnx6. - initrd/initramfs work - "file sealing" and the memfd_create() syscall, in tmpfs - add pci_zalloc_consistent, use it in lots of places - MAINTAINERS maintenance - kexec feature work" * emailed patches from Andrew Morton <akpm@linux-foundation.org: (193 commits) MAINTAINERS: update nomadik patterns MAINTAINERS: update usb/gadget patterns MAINTAINERS: update DMA BUFFER SHARING patterns kexec: verify the signature of signed PE bzImage kexec: support kexec/kdump on EFI systems kexec: support for kexec on panic using new system call kexec-bzImage64: support for loading bzImage using 64bit entry kexec: load and relocate purgatory at kernel load time purgatory: core purgatory functionality purgatory/sha256: provide implementation of sha256 in purgaotory context kexec: implementation of new syscall kexec_file_load kexec: new syscall kexec_file_load() declaration kexec: make kexec_segment user buffer pointer a union resource: provide new functions to walk through resources kexec: use common function for kimage_normal_alloc() and kimage_crash_alloc() kexec: move segment verification code in a separate function kexec: rename unusebale_pages to unusable_pages kernel: build bin2c based on config option CONFIG_BUILD_BIN2C bin2c: move bin2c in scripts/basic shm: wait for pins to be released when sealing ...
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/rtl8192e/rtl8192e/rtl_core.c15
-rw-r--r--drivers/staging/rtl8192ee/pci.c37
-rw-r--r--drivers/staging/rtl8821ae/pci.c36
-rw-r--r--drivers/staging/slicoss/slicoss.c9
-rw-r--r--drivers/staging/vt6655/device_main.c40
5 files changed, 44 insertions, 93 deletions
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 2920e406030a..5729cf678765 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -2065,20 +2065,16 @@ static short rtl8192_alloc_rx_desc_ring(struct net_device *dev)
2065 int i, rx_queue_idx; 2065 int i, rx_queue_idx;
2066 2066
2067 for (rx_queue_idx = 0; rx_queue_idx < MAX_RX_QUEUE; rx_queue_idx++) { 2067 for (rx_queue_idx = 0; rx_queue_idx < MAX_RX_QUEUE; rx_queue_idx++) {
2068 priv->rx_ring[rx_queue_idx] = pci_alloc_consistent(priv->pdev, 2068 priv->rx_ring[rx_queue_idx] =
2069 sizeof(*priv->rx_ring[rx_queue_idx]) * 2069 pci_zalloc_consistent(priv->pdev,
2070 priv->rxringcount, 2070 sizeof(*priv->rx_ring[rx_queue_idx]) * priv->rxringcount,
2071 &priv->rx_ring_dma[rx_queue_idx]); 2071 &priv->rx_ring_dma[rx_queue_idx]);
2072
2073 if (!priv->rx_ring[rx_queue_idx] || 2072 if (!priv->rx_ring[rx_queue_idx] ||
2074 (unsigned long)priv->rx_ring[rx_queue_idx] & 0xFF) { 2073 (unsigned long)priv->rx_ring[rx_queue_idx] & 0xFF) {
2075 RT_TRACE(COMP_ERR, "Cannot allocate RX ring\n"); 2074 RT_TRACE(COMP_ERR, "Cannot allocate RX ring\n");
2076 return -ENOMEM; 2075 return -ENOMEM;
2077 } 2076 }
2078 2077
2079 memset(priv->rx_ring[rx_queue_idx], 0,
2080 sizeof(*priv->rx_ring[rx_queue_idx]) *
2081 priv->rxringcount);
2082 priv->rx_idx[rx_queue_idx] = 0; 2078 priv->rx_idx[rx_queue_idx] = 0;
2083 2079
2084 for (i = 0; i < priv->rxringcount; i++) { 2080 for (i = 0; i < priv->rxringcount; i++) {
@@ -2118,14 +2114,13 @@ static int rtl8192_alloc_tx_desc_ring(struct net_device *dev,
2118 dma_addr_t dma; 2114 dma_addr_t dma;
2119 int i; 2115 int i;
2120 2116
2121 ring = pci_alloc_consistent(priv->pdev, sizeof(*ring) * entries, &dma); 2117 ring = pci_zalloc_consistent(priv->pdev, sizeof(*ring) * entries, &dma);
2122 if (!ring || (unsigned long)ring & 0xFF) { 2118 if (!ring || (unsigned long)ring & 0xFF) {
2123 RT_TRACE(COMP_ERR, "Cannot allocate TX ring (prio = %d)\n", 2119 RT_TRACE(COMP_ERR, "Cannot allocate TX ring (prio = %d)\n",
2124 prio); 2120 prio);
2125 return -ENOMEM; 2121 return -ENOMEM;
2126 } 2122 }
2127 2123
2128 memset(ring, 0, sizeof(*ring)*entries);
2129 priv->tx_ring[prio].desc = ring; 2124 priv->tx_ring[prio].desc = ring;
2130 priv->tx_ring[prio].dma = dma; 2125 priv->tx_ring[prio].dma = dma;
2131 priv->tx_ring[prio].idx = 0; 2126 priv->tx_ring[prio].idx = 0;
diff --git a/drivers/staging/rtl8192ee/pci.c b/drivers/staging/rtl8192ee/pci.c
index f3abbcc9f3ba..0215aef1eacc 100644
--- a/drivers/staging/rtl8192ee/pci.c
+++ b/drivers/staging/rtl8192ee/pci.c
@@ -1224,10 +1224,10 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw,
1224 1224
1225 /* alloc tx buffer desc for new trx flow*/ 1225 /* alloc tx buffer desc for new trx flow*/
1226 if (rtlpriv->use_new_trx_flow) { 1226 if (rtlpriv->use_new_trx_flow) {
1227 buffer_desc = pci_alloc_consistent(rtlpci->pdev, 1227 buffer_desc =
1228 sizeof(*buffer_desc) * entries, 1228 pci_zalloc_consistent(rtlpci->pdev,
1229 &buffer_desc_dma); 1229 sizeof(*buffer_desc) * entries,
1230 1230 &buffer_desc_dma);
1231 if (!buffer_desc || (unsigned long)buffer_desc & 0xFF) { 1231 if (!buffer_desc || (unsigned long)buffer_desc & 0xFF) {
1232 RT_TRACE(COMP_ERR, DBG_EMERG, 1232 RT_TRACE(COMP_ERR, DBG_EMERG,
1233 ("Cannot allocate TX ring (prio = %d)\n", 1233 ("Cannot allocate TX ring (prio = %d)\n",
@@ -1235,7 +1235,6 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw,
1235 return -ENOMEM; 1235 return -ENOMEM;
1236 } 1236 }
1237 1237
1238 memset(buffer_desc, 0, sizeof(*buffer_desc) * entries);
1239 rtlpci->tx_ring[prio].buffer_desc = buffer_desc; 1238 rtlpci->tx_ring[prio].buffer_desc = buffer_desc;
1240 rtlpci->tx_ring[prio].buffer_desc_dma = buffer_desc_dma; 1239 rtlpci->tx_ring[prio].buffer_desc_dma = buffer_desc_dma;
1241 1240
@@ -1245,16 +1244,14 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw,
1245 } 1244 }
1246 1245
1247 /* alloc dma for this ring */ 1246 /* alloc dma for this ring */
1248 desc = pci_alloc_consistent(rtlpci->pdev, 1247 desc = pci_zalloc_consistent(rtlpci->pdev, sizeof(*desc) * entries,
1249 sizeof(*desc) * entries, &desc_dma); 1248 &desc_dma);
1250
1251 if (!desc || (unsigned long)desc & 0xFF) { 1249 if (!desc || (unsigned long)desc & 0xFF) {
1252 RT_TRACE(COMP_ERR, DBG_EMERG, 1250 RT_TRACE(COMP_ERR, DBG_EMERG,
1253 ("Cannot allocate TX ring (prio = %d)\n", prio)); 1251 ("Cannot allocate TX ring (prio = %d)\n", prio));
1254 return -ENOMEM; 1252 return -ENOMEM;
1255 } 1253 }
1256 1254
1257 memset(desc, 0, sizeof(*desc) * entries);
1258 rtlpci->tx_ring[prio].desc = desc; 1255 rtlpci->tx_ring[prio].desc = desc;
1259 rtlpci->tx_ring[prio].dma = desc_dma; 1256 rtlpci->tx_ring[prio].dma = desc_dma;
1260 1257
@@ -1290,11 +1287,9 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw, int rxring_idx)
1290 struct rtl_rx_buffer_desc *entry = NULL; 1287 struct rtl_rx_buffer_desc *entry = NULL;
1291 /* alloc dma for this ring */ 1288 /* alloc dma for this ring */
1292 rtlpci->rx_ring[rxring_idx].buffer_desc = 1289 rtlpci->rx_ring[rxring_idx].buffer_desc =
1293 pci_alloc_consistent(rtlpci->pdev, 1290 pci_zalloc_consistent(rtlpci->pdev,
1294 sizeof(*rtlpci->rx_ring[rxring_idx]. 1291 sizeof(*rtlpci->rx_ring[rxring_idx].buffer_desc) * rtlpci->rxringcount,
1295 buffer_desc) * 1292 &rtlpci->rx_ring[rxring_idx].dma);
1296 rtlpci->rxringcount,
1297 &rtlpci->rx_ring[rxring_idx].dma);
1298 if (!rtlpci->rx_ring[rxring_idx].buffer_desc || 1293 if (!rtlpci->rx_ring[rxring_idx].buffer_desc ||
1299 (unsigned long)rtlpci->rx_ring[rxring_idx].buffer_desc & 0xFF) { 1294 (unsigned long)rtlpci->rx_ring[rxring_idx].buffer_desc & 0xFF) {
1300 RT_TRACE(COMP_ERR, DBG_EMERG, 1295 RT_TRACE(COMP_ERR, DBG_EMERG,
@@ -1302,10 +1297,6 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw, int rxring_idx)
1302 return -ENOMEM; 1297 return -ENOMEM;
1303 } 1298 }
1304 1299
1305 memset(rtlpci->rx_ring[rxring_idx].buffer_desc, 0,
1306 sizeof(*rtlpci->rx_ring[rxring_idx].buffer_desc) *
1307 rtlpci->rxringcount);
1308
1309 /* init every desc in this ring */ 1300 /* init every desc in this ring */
1310 rtlpci->rx_ring[rxring_idx].idx = 0; 1301 rtlpci->rx_ring[rxring_idx].idx = 0;
1311 1302
@@ -1320,19 +1311,15 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw, int rxring_idx)
1320 u8 tmp_one = 1; 1311 u8 tmp_one = 1;
1321 /* alloc dma for this ring */ 1312 /* alloc dma for this ring */
1322 rtlpci->rx_ring[rxring_idx].desc = 1313 rtlpci->rx_ring[rxring_idx].desc =
1323 pci_alloc_consistent(rtlpci->pdev, 1314 pci_zalloc_consistent(rtlpci->pdev,
1324 sizeof(*rtlpci->rx_ring[rxring_idx]. 1315 sizeof(*rtlpci->rx_ring[rxring_idx].desc) * rtlpci->rxringcount,
1325 desc) * rtlpci->rxringcount, 1316 &rtlpci->rx_ring[rxring_idx].dma);
1326 &rtlpci->rx_ring[rxring_idx].dma);
1327 if (!rtlpci->rx_ring[rxring_idx].desc || 1317 if (!rtlpci->rx_ring[rxring_idx].desc ||
1328 (unsigned long)rtlpci->rx_ring[rxring_idx].desc & 0xFF) { 1318 (unsigned long)rtlpci->rx_ring[rxring_idx].desc & 0xFF) {
1329 RT_TRACE(COMP_ERR, DBG_EMERG, 1319 RT_TRACE(COMP_ERR, DBG_EMERG,
1330 ("Cannot allocate RX ring\n")); 1320 ("Cannot allocate RX ring\n"));
1331 return -ENOMEM; 1321 return -ENOMEM;
1332 } 1322 }
1333 memset(rtlpci->rx_ring[rxring_idx].desc, 0,
1334 sizeof(*rtlpci->rx_ring[rxring_idx].desc) *
1335 rtlpci->rxringcount);
1336 1323
1337 /* init every desc in this ring */ 1324 /* init every desc in this ring */
1338 rtlpci->rx_ring[rxring_idx].idx = 0; 1325 rtlpci->rx_ring[rxring_idx].idx = 0;
diff --git a/drivers/staging/rtl8821ae/pci.c b/drivers/staging/rtl8821ae/pci.c
index f9847d1fbdeb..26d7b2fc852a 100644
--- a/drivers/staging/rtl8821ae/pci.c
+++ b/drivers/staging/rtl8821ae/pci.c
@@ -1248,9 +1248,10 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw,
1248 1248
1249 /* alloc tx buffer desc for new trx flow*/ 1249 /* alloc tx buffer desc for new trx flow*/
1250 if (rtlpriv->use_new_trx_flow) { 1250 if (rtlpriv->use_new_trx_flow) {
1251 buffer_desc = pci_alloc_consistent(rtlpci->pdev, 1251 buffer_desc =
1252 sizeof(*buffer_desc) * entries, 1252 pci_zalloc_consistent(rtlpci->pdev,
1253 &buffer_desc_dma); 1253 sizeof(*buffer_desc) * entries,
1254 &buffer_desc_dma);
1254 1255
1255 if (!buffer_desc || (unsigned long)buffer_desc & 0xFF) { 1256 if (!buffer_desc || (unsigned long)buffer_desc & 0xFF) {
1256 RT_TRACE(COMP_ERR, DBG_EMERG, 1257 RT_TRACE(COMP_ERR, DBG_EMERG,
@@ -1259,7 +1260,6 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw,
1259 return -ENOMEM; 1260 return -ENOMEM;
1260 } 1261 }
1261 1262
1262 memset(buffer_desc, 0, sizeof(*buffer_desc) * entries);
1263 rtlpci->tx_ring[prio].buffer_desc = buffer_desc; 1263 rtlpci->tx_ring[prio].buffer_desc = buffer_desc;
1264 rtlpci->tx_ring[prio].buffer_desc_dma = buffer_desc_dma; 1264 rtlpci->tx_ring[prio].buffer_desc_dma = buffer_desc_dma;
1265 1265
@@ -1270,8 +1270,8 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw,
1270 } 1270 }
1271 1271
1272 /* alloc dma for this ring */ 1272 /* alloc dma for this ring */
1273 desc = pci_alloc_consistent(rtlpci->pdev, 1273 desc = pci_zalloc_consistent(rtlpci->pdev, sizeof(*desc) * entries,
1274 sizeof(*desc) * entries, &desc_dma); 1274 &desc_dma);
1275 1275
1276 if (!desc || (unsigned long)desc & 0xFF) { 1276 if (!desc || (unsigned long)desc & 0xFF) {
1277 RT_TRACE(COMP_ERR, DBG_EMERG, 1277 RT_TRACE(COMP_ERR, DBG_EMERG,
@@ -1279,7 +1279,6 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw,
1279 return -ENOMEM; 1279 return -ENOMEM;
1280 } 1280 }
1281 1281
1282 memset(desc, 0, sizeof(*desc) * entries);
1283 rtlpci->tx_ring[prio].desc = desc; 1282 rtlpci->tx_ring[prio].desc = desc;
1284 rtlpci->tx_ring[prio].dma = desc_dma; 1283 rtlpci->tx_ring[prio].dma = desc_dma;
1285 1284
@@ -1316,21 +1315,15 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw, int rxring_idx)
1316 struct rtl_rx_buffer_desc *entry = NULL; 1315 struct rtl_rx_buffer_desc *entry = NULL;
1317 /* alloc dma for this ring */ 1316 /* alloc dma for this ring */
1318 rtlpci->rx_ring[rxring_idx].buffer_desc = 1317 rtlpci->rx_ring[rxring_idx].buffer_desc =
1319 pci_alloc_consistent(rtlpci->pdev, 1318 pci_zalloc_consistent(rtlpci->pdev,
1320 sizeof(*rtlpci->rx_ring[rxring_idx]. 1319 sizeof(*rtlpci->rx_ring[rxring_idx].buffer_desc) * rtlpci->rxringcount,
1321 buffer_desc) * 1320 &rtlpci->rx_ring[rxring_idx].dma);
1322 rtlpci->rxringcount,
1323 &rtlpci->rx_ring[rxring_idx].dma);
1324 if (!rtlpci->rx_ring[rxring_idx].buffer_desc || 1321 if (!rtlpci->rx_ring[rxring_idx].buffer_desc ||
1325 (unsigned long)rtlpci->rx_ring[rxring_idx].buffer_desc & 0xFF) { 1322 (unsigned long)rtlpci->rx_ring[rxring_idx].buffer_desc & 0xFF) {
1326 RT_TRACE(COMP_ERR, DBG_EMERG, ("Cannot allocate RX ring\n")); 1323 RT_TRACE(COMP_ERR, DBG_EMERG, ("Cannot allocate RX ring\n"));
1327 return -ENOMEM; 1324 return -ENOMEM;
1328 } 1325 }
1329 1326
1330 memset(rtlpci->rx_ring[rxring_idx].buffer_desc, 0,
1331 sizeof(*rtlpci->rx_ring[rxring_idx].buffer_desc) *
1332 rtlpci->rxringcount);
1333
1334 /* init every desc in this ring */ 1327 /* init every desc in this ring */
1335 rtlpci->rx_ring[rxring_idx].idx = 0; 1328 rtlpci->rx_ring[rxring_idx].idx = 0;
1336 for (i = 0; i < rtlpci->rxringcount; i++) { 1329 for (i = 0; i < rtlpci->rxringcount; i++) {
@@ -1344,10 +1337,9 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw, int rxring_idx)
1344 u8 tmp_one = 1; 1337 u8 tmp_one = 1;
1345 /* alloc dma for this ring */ 1338 /* alloc dma for this ring */
1346 rtlpci->rx_ring[rxring_idx].desc = 1339 rtlpci->rx_ring[rxring_idx].desc =
1347 pci_alloc_consistent(rtlpci->pdev, 1340 pci_zalloc_consistent(rtlpci->pdev,
1348 sizeof(*rtlpci->rx_ring[rxring_idx]. 1341 sizeof(*rtlpci->rx_ring[rxring_idx].desc) * rtlpci->rxringcount,
1349 desc) * rtlpci->rxringcount, 1342 &rtlpci->rx_ring[rxring_idx].dma);
1350 &rtlpci->rx_ring[rxring_idx].dma);
1351 if (!rtlpci->rx_ring[rxring_idx].desc || 1343 if (!rtlpci->rx_ring[rxring_idx].desc ||
1352 (unsigned long)rtlpci->rx_ring[rxring_idx].desc & 0xFF) { 1344 (unsigned long)rtlpci->rx_ring[rxring_idx].desc & 0xFF) {
1353 RT_TRACE(COMP_ERR, DBG_EMERG, 1345 RT_TRACE(COMP_ERR, DBG_EMERG,
@@ -1355,10 +1347,6 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw, int rxring_idx)
1355 return -ENOMEM; 1347 return -ENOMEM;
1356 } 1348 }
1357 1349
1358 memset(rtlpci->rx_ring[rxring_idx].desc, 0,
1359 sizeof(*rtlpci->rx_ring[rxring_idx].desc) *
1360 rtlpci->rxringcount);
1361
1362 /* init every desc in this ring */ 1350 /* init every desc in this ring */
1363 rtlpci->rx_ring[rxring_idx].idx = 0; 1351 rtlpci->rx_ring[rxring_idx].idx = 0;
1364 for (i = 0; i < rtlpci->rxringcount; i++) { 1352 for (i = 0; i < rtlpci->rxringcount; i++) {
diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
index 50ece291fc6a..f35fa3dfe22c 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -1191,18 +1191,15 @@ static int slic_rspqueue_init(struct adapter *adapter)
1191 rspq->num_pages = SLIC_RSPQ_PAGES_GB; 1191 rspq->num_pages = SLIC_RSPQ_PAGES_GB;
1192 1192
1193 for (i = 0; i < rspq->num_pages; i++) { 1193 for (i = 0; i < rspq->num_pages; i++) {
1194 rspq->vaddr[i] = pci_alloc_consistent(adapter->pcidev, 1194 rspq->vaddr[i] = pci_zalloc_consistent(adapter->pcidev,
1195 PAGE_SIZE, 1195 PAGE_SIZE,
1196 &rspq->paddr[i]); 1196 &rspq->paddr[i]);
1197 if (!rspq->vaddr[i]) { 1197 if (!rspq->vaddr[i]) {
1198 dev_err(&adapter->pcidev->dev, 1198 dev_err(&adapter->pcidev->dev,
1199 "pci_alloc_consistent failed\n"); 1199 "pci_alloc_consistent failed\n");
1200 slic_rspqueue_free(adapter); 1200 slic_rspqueue_free(adapter);
1201 return -ENOMEM; 1201 return -ENOMEM;
1202 } 1202 }
1203 /* FIXME:
1204 * do we really need this assertions (4K PAGE_SIZE aligned addr)? */
1205 memset(rspq->vaddr[i], 0, PAGE_SIZE);
1206 1203
1207 if (paddrh == 0) { 1204 if (paddrh == 0) {
1208 slic_reg32_write(&slic_regs->slic_rbar, 1205 slic_reg32_write(&slic_regs->slic_rbar,
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index c78d06eff7ea..0b583a37f5b3 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -1111,25 +1111,17 @@ static bool device_init_rings(PSDevice pDevice)
1111 void *vir_pool; 1111 void *vir_pool;
1112 1112
1113 /*allocate all RD/TD rings a single pool*/ 1113 /*allocate all RD/TD rings a single pool*/
1114 vir_pool = pci_alloc_consistent(pDevice->pcid, 1114 vir_pool = pci_zalloc_consistent(pDevice->pcid,
1115 pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc) + 1115 pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc) +
1116 pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc) + 1116 pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc) +
1117 pDevice->sOpts.nTxDescs[0] * sizeof(STxDesc) + 1117 pDevice->sOpts.nTxDescs[0] * sizeof(STxDesc) +
1118 pDevice->sOpts.nTxDescs[1] * sizeof(STxDesc), 1118 pDevice->sOpts.nTxDescs[1] * sizeof(STxDesc),
1119 &pDevice->pool_dma); 1119 &pDevice->pool_dma);
1120
1121 if (vir_pool == NULL) { 1120 if (vir_pool == NULL) {
1122 DBG_PRT(MSG_LEVEL_ERR, KERN_ERR "%s : allocate desc dma memory failed\n", pDevice->dev->name); 1121 DBG_PRT(MSG_LEVEL_ERR, KERN_ERR "%s : allocate desc dma memory failed\n", pDevice->dev->name);
1123 return false; 1122 return false;
1124 } 1123 }
1125 1124
1126 memset(vir_pool, 0,
1127 pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc) +
1128 pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc) +
1129 pDevice->sOpts.nTxDescs[0] * sizeof(STxDesc) +
1130 pDevice->sOpts.nTxDescs[1] * sizeof(STxDesc)
1131 );
1132
1133 pDevice->aRD0Ring = vir_pool; 1125 pDevice->aRD0Ring = vir_pool;
1134 pDevice->aRD1Ring = vir_pool + 1126 pDevice->aRD1Ring = vir_pool +
1135 pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc); 1127 pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc);
@@ -1138,13 +1130,12 @@ static bool device_init_rings(PSDevice pDevice)
1138 pDevice->rd1_pool_dma = pDevice->rd0_pool_dma + 1130 pDevice->rd1_pool_dma = pDevice->rd0_pool_dma +
1139 pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc); 1131 pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc);
1140 1132
1141 pDevice->tx0_bufs = pci_alloc_consistent(pDevice->pcid, 1133 pDevice->tx0_bufs = pci_zalloc_consistent(pDevice->pcid,
1142 pDevice->sOpts.nTxDescs[0] * PKT_BUF_SZ + 1134 pDevice->sOpts.nTxDescs[0] * PKT_BUF_SZ +
1143 pDevice->sOpts.nTxDescs[1] * PKT_BUF_SZ + 1135 pDevice->sOpts.nTxDescs[1] * PKT_BUF_SZ +
1144 CB_BEACON_BUF_SIZE + 1136 CB_BEACON_BUF_SIZE +
1145 CB_MAX_BUF_SIZE, 1137 CB_MAX_BUF_SIZE,
1146 &pDevice->tx_bufs_dma0); 1138 &pDevice->tx_bufs_dma0);
1147
1148 if (pDevice->tx0_bufs == NULL) { 1139 if (pDevice->tx0_bufs == NULL) {
1149 DBG_PRT(MSG_LEVEL_ERR, KERN_ERR "%s: allocate buf dma memory failed\n", pDevice->dev->name); 1140 DBG_PRT(MSG_LEVEL_ERR, KERN_ERR "%s: allocate buf dma memory failed\n", pDevice->dev->name);
1150 pci_free_consistent(pDevice->pcid, 1141 pci_free_consistent(pDevice->pcid,
@@ -1157,13 +1148,6 @@ static bool device_init_rings(PSDevice pDevice)
1157 return false; 1148 return false;
1158 } 1149 }
1159 1150
1160 memset(pDevice->tx0_bufs, 0,
1161 pDevice->sOpts.nTxDescs[0] * PKT_BUF_SZ +
1162 pDevice->sOpts.nTxDescs[1] * PKT_BUF_SZ +
1163 CB_BEACON_BUF_SIZE +
1164 CB_MAX_BUF_SIZE
1165 );
1166
1167 pDevice->td0_pool_dma = pDevice->rd1_pool_dma + 1151 pDevice->td0_pool_dma = pDevice->rd1_pool_dma +
1168 pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc); 1152 pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc);
1169 1153