Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem

+1740 -1471
+2 -2
drivers/bcma/bcma_private.h
··· 48 48 #endif /* CONFIG_BCMA_DRIVER_MIPS */ 49 49 50 50 /* driver_chipcommon_pmu.c */ 51 - u32 bcma_pmu_alp_clock(struct bcma_drv_cc *cc); 52 - u32 bcma_pmu_get_clockcpu(struct bcma_drv_cc *cc); 51 + u32 bcma_pmu_get_alp_clock(struct bcma_drv_cc *cc); 52 + u32 bcma_pmu_get_cpu_clock(struct bcma_drv_cc *cc); 53 53 54 54 #ifdef CONFIG_BCMA_SFLASH 55 55 /* driver_chipcommon_sflash.c */
+5 -5
drivers/bcma/driver_chipcommon.c
··· 25 25 return value; 26 26 } 27 27 28 - static u32 bcma_chipco_alp_clock(struct bcma_drv_cc *cc) 28 + static u32 bcma_chipco_get_alp_clock(struct bcma_drv_cc *cc) 29 29 { 30 30 if (cc->capabilities & BCMA_CC_CAP_PMU) 31 - return bcma_pmu_alp_clock(cc); 31 + return bcma_pmu_get_alp_clock(cc); 32 32 33 33 return 20000000; 34 34 } ··· 79 79 if (cc->capabilities & BCMA_CC_CAP_PMU) { 80 80 if (bus->chipinfo.id == BCMA_CHIP_ID_BCM4706) 81 81 /* 4706 CC and PMU watchdogs are clocked at 1/4 of ALP clock */ 82 - return bcma_chipco_alp_clock(cc) / 4000; 82 + return bcma_chipco_get_alp_clock(cc) / 4000; 83 83 else 84 84 /* based on 32KHz ILP clock */ 85 85 return 32; 86 86 } else { 87 - return bcma_chipco_alp_clock(cc) / 1000; 87 + return bcma_chipco_get_alp_clock(cc) / 1000; 88 88 } 89 89 } 90 90 ··· 236 236 struct bcma_serial_port *ports = cc->serial_ports; 237 237 238 238 if (ccrev >= 11 && ccrev != 15) { 239 - baud_base = bcma_chipco_alp_clock(cc); 239 + baud_base = bcma_chipco_get_alp_clock(cc); 240 240 if (ccrev >= 21) { 241 241 /* Turn off UART clock before switching clocksource. */ 242 242 bcma_cc_write32(cc, BCMA_CC_CORECTL,
+21 -18
drivers/bcma/driver_chipcommon_pmu.c
··· 168 168 bcma_pmu_workarounds(cc); 169 169 } 170 170 171 - u32 bcma_pmu_alp_clock(struct bcma_drv_cc *cc) 171 + u32 bcma_pmu_get_alp_clock(struct bcma_drv_cc *cc) 172 172 { 173 173 struct bcma_bus *bus = cc->core->bus; 174 174 ··· 196 196 /* Find the output of the "m" pll divider given pll controls that start with 197 197 * pllreg "pll0" i.e. 12 for main 6 for phy, 0 for misc. 198 198 */ 199 - static u32 bcma_pmu_clock(struct bcma_drv_cc *cc, u32 pll0, u32 m) 199 + static u32 bcma_pmu_pll_clock(struct bcma_drv_cc *cc, u32 pll0, u32 m) 200 200 { 201 201 u32 tmp, div, ndiv, p1, p2, fc; 202 202 struct bcma_bus *bus = cc->core->bus; ··· 225 225 ndiv = (tmp & BCMA_CC_PPL_NDIV_MASK) >> BCMA_CC_PPL_NDIV_SHIFT; 226 226 227 227 /* Do calculation in Mhz */ 228 - fc = bcma_pmu_alp_clock(cc) / 1000000; 228 + fc = bcma_pmu_get_alp_clock(cc) / 1000000; 229 229 fc = (p1 * ndiv * fc) / p2; 230 230 231 231 /* Return clock in Hertz */ 232 232 return (fc / div) * 1000000; 233 233 } 234 234 235 - static u32 bcma_pmu_clock_bcm4706(struct bcma_drv_cc *cc, u32 pll0, u32 m) 235 + static u32 bcma_pmu_pll_clock_bcm4706(struct bcma_drv_cc *cc, u32 pll0, u32 m) 236 236 { 237 237 u32 tmp, ndiv, p1div, p2div; 238 238 u32 clock; ··· 263 263 } 264 264 265 265 /* query bus clock frequency for PMU-enabled chipcommon */ 266 - static u32 bcma_pmu_get_clockcontrol(struct bcma_drv_cc *cc) 266 + static u32 bcma_pmu_get_bus_clock(struct bcma_drv_cc *cc) 267 267 { 268 268 struct bcma_bus *bus = cc->core->bus; 269 269 ··· 271 271 case BCMA_CHIP_ID_BCM4716: 272 272 case BCMA_CHIP_ID_BCM4748: 273 273 case BCMA_CHIP_ID_BCM47162: 274 - return bcma_pmu_clock(cc, BCMA_CC_PMU4716_MAINPLL_PLL0, 275 - BCMA_CC_PMU5_MAINPLL_SSB); 274 + return bcma_pmu_pll_clock(cc, BCMA_CC_PMU4716_MAINPLL_PLL0, 275 + BCMA_CC_PMU5_MAINPLL_SSB); 276 276 case BCMA_CHIP_ID_BCM5356: 277 - return bcma_pmu_clock(cc, BCMA_CC_PMU5356_MAINPLL_PLL0, 278 - BCMA_CC_PMU5_MAINPLL_SSB); 277 + return bcma_pmu_pll_clock(cc, BCMA_CC_PMU5356_MAINPLL_PLL0, 278 + BCMA_CC_PMU5_MAINPLL_SSB); 279 279 case BCMA_CHIP_ID_BCM5357: 280 280 case BCMA_CHIP_ID_BCM4749: 281 - return bcma_pmu_clock(cc, BCMA_CC_PMU5357_MAINPLL_PLL0, 282 - BCMA_CC_PMU5_MAINPLL_SSB); 281 + return bcma_pmu_pll_clock(cc, BCMA_CC_PMU5357_MAINPLL_PLL0, 282 + BCMA_CC_PMU5_MAINPLL_SSB); 283 283 case BCMA_CHIP_ID_BCM4706: 284 - return bcma_pmu_clock_bcm4706(cc, BCMA_CC_PMU4706_MAINPLL_PLL0, 285 - BCMA_CC_PMU5_MAINPLL_SSB); 284 + return bcma_pmu_pll_clock_bcm4706(cc, 285 + BCMA_CC_PMU4706_MAINPLL_PLL0, 286 + BCMA_CC_PMU5_MAINPLL_SSB); 286 287 case BCMA_CHIP_ID_BCM53572: 287 288 return 75000000; 288 289 default: 289 - bcma_warn(bus, "No backplane clock specified for %04X device, pmu rev. %d, using default %d Hz\n", 290 + bcma_warn(bus, "No bus clock specified for %04X device, pmu rev. %d, using default %d Hz\n", 290 291 bus->chipinfo.id, cc->pmu.rev, BCMA_CC_PMU_HT_CLOCK); 291 292 } 292 293 return BCMA_CC_PMU_HT_CLOCK; 293 294 } 294 295 295 296 /* query cpu clock frequency for PMU-enabled chipcommon */ 296 - u32 bcma_pmu_get_clockcpu(struct bcma_drv_cc *cc) 297 + u32 bcma_pmu_get_cpu_clock(struct bcma_drv_cc *cc) 297 298 { 298 299 struct bcma_bus *bus = cc->core->bus; 299 300 300 301 if (bus->chipinfo.id == BCMA_CHIP_ID_BCM53572) 301 302 return 300000000; 302 303 304 + /* New PMUs can have different clock for bus and CPU */ 303 305 if (cc->pmu.rev >= 5) { 304 306 u32 pll; 305 307 switch (bus->chipinfo.id) { 306 308 case BCMA_CHIP_ID_BCM4706: 307 - return bcma_pmu_clock_bcm4706(cc, 309 + return bcma_pmu_pll_clock_bcm4706(cc, 308 310 BCMA_CC_PMU4706_MAINPLL_PLL0, 309 311 BCMA_CC_PMU5_MAINPLL_CPU); 310 312 case BCMA_CHIP_ID_BCM5356: ··· 321 319 break; 322 320 } 323 321 324 - return bcma_pmu_clock(cc, pll, BCMA_CC_PMU5_MAINPLL_CPU); 322 + return bcma_pmu_pll_clock(cc, pll, BCMA_CC_PMU5_MAINPLL_CPU); 325 323 } 326 324 327 - return bcma_pmu_get_clockcontrol(cc); 325 + /* On old PMUs CPU has the same clock as the bus */ 326 + return bcma_pmu_get_bus_clock(cc); 328 327 } 329 328 330 329 static void bcma_pmu_spuravoid_pll_write(struct bcma_drv_cc *cc, u32 offset,
+2 -2
drivers/bcma/driver_mips.c
··· 115 115 bcma_read32(mdev, BCMA_MIPS_MIPS74K_INTMASK(0)) & 116 116 ~(1 << irqflag)); 117 117 else 118 - bcma_write32(mdev, BCMA_MIPS_MIPS74K_INTMASK(irq), 0); 118 + bcma_write32(mdev, BCMA_MIPS_MIPS74K_INTMASK(oldirq), 0); 119 119 120 120 /* assign the new one */ 121 121 if (irq == 0) { ··· 171 171 struct bcma_bus *bus = mcore->core->bus; 172 172 173 173 if (bus->drv_cc.capabilities & BCMA_CC_CAP_PMU) 174 - return bcma_pmu_get_clockcpu(&bus->drv_cc); 174 + return bcma_pmu_get_cpu_clock(&bus->drv_cc); 175 175 176 176 bcma_err(bus, "No PMU available, need this to get the cpu clock\n"); 177 177 return 0;
+3 -14
drivers/net/wireless/ath/ath5k/base.c
··· 849 849 return; 850 850 dma_unmap_single(ah->dev, bf->skbaddr, bf->skb->len, 851 851 DMA_TO_DEVICE); 852 - dev_kfree_skb_any(bf->skb); 852 + ieee80211_free_txskb(ah->hw, bf->skb); 853 853 bf->skb = NULL; 854 854 bf->skbaddr = 0; 855 855 bf->desc->ds_data = 0; ··· 1336 1336 * 15bit only. that means TSF extension has to be done within 1337 1337 * 32768usec (about 32ms). it might be necessary to move this to 1338 1338 * the interrupt handler, like it is done in madwifi. 1339 - * 1340 - * Unfortunately we don't know when the hardware takes the rx 1341 - * timestamp (beginning of phy frame, data frame, end of rx?). 1342 - * The only thing we know is that it is hardware specific... 1343 - * On AR5213 it seems the rx timestamp is at the end of the 1344 - * frame, but I'm not sure. 1345 - * 1346 - * NOTE: mac80211 defines mactime at the beginning of the first 1347 - * data symbol. Since we don't have any time references it's 1348 - * impossible to comply to that. This affects IBSS merge only 1349 - * right now, so it's not too bad... 1350 1339 */ 1351 1340 rxs->mactime = ath5k_extend_tsf(ah, rs->rs_tstamp); 1352 - rxs->flag |= RX_FLAG_MACTIME_START; 1341 + rxs->flag |= RX_FLAG_MACTIME_END; 1353 1342 1354 1343 rxs->freq = ah->curchan->center_freq; 1355 1344 rxs->band = ah->curchan->band; ··· 1565 1576 return; 1566 1577 1567 1578 drop_packet: 1568 - dev_kfree_skb_any(skb); 1579 + ieee80211_free_txskb(hw, skb); 1569 1580 } 1570 1581 1571 1582 static void
+1 -1
drivers/net/wireless/ath/ath5k/mac80211-ops.c
··· 62 62 u16 qnum = skb_get_queue_mapping(skb); 63 63 64 64 if (WARN_ON(qnum >= ah->ah_capabilities.cap_queues.q_tx_num)) { 65 - dev_kfree_skb_any(skb); 65 + ieee80211_free_txskb(hw, skb); 66 66 return; 67 67 } 68 68
+86 -86
drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
··· 534 534 535 535 static const u32 ar9300Modes_high_power_tx_gain_table_2p2[][5] = { 536 536 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ 537 - {0x0000a2dc, 0x00033800, 0x00033800, 0x03aaa352, 0x03aaa352}, 538 - {0x0000a2e0, 0x0003c000, 0x0003c000, 0x03ccc584, 0x03ccc584}, 539 - {0x0000a2e4, 0x03fc0000, 0x03fc0000, 0x03f0f800, 0x03f0f800}, 537 + {0x0000a2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352}, 538 + {0x0000a2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584}, 539 + {0x0000a2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800}, 540 540 {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000}, 541 - {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9}, 542 - {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 543 - {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002}, 544 - {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004}, 545 - {0x0000a50c, 0x10000023, 0x10000023, 0x0b000200, 0x0b000200}, 546 - {0x0000a510, 0x16000220, 0x16000220, 0x0f000202, 0x0f000202}, 547 - {0x0000a514, 0x1c000223, 0x1c000223, 0x12000400, 0x12000400}, 548 - {0x0000a518, 0x21002220, 0x21002220, 0x16000402, 0x16000402}, 549 - {0x0000a51c, 0x27002223, 0x27002223, 0x19000404, 0x19000404}, 550 - {0x0000a520, 0x2b022220, 0x2b022220, 0x1c000603, 0x1c000603}, 551 - {0x0000a524, 0x2f022222, 0x2f022222, 0x21000a02, 0x21000a02}, 552 - {0x0000a528, 0x34022225, 0x34022225, 0x25000a04, 0x25000a04}, 553 - {0x0000a52c, 0x3a02222a, 0x3a02222a, 0x28000a20, 0x28000a20}, 554 - {0x0000a530, 0x3e02222c, 0x3e02222c, 0x2c000e20, 0x2c000e20}, 555 - {0x0000a534, 0x4202242a, 0x4202242a, 0x30000e22, 0x30000e22}, 556 - {0x0000a538, 0x4702244a, 0x4702244a, 0x34000e24, 0x34000e24}, 557 - {0x0000a53c, 0x4b02244c, 0x4b02244c, 0x38001640, 0x38001640}, 558 - {0x0000a540, 0x4e02246c, 0x4e02246c, 0x3c001660, 0x3c001660}, 559 - {0x0000a544, 0x52022470, 0x52022470, 0x3f001861, 0x3f001861}, 560 - {0x0000a548, 0x55022490, 0x55022490, 0x43001a81, 0x43001a81}, 561 - {0x0000a54c, 0x59022492, 0x59022492, 0x47001a83, 0x47001a83}, 562 - {0x0000a550, 0x5d022692, 0x5d022692, 0x4a001c84, 0x4a001c84}, 563 - {0x0000a554, 0x61022892, 0x61022892, 0x4e001ce3, 0x4e001ce3}, 564 - {0x0000a558, 0x65024890, 0x65024890, 0x52001ce5, 0x52001ce5}, 565 - {0x0000a55c, 0x69024892, 0x69024892, 0x56001ce9, 0x56001ce9}, 566 - {0x0000a560, 0x6e024c92, 0x6e024c92, 0x5a001ceb, 0x5a001ceb}, 567 - {0x0000a564, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec}, 568 - {0x0000a568, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec}, 569 - {0x0000a56c, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec}, 570 - {0x0000a570, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec}, 571 - {0x0000a574, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec}, 572 - {0x0000a578, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec}, 573 - {0x0000a57c, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec}, 574 - {0x0000a580, 0x00800000, 0x00800000, 0x00800000, 0x00800000}, 575 - {0x0000a584, 0x06800003, 0x06800003, 0x04800002, 0x04800002}, 576 - {0x0000a588, 0x0a800020, 0x0a800020, 0x08800004, 0x08800004}, 577 - {0x0000a58c, 0x10800023, 0x10800023, 0x0b800200, 0x0b800200}, 578 - {0x0000a590, 0x16800220, 0x16800220, 0x0f800202, 0x0f800202}, 579 - {0x0000a594, 0x1c800223, 0x1c800223, 0x12800400, 0x12800400}, 580 - {0x0000a598, 0x21802220, 0x21802220, 0x16800402, 0x16800402}, 581 - {0x0000a59c, 0x27802223, 0x27802223, 0x19800404, 0x19800404}, 582 - {0x0000a5a0, 0x2b822220, 0x2b822220, 0x1c800603, 0x1c800603}, 583 - {0x0000a5a4, 0x2f822222, 0x2f822222, 0x21800a02, 0x21800a02}, 584 - {0x0000a5a8, 0x34822225, 0x34822225, 0x25800a04, 0x25800a04}, 585 - {0x0000a5ac, 0x3a82222a, 0x3a82222a, 0x28800a20, 0x28800a20}, 586 - {0x0000a5b0, 0x3e82222c, 0x3e82222c, 0x2c800e20, 0x2c800e20}, 587 - {0x0000a5b4, 0x4282242a, 0x4282242a, 0x30800e22, 0x30800e22}, 588 - {0x0000a5b8, 0x4782244a, 0x4782244a, 0x34800e24, 0x34800e24}, 589 - {0x0000a5bc, 0x4b82244c, 0x4b82244c, 0x38801640, 0x38801640}, 590 - {0x0000a5c0, 0x4e82246c, 0x4e82246c, 0x3c801660, 0x3c801660}, 591 - {0x0000a5c4, 0x52822470, 0x52822470, 0x3f801861, 0x3f801861}, 592 - {0x0000a5c8, 0x55822490, 0x55822490, 0x43801a81, 0x43801a81}, 593 - {0x0000a5cc, 0x59822492, 0x59822492, 0x47801a83, 0x47801a83}, 594 - {0x0000a5d0, 0x5d822692, 0x5d822692, 0x4a801c84, 0x4a801c84}, 595 - {0x0000a5d4, 0x61822892, 0x61822892, 0x4e801ce3, 0x4e801ce3}, 596 - {0x0000a5d8, 0x65824890, 0x65824890, 0x52801ce5, 0x52801ce5}, 597 - {0x0000a5dc, 0x69824892, 0x69824892, 0x56801ce9, 0x56801ce9}, 598 - {0x0000a5e0, 0x6e824c92, 0x6e824c92, 0x5a801ceb, 0x5a801ceb}, 599 - {0x0000a5e4, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec}, 600 - {0x0000a5e8, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec}, 601 - {0x0000a5ec, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec}, 602 - {0x0000a5f0, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec}, 603 - {0x0000a5f4, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec}, 604 - {0x0000a5f8, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec}, 605 - {0x0000a5fc, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec}, 541 + {0x0000a410, 0x000050d8, 0x000050d8, 0x000050d9, 0x000050d9}, 542 + {0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000}, 543 + {0x0000a504, 0x04002222, 0x04002222, 0x04000002, 0x04000002}, 544 + {0x0000a508, 0x09002421, 0x09002421, 0x08000004, 0x08000004}, 545 + {0x0000a50c, 0x0d002621, 0x0d002621, 0x0b000200, 0x0b000200}, 546 + {0x0000a510, 0x13004620, 0x13004620, 0x0f000202, 0x0f000202}, 547 + {0x0000a514, 0x19004a20, 0x19004a20, 0x11000400, 0x11000400}, 548 + {0x0000a518, 0x1d004e20, 0x1d004e20, 0x15000402, 0x15000402}, 549 + {0x0000a51c, 0x21005420, 0x21005420, 0x19000404, 0x19000404}, 550 + {0x0000a520, 0x26005e20, 0x26005e20, 0x1b000603, 0x1b000603}, 551 + {0x0000a524, 0x2b005e40, 0x2b005e40, 0x1f000a02, 0x1f000a02}, 552 + {0x0000a528, 0x2f005e42, 0x2f005e42, 0x23000a04, 0x23000a04}, 553 + {0x0000a52c, 0x33005e44, 0x33005e44, 0x26000a20, 0x26000a20}, 554 + {0x0000a530, 0x38005e65, 0x38005e65, 0x2a000e20, 0x2a000e20}, 555 + {0x0000a534, 0x3c005e69, 0x3c005e69, 0x2e000e22, 0x2e000e22}, 556 + {0x0000a538, 0x40005e6b, 0x40005e6b, 0x31000e24, 0x31000e24}, 557 + {0x0000a53c, 0x44005e6d, 0x44005e6d, 0x34001640, 0x34001640}, 558 + {0x0000a540, 0x49005e72, 0x49005e72, 0x38001660, 0x38001660}, 559 + {0x0000a544, 0x4e005eb2, 0x4e005eb2, 0x3b001861, 0x3b001861}, 560 + {0x0000a548, 0x53005f12, 0x53005f12, 0x3e001a81, 0x3e001a81}, 561 + {0x0000a54c, 0x59025eb2, 0x59025eb2, 0x42001a83, 0x42001a83}, 562 + {0x0000a550, 0x5e025f12, 0x5e025f12, 0x44001c84, 0x44001c84}, 563 + {0x0000a554, 0x61027f12, 0x61027f12, 0x48001ce3, 0x48001ce3}, 564 + {0x0000a558, 0x6702bf12, 0x6702bf12, 0x4c001ce5, 0x4c001ce5}, 565 + {0x0000a55c, 0x6b02bf14, 0x6b02bf14, 0x50001ce9, 0x50001ce9}, 566 + {0x0000a560, 0x6f02bf16, 0x6f02bf16, 0x54001ceb, 0x54001ceb}, 567 + {0x0000a564, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec}, 568 + {0x0000a568, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec}, 569 + {0x0000a56c, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec}, 570 + {0x0000a570, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec}, 571 + {0x0000a574, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec}, 572 + {0x0000a578, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec}, 573 + {0x0000a57c, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec}, 574 + {0x0000a580, 0x00802220, 0x00802220, 0x00800000, 0x00800000}, 575 + {0x0000a584, 0x04802222, 0x04802222, 0x04800002, 0x04800002}, 576 + {0x0000a588, 0x09802421, 0x09802421, 0x08800004, 0x08800004}, 577 + {0x0000a58c, 0x0d802621, 0x0d802621, 0x0b800200, 0x0b800200}, 578 + {0x0000a590, 0x13804620, 0x13804620, 0x0f800202, 0x0f800202}, 579 + {0x0000a594, 0x19804a20, 0x19804a20, 0x11800400, 0x11800400}, 580 + {0x0000a598, 0x1d804e20, 0x1d804e20, 0x15800402, 0x15800402}, 581 + {0x0000a59c, 0x21805420, 0x21805420, 0x19800404, 0x19800404}, 582 + {0x0000a5a0, 0x26805e20, 0x26805e20, 0x1b800603, 0x1b800603}, 583 + {0x0000a5a4, 0x2b805e40, 0x2b805e40, 0x1f800a02, 0x1f800a02}, 584 + {0x0000a5a8, 0x2f805e42, 0x2f805e42, 0x23800a04, 0x23800a04}, 585 + {0x0000a5ac, 0x33805e44, 0x33805e44, 0x26800a20, 0x26800a20}, 586 + {0x0000a5b0, 0x38805e65, 0x38805e65, 0x2a800e20, 0x2a800e20}, 587 + {0x0000a5b4, 0x3c805e69, 0x3c805e69, 0x2e800e22, 0x2e800e22}, 588 + {0x0000a5b8, 0x40805e6b, 0x40805e6b, 0x31800e24, 0x31800e24}, 589 + {0x0000a5bc, 0x44805e6d, 0x44805e6d, 0x34801640, 0x34801640}, 590 + {0x0000a5c0, 0x49805e72, 0x49805e72, 0x38801660, 0x38801660}, 591 + {0x0000a5c4, 0x4e805eb2, 0x4e805eb2, 0x3b801861, 0x3b801861}, 592 + {0x0000a5c8, 0x53805f12, 0x53805f12, 0x3e801a81, 0x3e801a81}, 593 + {0x0000a5cc, 0x59825eb2, 0x59825eb2, 0x42801a83, 0x42801a83}, 594 + {0x0000a5d0, 0x5e825f12, 0x5e825f12, 0x44801c84, 0x44801c84}, 595 + {0x0000a5d4, 0x61827f12, 0x61827f12, 0x48801ce3, 0x48801ce3}, 596 + {0x0000a5d8, 0x6782bf12, 0x6782bf12, 0x4c801ce5, 0x4c801ce5}, 597 + {0x0000a5dc, 0x6b82bf14, 0x6b82bf14, 0x50801ce9, 0x50801ce9}, 598 + {0x0000a5e0, 0x6f82bf16, 0x6f82bf16, 0x54801ceb, 0x54801ceb}, 599 + {0x0000a5e4, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec}, 600 + {0x0000a5e8, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec}, 601 + {0x0000a5ec, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec}, 602 + {0x0000a5f0, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec}, 603 + {0x0000a5f4, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec}, 604 + {0x0000a5f8, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec}, 605 + {0x0000a5fc, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec}, 606 606 {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 607 607 {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 608 608 {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 609 609 {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 610 - {0x0000a610, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 611 - {0x0000a614, 0x02004000, 0x02004000, 0x01404000, 0x01404000}, 612 - {0x0000a618, 0x02004801, 0x02004801, 0x01404501, 0x01404501}, 613 - {0x0000a61c, 0x02808a02, 0x02808a02, 0x02008501, 0x02008501}, 614 - {0x0000a620, 0x0380ce03, 0x0380ce03, 0x0280ca03, 0x0280ca03}, 615 - {0x0000a624, 0x04411104, 0x04411104, 0x03010c04, 0x03010c04}, 616 - {0x0000a628, 0x04411104, 0x04411104, 0x04014c04, 0x04014c04}, 617 - {0x0000a62c, 0x04411104, 0x04411104, 0x04015005, 0x04015005}, 618 - {0x0000a630, 0x04411104, 0x04411104, 0x04015005, 0x04015005}, 619 - {0x0000a634, 0x04411104, 0x04411104, 0x04015005, 0x04015005}, 620 - {0x0000a638, 0x04411104, 0x04411104, 0x04015005, 0x04015005}, 621 - {0x0000a63c, 0x04411104, 0x04411104, 0x04015005, 0x04015005}, 622 - {0x0000b2dc, 0x00033800, 0x00033800, 0x03aaa352, 0x03aaa352}, 623 - {0x0000b2e0, 0x0003c000, 0x0003c000, 0x03ccc584, 0x03ccc584}, 624 - {0x0000b2e4, 0x03fc0000, 0x03fc0000, 0x03f0f800, 0x03f0f800}, 610 + {0x0000a610, 0x00804000, 0x00804000, 0x00000000, 0x00000000}, 611 + {0x0000a614, 0x00804201, 0x00804201, 0x01404000, 0x01404000}, 612 + {0x0000a618, 0x0280c802, 0x0280c802, 0x01404501, 0x01404501}, 613 + {0x0000a61c, 0x0280ca03, 0x0280ca03, 0x02008501, 0x02008501}, 614 + {0x0000a620, 0x04c15104, 0x04c15104, 0x0280ca03, 0x0280ca03}, 615 + {0x0000a624, 0x04c15305, 0x04c15305, 0x03010c04, 0x03010c04}, 616 + {0x0000a628, 0x04c15305, 0x04c15305, 0x04014c04, 0x04014c04}, 617 + {0x0000a62c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005}, 618 + {0x0000a630, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005}, 619 + {0x0000a634, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005}, 620 + {0x0000a638, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005}, 621 + {0x0000a63c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005}, 622 + {0x0000b2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352}, 623 + {0x0000b2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584}, 624 + {0x0000b2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800}, 625 625 {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000}, 626 - {0x0000c2dc, 0x00033800, 0x00033800, 0x03aaa352, 0x03aaa352}, 627 - {0x0000c2e0, 0x0003c000, 0x0003c000, 0x03ccc584, 0x03ccc584}, 628 - {0x0000c2e4, 0x03fc0000, 0x03fc0000, 0x03f0f800, 0x03f0f800}, 626 + {0x0000c2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352}, 627 + {0x0000c2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584}, 628 + {0x0000c2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800}, 629 629 {0x0000c2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000}, 630 630 {0x00016044, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4}, 631 631 {0x00016048, 0x66480001, 0x66480001, 0x66480001, 0x66480001},
+38 -28
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
··· 2987 2987 case EEP_RX_MASK: 2988 2988 return pBase->txrxMask & 0xf; 2989 2989 case EEP_PAPRD: 2990 - if (AR_SREV_9462(ah)) 2991 - return false; 2992 - if (!ah->config.enable_paprd) 2993 - return false; 2994 2990 return !!(pBase->featureEnable & BIT(5)); 2995 2991 case EEP_CHAIN_MASK_REDUCE: 2996 2992 return (pBase->miscConfiguration >> 0x3) & 0x1; ··· 3001 3005 } 3002 3006 } 3003 3007 3004 - static bool ar9300_eeprom_read_byte(struct ath_common *common, int address, 3008 + static bool ar9300_eeprom_read_byte(struct ath_hw *ah, int address, 3005 3009 u8 *buffer) 3006 3010 { 3007 3011 u16 val; 3008 3012 3009 - if (unlikely(!ath9k_hw_nvram_read(common, address / 2, &val))) 3013 + if (unlikely(!ath9k_hw_nvram_read(ah, address / 2, &val))) 3010 3014 return false; 3011 3015 3012 3016 *buffer = (val >> (8 * (address % 2))) & 0xff; 3013 3017 return true; 3014 3018 } 3015 3019 3016 - static bool ar9300_eeprom_read_word(struct ath_common *common, int address, 3020 + static bool ar9300_eeprom_read_word(struct ath_hw *ah, int address, 3017 3021 u8 *buffer) 3018 3022 { 3019 3023 u16 val; 3020 3024 3021 - if (unlikely(!ath9k_hw_nvram_read(common, address / 2, &val))) 3025 + if (unlikely(!ath9k_hw_nvram_read(ah, address / 2, &val))) 3022 3026 return false; 3023 3027 3024 3028 buffer[0] = val >> 8; ··· 3044 3048 * the 16-bit word at that address 3045 3049 */ 3046 3050 if (address % 2 == 0) { 3047 - if (!ar9300_eeprom_read_byte(common, address--, buffer++)) 3051 + if (!ar9300_eeprom_read_byte(ah, address--, buffer++)) 3048 3052 goto error; 3049 3053 3050 3054 count--; 3051 3055 } 3052 3056 3053 3057 for (i = 0; i < count / 2; i++) { 3054 - if (!ar9300_eeprom_read_word(common, address, buffer)) 3058 + if (!ar9300_eeprom_read_word(ah, address, buffer)) 3055 3059 goto error; 3056 3060 3057 3061 address -= 2; ··· 3059 3063 } 3060 3064 3061 3065 if (count % 2) 3062 - if (!ar9300_eeprom_read_byte(common, address, buffer)) 3066 + if (!ar9300_eeprom_read_byte(ah, address, buffer)) 3063 3067 goto error; 3064 3068 3065 3069 return true; ··· 3236 3240 static int ar9300_eeprom_restore_flash(struct ath_hw *ah, u8 *mptr, 3237 3241 int mdata_size) 3238 3242 { 3239 - struct ath_common *common = ath9k_hw_common(ah); 3240 3243 u16 *data = (u16 *) mptr; 3241 3244 int i; 3242 3245 3243 3246 for (i = 0; i < mdata_size / 2; i++, data++) 3244 - ath9k_hw_nvram_read(common, i, data); 3247 + ath9k_hw_nvram_read(ah, i, data); 3245 3248 3246 3249 return 0; 3247 3250 } ··· 5071 5076 return base_pwridx + 4 * (mcs_idx / 8) + mod_idx - 2; 5072 5077 } 5073 5078 5079 + static void ar9003_paprd_set_txpower(struct ath_hw *ah, 5080 + struct ath9k_channel *chan, 5081 + u8 *targetPowerValT2) 5082 + { 5083 + int i; 5084 + 5085 + if (!ar9003_is_paprd_enabled(ah)) 5086 + return; 5087 + 5088 + if (IS_CHAN_HT40(chan)) 5089 + i = ALL_TARGET_HT40_7; 5090 + else 5091 + i = ALL_TARGET_HT20_7; 5092 + 5093 + if (IS_CHAN_2GHZ(chan)) { 5094 + if (!AR_SREV_9330(ah) && !AR_SREV_9340(ah) && 5095 + !AR_SREV_9462(ah) && !AR_SREV_9565(ah)) { 5096 + if (IS_CHAN_HT40(chan)) 5097 + i = ALL_TARGET_HT40_0_8_16; 5098 + else 5099 + i = ALL_TARGET_HT20_0_8_16; 5100 + } 5101 + } 5102 + 5103 + ah->paprd_target_power = targetPowerValT2[i]; 5104 + } 5105 + 5074 5106 static void ath9k_hw_ar9300_set_txpower(struct ath_hw *ah, 5075 5107 struct ath9k_channel *chan, u16 cfgCtl, 5076 5108 u8 twiceAntennaReduction, ··· 5119 5097 */ 5120 5098 ar9003_hw_get_target_power_eeprom(ah, chan, targetPowerValT2); 5121 5099 5122 - if (ah->eep_ops->get_eeprom(ah, EEP_PAPRD)) { 5100 + if (ar9003_is_paprd_enabled(ah)) { 5123 5101 if (IS_CHAN_2GHZ(chan)) 5124 5102 modal_hdr = &eep->modalHeader2G; 5125 5103 else ··· 5160 5138 twiceAntennaReduction, 5161 5139 powerLimit); 5162 5140 5163 - if (ah->eep_ops->get_eeprom(ah, EEP_PAPRD)) { 5141 + if (ar9003_is_paprd_enabled(ah)) { 5164 5142 for (i = 0; i < ar9300RateSize; i++) { 5165 5143 if ((ah->paprd_ratemask & (1 << i)) && 5166 5144 (abs(targetPowerValT2[i] - ··· 5192 5170 /* Write target power array to registers */ 5193 5171 ar9003_hw_tx_power_regwrite(ah, targetPowerValT2); 5194 5172 ar9003_hw_calibration_apply(ah, chan->channel); 5195 - 5196 - if (IS_CHAN_2GHZ(chan)) { 5197 - if (IS_CHAN_HT40(chan)) 5198 - i = ALL_TARGET_HT40_0_8_16; 5199 - else 5200 - i = ALL_TARGET_HT20_0_8_16; 5201 - } else { 5202 - if (IS_CHAN_HT40(chan)) 5203 - i = ALL_TARGET_HT40_7; 5204 - else 5205 - i = ALL_TARGET_HT20_7; 5206 - } 5207 - ah->paprd_target_power = targetPowerValT2[i]; 5173 + ar9003_paprd_set_txpower(ah, chan, targetPowerValT2); 5208 5174 } 5209 5175 5210 5176 static u16 ath9k_hw_ar9300_get_spur_channel(struct ath_hw *ah,
+3 -3
drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
··· 68 68 #define AR9300_BASE_ADDR 0x3ff 69 69 #define AR9300_BASE_ADDR_512 0x1ff 70 70 71 - #define AR9300_OTP_BASE 0x14000 72 - #define AR9300_OTP_STATUS 0x15f18 71 + #define AR9300_OTP_BASE (AR_SREV_9340(ah) ? 0x30000 : 0x14000) 72 + #define AR9300_OTP_STATUS (AR_SREV_9340(ah) ? 0x30018 : 0x15f18) 73 73 #define AR9300_OTP_STATUS_TYPE 0x7 74 74 #define AR9300_OTP_STATUS_VALID 0x4 75 75 #define AR9300_OTP_STATUS_ACCESS_BUSY 0x2 76 76 #define AR9300_OTP_STATUS_SM_BUSY 0x1 77 - #define AR9300_OTP_READ_DATA 0x15f1c 77 + #define AR9300_OTP_READ_DATA (AR_SREV_9340(ah) ? 0x3001c : 0x15f1c) 78 78 79 79 enum targetPowerHTRates { 80 80 HT_TARGET_RATE_0_8_16,
+63 -22
drivers/net/wireless/ath/ath9k/ar9003_paprd.c
··· 74 74 unsigned int power, scale, delta; 75 75 76 76 scale = ar9003_get_paprd_scale_factor(ah, chan); 77 - power = REG_READ_FIELD(ah, AR_PHY_POWERTX_RATE5, 78 - AR_PHY_POWERTX_RATE5_POWERTXHT20_0); 79 77 80 - delta = abs((int) ah->paprd_target_power - (int) power); 81 - if (delta > scale) 82 - return -1; 78 + if (AR_SREV_9330(ah) || AR_SREV_9340(ah) || 79 + AR_SREV_9462(ah) || AR_SREV_9565(ah)) { 80 + power = ah->paprd_target_power + 2; 81 + } else if (AR_SREV_9485(ah)) { 82 + power = 25; 83 + } else { 84 + power = REG_READ_FIELD(ah, AR_PHY_POWERTX_RATE5, 85 + AR_PHY_POWERTX_RATE5_POWERTXHT20_0); 83 86 84 - if (delta < 4) 85 - power -= 4 - delta; 87 + delta = abs((int) ah->paprd_target_power - (int) power); 88 + if (delta > scale) 89 + return -1; 90 + 91 + if (delta < 4) 92 + power -= 4 - delta; 93 + } 86 94 87 95 return power; 88 96 } ··· 177 169 REG_RMW_FIELD(ah, AR_PHY_PAPRD_HT40, AR_PHY_PAPRD_HT40_MASK, 178 170 ah->paprd_ratemask_ht40); 179 171 172 + ath_dbg(common, CALIBRATE, "PAPRD HT20 mask: 0x%x, HT40 mask: 0x%x\n", 173 + ah->paprd_ratemask, ah->paprd_ratemask_ht40); 174 + 180 175 for (i = 0; i < ah->caps.max_txchains; i++) { 181 176 REG_RMW_FIELD(ah, ctrl0[i], 182 177 AR_PHY_PAPRD_CTRL0_USE_SINGLE_TABLE_MASK, 1); ··· 215 204 AR_PHY_PAPRD_TRAINER_CNTL1_CF_PAPRD_AGC2_SETTLING, 28); 216 205 REG_RMW_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL1, 217 206 AR_PHY_PAPRD_TRAINER_CNTL1_CF_CF_PAPRD_TRAIN_ENABLE, 1); 218 - val = AR_SREV_9462(ah) ? 0x91 : 147; 207 + 208 + if (AR_SREV_9485(ah)) { 209 + val = 148; 210 + } else { 211 + if (IS_CHAN_2GHZ(ah->curchan)) { 212 + if (AR_SREV_9462(ah) || AR_SREV_9565(ah)) 213 + val = 145; 214 + else 215 + val = 147; 216 + } else { 217 + val = 137; 218 + } 219 + } 220 + 219 221 REG_RMW_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL2, 220 222 AR_PHY_PAPRD_TRAINER_CNTL2_CF_PAPRD_INIT_RX_BB_GAIN, val); 221 223 REG_RMW_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL3, ··· 239 215 AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_NUM_CORR_STAGES, 7); 240 216 REG_RMW_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL3, 241 217 AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_MIN_LOOPBACK_DEL, 1); 242 - if (AR_SREV_9485(ah) || AR_SREV_9462(ah) || AR_SREV_9550(ah)) 218 + 219 + if (AR_SREV_9485(ah) || 220 + AR_SREV_9462(ah) || 221 + AR_SREV_9565(ah) || 222 + AR_SREV_9550(ah) || 223 + AR_SREV_9330(ah) || 224 + AR_SREV_9340(ah)) 243 225 REG_RMW_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL3, 244 - AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_QUICK_DROP, 245 - -3); 226 + AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_QUICK_DROP, -3); 246 227 else 247 228 REG_RMW_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL3, 248 - AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_QUICK_DROP, 249 - -6); 250 - val = AR_SREV_9462(ah) ? -10 : -15; 229 + AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_QUICK_DROP, -6); 230 + 231 + val = -10; 232 + 233 + if (IS_CHAN_2GHZ(ah->curchan) && !AR_SREV_9462(ah) && !AR_SREV_9565(ah)) 234 + val = -15; 235 + 251 236 REG_RMW_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL3, 252 237 AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_ADC_DESIRED_SIZE, 253 238 val); ··· 294 261 u8 *index = ah->paprd_gain_table_index; 295 262 u32 reg = AR_PHY_TXGAIN_TABLE; 296 263 int i; 297 - 298 - memset(entry, 0, sizeof(ah->paprd_gain_table_entries)); 299 - memset(index, 0, sizeof(ah->paprd_gain_table_index)); 300 264 301 265 for (i = 0; i < PAPRD_GAIN_TABLE_ENTRIES; i++) { 302 266 entry[i] = REG_READ(ah, reg); ··· 793 763 } 794 764 EXPORT_SYMBOL(ar9003_paprd_populate_single_table); 795 765 796 - int ar9003_paprd_setup_gain_table(struct ath_hw *ah, int chain) 766 + void ar9003_paprd_setup_gain_table(struct ath_hw *ah, int chain) 797 767 { 798 768 unsigned int i, desired_gain, gain_index; 799 769 unsigned int train_power = ah->paprd_training_power; ··· 811 781 812 782 REG_CLR_BIT(ah, AR_PHY_PAPRD_TRAINER_STAT1, 813 783 AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE); 814 - 815 - return 0; 816 784 } 817 785 EXPORT_SYMBOL(ar9003_paprd_setup_gain_table); 818 786 ··· 922 894 923 895 memset(caldata->pa_table[chain], 0, sizeof(caldata->pa_table[chain])); 924 896 925 - buf = kmalloc(2 * 48 * sizeof(u32), GFP_ATOMIC); 897 + buf = kmalloc(2 * 48 * sizeof(u32), GFP_KERNEL); 926 898 if (!buf) 927 899 return -ENOMEM; 928 900 ··· 973 945 bool ar9003_paprd_is_done(struct ath_hw *ah) 974 946 { 975 947 int paprd_done, agc2_pwr; 948 + 976 949 paprd_done = REG_READ_FIELD(ah, AR_PHY_PAPRD_TRAINER_STAT1, 977 950 AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE); 951 + 952 + if (AR_SREV_9485(ah)) 953 + goto exit; 978 954 979 955 if (paprd_done == 0x1) { 980 956 agc2_pwr = REG_READ_FIELD(ah, AR_PHY_PAPRD_TRAINER_STAT1, ··· 995 963 if (agc2_pwr <= PAPRD_IDEAL_AGC2_PWR_RANGE) 996 964 paprd_done = 0; 997 965 } 998 - 966 + exit: 999 967 return !!paprd_done; 1000 968 } 1001 969 EXPORT_SYMBOL(ar9003_paprd_is_done); 970 + 971 + bool ar9003_is_paprd_enabled(struct ath_hw *ah) 972 + { 973 + if ((ah->caps.hw_caps & ATH9K_HW_CAP_PAPRD) && ah->config.enable_paprd) 974 + return true; 975 + 976 + return false; 977 + } 978 + EXPORT_SYMBOL(ar9003_is_paprd_enabled);
+14 -15
drivers/net/wireless/ath/ath9k/ar9003_phy.h
··· 1145 1145 #define AR_PHY_PAPRD_CTRL1_PAPRD_MAG_SCALE_FACT 0x0ffe0000 1146 1146 #define AR_PHY_PAPRD_CTRL1_PAPRD_MAG_SCALE_FACT_S 17 1147 1147 1148 - #define AR_PHY_PAPRD_TRAINER_CNTL1 (AR_SM_BASE + \ 1149 - (AR_SREV_9485(ah) ? \ 1150 - 0x580 : 0x490)) 1148 + #define AR_PHY_PAPRD_TRAINER_CNTL1 (AR_SM_BASE + (AR_SREV_9485(ah) ? 0x580 : 0x490)) 1149 + 1151 1150 #define AR_PHY_PAPRD_TRAINER_CNTL1_CF_CF_PAPRD_TRAIN_ENABLE 0x00000001 1152 1151 #define AR_PHY_PAPRD_TRAINER_CNTL1_CF_CF_PAPRD_TRAIN_ENABLE_S 0 1153 1152 #define AR_PHY_PAPRD_TRAINER_CNTL1_CF_PAPRD_AGC2_SETTLING 0x0000007e ··· 1162 1163 #define AR_PHY_PAPRD_TRAINER_CNTL1_CF_PAPRD_LB_SKIP 0x0003f000 1163 1164 #define AR_PHY_PAPRD_TRAINER_CNTL1_CF_PAPRD_LB_SKIP_S 12 1164 1165 1165 - #define AR_PHY_PAPRD_TRAINER_CNTL2 (AR_SM_BASE + \ 1166 - (AR_SREV_9485(ah) ? \ 1167 - 0x584 : 0x494)) 1166 + #define AR_PHY_PAPRD_TRAINER_CNTL2 (AR_SM_BASE + (AR_SREV_9485(ah) ? 0x584 : 0x494)) 1167 + 1168 1168 #define AR_PHY_PAPRD_TRAINER_CNTL2_CF_PAPRD_INIT_RX_BB_GAIN 0xFFFFFFFF 1169 1169 #define AR_PHY_PAPRD_TRAINER_CNTL2_CF_PAPRD_INIT_RX_BB_GAIN_S 0 1170 1170 1171 - #define AR_PHY_PAPRD_TRAINER_CNTL3 (AR_SM_BASE + \ 1172 - (AR_SREV_9485(ah) ? \ 1173 - 0x588 : 0x498)) 1171 + #define AR_PHY_PAPRD_TRAINER_CNTL3 (AR_SM_BASE + (AR_SREV_9485(ah) ? 0x588 : 0x498)) 1172 + 1174 1173 #define AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_ADC_DESIRED_SIZE 0x0000003f 1175 1174 #define AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_ADC_DESIRED_SIZE_S 0 1176 1175 #define AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_QUICK_DROP 0x00000fc0 ··· 1184 1187 #define AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_BBTXMIX_DISABLE 0x20000000 1185 1188 #define AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_BBTXMIX_DISABLE_S 29 1186 1189 1187 - #define AR_PHY_PAPRD_TRAINER_CNTL4 (AR_SM_BASE + \ 1188 - (AR_SREV_9485(ah) ? \ 1189 - 0x58c : 0x49c)) 1190 + #define AR_PHY_PAPRD_TRAINER_CNTL4 (AR_SM_BASE + (AR_SREV_9485(ah) ? 0x58c : 0x49c)) 1191 + 1190 1192 #define AR_PHY_PAPRD_TRAINER_CNTL4_CF_PAPRD_NUM_TRAIN_SAMPLES 0x03ff0000 1191 1193 #define AR_PHY_PAPRD_TRAINER_CNTL4_CF_PAPRD_NUM_TRAIN_SAMPLES_S 16 1192 1194 #define AR_PHY_PAPRD_TRAINER_CNTL4_CF_PAPRD_SAFETY_DELTA 0x0000f000 ··· 1204 1208 #define AR_PHY_PAPRD_PRE_POST_SCALING 0x3FFFF 1205 1209 #define AR_PHY_PAPRD_PRE_POST_SCALING_S 0 1206 1210 1207 - #define AR_PHY_PAPRD_TRAINER_STAT1 (AR_SM_BASE + 0x4a0) 1211 + #define AR_PHY_PAPRD_TRAINER_STAT1 (AR_SM_BASE + (AR_SREV_9485(ah) ? 0x590 : 0x4a0)) 1212 + 1208 1213 #define AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE 0x00000001 1209 1214 #define AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE_S 0 1210 1215 #define AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_INCOMPLETE 0x00000002 ··· 1219 1222 #define AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_AGC2_PWR 0x0001fe00 1220 1223 #define AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_AGC2_PWR_S 9 1221 1224 1222 - #define AR_PHY_PAPRD_TRAINER_STAT2 (AR_SM_BASE + 0x4a4) 1225 + #define AR_PHY_PAPRD_TRAINER_STAT2 (AR_SM_BASE + (AR_SREV_9485(ah) ? 0x594 : 0x4a4)) 1226 + 1223 1227 #define AR_PHY_PAPRD_TRAINER_STAT2_PAPRD_FINE_VAL 0x0000ffff 1224 1228 #define AR_PHY_PAPRD_TRAINER_STAT2_PAPRD_FINE_VAL_S 0 1225 1229 #define AR_PHY_PAPRD_TRAINER_STAT2_PAPRD_COARSE_IDX 0x001f0000 ··· 1228 1230 #define AR_PHY_PAPRD_TRAINER_STAT2_PAPRD_FINE_IDX 0x00600000 1229 1231 #define AR_PHY_PAPRD_TRAINER_STAT2_PAPRD_FINE_IDX_S 21 1230 1232 1231 - #define AR_PHY_PAPRD_TRAINER_STAT3 (AR_SM_BASE + 0x4a8) 1233 + #define AR_PHY_PAPRD_TRAINER_STAT3 (AR_SM_BASE + (AR_SREV_9485(ah) ? 0x598 : 0x4a8)) 1234 + 1232 1235 #define AR_PHY_PAPRD_TRAINER_STAT3_PAPRD_TRAIN_SAMPLES_CNT 0x000fffff 1233 1236 #define AR_PHY_PAPRD_TRAINER_STAT3_PAPRD_TRAIN_SAMPLES_CNT_S 0 1234 1237
+4 -2
drivers/net/wireless/ath/ath9k/ar9340_initvals.h
··· 211 211 {0x0001609c, 0x02566f3a}, 212 212 {0x000160ac, 0xa4647c00}, 213 213 {0x000160b0, 0x01885f5a}, 214 + {0x00008244, 0x0010f400}, 215 + {0x0000824c, 0x0001e800}, 214 216 }; 215 217 216 218 #define ar9340_1p0_mac_postamble ar9300_2p2_mac_postamble ··· 1275 1273 {0x000081f8, 0x00000000}, 1276 1274 {0x000081fc, 0x00000000}, 1277 1275 {0x00008240, 0x00100000}, 1278 - {0x00008244, 0x0010f424}, 1276 + {0x00008244, 0x0010f3d7}, 1279 1277 {0x00008248, 0x00000800}, 1280 - {0x0000824c, 0x0001e848}, 1278 + {0x0000824c, 0x0001e7ae}, 1281 1279 {0x00008250, 0x00000000}, 1282 1280 {0x00008254, 0x00000000}, 1283 1281 {0x00008258, 0x00000000},
+1
drivers/net/wireless/ath/ath9k/calib.c
··· 69 69 70 70 if (chan && chan->noisefloor) { 71 71 s8 delta = chan->noisefloor - 72 + ATH9K_NF_CAL_NOISE_THRESH - 72 73 ath9k_hw_get_default_nf(ah, chan); 73 74 if (delta > 0) 74 75 noise += delta;
+3
drivers/net/wireless/ath/ath9k/calib.h
··· 21 21 22 22 #define AR_PHY_CCA_FILTERWINDOW_LENGTH 5 23 23 24 + /* Internal noise floor can vary by about 6db depending on the frequency */ 25 + #define ATH9K_NF_CAL_NOISE_THRESH 6 26 + 24 27 #define NUM_NF_READINGS 6 25 28 #define ATH9K_NF_CAL_HIST_MAX 5 26 29
+1 -1
drivers/net/wireless/ath/ath9k/debug.h
··· 242 242 243 243 struct ath_stats { 244 244 struct ath_interrupt_stats istats; 245 - struct ath_tx_stats txstats[IEEE80211_NUM_ACS]; 245 + struct ath_tx_stats txstats[ATH9K_NUM_TX_QUEUES]; 246 246 struct ath_rx_stats rxstats; 247 247 struct ath_dfs_stats dfs_stats; 248 248 u32 reset[__RESET_TYPE_MAX];
+27 -2
drivers/net/wireless/ath/ath9k/eeprom.c
··· 113 113 } 114 114 } 115 115 116 - bool ath9k_hw_nvram_read(struct ath_common *common, u32 off, u16 *data) 116 + static bool ath9k_hw_nvram_read_blob(struct ath_hw *ah, u32 off, 117 + u16 *data) 117 118 { 118 - return common->bus_ops->eeprom_read(common, off, data); 119 + u16 *blob_data; 120 + 121 + if (off * sizeof(u16) > ah->eeprom_blob->size) 122 + return false; 123 + 124 + blob_data = (u16 *)ah->eeprom_blob->data; 125 + *data = blob_data[off]; 126 + return true; 127 + } 128 + 129 + bool ath9k_hw_nvram_read(struct ath_hw *ah, u32 off, u16 *data) 130 + { 131 + struct ath_common *common = ath9k_hw_common(ah); 132 + bool ret; 133 + 134 + if (ah->eeprom_blob) 135 + ret = ath9k_hw_nvram_read_blob(ah, off, data); 136 + else 137 + ret = common->bus_ops->eeprom_read(common, off, data); 138 + 139 + if (!ret) 140 + ath_dbg(common, EEPROM, 141 + "unable to read eeprom region at offset %u\n", off); 142 + 143 + return ret; 119 144 } 120 145 121 146 void ath9k_hw_fill_vpd_table(u8 pwrMin, u8 pwrMax, u8 *pPwrList,
+1 -1
drivers/net/wireless/ath/ath9k/eeprom.h
··· 663 663 int16_t targetRight); 664 664 bool ath9k_hw_get_lower_upper_index(u8 target, u8 *pList, u16 listSize, 665 665 u16 *indexL, u16 *indexR); 666 - bool ath9k_hw_nvram_read(struct ath_common *common, u32 off, u16 *data); 666 + bool ath9k_hw_nvram_read(struct ath_hw *ah, u32 off, u16 *data); 667 667 void ath9k_hw_usb_gen_fill_eeprom(struct ath_hw *ah, u16 *eep_data, 668 668 int eep_start_loc, int size); 669 669 void ath9k_hw_fill_vpd_table(u8 pwrMin, u8 pwrMax, u8 *pPwrList,
+2 -6
drivers/net/wireless/ath/ath9k/eeprom_4k.c
··· 32 32 33 33 static bool __ath9k_hw_4k_fill_eeprom(struct ath_hw *ah) 34 34 { 35 - struct ath_common *common = ath9k_hw_common(ah); 36 35 u16 *eep_data = (u16 *)&ah->eeprom.map4k; 37 36 int addr, eep_start_loc = 64; 38 37 39 38 for (addr = 0; addr < SIZE_EEPROM_4K; addr++) { 40 - if (!ath9k_hw_nvram_read(common, addr + eep_start_loc, eep_data)) { 41 - ath_dbg(common, EEPROM, 42 - "Unable to read eeprom region\n"); 39 + if (!ath9k_hw_nvram_read(ah, addr + eep_start_loc, eep_data)) 43 40 return false; 44 - } 45 41 eep_data++; 46 42 } 47 43 ··· 192 196 193 197 194 198 if (!ath9k_hw_use_flash(ah)) { 195 - if (!ath9k_hw_nvram_read(common, AR5416_EEPROM_MAGIC_OFFSET, 199 + if (!ath9k_hw_nvram_read(ah, AR5416_EEPROM_MAGIC_OFFSET, 196 200 &magic)) { 197 201 ath_err(common, "Reading Magic # failed\n"); 198 202 return false;
+2 -7
drivers/net/wireless/ath/ath9k/eeprom_9287.c
··· 33 33 static bool __ath9k_hw_ar9287_fill_eeprom(struct ath_hw *ah) 34 34 { 35 35 struct ar9287_eeprom *eep = &ah->eeprom.map9287; 36 - struct ath_common *common = ath9k_hw_common(ah); 37 36 u16 *eep_data; 38 37 int addr, eep_start_loc = AR9287_EEP_START_LOC; 39 38 eep_data = (u16 *)eep; 40 39 41 40 for (addr = 0; addr < SIZE_EEPROM_AR9287; addr++) { 42 - if (!ath9k_hw_nvram_read(common, addr + eep_start_loc, 43 - eep_data)) { 44 - ath_dbg(common, EEPROM, 45 - "Unable to read eeprom region\n"); 41 + if (!ath9k_hw_nvram_read(ah, addr + eep_start_loc, eep_data)) 46 42 return false; 47 - } 48 43 eep_data++; 49 44 } 50 45 ··· 185 190 struct ath_common *common = ath9k_hw_common(ah); 186 191 187 192 if (!ath9k_hw_use_flash(ah)) { 188 - if (!ath9k_hw_nvram_read(common, AR5416_EEPROM_MAGIC_OFFSET, 193 + if (!ath9k_hw_nvram_read(ah, AR5416_EEPROM_MAGIC_OFFSET, 189 194 &magic)) { 190 195 ath_err(common, "Reading Magic # failed\n"); 191 196 return false;
+3 -7
drivers/net/wireless/ath/ath9k/eeprom_def.c
··· 91 91 92 92 static bool __ath9k_hw_def_fill_eeprom(struct ath_hw *ah) 93 93 { 94 - struct ath_common *common = ath9k_hw_common(ah); 95 94 u16 *eep_data = (u16 *)&ah->eeprom.def; 96 95 int addr, ar5416_eep_start_loc = 0x100; 97 96 98 97 for (addr = 0; addr < SIZE_EEPROM_DEF; addr++) { 99 - if (!ath9k_hw_nvram_read(common, addr + ar5416_eep_start_loc, 100 - eep_data)) { 101 - ath_err(ath9k_hw_common(ah), 102 - "Unable to read eeprom region\n"); 98 + if (!ath9k_hw_nvram_read(ah, addr + ar5416_eep_start_loc, 99 + eep_data)) 103 100 return false; 104 - } 105 101 eep_data++; 106 102 } 107 103 return true; ··· 267 271 bool need_swap = false; 268 272 int i, addr, size; 269 273 270 - if (!ath9k_hw_nvram_read(common, AR5416_EEPROM_MAGIC_OFFSET, &magic)) { 274 + if (!ath9k_hw_nvram_read(ah, AR5416_EEPROM_MAGIC_OFFSET, &magic)) { 271 275 ath_err(common, "Reading Magic # failed\n"); 272 276 return false; 273 277 }
+1 -1
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
··· 1082 1082 rx_status->freq = hw->conf.channel->center_freq; 1083 1083 rx_status->signal = rxbuf->rxstatus.rs_rssi + ATH_DEFAULT_NOISE_FLOOR; 1084 1084 rx_status->antenna = rxbuf->rxstatus.rs_antenna; 1085 - rx_status->flag |= RX_FLAG_MACTIME_START; 1085 + rx_status->flag |= RX_FLAG_MACTIME_END; 1086 1086 1087 1087 return true; 1088 1088
+4
drivers/net/wireless/ath/ath9k/hw.c
··· 2599 2599 pCap->hw_caps |= ATH9K_HW_WOW_PATTERN_MATCH_DWORD; 2600 2600 } 2601 2601 2602 + if (AR_SREV_9300_20_OR_LATER(ah) && 2603 + ah->eep_ops->get_eeprom(ah, EEP_PAPRD)) 2604 + pCap->hw_caps |= ATH9K_HW_CAP_PAPRD; 2605 + 2602 2606 return 0; 2603 2607 } 2604 2608
+6 -1
drivers/net/wireless/ath/ath9k/hw.h
··· 20 20 #include <linux/if_ether.h> 21 21 #include <linux/delay.h> 22 22 #include <linux/io.h> 23 + #include <linux/firmware.h> 23 24 24 25 #include "mac.h" 25 26 #include "ani.h" ··· 248 247 ATH9K_HW_WOW_DEVICE_CAPABLE = BIT(17), 249 248 ATH9K_HW_WOW_PATTERN_MATCH_EXACT = BIT(18), 250 249 ATH9K_HW_WOW_PATTERN_MATCH_DWORD = BIT(19), 250 + ATH9K_HW_CAP_PAPRD = BIT(20), 251 251 }; 252 252 253 253 /* ··· 922 920 bool is_clk_25mhz; 923 921 int (*get_mac_revision)(void); 924 922 int (*external_reset)(void); 923 + 924 + const struct firmware *eeprom_blob; 925 925 }; 926 926 927 927 struct ath_bus_ops { ··· 1062 1058 int chain); 1063 1059 int ar9003_paprd_create_curve(struct ath_hw *ah, 1064 1060 struct ath9k_hw_cal_data *caldata, int chain); 1065 - int ar9003_paprd_setup_gain_table(struct ath_hw *ah, int chain); 1061 + void ar9003_paprd_setup_gain_table(struct ath_hw *ah, int chain); 1066 1062 int ar9003_paprd_init_table(struct ath_hw *ah); 1067 1063 bool ar9003_paprd_is_done(struct ath_hw *ah); 1064 + bool ar9003_is_paprd_enabled(struct ath_hw *ah); 1068 1065 1069 1066 /* Hardware family op attach helpers */ 1070 1067 void ar5008_hw_attach_phy_ops(struct ath_hw *ah);
+59 -1
drivers/net/wireless/ath/ath9k/init.c
··· 23 23 24 24 #include "ath9k.h" 25 25 26 + struct ath9k_eeprom_ctx { 27 + struct completion complete; 28 + struct ath_hw *ah; 29 + }; 30 + 26 31 static char *dev_info = "ath9k"; 27 32 28 33 MODULE_AUTHOR("Atheros Communications"); ··· 511 506 sc->ant_comb.count = ATH_ANT_DIV_COMB_INIT_COUNT; 512 507 } 513 508 509 + static void ath9k_eeprom_request_cb(const struct firmware *eeprom_blob, 510 + void *ctx) 511 + { 512 + struct ath9k_eeprom_ctx *ec = ctx; 513 + 514 + if (eeprom_blob) 515 + ec->ah->eeprom_blob = eeprom_blob; 516 + 517 + complete(&ec->complete); 518 + } 519 + 520 + static int ath9k_eeprom_request(struct ath_softc *sc, const char *name) 521 + { 522 + struct ath9k_eeprom_ctx ec; 523 + struct ath_hw *ah = ah = sc->sc_ah; 524 + int err; 525 + 526 + /* try to load the EEPROM content asynchronously */ 527 + init_completion(&ec.complete); 528 + ec.ah = sc->sc_ah; 529 + 530 + err = request_firmware_nowait(THIS_MODULE, 1, name, sc->dev, GFP_KERNEL, 531 + &ec, ath9k_eeprom_request_cb); 532 + if (err < 0) { 533 + ath_err(ath9k_hw_common(ah), 534 + "EEPROM request failed\n"); 535 + return err; 536 + } 537 + 538 + wait_for_completion(&ec.complete); 539 + 540 + if (!ah->eeprom_blob) { 541 + ath_err(ath9k_hw_common(ah), 542 + "Unable to load EEPROM file %s\n", name); 543 + return -EINVAL; 544 + } 545 + 546 + return 0; 547 + } 548 + 549 + static void ath9k_eeprom_release(struct ath_softc *sc) 550 + { 551 + release_firmware(sc->sc_ah->eeprom_blob); 552 + } 553 + 514 554 static int ath9k_init_softc(u16 devid, struct ath_softc *sc, 515 555 const struct ath_bus_ops *bus_ops) 516 556 { ··· 633 583 ath_read_cachesize(common, &csz); 634 584 common->cachelsz = csz << 2; /* convert to bytes */ 635 585 586 + if (pdata && pdata->eeprom_name) { 587 + ret = ath9k_eeprom_request(sc, pdata->eeprom_name); 588 + if (ret) 589 + goto err_eeprom; 590 + } 591 + 636 592 /* Initializes the hardware for all supported chipsets */ 637 593 ret = ath9k_hw_init(ah); 638 594 if (ret) ··· 675 619 err_queues: 676 620 ath9k_hw_deinit(ah); 677 621 err_hw: 678 - 622 + ath9k_eeprom_release(sc); 623 + err_eeprom: 679 624 kfree(ah); 680 625 sc->sc_ah = NULL; 681 626 ··· 939 882 if (sc->dfs_detector != NULL) 940 883 sc->dfs_detector->exit(sc->dfs_detector); 941 884 885 + ath9k_eeprom_release(sc); 942 886 kfree(sc->sc_ah); 943 887 sc->sc_ah = NULL; 944 888 }
+15 -7
drivers/net/wireless/ath/ath9k/link.c
··· 179 179 static void ath_paprd_activate(struct ath_softc *sc) 180 180 { 181 181 struct ath_hw *ah = sc->sc_ah; 182 + struct ath_common *common = ath9k_hw_common(ah); 182 183 struct ath9k_hw_cal_data *caldata = ah->caldata; 183 184 int chain; 184 185 185 - if (!caldata || !caldata->paprd_done) 186 + if (!caldata || !caldata->paprd_done) { 187 + ath_dbg(common, CALIBRATE, "Failed to activate PAPRD\n"); 186 188 return; 189 + } 187 190 188 - ath9k_ps_wakeup(sc); 189 191 ar9003_paprd_enable(ah, false); 190 192 for (chain = 0; chain < AR9300_MAX_CHAINS; chain++) { 191 193 if (!(ah->txchainmask & BIT(chain))) ··· 196 194 ar9003_paprd_populate_single_table(ah, caldata, chain); 197 195 } 198 196 197 + ath_dbg(common, CALIBRATE, "Activating PAPRD\n"); 199 198 ar9003_paprd_enable(ah, true); 200 - ath9k_ps_restore(sc); 201 199 } 202 200 203 201 static bool ath_paprd_send_frame(struct ath_softc *sc, struct sk_buff *skb, int chain) ··· 255 253 int len = 1800; 256 254 int ret; 257 255 258 - if (!caldata || !caldata->paprd_packet_sent || caldata->paprd_done) 256 + if (!caldata || !caldata->paprd_packet_sent || caldata->paprd_done) { 257 + ath_dbg(common, CALIBRATE, "Skipping PAPRD calibration\n"); 259 258 return; 259 + } 260 260 261 261 ath9k_ps_wakeup(sc); 262 262 ··· 434 430 cal_interval = min(cal_interval, (u32)short_cal_interval); 435 431 436 432 mod_timer(&common->ani.timer, jiffies + msecs_to_jiffies(cal_interval)); 437 - if (ah->eep_ops->get_eeprom(ah, EEP_PAPRD) && ah->caldata) { 438 - if (!ah->caldata->paprd_done) 433 + 434 + if (ar9003_is_paprd_enabled(ah) && ah->caldata) { 435 + if (!ah->caldata->paprd_done) { 439 436 ieee80211_queue_work(sc->hw, &sc->paprd_work); 440 - else if (!ah->paprd_table_write_done) 437 + } else if (!ah->paprd_table_write_done) { 438 + ath9k_ps_wakeup(sc); 441 439 ath_paprd_activate(sc); 440 + ath9k_ps_restore(sc); 441 + } 442 442 } 443 443 } 444 444
+1 -1
drivers/net/wireless/ath/ath9k/recv.c
··· 976 976 rx_status->freq = hw->conf.channel->center_freq; 977 977 rx_status->signal = ah->noise + rx_stats->rs_rssi; 978 978 rx_status->antenna = rx_stats->rs_antenna; 979 - rx_status->flag |= RX_FLAG_MACTIME_START; 979 + rx_status->flag |= RX_FLAG_MACTIME_END; 980 980 if (rx_stats->rs_moreaggr) 981 981 rx_status->flag |= RX_FLAG_NO_SIGNAL_VAL; 982 982
+1 -1
drivers/net/wireless/ath/carl9170/rx.c
··· 684 684 if (!skb) 685 685 return -ENOMEM; 686 686 687 - memcpy(IEEE80211_SKB_RXCB(skb), &status, sizeof(status)); 687 + memcpy(IEEE80211_SKB_RXCB(skb), status, sizeof(*status)); 688 688 ieee80211_rx(ar->hw, skb); 689 689 return 0; 690 690 }
+5 -2
drivers/net/wireless/b43/dma.c
··· 409 409 struct b43_dmadesc_meta *meta) 410 410 { 411 411 if (meta->skb) { 412 - dev_kfree_skb_any(meta->skb); 412 + if (ring->tx) 413 + ieee80211_free_txskb(ring->dev->wl->hw, meta->skb); 414 + else 415 + dev_kfree_skb_any(meta->skb); 413 416 meta->skb = NULL; 414 417 } 415 418 } ··· 1457 1454 if (unlikely(err == -ENOKEY)) { 1458 1455 /* Drop this packet, as we don't have the encryption key 1459 1456 * anymore and must not transmit it unencrypted. */ 1460 - dev_kfree_skb_any(skb); 1457 + ieee80211_free_txskb(dev->wl->hw, skb); 1461 1458 err = 0; 1462 1459 goto out; 1463 1460 }
+8 -4
drivers/net/wireless/b43/main.c
··· 3397 3397 break; 3398 3398 } 3399 3399 if (unlikely(err)) 3400 - dev_kfree_skb(skb); /* Drop it */ 3400 + ieee80211_free_txskb(wl->hw, skb); 3401 3401 err = 0; 3402 3402 } 3403 3403 ··· 3419 3419 3420 3420 if (unlikely(skb->len < 2 + 2 + 6)) { 3421 3421 /* Too short, this can't be a valid frame. */ 3422 - dev_kfree_skb_any(skb); 3422 + ieee80211_free_txskb(hw, skb); 3423 3423 return; 3424 3424 } 3425 3425 B43_WARN_ON(skb_shinfo(skb)->nr_frags); ··· 4229 4229 4230 4230 /* Drain all TX queues. */ 4231 4231 for (queue_num = 0; queue_num < B43_QOS_QUEUE_NUM; queue_num++) { 4232 - while (skb_queue_len(&wl->tx_queue[queue_num])) 4233 - dev_kfree_skb(skb_dequeue(&wl->tx_queue[queue_num])); 4232 + while (skb_queue_len(&wl->tx_queue[queue_num])) { 4233 + struct sk_buff *skb; 4234 + 4235 + skb = skb_dequeue(&wl->tx_queue[queue_num]); 4236 + ieee80211_free_txskb(wl->hw, skb); 4237 + } 4234 4238 } 4235 4239 4236 4240 b43_mac_suspend(dev);
+2 -2
drivers/net/wireless/b43/pio.c
··· 196 196 for (i = 0; i < ARRAY_SIZE(q->packets); i++) { 197 197 pack = &(q->packets[i]); 198 198 if (pack->skb) { 199 - dev_kfree_skb_any(pack->skb); 199 + ieee80211_free_txskb(q->dev->wl->hw, pack->skb); 200 200 pack->skb = NULL; 201 201 } 202 202 } ··· 552 552 if (unlikely(err == -ENOKEY)) { 553 553 /* Drop this packet, as we don't have the encryption key 554 554 * anymore and must not transmit it unencrypted. */ 555 - dev_kfree_skb_any(skb); 555 + ieee80211_free_txskb(dev->wl->hw, skb); 556 556 err = 0; 557 557 goto out; 558 558 }
+5
drivers/net/wireless/b43legacy/b43legacy.h
··· 13 13 14 14 #include <linux/ssb/ssb.h> 15 15 #include <linux/ssb/ssb_driver_chipcommon.h> 16 + #include <linux/completion.h> 16 17 17 18 #include <net/mac80211.h> 18 19 ··· 734 733 735 734 /* Firmware data */ 736 735 struct b43legacy_firmware fw; 736 + const struct firmware *fwp; /* needed to pass fw pointer */ 737 + 738 + /* completion struct for firmware loading */ 739 + struct completion fw_load_complete; 737 740 738 741 /* Devicelist in struct b43legacy_wl (all 802.11 cores) */ 739 742 struct list_head list;
+31 -6
drivers/net/wireless/b43legacy/main.c
··· 1513 1513 "and download the correct firmware (version 3).\n"); 1514 1514 } 1515 1515 1516 + static void b43legacy_fw_cb(const struct firmware *firmware, void *context) 1517 + { 1518 + struct b43legacy_wldev *dev = context; 1519 + 1520 + dev->fwp = firmware; 1521 + complete(&dev->fw_load_complete); 1522 + } 1523 + 1516 1524 static int do_request_fw(struct b43legacy_wldev *dev, 1517 1525 const char *name, 1518 - const struct firmware **fw) 1526 + const struct firmware **fw, bool async) 1519 1527 { 1520 1528 char path[sizeof(modparam_fwpostfix) + 32]; 1521 1529 struct b43legacy_fw_header *hdr; ··· 1536 1528 snprintf(path, ARRAY_SIZE(path), 1537 1529 "b43legacy%s/%s.fw", 1538 1530 modparam_fwpostfix, name); 1539 - err = request_firmware(fw, path, dev->dev->dev); 1531 + b43legacyinfo(dev->wl, "Loading firmware %s\n", path); 1532 + if (async) { 1533 + init_completion(&dev->fw_load_complete); 1534 + err = request_firmware_nowait(THIS_MODULE, 1, path, 1535 + dev->dev->dev, GFP_KERNEL, 1536 + dev, b43legacy_fw_cb); 1537 + if (err) { 1538 + b43legacyerr(dev->wl, "Unable to load firmware\n"); 1539 + return err; 1540 + } 1541 + /* stall here until fw ready */ 1542 + wait_for_completion(&dev->fw_load_complete); 1543 + if (!dev->fwp) 1544 + err = -EINVAL; 1545 + *fw = dev->fwp; 1546 + } else { 1547 + err = request_firmware(fw, path, dev->dev->dev); 1548 + } 1540 1549 if (err) { 1541 1550 b43legacyerr(dev->wl, "Firmware file \"%s\" not found " 1542 1551 "or load failed.\n", path); ··· 1605 1580 filename = "ucode4"; 1606 1581 else 1607 1582 filename = "ucode5"; 1608 - err = do_request_fw(dev, filename, &fw->ucode); 1583 + err = do_request_fw(dev, filename, &fw->ucode, true); 1609 1584 if (err) 1610 1585 goto err_load; 1611 1586 } ··· 1614 1589 filename = "pcm4"; 1615 1590 else 1616 1591 filename = "pcm5"; 1617 - err = do_request_fw(dev, filename, &fw->pcm); 1592 + err = do_request_fw(dev, filename, &fw->pcm, false); 1618 1593 if (err) 1619 1594 goto err_load; 1620 1595 } ··· 1632 1607 default: 1633 1608 goto err_no_initvals; 1634 1609 } 1635 - err = do_request_fw(dev, filename, &fw->initvals); 1610 + err = do_request_fw(dev, filename, &fw->initvals, false); 1636 1611 if (err) 1637 1612 goto err_load; 1638 1613 } ··· 1652 1627 default: 1653 1628 goto err_no_initvals; 1654 1629 } 1655 - err = do_request_fw(dev, filename, &fw->initvals_band); 1630 + err = do_request_fw(dev, filename, &fw->initvals_band, false); 1656 1631 if (err) 1657 1632 goto err_load; 1658 1633 }
+7 -8
drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
··· 67 67 u8 data; 68 68 unsigned long flags; 69 69 70 - brcmf_dbg(TRACE, "Entering\n"); 70 + brcmf_dbg(TRACE, "Entering: irq %d\n", sdiodev->irq); 71 71 72 - brcmf_dbg(ERROR, "requesting irq %d\n", sdiodev->irq); 73 72 ret = request_irq(sdiodev->irq, brcmf_sdio_irqhandler, 74 73 sdiodev->irq_flags, "brcmf_oob_intr", 75 74 &sdiodev->func[1]->dev); ··· 183 184 } while (err != 0 && retry++ < SDIOH_API_ACCESS_RETRY_LIMIT); 184 185 185 186 if (err) { 186 - brcmf_dbg(ERROR, "failed at addr:0x%0x\n", 187 + brcmf_err("failed at addr:0x%0x\n", 187 188 SBSDIO_FUNC1_SBADDRLOW + i); 188 189 break; 189 190 } ··· 245 246 } while (ret != 0 && retry++ < SDIOH_API_ACCESS_RETRY_LIMIT); 246 247 247 248 if (ret != 0) 248 - brcmf_dbg(ERROR, "failed with %d\n", ret); 249 + brcmf_err("failed with %d\n", ret); 249 250 250 251 return ret; 251 252 } ··· 339 340 340 341 mypkt = brcmu_pkt_buf_get_skb(nbytes); 341 342 if (!mypkt) { 342 - brcmf_dbg(ERROR, "brcmu_pkt_buf_get_skb failed: len %d\n", 343 + brcmf_err("brcmu_pkt_buf_get_skb failed: len %d\n", 343 344 nbytes); 344 345 return -EIO; 345 346 } ··· 408 409 409 410 mypkt = brcmu_pkt_buf_get_skb(nbytes); 410 411 if (!mypkt) { 411 - brcmf_dbg(ERROR, "brcmu_pkt_buf_get_skb failed: len %d\n", 412 + brcmf_err("brcmu_pkt_buf_get_skb failed: len %d\n", 412 413 nbytes); 413 414 return -EIO; 414 415 } ··· 471 472 472 473 mypkt = brcmu_pkt_buf_get_skb(nbytes); 473 474 if (!mypkt) { 474 - brcmf_dbg(ERROR, "brcmu_pkt_buf_get_skb failed: len %d\n", 475 + brcmf_err("brcmu_pkt_buf_get_skb failed: len %d\n", 475 476 nbytes); 476 477 return -EIO; 477 478 } ··· 518 519 /* try to attach to the target device */ 519 520 sdiodev->bus = brcmf_sdbrcm_probe(regs, sdiodev); 520 521 if (!sdiodev->bus) { 521 - brcmf_dbg(ERROR, "device attach failed\n"); 522 + brcmf_err("device attach failed\n"); 522 523 ret = -ENODEV; 523 524 goto out; 524 525 }
+21 -23
drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
··· 107 107 /* Enable Function 2 */ 108 108 err_ret = sdio_enable_func(sdfunc); 109 109 if (err_ret) 110 - brcmf_dbg(ERROR, 111 - "enable F2 failed:%d\n", 110 + brcmf_err("enable F2 failed:%d\n", 112 111 err_ret); 113 112 } else { 114 113 /* Disable Function 2 */ 115 114 err_ret = sdio_disable_func(sdfunc); 116 115 if (err_ret) 117 - brcmf_dbg(ERROR, 118 - "Disable F2 failed:%d\n", 116 + brcmf_err("Disable F2 failed:%d\n", 119 117 err_ret); 120 118 } 121 119 } ··· 127 129 sdio_writeb(sdfunc, *byte, regaddr, &err_ret); 128 130 kfree(sdfunc); 129 131 } else if (regaddr < 0xF0) { 130 - brcmf_dbg(ERROR, "F0 Wr:0x%02x: write disallowed\n", regaddr); 132 + brcmf_err("F0 Wr:0x%02x: write disallowed\n", regaddr); 131 133 err_ret = -EPERM; 132 134 } else { 133 135 sdio_f0_writeb(sdfunc, *byte, regaddr, &err_ret); ··· 164 166 } 165 167 166 168 if (err_ret) 167 - brcmf_dbg(ERROR, "Failed to %s byte F%d:@0x%05x=%02x, Err: %d\n", 169 + brcmf_err("Failed to %s byte F%d:@0x%05x=%02x, Err: %d\n", 168 170 rw ? "write" : "read", func, regaddr, *byte, err_ret); 169 171 170 172 return err_ret; ··· 177 179 int err_ret = -EIO; 178 180 179 181 if (func == 0) { 180 - brcmf_dbg(ERROR, "Only CMD52 allowed to F0\n"); 182 + brcmf_err("Only CMD52 allowed to F0\n"); 181 183 return -EINVAL; 182 184 } 183 185 ··· 196 198 sdio_writew(sdiodev->func[func], (*word & 0xFFFF), 197 199 addr, &err_ret); 198 200 else 199 - brcmf_dbg(ERROR, "Invalid nbytes: %d\n", nbytes); 201 + brcmf_err("Invalid nbytes: %d\n", nbytes); 200 202 } else { /* CMD52 Read */ 201 203 if (nbytes == 4) 202 204 *word = sdio_readl(sdiodev->func[func], addr, &err_ret); ··· 204 206 *word = sdio_readw(sdiodev->func[func], addr, 205 207 &err_ret) & 0xFFFF; 206 208 else 207 - brcmf_dbg(ERROR, "Invalid nbytes: %d\n", nbytes); 209 + brcmf_err("Invalid nbytes: %d\n", nbytes); 208 210 } 209 211 210 212 if (err_ret) 211 - brcmf_dbg(ERROR, "Failed to %s word, Err: 0x%08x\n", 213 + brcmf_err("Failed to %s word, Err: 0x%08x\n", 212 214 rw ? "write" : "read", err_ret); 213 215 214 216 return err_ret; ··· 268 270 err_ret = brcmf_sdioh_request_data(sdiodev, write, fifo, func, 269 271 addr, pkt, pkt_len); 270 272 if (err_ret) { 271 - brcmf_dbg(ERROR, "%s FAILED %p[%d], addr=0x%05x, pkt_len=%d, ERR=0x%08x\n", 273 + brcmf_err("%s FAILED %p[%d], addr=0x%05x, pkt_len=%d, ERR=0x%08x\n", 272 274 write ? "TX" : "RX", pkt, SGCount, addr, 273 275 pkt_len, err_ret); 274 276 } else { ··· 313 315 status = brcmf_sdioh_request_data(sdiodev, write, fifo, func, 314 316 addr, pkt, pkt_len); 315 317 if (status) { 316 - brcmf_dbg(ERROR, "%s FAILED %p, addr=0x%05x, pkt_len=%d, ERR=0x%08x\n", 318 + brcmf_err("%s FAILED %p, addr=0x%05x, pkt_len=%d, ERR=0x%08x\n", 317 319 write ? "TX" : "RX", pkt, addr, pkt_len, status); 318 320 } else { 319 321 brcmf_dbg(TRACE, "%s xfr'd %p, addr=0x%05x, len=%d\n", ··· 334 336 for (i = 0; i < 3; i++) { 335 337 regdata = brcmf_sdio_regrl(sdiodev, regaddr, &ret); 336 338 if (ret != 0) 337 - brcmf_dbg(ERROR, "Can't read!\n"); 339 + brcmf_err("Can't read!\n"); 338 340 339 341 *ptr++ = (u8) regdata; 340 342 regaddr++; ··· 372 374 /* Enable Function 1 */ 373 375 err_ret = sdio_enable_func(sdiodev->func[1]); 374 376 if (err_ret) 375 - brcmf_dbg(ERROR, "Failed to enable F1 Err: 0x%08x\n", err_ret); 377 + brcmf_err("Failed to enable F1 Err: 0x%08x\n", err_ret); 376 378 377 379 return false; 378 380 } ··· 392 394 393 395 err_ret = sdio_set_block_size(sdiodev->func[1], SDIO_FUNC1_BLOCKSIZE); 394 396 if (err_ret) { 395 - brcmf_dbg(ERROR, "Failed to set F1 blocksize\n"); 397 + brcmf_err("Failed to set F1 blocksize\n"); 396 398 goto out; 397 399 } 398 400 399 401 err_ret = sdio_set_block_size(sdiodev->func[2], SDIO_FUNC2_BLOCKSIZE); 400 402 if (err_ret) { 401 - brcmf_dbg(ERROR, "Failed to set F2 blocksize\n"); 403 + brcmf_err("Failed to set F2 blocksize\n"); 402 404 goto out; 403 405 } 404 406 ··· 432 434 struct brcmf_sdio_oobirq *oobirq_entry; 433 435 434 436 if (list_empty(&oobirq_lh)) { 435 - brcmf_dbg(ERROR, "no valid oob irq resource\n"); 437 + brcmf_err("no valid oob irq resource\n"); 436 438 return -ENXIO; 437 439 } 438 440 ··· 506 508 brcmf_dbg(TRACE, "F2 found, calling brcmf_sdio_probe...\n"); 507 509 err = brcmf_sdio_probe(sdiodev); 508 510 if (err) { 509 - brcmf_dbg(ERROR, "F2 error, probe failed %d...\n", err); 511 + brcmf_err("F2 error, probe failed %d...\n", err); 510 512 goto fail; 511 513 } 512 514 brcmf_dbg(TRACE, "F2 init completed...\n"); ··· 562 564 563 565 sdio_flags = sdio_get_host_pm_caps(sdiodev->func[1]); 564 566 if (!(sdio_flags & MMC_PM_KEEP_POWER)) { 565 - brcmf_dbg(ERROR, "Host can't keep power while suspended\n"); 567 + brcmf_err("Host can't keep power while suspended\n"); 566 568 return -EINVAL; 567 569 } 568 570 569 571 ret = sdio_set_host_pm_flags(sdiodev->func[1], MMC_PM_KEEP_POWER); 570 572 if (ret) { 571 - brcmf_dbg(ERROR, "Failed to set pm_flags\n"); 573 + brcmf_err("Failed to set pm_flags\n"); 572 574 return ret; 573 575 } 574 576 ··· 633 635 ret = sdio_register_driver(&brcmf_sdmmc_driver); 634 636 635 637 if (ret) 636 - brcmf_dbg(ERROR, "sdio_register_driver failed: %d\n", ret); 638 + brcmf_err("sdio_register_driver failed: %d\n", ret); 637 639 638 640 return ret; 639 641 } ··· 663 665 ret = platform_driver_register(&brcmf_sdio_pd); 664 666 665 667 if (ret) 666 - brcmf_dbg(ERROR, "platform_driver_register failed: %d\n", ret); 668 + brcmf_err("platform_driver_register failed: %d\n", ret); 667 669 } 668 670 #else 669 671 void brcmf_sdio_exit(void) ··· 682 684 ret = sdio_register_driver(&brcmf_sdmmc_driver); 683 685 684 686 if (ret) 685 - brcmf_dbg(ERROR, "sdio_register_driver failed: %d\n", ret); 687 + brcmf_err("sdio_register_driver failed: %d\n", ret); 686 688 } 687 689 #endif /* CONFIG_BRCMFMAC_SDIO_OOB */
-1
drivers/net/wireless/brcm80211/brcmfmac/dhd.h
··· 470 470 struct brcmf_bus *bus_if; 471 471 struct brcmf_proto *prot; 472 472 struct brcmf_cfg80211_info *config; 473 - struct device *dev; /* fullmac dongle device pointer */ 474 473 475 474 /* Internal brcmf items */ 476 475 uint hdrlen; /* Total BRCMF header length (proto + bus) */
+73 -19
drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h
··· 43 43 struct list_head list; 44 44 }; 45 45 46 - /* interface structure between common and bus layer */ 46 + /** 47 + * struct brcmf_bus_ops - bus callback operations. 48 + * 49 + * @init: prepare for communication with dongle. 50 + * @stop: clear pending frames, disable data flow. 51 + * @txdata: send a data frame to the dongle (callee disposes skb). 52 + * @txctl: transmit a control request message to dongle. 53 + * @rxctl: receive a control response message from dongle. 54 + * 55 + * This structure provides an abstract interface towards the 56 + * bus specific driver. For control messages to common driver 57 + * will assure there is only one active transaction. 58 + */ 59 + struct brcmf_bus_ops { 60 + int (*init)(struct device *dev); 61 + void (*stop)(struct device *dev); 62 + int (*txdata)(struct device *dev, struct sk_buff *skb); 63 + int (*txctl)(struct device *dev, unsigned char *msg, uint len); 64 + int (*rxctl)(struct device *dev, unsigned char *msg, uint len); 65 + }; 66 + 67 + /** 68 + * struct brcmf_bus - interface structure between common and bus layer 69 + * 70 + * @bus_priv: pointer to private bus device. 71 + * @dev: device pointer of bus device. 72 + * @drvr: public driver information. 73 + * @state: operational state of the bus interface. 74 + * @maxctl: maximum size for rxctl request message. 75 + * @drvr_up: indicates driver up/down status. 76 + * @tx_realloc: number of tx packets realloced for headroom. 77 + * @dstats: dongle-based statistical data. 78 + * @align: alignment requirement for the bus. 79 + * @dcmd_list: bus/device specific dongle initialization commands. 80 + */ 47 81 struct brcmf_bus { 48 82 union { 49 83 struct brcmf_sdio_dev *sdio; 50 84 struct brcmf_usbdev *usb; 51 85 } bus_priv; 52 - struct brcmf_pub *drvr; /* pointer to driver pub structure brcmf_pub */ 86 + struct device *dev; 87 + struct brcmf_pub *drvr; 53 88 enum brcmf_bus_state state; 54 - uint maxctl; /* Max size rxctl request from proto to bus */ 55 - bool drvr_up; /* Status flag of driver up/down */ 56 - unsigned long tx_realloc; /* Tx packets realloced for headroom */ 57 - struct dngl_stats dstats; /* Stats for dongle-based data */ 58 - u8 align; /* bus alignment requirement */ 89 + uint maxctl; 90 + bool drvr_up; 91 + unsigned long tx_realloc; 92 + struct dngl_stats dstats; 93 + u8 align; 59 94 struct list_head dcmd_list; 60 95 61 - /* interface functions pointers */ 62 - /* Stop bus module: clear pending frames, disable data flow */ 63 - void (*brcmf_bus_stop)(struct device *); 64 - /* Initialize bus module: prepare for communication w/dongle */ 65 - int (*brcmf_bus_init)(struct device *); 66 - /* Send a data frame to the dongle. Callee disposes of txp. */ 67 - int (*brcmf_bus_txdata)(struct device *, struct sk_buff *); 68 - /* Send/receive a control message to/from the dongle. 69 - * Expects caller to enforce a single outstanding transaction. 70 - */ 71 - int (*brcmf_bus_txctl)(struct device *, unsigned char *, uint); 72 - int (*brcmf_bus_rxctl)(struct device *, unsigned char *, uint); 96 + struct brcmf_bus_ops *ops; 73 97 }; 98 + 99 + /* 100 + * callback wrappers 101 + */ 102 + static inline int brcmf_bus_init(struct brcmf_bus *bus) 103 + { 104 + return bus->ops->init(bus->dev); 105 + } 106 + 107 + static inline void brcmf_bus_stop(struct brcmf_bus *bus) 108 + { 109 + bus->ops->stop(bus->dev); 110 + } 111 + 112 + static inline int brcmf_bus_txdata(struct brcmf_bus *bus, struct sk_buff *skb) 113 + { 114 + return bus->ops->txdata(bus->dev, skb); 115 + } 116 + 117 + static inline 118 + int brcmf_bus_txctl(struct brcmf_bus *bus, unsigned char *msg, uint len) 119 + { 120 + return bus->ops->txctl(bus->dev, msg, len); 121 + } 122 + 123 + static inline 124 + int brcmf_bus_rxctl(struct brcmf_bus *bus, unsigned char *msg, uint len) 125 + { 126 + return bus->ops->rxctl(bus->dev, msg, len); 127 + } 74 128 75 129 /* 76 130 * interface functions from common layer
+11 -14
drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c
··· 117 117 len = CDC_MAX_MSG_SIZE; 118 118 119 119 /* Send request */ 120 - return drvr->bus_if->brcmf_bus_txctl(drvr->dev, 121 - (unsigned char *)&prot->msg, 122 - len); 120 + return brcmf_bus_txctl(drvr->bus_if, (unsigned char *)&prot->msg, len); 123 121 } 124 122 125 123 static int brcmf_proto_cdc_cmplt(struct brcmf_pub *drvr, u32 id, u32 len) ··· 126 128 struct brcmf_proto *prot = drvr->prot; 127 129 128 130 brcmf_dbg(TRACE, "Enter\n"); 129 - 131 + len += sizeof(struct brcmf_proto_cdc_dcmd); 130 132 do { 131 - ret = drvr->bus_if->brcmf_bus_rxctl(drvr->dev, 132 - (unsigned char *)&prot->msg, 133 - len + sizeof(struct brcmf_proto_cdc_dcmd)); 133 + ret = brcmf_bus_rxctl(drvr->bus_if, (unsigned char *)&prot->msg, 134 + len); 134 135 if (ret < 0) 135 136 break; 136 137 } while (CDC_DCMD_ID(le32_to_cpu(prot->msg.flags)) != id); ··· 176 179 177 180 ret = brcmf_proto_cdc_msg(drvr); 178 181 if (ret < 0) { 179 - brcmf_dbg(ERROR, "brcmf_proto_cdc_msg failed w/status %d\n", 182 + brcmf_err("brcmf_proto_cdc_msg failed w/status %d\n", 180 183 ret); 181 184 goto done; 182 185 } ··· 193 196 if ((id < prot->reqid) && (++retries < RETRIES)) 194 197 goto retry; 195 198 if (id != prot->reqid) { 196 - brcmf_dbg(ERROR, "%s: unexpected request id %d (expected %d)\n", 199 + brcmf_err("%s: unexpected request id %d (expected %d)\n", 197 200 brcmf_ifname(drvr, ifidx), id, prot->reqid); 198 201 ret = -EINVAL; 199 202 goto done; ··· 255 258 id = (flags & CDC_DCMD_ID_MASK) >> CDC_DCMD_ID_SHIFT; 256 259 257 260 if (id != prot->reqid) { 258 - brcmf_dbg(ERROR, "%s: unexpected request id %d (expected %d)\n", 261 + brcmf_err("%s: unexpected request id %d (expected %d)\n", 259 262 brcmf_ifname(drvr, ifidx), id, prot->reqid); 260 263 ret = -EINVAL; 261 264 goto done; ··· 317 320 /* Pop BDC header used to convey priority for buses that don't */ 318 321 319 322 if (pktbuf->len < BDC_HEADER_LEN) { 320 - brcmf_dbg(ERROR, "rx data too short (%d < %d)\n", 323 + brcmf_err("rx data too short (%d < %d)\n", 321 324 pktbuf->len, BDC_HEADER_LEN); 322 325 return -EBADE; 323 326 } ··· 326 329 327 330 *ifidx = BDC_GET_IF_IDX(h); 328 331 if (*ifidx >= BRCMF_MAX_IFS) { 329 - brcmf_dbg(ERROR, "rx data ifnum out of range (%d)\n", *ifidx); 332 + brcmf_err("rx data ifnum out of range (%d)\n", *ifidx); 330 333 return -EBADE; 331 334 } 332 335 333 336 if (((h->flags & BDC_FLAG_VER_MASK) >> BDC_FLAG_VER_SHIFT) != 334 337 BDC_PROTO_VER) { 335 - brcmf_dbg(ERROR, "%s: non-BDC packet received, flags 0x%x\n", 338 + brcmf_err("%s: non-BDC packet received, flags 0x%x\n", 336 339 brcmf_ifname(drvr, *ifidx), h->flags); 337 340 return -EBADE; 338 341 } ··· 361 364 362 365 /* ensure that the msg buf directly follows the cdc msg struct */ 363 366 if ((unsigned long)(&cdc->msg + 1) != (unsigned long)cdc->buf) { 364 - brcmf_dbg(ERROR, "struct brcmf_proto is not correctly defined\n"); 367 + brcmf_err("struct brcmf_proto is not correctly defined\n"); 365 368 goto fail; 366 369 } 367 370
+20 -20
drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c
··· 80 80 p = discard_oldest ? brcmu_pktq_pdeq(q, eprec) : 81 81 brcmu_pktq_pdeq_tail(q, eprec); 82 82 if (p == NULL) 83 - brcmf_dbg(ERROR, "brcmu_pktq_penq() failed, oldest %d\n", 83 + brcmf_err("brcmu_pktq_penq() failed, oldest %d\n", 84 84 discard_oldest); 85 85 86 86 brcmu_pkt_buf_free_skb(p); ··· 89 89 /* Enqueue */ 90 90 p = brcmu_pktq_penq(q, prec, pkt); 91 91 if (p == NULL) 92 - brcmf_dbg(ERROR, "brcmu_pktq_penq() failed\n"); 92 + brcmf_err("brcmu_pktq_penq() failed\n"); 93 93 94 94 return p != NULL; 95 95 } ··· 99 99 { 100 100 int i; 101 101 if (strncmp(src, "0x", 2) != 0 && strncmp(src, "0X", 2) != 0) { 102 - brcmf_dbg(ERROR, "Mask invalid format. Needs to start with 0x\n"); 102 + brcmf_err("Mask invalid format. Needs to start with 0x\n"); 103 103 return -EINVAL; 104 104 } 105 105 src = src + 2; /* Skip past 0x */ 106 106 if (strlen(src) % 2 != 0) { 107 - brcmf_dbg(ERROR, "Mask invalid format. Length must be even.\n"); 107 + brcmf_err("Mask invalid format. Length must be even.\n"); 108 108 return -EINVAL; 109 109 } 110 110 for (i = 0; *src != '\0'; i++) { ··· 139 139 argv = strsep(&arg_save, " "); 140 140 141 141 if (argv == NULL) { 142 - brcmf_dbg(ERROR, "No args provided\n"); 142 + brcmf_err("No args provided\n"); 143 143 goto fail; 144 144 } 145 145 ··· 154 154 err = brcmf_fil_iovar_data_set(ifp, "pkt_filter_enable", &enable_parm, 155 155 sizeof(enable_parm)); 156 156 if (err) 157 - brcmf_dbg(ERROR, "Set pkt_filter_enable error (%d)\n", err); 157 + brcmf_err("Set pkt_filter_enable error (%d)\n", err); 158 158 159 159 /* Control the master mode */ 160 160 err = brcmf_fil_iovar_int_set(ifp, "pkt_filter_mode", master_mode); 161 161 if (err) 162 - brcmf_dbg(ERROR, "Set pkt_filter_mode error (%d)\n", err); 162 + brcmf_err("Set pkt_filter_mode error (%d)\n", err); 163 163 164 164 fail: 165 165 kfree(arg_org); ··· 191 191 while (argv[i]) { 192 192 i++; 193 193 if (i >= 8) { 194 - brcmf_dbg(ERROR, "Too many parameters\n"); 194 + brcmf_err("Too many parameters\n"); 195 195 goto fail; 196 196 } 197 197 argv[i] = strsep(&arg_save, " "); 198 198 } 199 199 200 200 if (i != 6) { 201 - brcmf_dbg(ERROR, "Not enough args provided %d\n", i); 201 + brcmf_err("Not enough args provided %d\n", i); 202 202 goto fail; 203 203 } 204 204 ··· 233 233 (char *)&pkt_filter->u.pattern.mask_and_pattern[mask_size]); 234 234 235 235 if (mask_size != pattern_size) { 236 - brcmf_dbg(ERROR, "Mask and pattern not the same size\n"); 236 + brcmf_err("Mask and pattern not the same size\n"); 237 237 goto fail; 238 238 } 239 239 ··· 245 245 err = brcmf_fil_iovar_data_set(ifp, "pkt_filter_add", pkt_filter, 246 246 buf_len); 247 247 if (err) 248 - brcmf_dbg(ERROR, "Set pkt_filter_add error (%d)\n", err); 248 + brcmf_err("Set pkt_filter_add error (%d)\n", err); 249 249 250 250 fail: 251 251 kfree(arg_org); ··· 266 266 err = brcmf_fil_iovar_data_get(ifp, "cur_etheraddr", ifp->mac_addr, 267 267 sizeof(ifp->mac_addr)); 268 268 if (err < 0) { 269 - brcmf_dbg(ERROR, "Retreiving cur_etheraddr failed, %d\n", 269 + brcmf_err("Retreiving cur_etheraddr failed, %d\n", 270 270 err); 271 271 goto done; 272 272 } ··· 277 277 strcpy(buf, "ver"); 278 278 err = brcmf_fil_iovar_data_get(ifp, "ver", buf, sizeof(buf)); 279 279 if (err < 0) { 280 - brcmf_dbg(ERROR, "Retreiving version information failed, %d\n", 280 + brcmf_err("Retreiving version information failed, %d\n", 281 281 err); 282 282 goto done; 283 283 } 284 284 ptr = (char *)buf; 285 285 strsep(&ptr, "\n"); 286 286 /* Print fw version info */ 287 - brcmf_dbg(ERROR, "Firmware version = %s\n", buf); 287 + brcmf_err("Firmware version = %s\n", buf); 288 288 289 289 /* 290 290 * Setup timeout if Beacons are lost and roam is off to report ··· 293 293 err = brcmf_fil_iovar_int_set(ifp, "bcn_timeout", 294 294 BRCMF_DEFAULT_BCN_TIMEOUT); 295 295 if (err) { 296 - brcmf_dbg(ERROR, "bcn_timeout error (%d)\n", err); 296 + brcmf_err("bcn_timeout error (%d)\n", err); 297 297 goto done; 298 298 } 299 299 ··· 302 302 */ 303 303 err = brcmf_fil_iovar_int_set(ifp, "roam_off", 1); 304 304 if (err) { 305 - brcmf_dbg(ERROR, "roam_off error (%d)\n", err); 305 + brcmf_err("roam_off error (%d)\n", err); 306 306 goto done; 307 307 } 308 308 ··· 310 310 err = brcmf_fil_iovar_data_get(ifp, "event_msgs", eventmask, 311 311 BRCMF_EVENTING_MASK_LEN); 312 312 if (err) { 313 - brcmf_dbg(ERROR, "Get event_msgs error (%d)\n", err); 313 + brcmf_err("Get event_msgs error (%d)\n", err); 314 314 goto done; 315 315 } 316 316 setbit(eventmask, BRCMF_E_IF); 317 317 err = brcmf_fil_iovar_data_set(ifp, "event_msgs", eventmask, 318 318 BRCMF_EVENTING_MASK_LEN); 319 319 if (err) { 320 - brcmf_dbg(ERROR, "Set event_msgs error (%d)\n", err); 320 + brcmf_err("Set event_msgs error (%d)\n", err); 321 321 goto done; 322 322 } 323 323 ··· 325 325 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_CHANNEL_TIME, 326 326 BRCMF_DEFAULT_SCAN_CHANNEL_TIME); 327 327 if (err) { 328 - brcmf_dbg(ERROR, "BRCMF_C_SET_SCAN_CHANNEL_TIME error (%d)\n", 328 + brcmf_err("BRCMF_C_SET_SCAN_CHANNEL_TIME error (%d)\n", 329 329 err); 330 330 goto done; 331 331 } ··· 334 334 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_UNASSOC_TIME, 335 335 BRCMF_DEFAULT_SCAN_UNASSOC_TIME); 336 336 if (err) { 337 - brcmf_dbg(ERROR, "BRCMF_C_SET_SCAN_UNASSOC_TIME error (%d)\n", 337 + brcmf_err("BRCMF_C_SET_SCAN_UNASSOC_TIME error (%d)\n", 338 338 err); 339 339 goto done; 340 340 }
+4 -1
drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.c
··· 20 20 #include <brcmu_wifi.h> 21 21 #include <brcmu_utils.h> 22 22 #include "dhd.h" 23 + #include "dhd_bus.h" 23 24 #include "dhd_dbg.h" 24 25 25 26 static struct dentry *root_folder; ··· 43 42 44 43 int brcmf_debugfs_attach(struct brcmf_pub *drvr) 45 44 { 45 + struct device *dev = drvr->bus_if->dev; 46 + 46 47 if (!root_folder) 47 48 return -ENODEV; 48 49 49 - drvr->dbgfs_dir = debugfs_create_dir(dev_name(drvr->dev), root_folder); 50 + drvr->dbgfs_dir = debugfs_create_dir(dev_name(dev), root_folder); 50 51 return PTR_RET(drvr->dbgfs_dir); 51 52 } 52 53
+20 -15
drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.h
··· 18 18 #define _BRCMF_DBG_H_ 19 19 20 20 /* message levels */ 21 - #define BRCMF_ERROR_VAL 0x0001 22 21 #define BRCMF_TRACE_VAL 0x0002 23 22 #define BRCMF_INFO_VAL 0x0004 24 23 #define BRCMF_DATA_VAL 0x0008 ··· 31 32 #define BRCMF_BTA_VAL 0x0800 32 33 #define BRCMF_FIL_VAL 0x1000 33 34 #define BRCMF_USB_VAL 0x2000 35 + #define BRCMF_SCAN_VAL 0x4000 36 + #define BRCMF_CONN_VAL 0x8000 37 + 38 + /* Macro for error messages. net_ratelimit() is used when driver 39 + * debugging is not selected. When debugging the driver error 40 + * messages are as important as other tracing or even more so. 41 + */ 42 + #ifdef CONFIG_BRCMDBG 43 + #define brcmf_err(fmt, ...) pr_err("%s: " fmt, __func__, ##__VA_ARGS__) 44 + #else 45 + #define brcmf_err(fmt, ...) \ 46 + do { \ 47 + if (net_ratelimit()) \ 48 + pr_err("%s: " fmt, __func__, ##__VA_ARGS__); \ 49 + } while (0) 50 + #endif 34 51 35 52 #if defined(DEBUG) 36 53 37 - #define brcmf_dbg(level, fmt, ...) \ 38 - do { \ 39 - if (BRCMF_ERROR_VAL == BRCMF_##level##_VAL) { \ 40 - if (brcmf_msg_level & BRCMF_##level##_VAL) { \ 41 - if (net_ratelimit()) \ 42 - pr_debug("%s: " fmt, \ 43 - __func__, ##__VA_ARGS__); \ 44 - } \ 45 - } else { \ 46 - if (brcmf_msg_level & BRCMF_##level##_VAL) { \ 47 - pr_debug("%s: " fmt, \ 48 - __func__, ##__VA_ARGS__); \ 49 - } \ 50 - } \ 54 + #define brcmf_dbg(level, fmt, ...) \ 55 + do { \ 56 + if (brcmf_msg_level & BRCMF_##level##_VAL) \ 57 + pr_debug("%s: " fmt, __func__, ##__VA_ARGS__); \ 51 58 } while (0) 52 59 53 60 #define BRCMF_DATA_ON() (brcmf_msg_level & BRCMF_DATA_VAL)
+28 -29
drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
··· 39 39 #define MAX_WAIT_FOR_8021X_TX 50 /* msecs */ 40 40 41 41 /* Error bits */ 42 - int brcmf_msg_level = BRCMF_ERROR_VAL; 42 + int brcmf_msg_level; 43 43 module_param(brcmf_msg_level, int, 0); 44 44 45 45 46 46 char *brcmf_ifname(struct brcmf_pub *drvr, int ifidx) 47 47 { 48 48 if (ifidx < 0 || ifidx >= BRCMF_MAX_IFS) { 49 - brcmf_dbg(ERROR, "ifidx %d out of range\n", ifidx); 49 + brcmf_err("ifidx %d out of range\n", ifidx); 50 50 return "<if_bad>"; 51 51 } 52 52 53 53 if (drvr->iflist[ifidx] == NULL) { 54 - brcmf_dbg(ERROR, "null i/f %d\n", ifidx); 54 + brcmf_err("null i/f %d\n", ifidx); 55 55 return "<if_null>"; 56 56 } 57 57 ··· 102 102 103 103 err = brcmf_fil_iovar_data_set(ifp, "mcast_list", buf, buflen); 104 104 if (err < 0) { 105 - brcmf_dbg(ERROR, "Setting mcast_list failed, %d\n", err); 105 + brcmf_err("Setting mcast_list failed, %d\n", err); 106 106 cmd_value = cnt ? true : cmd_value; 107 107 } 108 108 ··· 115 115 */ 116 116 err = brcmf_fil_iovar_int_set(ifp, "allmulti", cmd_value); 117 117 if (err < 0) 118 - brcmf_dbg(ERROR, "Setting allmulti failed, %d\n", err); 118 + brcmf_err("Setting allmulti failed, %d\n", err); 119 119 120 120 /*Finally, pick up the PROMISC flag */ 121 121 cmd_value = (ndev->flags & IFF_PROMISC) ? true : false; 122 122 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PROMISC, cmd_value); 123 123 if (err < 0) 124 - brcmf_dbg(ERROR, "Setting BRCMF_C_SET_PROMISC failed, %d\n", 124 + brcmf_err("Setting BRCMF_C_SET_PROMISC failed, %d\n", 125 125 err); 126 126 } 127 127 ··· 137 137 err = brcmf_fil_iovar_data_set(ifp, "cur_etheraddr", ifp->mac_addr, 138 138 ETH_ALEN); 139 139 if (err < 0) { 140 - brcmf_dbg(ERROR, "Setting cur_etheraddr failed, %d\n", err); 140 + brcmf_err("Setting cur_etheraddr failed, %d\n", err); 141 141 } else { 142 142 brcmf_dbg(TRACE, "MAC address updated to %pM\n", 143 143 ifp->mac_addr); ··· 173 173 /* Reject if down */ 174 174 if (!drvr->bus_if->drvr_up || 175 175 (drvr->bus_if->state != BRCMF_BUS_DATA)) { 176 - brcmf_dbg(ERROR, "xmit rejected drvup=%d state=%d\n", 176 + brcmf_err("xmit rejected drvup=%d state=%d\n", 177 177 drvr->bus_if->drvr_up, 178 178 drvr->bus_if->state); 179 179 netif_stop_queue(ndev); ··· 181 181 } 182 182 183 183 if (!drvr->iflist[ifp->idx]) { 184 - brcmf_dbg(ERROR, "bad ifidx %d\n", ifp->idx); 184 + brcmf_err("bad ifidx %d\n", ifp->idx); 185 185 netif_stop_queue(ndev); 186 186 return -ENODEV; 187 187 } ··· 197 197 dev_kfree_skb(skb); 198 198 skb = skb2; 199 199 if (skb == NULL) { 200 - brcmf_dbg(ERROR, "%s: skb_realloc_headroom failed\n", 200 + brcmf_err("%s: skb_realloc_headroom failed\n", 201 201 brcmf_ifname(drvr, ifp->idx)); 202 202 ret = -ENOMEM; 203 203 goto done; ··· 219 219 brcmf_proto_hdrpush(drvr, ifp->idx, skb); 220 220 221 221 /* Use bus module to send data frame */ 222 - ret = drvr->bus_if->brcmf_bus_txdata(drvr->dev, skb); 222 + ret = brcmf_bus_txdata(drvr->bus_if, skb); 223 223 224 224 done: 225 225 if (ret) ··· 377 377 378 378 err = brcmf_fil_iovar_int_set(ifp, "toe_ol", toe_ol); 379 379 if (err < 0) { 380 - brcmf_dbg(ERROR, "Setting toe_ol failed, %d\n", err); 380 + brcmf_err("Setting toe_ol failed, %d\n", err); 381 381 return err; 382 382 } 383 383 384 384 err = brcmf_fil_iovar_int_set(ifp, "toe", (toe_ol != 0)); 385 385 if (err < 0) 386 - brcmf_dbg(ERROR, "Setting toe failed, %d\n", err); 386 + brcmf_err("Setting toe failed, %d\n", err); 387 387 388 388 return err; 389 389 ··· 397 397 398 398 sprintf(info->driver, KBUILD_MODNAME); 399 399 sprintf(info->version, "%lu", drvr->drv_version); 400 - sprintf(info->bus_info, "%s", dev_name(drvr->dev)); 400 + sprintf(info->bus_info, "%s", dev_name(drvr->bus_if->dev)); 401 401 } 402 402 403 403 static const struct ethtool_ops brcmf_ethtool_ops = { ··· 440 440 441 441 /* otherwise, require dongle to be up */ 442 442 else if (!drvr->bus_if->drvr_up) { 443 - brcmf_dbg(ERROR, "dongle is not up\n"); 443 + brcmf_err("dongle is not up\n"); 444 444 return -ENODEV; 445 445 } 446 446 /* finally, report dongle driver type */ ··· 559 559 560 560 /* If bus is not ready, can't continue */ 561 561 if (bus_if->state != BRCMF_BUS_DATA) { 562 - brcmf_dbg(ERROR, "failed bus is not ready\n"); 562 + brcmf_err("failed bus is not ready\n"); 563 563 return -EAGAIN; 564 564 } 565 565 ··· 583 583 netif_start_queue(ndev); 584 584 drvr->bus_if->drvr_up = true; 585 585 if (brcmf_cfg80211_up(ndev)) { 586 - brcmf_dbg(ERROR, "failed to bring up cfg80211\n"); 586 + brcmf_err("failed to bring up cfg80211\n"); 587 587 return -1; 588 588 } 589 589 ··· 634 634 memcpy(ndev->dev_addr, ifp->mac_addr, ETH_ALEN); 635 635 636 636 if (register_netdev(ndev) != 0) { 637 - brcmf_dbg(ERROR, "couldn't register the net device\n"); 637 + brcmf_err("couldn't register the net device\n"); 638 638 goto fail; 639 639 } 640 640 ··· 662 662 * in case we missed the BRCMF_E_IF_DEL event. 663 663 */ 664 664 if (ifp) { 665 - brcmf_dbg(ERROR, "ERROR: netdev:%s already exists\n", 665 + brcmf_err("ERROR: netdev:%s already exists\n", 666 666 ifp->ndev->name); 667 667 if (ifidx) { 668 668 netif_stop_queue(ifp->ndev); ··· 670 670 free_netdev(ifp->ndev); 671 671 drvr->iflist[ifidx] = NULL; 672 672 } else { 673 - brcmf_dbg(ERROR, "ignore IF event\n"); 673 + brcmf_err("ignore IF event\n"); 674 674 return ERR_PTR(-EINVAL); 675 675 } 676 676 } ··· 678 678 /* Allocate netdev, including space for private structure */ 679 679 ndev = alloc_netdev(sizeof(struct brcmf_if), name, ether_setup); 680 680 if (!ndev) { 681 - brcmf_dbg(ERROR, "OOM - alloc_netdev\n"); 681 + brcmf_err("OOM - alloc_netdev\n"); 682 682 return ERR_PTR(-ENOMEM); 683 683 } 684 684 ··· 710 710 711 711 ifp = drvr->iflist[ifidx]; 712 712 if (!ifp) { 713 - brcmf_dbg(ERROR, "Null interface\n"); 713 + brcmf_err("Null interface\n"); 714 714 return; 715 715 } 716 716 if (ifp->ndev) { ··· 753 753 drvr->hdrlen = bus_hdrlen; 754 754 drvr->bus_if = dev_get_drvdata(dev); 755 755 drvr->bus_if->drvr = drvr; 756 - drvr->dev = dev; 757 756 758 757 /* create device debugfs folder */ 759 758 brcmf_debugfs_attach(drvr); ··· 760 761 /* Attach and link in the protocol */ 761 762 ret = brcmf_proto_attach(drvr); 762 763 if (ret != 0) { 763 - brcmf_dbg(ERROR, "brcmf_prot_attach failed\n"); 764 + brcmf_err("brcmf_prot_attach failed\n"); 764 765 goto fail; 765 766 } 766 767 ··· 789 790 brcmf_dbg(TRACE, "\n"); 790 791 791 792 /* Bring up the bus */ 792 - ret = bus_if->brcmf_bus_init(dev); 793 + ret = brcmf_bus_init(bus_if); 793 794 if (ret != 0) { 794 - brcmf_dbg(ERROR, "brcmf_sdbrcm_bus_init failed %d\n", ret); 795 + brcmf_err("brcmf_sdbrcm_bus_init failed %d\n", ret); 795 796 return ret; 796 797 } 797 798 ··· 808 809 if (ret < 0) 809 810 goto fail; 810 811 811 - drvr->config = brcmf_cfg80211_attach(drvr); 812 + drvr->config = brcmf_cfg80211_attach(drvr, bus_if->dev); 812 813 if (drvr->config == NULL) { 813 814 ret = -ENOMEM; 814 815 goto fail; ··· 821 822 ret = brcmf_net_attach(ifp); 822 823 fail: 823 824 if (ret < 0) { 824 - brcmf_dbg(ERROR, "failed: %d\n", ret); 825 + brcmf_err("failed: %d\n", ret); 825 826 if (drvr->config) 826 827 brcmf_cfg80211_detach(drvr->config); 827 828 free_netdev(drvr->iflist[0]->ndev); ··· 841 842 brcmf_proto_stop(drvr); 842 843 843 844 /* Stop the bus module */ 844 - drvr->bus_if->brcmf_bus_stop(drvr->dev); 845 + brcmf_bus_stop(drvr->bus_if); 845 846 } 846 847 } 847 848
+105 -100
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
··· 689 689 brcmf_sdio_regwb(bus->sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, 690 690 clkreq, &err); 691 691 if (err) { 692 - brcmf_dbg(ERROR, "HT Avail request error: %d\n", err); 692 + brcmf_err("HT Avail request error: %d\n", err); 693 693 return -EBADE; 694 694 } 695 695 ··· 697 697 clkctl = brcmf_sdio_regrb(bus->sdiodev, 698 698 SBSDIO_FUNC1_CHIPCLKCSR, &err); 699 699 if (err) { 700 - brcmf_dbg(ERROR, "HT Avail read error: %d\n", err); 700 + brcmf_err("HT Avail read error: %d\n", err); 701 701 return -EBADE; 702 702 } 703 703 ··· 707 707 devctl = brcmf_sdio_regrb(bus->sdiodev, 708 708 SBSDIO_DEVICE_CTL, &err); 709 709 if (err) { 710 - brcmf_dbg(ERROR, "Devctl error setting CA: %d\n", 710 + brcmf_err("Devctl error setting CA: %d\n", 711 711 err); 712 712 return -EBADE; 713 713 } ··· 741 741 usleep_range(5000, 10000); 742 742 } 743 743 if (err) { 744 - brcmf_dbg(ERROR, "HT Avail request error: %d\n", err); 744 + brcmf_err("HT Avail request error: %d\n", err); 745 745 return -EBADE; 746 746 } 747 747 if (!SBSDIO_CLKAV(clkctl, bus->alp_only)) { 748 - brcmf_dbg(ERROR, "HT Avail timeout (%d): clkctl 0x%02x\n", 748 + brcmf_err("HT Avail timeout (%d): clkctl 0x%02x\n", 749 749 PMU_MAX_TRANSITION_DLY, clkctl); 750 750 return -EBADE; 751 751 } ··· 757 757 #if defined(DEBUG) 758 758 if (!bus->alp_only) { 759 759 if (SBSDIO_ALPONLY(clkctl)) 760 - brcmf_dbg(ERROR, "HT Clock should be on\n"); 760 + brcmf_err("HT Clock should be on\n"); 761 761 } 762 762 #endif /* defined (DEBUG) */ 763 763 ··· 779 779 clkreq, &err); 780 780 brcmf_dbg(INFO, "CLKCTL: turned OFF\n"); 781 781 if (err) { 782 - brcmf_dbg(ERROR, "Failed access turning clock off: %d\n", 782 + brcmf_err("Failed access turning clock off: %d\n", 783 783 err); 784 784 return -EBADE; 785 785 } ··· 836 836 else if (bus->clkstate == CLK_AVAIL) 837 837 brcmf_sdbrcm_htclk(bus, false, false); 838 838 else 839 - brcmf_dbg(ERROR, "request for %d -> %d\n", 839 + brcmf_err("request for %d -> %d\n", 840 840 bus->clkstate, target); 841 841 brcmf_sdbrcm_wd_timer(bus, BRCMF_WD_POLL_MS); 842 842 break; ··· 880 880 brcmf_dbg(INFO, "Dongle reports NAK handled, expect rtx of %d\n", 881 881 bus->rx_seq); 882 882 if (!bus->rxskip) 883 - brcmf_dbg(ERROR, "unexpected NAKHANDLED!\n"); 883 + brcmf_err("unexpected NAKHANDLED!\n"); 884 884 885 885 bus->rxskip = false; 886 886 intstatus |= I_HMB_FRAME_IND; ··· 894 894 (hmb_data & HMB_DATA_VERSION_MASK) >> 895 895 HMB_DATA_VERSION_SHIFT; 896 896 if (bus->sdpcm_ver != SDPCM_PROT_VERSION) 897 - brcmf_dbg(ERROR, "Version mismatch, dongle reports %d, " 897 + brcmf_err("Version mismatch, dongle reports %d, " 898 898 "expecting %d\n", 899 899 bus->sdpcm_ver, SDPCM_PROT_VERSION); 900 900 else ··· 927 927 HMB_DATA_FC | 928 928 HMB_DATA_FWREADY | 929 929 HMB_DATA_FCDATA_MASK | HMB_DATA_VERSION_MASK)) 930 - brcmf_dbg(ERROR, "Unknown mailbox data content: 0x%02x\n", 930 + brcmf_err("Unknown mailbox data content: 0x%02x\n", 931 931 hmb_data); 932 932 933 933 return intstatus; ··· 940 940 u8 hi, lo; 941 941 int err; 942 942 943 - brcmf_dbg(ERROR, "%sterminate frame%s\n", 943 + brcmf_err("%sterminate frame%s\n", 944 944 abort ? "abort command, " : "", 945 945 rtx ? ", send NAK" : ""); 946 946 ··· 963 963 break; 964 964 965 965 if ((hi > (lastrbc >> 8)) && (lo > (lastrbc & 0x00ff))) { 966 - brcmf_dbg(ERROR, "count growing: last 0x%04x now 0x%04x\n", 966 + brcmf_err("count growing: last 0x%04x now 0x%04x\n", 967 967 lastrbc, (hi << 8) + lo); 968 968 } 969 969 lastrbc = (hi << 8) + lo; 970 970 } 971 971 972 972 if (!retries) 973 - brcmf_dbg(ERROR, "count never zeroed: last 0x%04x\n", lastrbc); 973 + brcmf_err("count never zeroed: last 0x%04x\n", lastrbc); 974 974 else 975 975 brcmf_dbg(INFO, "flush took %d iterations\n", 0xffff - retries); 976 976 ··· 1057 1057 return -ENODATA; 1058 1058 } 1059 1059 if ((u16)(~(len ^ checksum))) { 1060 - brcmf_dbg(ERROR, "HW header checksum error\n"); 1060 + brcmf_err("HW header checksum error\n"); 1061 1061 bus->sdcnt.rx_badhdr++; 1062 1062 brcmf_sdbrcm_rxfail(bus, false, false); 1063 1063 return -EIO; 1064 1064 } 1065 1065 if (len < SDPCM_HDRLEN) { 1066 - brcmf_dbg(ERROR, "HW header length error\n"); 1066 + brcmf_err("HW header length error\n"); 1067 1067 return -EPROTO; 1068 1068 } 1069 1069 if (type == BRCMF_SDIO_FT_SUPER && 1070 1070 (roundup(len, bus->blocksize) != rd->len)) { 1071 - brcmf_dbg(ERROR, "HW superframe header length error\n"); 1071 + brcmf_err("HW superframe header length error\n"); 1072 1072 return -EPROTO; 1073 1073 } 1074 1074 if (type == BRCMF_SDIO_FT_SUB && len > rd->len) { 1075 - brcmf_dbg(ERROR, "HW subframe header length error\n"); 1075 + brcmf_err("HW subframe header length error\n"); 1076 1076 return -EPROTO; 1077 1077 } 1078 1078 rd->len = len; ··· 1089 1089 */ 1090 1090 if (type == BRCMF_SDIO_FT_SUPER && 1091 1091 SDPCM_GLOMDESC(&header[SDPCM_FRAMETAG_LEN])) { 1092 - brcmf_dbg(ERROR, "Glom descriptor found in superframe head\n"); 1092 + brcmf_err("Glom descriptor found in superframe head\n"); 1093 1093 rd->len = 0; 1094 1094 return -EINVAL; 1095 1095 } ··· 1097 1097 rd->channel = SDPCM_PACKET_CHANNEL(&header[SDPCM_FRAMETAG_LEN]); 1098 1098 if (len > MAX_RX_DATASZ && rd->channel != SDPCM_CONTROL_CHANNEL && 1099 1099 type != BRCMF_SDIO_FT_SUPER) { 1100 - brcmf_dbg(ERROR, "HW header length too long\n"); 1100 + brcmf_err("HW header length too long\n"); 1101 1101 bus->sdiodev->bus_if->dstats.rx_errors++; 1102 1102 bus->sdcnt.rx_toolong++; 1103 1103 brcmf_sdbrcm_rxfail(bus, false, false); ··· 1105 1105 return -EPROTO; 1106 1106 } 1107 1107 if (type == BRCMF_SDIO_FT_SUPER && rd->channel != SDPCM_GLOM_CHANNEL) { 1108 - brcmf_dbg(ERROR, "Wrong channel for superframe\n"); 1108 + brcmf_err("Wrong channel for superframe\n"); 1109 1109 rd->len = 0; 1110 1110 return -EINVAL; 1111 1111 } 1112 1112 if (type == BRCMF_SDIO_FT_SUB && rd->channel != SDPCM_DATA_CHANNEL && 1113 1113 rd->channel != SDPCM_EVENT_CHANNEL) { 1114 - brcmf_dbg(ERROR, "Wrong channel for subframe\n"); 1114 + brcmf_err("Wrong channel for subframe\n"); 1115 1115 rd->len = 0; 1116 1116 return -EINVAL; 1117 1117 } 1118 1118 rd->dat_offset = SDPCM_DOFFSET_VALUE(&header[SDPCM_FRAMETAG_LEN]); 1119 1119 if (rd->dat_offset < SDPCM_HDRLEN || rd->dat_offset > rd->len) { 1120 - brcmf_dbg(ERROR, "seq %d: bad data offset\n", rx_seq); 1120 + brcmf_err("seq %d: bad data offset\n", rx_seq); 1121 1121 bus->sdcnt.rx_badhdr++; 1122 1122 brcmf_sdbrcm_rxfail(bus, false, false); 1123 1123 rd->len = 0; 1124 1124 return -ENXIO; 1125 1125 } 1126 1126 if (rd->seq_num != rx_seq) { 1127 - brcmf_dbg(ERROR, "seq %d: sequence number error, expect %d\n", 1127 + brcmf_err("seq %d: sequence number error, expect %d\n", 1128 1128 rx_seq, rd->seq_num); 1129 1129 bus->sdcnt.rx_badseq++; 1130 1130 rd->seq_num = rx_seq; ··· 1136 1136 if (rd->len_nxtfrm << 4 > MAX_RX_DATASZ) { 1137 1137 /* only warm for NON glom packet */ 1138 1138 if (rd->channel != SDPCM_GLOM_CHANNEL) 1139 - brcmf_dbg(ERROR, "seq %d: next length error\n", rx_seq); 1139 + brcmf_err("seq %d: next length error\n", rx_seq); 1140 1140 rd->len_nxtfrm = 0; 1141 1141 } 1142 1142 fc = SDPCM_FCMASK_VALUE(&header[SDPCM_FRAMETAG_LEN]); ··· 1150 1150 } 1151 1151 tx_seq_max = SDPCM_WINDOW_VALUE(&header[SDPCM_FRAMETAG_LEN]); 1152 1152 if ((u8)(tx_seq_max - bus->tx_seq) > 0x40) { 1153 - brcmf_dbg(ERROR, "seq %d: max tx seq number error\n", rx_seq); 1153 + brcmf_err("seq %d: max tx seq number error\n", rx_seq); 1154 1154 tx_seq_max = bus->tx_seq + 2; 1155 1155 } 1156 1156 bus->tx_max = tx_seq_max; ··· 1186 1186 dlen = (u16) (bus->glomd->len); 1187 1187 dptr = bus->glomd->data; 1188 1188 if (!dlen || (dlen & 1)) { 1189 - brcmf_dbg(ERROR, "bad glomd len(%d), ignore descriptor\n", 1189 + brcmf_err("bad glomd len(%d), ignore descriptor\n", 1190 1190 dlen); 1191 1191 dlen = 0; 1192 1192 } ··· 1198 1198 dptr += sizeof(u16); 1199 1199 if ((sublen < SDPCM_HDRLEN) || 1200 1200 ((num == 0) && (sublen < (2 * SDPCM_HDRLEN)))) { 1201 - brcmf_dbg(ERROR, "descriptor len %d bad: %d\n", 1201 + brcmf_err("descriptor len %d bad: %d\n", 1202 1202 num, sublen); 1203 1203 pnext = NULL; 1204 1204 break; 1205 1205 } 1206 1206 if (sublen % BRCMF_SDALIGN) { 1207 - brcmf_dbg(ERROR, "sublen %d not multiple of %d\n", 1207 + brcmf_err("sublen %d not multiple of %d\n", 1208 1208 sublen, BRCMF_SDALIGN); 1209 1209 usechain = false; 1210 1210 } ··· 1221 1221 /* Allocate/chain packet for next subframe */ 1222 1222 pnext = brcmu_pkt_buf_get_skb(sublen + BRCMF_SDALIGN); 1223 1223 if (pnext == NULL) { 1224 - brcmf_dbg(ERROR, "bcm_pkt_buf_get_skb failed, num %d len %d\n", 1224 + brcmf_err("bcm_pkt_buf_get_skb failed, num %d len %d\n", 1225 1225 num, sublen); 1226 1226 break; 1227 1227 } ··· 1284 1284 bus->dataptr, dlen); 1285 1285 sublen = (u16) brcmf_sdbrcm_glom_from_buf(bus, dlen); 1286 1286 if (sublen != dlen) { 1287 - brcmf_dbg(ERROR, "FAILED TO COPY, dlen %d sublen %d\n", 1287 + brcmf_err("FAILED TO COPY, dlen %d sublen %d\n", 1288 1288 dlen, sublen); 1289 1289 errcode = -1; 1290 1290 } 1291 1291 pnext = NULL; 1292 1292 } else { 1293 - brcmf_dbg(ERROR, "COULDN'T ALLOC %d-BYTE GLOM, FORCE FAILURE\n", 1293 + brcmf_err("COULDN'T ALLOC %d-BYTE GLOM, FORCE FAILURE\n", 1294 1294 dlen); 1295 1295 errcode = -1; 1296 1296 } ··· 1299 1299 1300 1300 /* On failure, kill the superframe, allow a couple retries */ 1301 1301 if (errcode < 0) { 1302 - brcmf_dbg(ERROR, "glom read of %d bytes failed: %d\n", 1302 + brcmf_err("glom read of %d bytes failed: %d\n", 1303 1303 dlen, errcode); 1304 1304 bus->sdiodev->bus_if->dstats.rx_errors++; 1305 1305 ··· 1390 1390 continue; 1391 1391 } else if (brcmf_proto_hdrpull(bus->sdiodev->dev, 1392 1392 &ifidx, pfirst) != 0) { 1393 - brcmf_dbg(ERROR, "rx protocol error\n"); 1393 + brcmf_err("rx protocol error\n"); 1394 1394 bus->sdiodev->bus_if->dstats.rx_errors++; 1395 1395 skb_unlink(pfirst, &bus->glom); 1396 1396 brcmu_pkt_buf_free_skb(pfirst); ··· 1456 1456 if (bus->rxblen) 1457 1457 buf = vzalloc(bus->rxblen); 1458 1458 if (!buf) { 1459 - brcmf_dbg(ERROR, "no memory for control frame\n"); 1459 + brcmf_err("no memory for control frame\n"); 1460 1460 goto done; 1461 1461 } 1462 1462 rbuf = bus->rxbuf; ··· 1486 1486 1487 1487 /* Drop if the read is too big or it exceeds our maximum */ 1488 1488 if ((rdlen + BRCMF_FIRSTREAD) > bus->sdiodev->bus_if->maxctl) { 1489 - brcmf_dbg(ERROR, "%d-byte control read exceeds %d-byte buffer\n", 1489 + brcmf_err("%d-byte control read exceeds %d-byte buffer\n", 1490 1490 rdlen, bus->sdiodev->bus_if->maxctl); 1491 1491 bus->sdiodev->bus_if->dstats.rx_errors++; 1492 1492 brcmf_sdbrcm_rxfail(bus, false, false); ··· 1494 1494 } 1495 1495 1496 1496 if ((len - doff) > bus->sdiodev->bus_if->maxctl) { 1497 - brcmf_dbg(ERROR, "%d-byte ctl frame (%d-byte ctl data) exceeds %d-byte limit\n", 1497 + brcmf_err("%d-byte ctl frame (%d-byte ctl data) exceeds %d-byte limit\n", 1498 1498 len, len - doff, bus->sdiodev->bus_if->maxctl); 1499 1499 bus->sdiodev->bus_if->dstats.rx_errors++; 1500 1500 bus->sdcnt.rx_toolong++; ··· 1511 1511 1512 1512 /* Control frame failures need retransmission */ 1513 1513 if (sdret < 0) { 1514 - brcmf_dbg(ERROR, "read %d control bytes failed: %d\n", 1514 + brcmf_err("read %d control bytes failed: %d\n", 1515 1515 rdlen, sdret); 1516 1516 bus->sdcnt.rxc_errors++; 1517 1517 brcmf_sdbrcm_rxfail(bus, true, true); ··· 1527 1527 /* Point to valid data and indicate its length */ 1528 1528 spin_lock_bh(&bus->rxctl_lock); 1529 1529 if (bus->rxctl) { 1530 - brcmf_dbg(ERROR, "last control frame is being processed.\n"); 1530 + brcmf_err("last control frame is being processed.\n"); 1531 1531 spin_unlock_bh(&bus->rxctl_lock); 1532 1532 vfree(buf); 1533 1533 goto done; ··· 1599 1599 BRCMF_FIRSTREAD); 1600 1600 bus->sdcnt.f2rxhdrs++; 1601 1601 if (sdret < 0) { 1602 - brcmf_dbg(ERROR, "RXHEADER FAILED: %d\n", 1602 + brcmf_err("RXHEADER FAILED: %d\n", 1603 1603 sdret); 1604 1604 bus->sdcnt.rx_hdrfail++; 1605 1605 brcmf_sdbrcm_rxfail(bus, true, true); ··· 1643 1643 BRCMF_SDALIGN); 1644 1644 if (!pkt) { 1645 1645 /* Give up on data, request rtx of events */ 1646 - brcmf_dbg(ERROR, "brcmu_pkt_buf_get_skb failed\n"); 1646 + brcmf_err("brcmu_pkt_buf_get_skb failed\n"); 1647 1647 bus->sdiodev->bus_if->dstats.rx_dropped++; 1648 1648 brcmf_sdbrcm_rxfail(bus, false, 1649 1649 RETRYCHAN(rd->channel)); ··· 1659 1659 sdio_release_host(bus->sdiodev->func[1]); 1660 1660 1661 1661 if (sdret < 0) { 1662 - brcmf_dbg(ERROR, "read %d bytes from channel %d failed: %d\n", 1662 + brcmf_err("read %d bytes from channel %d failed: %d\n", 1663 1663 rd->len, rd->channel, sdret); 1664 1664 brcmu_pkt_buf_free_skb(pkt); 1665 1665 bus->sdiodev->bus_if->dstats.rx_errors++; ··· 1685 1685 } 1686 1686 bus->sdcnt.rx_readahead_cnt++; 1687 1687 if (rd->len != roundup(rd_new.len, 16)) { 1688 - brcmf_dbg(ERROR, "frame length mismatch:read %d, should be %d\n", 1688 + brcmf_err("frame length mismatch:read %d, should be %d\n", 1689 1689 rd->len, 1690 1690 roundup(rd_new.len, 16) >> 4); 1691 1691 rd->len = 0; ··· 1706 1706 "RxHdr:\n"); 1707 1707 1708 1708 if (rd_new.channel == SDPCM_CONTROL_CHANNEL) { 1709 - brcmf_dbg(ERROR, "readahead on control packet %d?\n", 1709 + brcmf_err("readahead on control packet %d?\n", 1710 1710 rd_new.seq_num); 1711 1711 /* Force retry w/normal header read */ 1712 1712 rd->len = 0; ··· 1733 1733 skb_pull(pkt, SDPCM_HDRLEN); 1734 1734 bus->glomd = pkt; 1735 1735 } else { 1736 - brcmf_dbg(ERROR, "%s: glom superframe w/o " 1736 + brcmf_err("%s: glom superframe w/o " 1737 1737 "descriptor!\n", __func__); 1738 1738 sdio_claim_host(bus->sdiodev->func[1]); 1739 1739 brcmf_sdbrcm_rxfail(bus, false, false); ··· 1762 1762 continue; 1763 1763 } else if (brcmf_proto_hdrpull(bus->sdiodev->dev, &ifidx, 1764 1764 pkt) != 0) { 1765 - brcmf_dbg(ERROR, "rx protocol error\n"); 1765 + brcmf_err("rx protocol error\n"); 1766 1766 brcmu_pkt_buf_free_skb(pkt); 1767 1767 bus->sdiodev->bus_if->dstats.rx_errors++; 1768 1768 continue; ··· 1818 1818 bus->sdiodev->bus_if->tx_realloc++; 1819 1819 new = brcmu_pkt_buf_get_skb(pkt->len + BRCMF_SDALIGN); 1820 1820 if (!new) { 1821 - brcmf_dbg(ERROR, "couldn't allocate new %d-byte packet\n", 1821 + brcmf_err("couldn't allocate new %d-byte packet\n", 1822 1822 pkt->len + BRCMF_SDALIGN); 1823 1823 ret = -ENOMEM; 1824 1824 goto done; ··· 2024 2024 (saveclk | SBSDIO_FORCE_HT), &err); 2025 2025 } 2026 2026 if (err) 2027 - brcmf_dbg(ERROR, "Failed to force clock for F2: err %d\n", err); 2027 + brcmf_err("Failed to force clock for F2: err %d\n", err); 2028 2028 2029 2029 /* Turn off the bus (F2), free any pending packets */ 2030 2030 brcmf_dbg(INTR, "disable SDIO interrupts\n"); ··· 2150 2150 devctl = brcmf_sdio_regrb(bus->sdiodev, 2151 2151 SBSDIO_DEVICE_CTL, &err); 2152 2152 if (err) { 2153 - brcmf_dbg(ERROR, "error reading DEVCTL: %d\n", err); 2153 + brcmf_err("error reading DEVCTL: %d\n", err); 2154 2154 bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN; 2155 2155 } 2156 2156 #endif /* DEBUG */ ··· 2159 2159 clkctl = brcmf_sdio_regrb(bus->sdiodev, 2160 2160 SBSDIO_FUNC1_CHIPCLKCSR, &err); 2161 2161 if (err) { 2162 - brcmf_dbg(ERROR, "error reading CSR: %d\n", 2162 + brcmf_err("error reading CSR: %d\n", 2163 2163 err); 2164 2164 bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN; 2165 2165 } ··· 2171 2171 devctl = brcmf_sdio_regrb(bus->sdiodev, 2172 2172 SBSDIO_DEVICE_CTL, &err); 2173 2173 if (err) { 2174 - brcmf_dbg(ERROR, "error reading DEVCTL: %d\n", 2174 + brcmf_err("error reading DEVCTL: %d\n", 2175 2175 err); 2176 2176 bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN; 2177 2177 } ··· 2179 2179 brcmf_sdio_regwb(bus->sdiodev, SBSDIO_DEVICE_CTL, 2180 2180 devctl, &err); 2181 2181 if (err) { 2182 - brcmf_dbg(ERROR, "error writing DEVCTL: %d\n", 2182 + brcmf_err("error writing DEVCTL: %d\n", 2183 2183 err); 2184 2184 bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN; 2185 2185 } ··· 2226 2226 2227 2227 /* Generally don't ask for these, can get CRC errors... */ 2228 2228 if (intstatus & I_WR_OOSYNC) { 2229 - brcmf_dbg(ERROR, "Dongle reports WR_OOSYNC\n"); 2229 + brcmf_err("Dongle reports WR_OOSYNC\n"); 2230 2230 intstatus &= ~I_WR_OOSYNC; 2231 2231 } 2232 2232 2233 2233 if (intstatus & I_RD_OOSYNC) { 2234 - brcmf_dbg(ERROR, "Dongle reports RD_OOSYNC\n"); 2234 + brcmf_err("Dongle reports RD_OOSYNC\n"); 2235 2235 intstatus &= ~I_RD_OOSYNC; 2236 2236 } 2237 2237 2238 2238 if (intstatus & I_SBINT) { 2239 - brcmf_dbg(ERROR, "Dongle reports SBINT\n"); 2239 + brcmf_err("Dongle reports SBINT\n"); 2240 2240 intstatus &= ~I_SBINT; 2241 2241 } 2242 2242 ··· 2319 2319 } 2320 2320 2321 2321 if ((bus->sdiodev->bus_if->state == BRCMF_BUS_DOWN) || (err != 0)) { 2322 - brcmf_dbg(ERROR, "failed backplane access over SDIO, halting operation\n"); 2322 + brcmf_err("failed backplane access over SDIO, halting operation\n"); 2323 2323 bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN; 2324 2324 atomic_set(&bus->intstatus, 0); 2325 2325 } else if (atomic_read(&bus->intstatus) || ··· 2370 2370 skb_pull(pkt, SDPCM_HDRLEN); 2371 2371 brcmf_txcomplete(bus->sdiodev->dev, pkt, false); 2372 2372 brcmu_pkt_buf_free_skb(pkt); 2373 - brcmf_dbg(ERROR, "out of bus->txq !!!\n"); 2373 + brcmf_err("out of bus->txq !!!\n"); 2374 2374 ret = -ENOSR; 2375 2375 } else { 2376 2376 ret = 0; ··· 2420 2420 /* Set the backplane window to include the start address */ 2421 2421 bcmerror = brcmf_sdcard_set_sbaddr_window(bus->sdiodev, address); 2422 2422 if (bcmerror) { 2423 - brcmf_dbg(ERROR, "window change failed\n"); 2423 + brcmf_err("window change failed\n"); 2424 2424 goto xfer_done; 2425 2425 } 2426 2426 ··· 2432 2432 bcmerror = brcmf_sdcard_rwdata(bus->sdiodev, write, 2433 2433 sdaddr, data, dsize); 2434 2434 if (bcmerror) { 2435 - brcmf_dbg(ERROR, "membytes transfer failed\n"); 2435 + brcmf_err("membytes transfer failed\n"); 2436 2436 break; 2437 2437 } 2438 2438 ··· 2444 2444 bcmerror = brcmf_sdcard_set_sbaddr_window(bus->sdiodev, 2445 2445 address); 2446 2446 if (bcmerror) { 2447 - brcmf_dbg(ERROR, "window change failed\n"); 2447 + brcmf_err("window change failed\n"); 2448 2448 break; 2449 2449 } 2450 2450 sdaddr = 0; ··· 2455 2455 xfer_done: 2456 2456 /* Return the window to backplane enumeration space for core access */ 2457 2457 if (brcmf_sdcard_set_sbaddr_window(bus->sdiodev, bus->sdiodev->sbwad)) 2458 - brcmf_dbg(ERROR, "FAILED to set window back to 0x%x\n", 2458 + brcmf_err("FAILED to set window back to 0x%x\n", 2459 2459 bus->sdiodev->sbwad); 2460 2460 2461 2461 sdio_release_host(bus->sdiodev->func[1]); ··· 2739 2739 * NVRAM length at the end of memory should have been overwritten. 2740 2740 */ 2741 2741 if (!brcmf_sdio_valid_shared_address(addr)) { 2742 - brcmf_dbg(ERROR, "invalid sdpcm_shared address 0x%08X\n", 2742 + brcmf_err("invalid sdpcm_shared address 0x%08X\n", 2743 2743 addr); 2744 2744 return -EINVAL; 2745 2745 } ··· 2762 2762 sh->msgtrace_addr = le32_to_cpu(sh_le.msgtrace_addr); 2763 2763 2764 2764 if ((sh->flags & SDPCM_SHARED_VERSION_MASK) != SDPCM_SHARED_VERSION) { 2765 - brcmf_dbg(ERROR, 2766 - "sdpcm_shared version mismatch: dhd %d dongle %d\n", 2765 + brcmf_err("sdpcm_shared version mismatch: dhd %d dongle %d\n", 2767 2766 SDPCM_SHARED_VERSION, 2768 2767 sh->flags & SDPCM_SHARED_VERSION_MASK); 2769 2768 return -EPROTO; ··· 2937 2938 if ((sh.flags & SDPCM_SHARED_ASSERT_BUILT) == 0) 2938 2939 brcmf_dbg(INFO, "firmware not built with -assert\n"); 2939 2940 else if (sh.flags & SDPCM_SHARED_ASSERT) 2940 - brcmf_dbg(ERROR, "assertion in dongle\n"); 2941 + brcmf_err("assertion in dongle\n"); 2941 2942 2942 2943 if (sh.flags & SDPCM_SHARED_TRAP) 2943 - brcmf_dbg(ERROR, "firmware trap in dongle\n"); 2944 + brcmf_err("firmware trap in dongle\n"); 2944 2945 2945 2946 return 0; 2946 2947 } ··· 3046 3047 brcmf_dbg(CTL, "resumed on rxctl frame, got %d expected %d\n", 3047 3048 rxlen, msglen); 3048 3049 } else if (timeleft == 0) { 3049 - brcmf_dbg(ERROR, "resumed on timeout\n"); 3050 + brcmf_err("resumed on timeout\n"); 3050 3051 brcmf_sdbrcm_checkdied(bus); 3051 3052 } else if (pending) { 3052 3053 brcmf_dbg(CTL, "cancelled\n"); ··· 3097 3098 bcmerror = brcmf_sdbrcm_membytes(bus, false, varaddr, 3098 3099 nvram_ularray, bus->varsz); 3099 3100 if (bcmerror) { 3100 - brcmf_dbg(ERROR, "error %d on reading %d nvram bytes at 0x%08x\n", 3101 + brcmf_err("error %d on reading %d nvram bytes at 0x%08x\n", 3101 3102 bcmerror, bus->varsz, varaddr); 3102 3103 } 3103 3104 /* Compare the org NVRAM with the one read from RAM */ 3104 3105 if (memcmp(bus->vars, nvram_ularray, bus->varsz)) 3105 - brcmf_dbg(ERROR, "Downloaded NVRAM image is corrupted\n"); 3106 + brcmf_err("Downloaded NVRAM image is corrupted\n"); 3106 3107 else 3107 - brcmf_dbg(ERROR, "Download/Upload/Compare of NVRAM ok\n"); 3108 + brcmf_err("Download/Upload/Compare of NVRAM ok\n"); 3108 3109 3109 3110 kfree(nvram_ularray); 3110 3111 #endif /* DEBUG */ ··· 3162 3163 } 3163 3164 } else { 3164 3165 if (!ci->iscoreup(bus->sdiodev, ci, BCMA_CORE_INTERNAL_MEM)) { 3165 - brcmf_dbg(ERROR, "SOCRAM core is down after reset?\n"); 3166 + brcmf_err("SOCRAM core is down after reset?\n"); 3166 3167 bcmerror = -EBADE; 3167 3168 goto fail; 3168 3169 } 3169 3170 3170 3171 bcmerror = brcmf_sdbrcm_write_vars(bus); 3171 3172 if (bcmerror) { 3172 - brcmf_dbg(ERROR, "no vars written to RAM\n"); 3173 + brcmf_err("no vars written to RAM\n"); 3173 3174 bcmerror = 0; 3174 3175 } 3175 3176 ··· 3209 3210 ret = request_firmware(&bus->firmware, BRCMF_SDIO_FW_NAME, 3210 3211 &bus->sdiodev->func[2]->dev); 3211 3212 if (ret) { 3212 - brcmf_dbg(ERROR, "Fail to request firmware %d\n", ret); 3213 + brcmf_err("Fail to request firmware %d\n", ret); 3213 3214 return ret; 3214 3215 } 3215 3216 bus->fw_ptr = 0; ··· 3228 3229 brcmf_sdbrcm_get_image((char *)memptr, MEMBLOCK, bus))) { 3229 3230 ret = brcmf_sdbrcm_membytes(bus, true, offset, memptr, len); 3230 3231 if (ret) { 3231 - brcmf_dbg(ERROR, "error %d on writing %d membytes at 0x%08x\n", 3232 + brcmf_err("error %d on writing %d membytes at 0x%08x\n", 3232 3233 ret, MEMBLOCK, offset); 3233 3234 goto err; 3234 3235 } ··· 3328 3329 ret = request_firmware(&bus->firmware, BRCMF_SDIO_NV_NAME, 3329 3330 &bus->sdiodev->func[2]->dev); 3330 3331 if (ret) { 3331 - brcmf_dbg(ERROR, "Fail to request nvram %d\n", ret); 3332 + brcmf_err("Fail to request nvram %d\n", ret); 3332 3333 return ret; 3333 3334 } 3334 3335 ··· 3345 3346 3346 3347 /* Keep arm in reset */ 3347 3348 if (brcmf_sdbrcm_download_state(bus, true)) { 3348 - brcmf_dbg(ERROR, "error placing ARM core in reset\n"); 3349 + brcmf_err("error placing ARM core in reset\n"); 3349 3350 goto err; 3350 3351 } 3351 3352 3352 3353 /* External image takes precedence if specified */ 3353 3354 if (brcmf_sdbrcm_download_code_file(bus)) { 3354 - brcmf_dbg(ERROR, "dongle image file download failed\n"); 3355 + brcmf_err("dongle image file download failed\n"); 3355 3356 goto err; 3356 3357 } 3357 3358 3358 3359 /* External nvram takes precedence if specified */ 3359 3360 if (brcmf_sdbrcm_download_nvram(bus)) 3360 - brcmf_dbg(ERROR, "dongle nvram file download failed\n"); 3361 + brcmf_err("dongle nvram file download failed\n"); 3361 3362 3362 3363 /* Take arm out of reset */ 3363 3364 if (brcmf_sdbrcm_download_state(bus, false)) { 3364 - brcmf_dbg(ERROR, "error getting out of ARM core reset\n"); 3365 + brcmf_err("error getting out of ARM core reset\n"); 3365 3366 goto err; 3366 3367 } 3367 3368 ··· 3429 3430 (saveclk | SBSDIO_FORCE_HT), &err); 3430 3431 } 3431 3432 if (err) { 3432 - brcmf_dbg(ERROR, "Failed to force clock for F2: err %d\n", err); 3433 + brcmf_err("Failed to force clock for F2: err %d\n", err); 3433 3434 goto exit; 3434 3435 } 3435 3436 ··· 3475 3476 if (ret == 0) { 3476 3477 ret = brcmf_sdio_intr_register(bus->sdiodev); 3477 3478 if (ret != 0) 3478 - brcmf_dbg(ERROR, "intr register failed:%d\n", ret); 3479 + brcmf_err("intr register failed:%d\n", ret); 3479 3480 } 3480 3481 3481 3482 /* If we didn't come up, turn off backplane clock */ ··· 3495 3496 brcmf_dbg(TRACE, "Enter\n"); 3496 3497 3497 3498 if (!bus) { 3498 - brcmf_dbg(ERROR, "bus is null pointer, exiting\n"); 3499 + brcmf_err("bus is null pointer, exiting\n"); 3499 3500 return; 3500 3501 } 3501 3502 3502 3503 if (bus->sdiodev->bus_if->state == BRCMF_BUS_DOWN) { 3503 - brcmf_dbg(ERROR, "bus is down. we have nothing to do\n"); 3504 + brcmf_err("bus is down. we have nothing to do\n"); 3504 3505 return; 3505 3506 } 3506 3507 /* Count the interrupt call */ ··· 3509 3510 atomic_set(&bus->ipend, 1); 3510 3511 else 3511 3512 if (brcmf_sdio_intr_rstatus(bus)) { 3512 - brcmf_dbg(ERROR, "failed backplane access\n"); 3513 + brcmf_err("failed backplane access\n"); 3513 3514 bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN; 3514 3515 } 3515 3516 3516 3517 /* Disable additional interrupts (is this needed now)? */ 3517 3518 if (!bus->intr) 3518 - brcmf_dbg(ERROR, "isr w/o interrupt configured!\n"); 3519 + brcmf_err("isr w/o interrupt configured!\n"); 3519 3520 3520 3521 brcmf_sdbrcm_adddpctsk(bus); 3521 3522 queue_work(bus->brcmf_wq, &bus->datawork); ··· 3717 3718 SBSDIO_FUNC1_CHIPCLKCSR, &err); 3718 3719 3719 3720 if (err || ((clkctl & ~SBSDIO_AVBITS) != BRCMF_INIT_CLKCTL1)) { 3720 - brcmf_dbg(ERROR, "ChipClkCSR access: err %d wrote 0x%02x read 0x%02x\n", 3721 + brcmf_err("ChipClkCSR access: err %d wrote 0x%02x read 0x%02x\n", 3721 3722 err, BRCMF_INIT_CLKCTL1, clkctl); 3722 3723 goto fail; 3723 3724 } 3724 3725 3725 3726 if (brcmf_sdio_chip_attach(bus->sdiodev, &bus->ci, regsva)) { 3726 - brcmf_dbg(ERROR, "brcmf_sdio_chip_attach failed!\n"); 3727 + brcmf_err("brcmf_sdio_chip_attach failed!\n"); 3727 3728 goto fail; 3728 3729 } 3729 3730 3730 3731 if (!brcmf_sdbrcm_chipmatch((u16) bus->ci->chip)) { 3731 - brcmf_dbg(ERROR, "unsupported chip: 0x%04x\n", bus->ci->chip); 3732 + brcmf_err("unsupported chip: 0x%04x\n", bus->ci->chip); 3732 3733 goto fail; 3733 3734 } 3734 3735 ··· 3738 3739 /* Get info on the SOCRAM cores... */ 3739 3740 bus->ramsize = bus->ci->ramsize; 3740 3741 if (!(bus->ramsize)) { 3741 - brcmf_dbg(ERROR, "failed to find SOCRAM memory!\n"); 3742 + brcmf_err("failed to find SOCRAM memory!\n"); 3742 3743 goto fail; 3743 3744 } 3744 3745 ··· 3882 3883 brcmf_dbg(TRACE, "Disconnected\n"); 3883 3884 } 3884 3885 3886 + static struct brcmf_bus_ops brcmf_sdio_bus_ops = { 3887 + .stop = brcmf_sdbrcm_bus_stop, 3888 + .init = brcmf_sdbrcm_bus_init, 3889 + .txdata = brcmf_sdbrcm_bus_txdata, 3890 + .txctl = brcmf_sdbrcm_bus_txctl, 3891 + .rxctl = brcmf_sdbrcm_bus_rxctl, 3892 + }; 3893 + 3885 3894 void *brcmf_sdbrcm_probe(u32 regsva, struct brcmf_sdio_dev *sdiodev) 3886 3895 { 3887 3896 int ret; ··· 3920 3913 INIT_WORK(&bus->datawork, brcmf_sdio_dataworker); 3921 3914 bus->brcmf_wq = create_singlethread_workqueue("brcmf_wq"); 3922 3915 if (bus->brcmf_wq == NULL) { 3923 - brcmf_dbg(ERROR, "insufficient memory to create txworkqueue\n"); 3916 + brcmf_err("insufficient memory to create txworkqueue\n"); 3924 3917 goto fail; 3925 3918 } 3926 3919 3927 3920 /* attempt to attach to the dongle */ 3928 3921 if (!(brcmf_sdbrcm_probe_attach(bus, regsva))) { 3929 - brcmf_dbg(ERROR, "brcmf_sdbrcm_probe_attach failed\n"); 3922 + brcmf_err("brcmf_sdbrcm_probe_attach failed\n"); 3930 3923 goto fail; 3931 3924 } 3932 3925 ··· 3953 3946 spin_lock_init(&bus->dpc_tl_lock); 3954 3947 3955 3948 /* Assign bus interface call back */ 3956 - bus->sdiodev->bus_if->brcmf_bus_stop = brcmf_sdbrcm_bus_stop; 3957 - bus->sdiodev->bus_if->brcmf_bus_init = brcmf_sdbrcm_bus_init; 3958 - bus->sdiodev->bus_if->brcmf_bus_txdata = brcmf_sdbrcm_bus_txdata; 3959 - bus->sdiodev->bus_if->brcmf_bus_txctl = brcmf_sdbrcm_bus_txctl; 3960 - bus->sdiodev->bus_if->brcmf_bus_rxctl = brcmf_sdbrcm_bus_rxctl; 3949 + bus->sdiodev->bus_if->dev = bus->sdiodev->dev; 3950 + bus->sdiodev->bus_if->ops = &brcmf_sdio_bus_ops; 3951 + 3961 3952 /* Attach to the brcmf/OS/network interface */ 3962 3953 ret = brcmf_attach(SDPCM_RESERVE, bus->sdiodev->dev); 3963 3954 if (ret != 0) { 3964 - brcmf_dbg(ERROR, "brcmf_attach failed\n"); 3955 + brcmf_err("brcmf_attach failed\n"); 3965 3956 goto fail; 3966 3957 } 3967 3958 3968 3959 /* Allocate buffers */ 3969 3960 if (!(brcmf_sdbrcm_probe_malloc(bus))) { 3970 - brcmf_dbg(ERROR, "brcmf_sdbrcm_probe_malloc failed\n"); 3961 + brcmf_err("brcmf_sdbrcm_probe_malloc failed\n"); 3971 3962 goto fail; 3972 3963 } 3973 3964 3974 3965 if (!(brcmf_sdbrcm_probe_init(bus))) { 3975 - brcmf_dbg(ERROR, "brcmf_sdbrcm_probe_init failed\n"); 3966 + brcmf_err("brcmf_sdbrcm_probe_init failed\n"); 3976 3967 goto fail; 3977 3968 } 3978 3969 ··· 4000 3995 /* if firmware path present try to download and bring up bus */ 4001 3996 ret = brcmf_bus_start(bus->sdiodev->dev); 4002 3997 if (ret != 0) { 4003 - brcmf_dbg(ERROR, "dongle is not responding\n"); 3998 + brcmf_err("dongle is not responding\n"); 4004 3999 goto fail; 4005 4000 } 4006 4001
+11 -73
drivers/net/wireless/brcm80211/brcmfmac/fweh.c
··· 95 95 }; 96 96 97 97 #ifdef DEBUG 98 + #define BRCMF_ENUM_DEF(id, val) \ 99 + { val, #id }, 100 + 98 101 /* array for mapping code to event name */ 99 102 static struct brcmf_fweh_event_name fweh_event_names[] = { 100 - { BRCMF_E_SET_SSID, "SET_SSID" }, 101 - { BRCMF_E_JOIN, "JOIN" }, 102 - { BRCMF_E_START, "START" }, 103 - { BRCMF_E_AUTH, "AUTH" }, 104 - { BRCMF_E_AUTH_IND, "AUTH_IND" }, 105 - { BRCMF_E_DEAUTH, "DEAUTH" }, 106 - { BRCMF_E_DEAUTH_IND, "DEAUTH_IND" }, 107 - { BRCMF_E_ASSOC, "ASSOC" }, 108 - { BRCMF_E_ASSOC_IND, "ASSOC_IND" }, 109 - { BRCMF_E_REASSOC, "REASSOC" }, 110 - { BRCMF_E_REASSOC_IND, "REASSOC_IND" }, 111 - { BRCMF_E_DISASSOC, "DISASSOC" }, 112 - { BRCMF_E_DISASSOC_IND, "DISASSOC_IND" }, 113 - { BRCMF_E_QUIET_START, "START_QUIET" }, 114 - { BRCMF_E_QUIET_END, "END_QUIET" }, 115 - { BRCMF_E_BEACON_RX, "BEACON_RX" }, 116 - { BRCMF_E_LINK, "LINK" }, 117 - { BRCMF_E_MIC_ERROR, "MIC_ERROR" }, 118 - { BRCMF_E_NDIS_LINK, "NDIS_LINK" }, 119 - { BRCMF_E_ROAM, "ROAM" }, 120 - { BRCMF_E_TXFAIL, "TXFAIL" }, 121 - { BRCMF_E_PMKID_CACHE, "PMKID_CACHE" }, 122 - { BRCMF_E_RETROGRADE_TSF, "RETROGRADE_TSF" }, 123 - { BRCMF_E_PRUNE, "PRUNE" }, 124 - { BRCMF_E_AUTOAUTH, "AUTOAUTH" }, 125 - { BRCMF_E_EAPOL_MSG, "EAPOL_MSG" }, 126 - { BRCMF_E_SCAN_COMPLETE, "SCAN_COMPLETE" }, 127 - { BRCMF_E_ADDTS_IND, "ADDTS_IND" }, 128 - { BRCMF_E_DELTS_IND, "DELTS_IND" }, 129 - { BRCMF_E_BCNSENT_IND, "BCNSENT_IND" }, 130 - { BRCMF_E_BCNRX_MSG, "BCNRX_MSG" }, 131 - { BRCMF_E_BCNLOST_MSG, "BCNLOST_MSG" }, 132 - { BRCMF_E_ROAM_PREP, "ROAM_PREP" }, 133 - { BRCMF_E_PFN_NET_FOUND, "PNO_NET_FOUND" }, 134 - { BRCMF_E_PFN_NET_LOST, "PNO_NET_LOST" }, 135 - { BRCMF_E_RESET_COMPLETE, "RESET_COMPLETE" }, 136 - { BRCMF_E_JOIN_START, "JOIN_START" }, 137 - { BRCMF_E_ROAM_START, "ROAM_START" }, 138 - { BRCMF_E_ASSOC_START, "ASSOC_START" }, 139 - { BRCMF_E_IBSS_ASSOC, "IBSS_ASSOC" }, 140 - { BRCMF_E_RADIO, "RADIO" }, 141 - { BRCMF_E_PSM_WATCHDOG, "PSM_WATCHDOG" }, 142 - { BRCMF_E_PROBREQ_MSG, "PROBREQ_MSG" }, 143 - { BRCMF_E_SCAN_CONFIRM_IND, "SCAN_CONFIRM_IND" }, 144 - { BRCMF_E_PSK_SUP, "PSK_SUP" }, 145 - { BRCMF_E_COUNTRY_CODE_CHANGED, "COUNTRY_CODE_CHANGED" }, 146 - { BRCMF_E_EXCEEDED_MEDIUM_TIME, "EXCEEDED_MEDIUM_TIME" }, 147 - { BRCMF_E_ICV_ERROR, "ICV_ERROR" }, 148 - { BRCMF_E_UNICAST_DECODE_ERROR, "UNICAST_DECODE_ERROR" }, 149 - { BRCMF_E_MULTICAST_DECODE_ERROR, "MULTICAST_DECODE_ERROR" }, 150 - { BRCMF_E_TRACE, "TRACE" }, 151 - { BRCMF_E_IF, "IF" }, 152 - { BRCMF_E_RSSI, "RSSI" }, 153 - { BRCMF_E_PFN_SCAN_COMPLETE, "PFN_SCAN_COMPLETE" }, 154 - { BRCMF_E_EXTLOG_MSG, "EXTLOG_MSG" }, 155 - { BRCMF_E_ACTION_FRAME, "ACTION_FRAME" }, 156 - { BRCMF_E_ACTION_FRAME_COMPLETE, "ACTION_FRAME_COMPLETE" }, 157 - { BRCMF_E_PRE_ASSOC_IND, "PRE_ASSOC_IND" }, 158 - { BRCMF_E_PRE_REASSOC_IND, "PRE_REASSOC_IND" }, 159 - { BRCMF_E_CHANNEL_ADOPTED, "CHANNEL_ADOPTED" }, 160 - { BRCMF_E_AP_STARTED, "AP_STARTED" }, 161 - { BRCMF_E_DFS_AP_STOP, "DFS_AP_STOP" }, 162 - { BRCMF_E_DFS_AP_RESUME, "DFS_AP_RESUME" }, 163 - { BRCMF_E_ESCAN_RESULT, "ESCAN_RESULT" }, 164 - { BRCMF_E_ACTION_FRAME_OFF_CHAN_COMPLETE, "ACTION_FRM_OFF_CHAN_CMPLT" }, 165 - { BRCMF_E_DCS_REQUEST, "DCS_REQUEST" }, 166 - { BRCMF_E_FIFO_CREDIT_MAP, "FIFO_CREDIT_MAP"} 103 + BRCMF_FWEH_EVENT_ENUM_DEFLIST 167 104 }; 105 + #undef BRCMF_ENUM_DEF 168 106 169 107 /** 170 108 * brcmf_fweh_event_name() - returns name for given event code. ··· 157 219 if (ifp->ndev && fweh->evt_handler[code]) 158 220 err = fweh->evt_handler[code](ifp, emsg, data); 159 221 else 160 - brcmf_dbg(ERROR, "unhandled event %d ignored\n", code); 222 + brcmf_err("unhandled event %d ignored\n", code); 161 223 } else { 162 - brcmf_dbg(ERROR, "no interface object\n"); 224 + brcmf_err("no interface object\n"); 163 225 } 164 226 return err; 165 227 } ··· 184 246 ifevent->bssidx, ifevent->flags); 185 247 186 248 if (ifevent->ifidx >= BRCMF_MAX_IFS) { 187 - brcmf_dbg(ERROR, "invalid interface index: %u\n", 249 + brcmf_err("invalid interface index: %u\n", 188 250 ifevent->ifidx); 189 251 return; 190 252 } ··· 286 348 err = brcmf_fweh_call_event_handler(ifp, event->code, &emsg, 287 349 event->data); 288 350 if (err) { 289 - brcmf_dbg(ERROR, "event handler failed (%d)\n", 351 + brcmf_err("event handler failed (%d)\n", 290 352 event->code); 291 353 err = 0; 292 354 } ··· 343 405 brcmf_fweh_handler_t handler) 344 406 { 345 407 if (drvr->fweh.evt_handler[code]) { 346 - brcmf_dbg(ERROR, "event code %d already registered\n", code); 408 + brcmf_err("event code %d already registered\n", code); 347 409 return -ENOSPC; 348 410 } 349 411 drvr->fweh.evt_handler[code] = handler; ··· 391 453 err = brcmf_fil_iovar_data_set(ifp, "event_msgs", 392 454 eventmask, BRCMF_EVENTING_MASK_LEN); 393 455 if (err) 394 - brcmf_dbg(ERROR, "Set event_msgs error (%d)\n", err); 456 + brcmf_err("Set event_msgs error (%d)\n", err); 395 457 396 458 return err; 397 459 }
+75 -67
drivers/net/wireless/brcm80211/brcmfmac/fweh.h
··· 29 29 struct brcmf_cfg80211_info; 30 30 struct brcmf_event; 31 31 32 + /* list of firmware events */ 33 + #define BRCMF_FWEH_EVENT_ENUM_DEFLIST \ 34 + BRCMF_ENUM_DEF(SET_SSID, 0) \ 35 + BRCMF_ENUM_DEF(JOIN, 1) \ 36 + BRCMF_ENUM_DEF(START, 2) \ 37 + BRCMF_ENUM_DEF(AUTH, 3) \ 38 + BRCMF_ENUM_DEF(AUTH_IND, 4) \ 39 + BRCMF_ENUM_DEF(DEAUTH, 5) \ 40 + BRCMF_ENUM_DEF(DEAUTH_IND, 6) \ 41 + BRCMF_ENUM_DEF(ASSOC, 7) \ 42 + BRCMF_ENUM_DEF(ASSOC_IND, 8) \ 43 + BRCMF_ENUM_DEF(REASSOC, 9) \ 44 + BRCMF_ENUM_DEF(REASSOC_IND, 10) \ 45 + BRCMF_ENUM_DEF(DISASSOC, 11) \ 46 + BRCMF_ENUM_DEF(DISASSOC_IND, 12) \ 47 + BRCMF_ENUM_DEF(QUIET_START, 13) \ 48 + BRCMF_ENUM_DEF(QUIET_END, 14) \ 49 + BRCMF_ENUM_DEF(BEACON_RX, 15) \ 50 + BRCMF_ENUM_DEF(LINK, 16) \ 51 + BRCMF_ENUM_DEF(MIC_ERROR, 17) \ 52 + BRCMF_ENUM_DEF(NDIS_LINK, 18) \ 53 + BRCMF_ENUM_DEF(ROAM, 19) \ 54 + BRCMF_ENUM_DEF(TXFAIL, 20) \ 55 + BRCMF_ENUM_DEF(PMKID_CACHE, 21) \ 56 + BRCMF_ENUM_DEF(RETROGRADE_TSF, 22) \ 57 + BRCMF_ENUM_DEF(PRUNE, 23) \ 58 + BRCMF_ENUM_DEF(AUTOAUTH, 24) \ 59 + BRCMF_ENUM_DEF(EAPOL_MSG, 25) \ 60 + BRCMF_ENUM_DEF(SCAN_COMPLETE, 26) \ 61 + BRCMF_ENUM_DEF(ADDTS_IND, 27) \ 62 + BRCMF_ENUM_DEF(DELTS_IND, 28) \ 63 + BRCMF_ENUM_DEF(BCNSENT_IND, 29) \ 64 + BRCMF_ENUM_DEF(BCNRX_MSG, 30) \ 65 + BRCMF_ENUM_DEF(BCNLOST_MSG, 31) \ 66 + BRCMF_ENUM_DEF(ROAM_PREP, 32) \ 67 + BRCMF_ENUM_DEF(PFN_NET_FOUND, 33) \ 68 + BRCMF_ENUM_DEF(PFN_NET_LOST, 34) \ 69 + BRCMF_ENUM_DEF(RESET_COMPLETE, 35) \ 70 + BRCMF_ENUM_DEF(JOIN_START, 36) \ 71 + BRCMF_ENUM_DEF(ROAM_START, 37) \ 72 + BRCMF_ENUM_DEF(ASSOC_START, 38) \ 73 + BRCMF_ENUM_DEF(IBSS_ASSOC, 39) \ 74 + BRCMF_ENUM_DEF(RADIO, 40) \ 75 + BRCMF_ENUM_DEF(PSM_WATCHDOG, 41) \ 76 + BRCMF_ENUM_DEF(PROBREQ_MSG, 44) \ 77 + BRCMF_ENUM_DEF(SCAN_CONFIRM_IND, 45) \ 78 + BRCMF_ENUM_DEF(PSK_SUP, 46) \ 79 + BRCMF_ENUM_DEF(COUNTRY_CODE_CHANGED, 47) \ 80 + BRCMF_ENUM_DEF(EXCEEDED_MEDIUM_TIME, 48) \ 81 + BRCMF_ENUM_DEF(ICV_ERROR, 49) \ 82 + BRCMF_ENUM_DEF(UNICAST_DECODE_ERROR, 50) \ 83 + BRCMF_ENUM_DEF(MULTICAST_DECODE_ERROR, 51) \ 84 + BRCMF_ENUM_DEF(TRACE, 52) \ 85 + BRCMF_ENUM_DEF(IF, 54) \ 86 + BRCMF_ENUM_DEF(RSSI, 56) \ 87 + BRCMF_ENUM_DEF(PFN_SCAN_COMPLETE, 57) \ 88 + BRCMF_ENUM_DEF(EXTLOG_MSG, 58) \ 89 + BRCMF_ENUM_DEF(ACTION_FRAME, 59) \ 90 + BRCMF_ENUM_DEF(ACTION_FRAME_COMPLETE, 60) \ 91 + BRCMF_ENUM_DEF(PRE_ASSOC_IND, 61) \ 92 + BRCMF_ENUM_DEF(PRE_REASSOC_IND, 62) \ 93 + BRCMF_ENUM_DEF(CHANNEL_ADOPTED, 63) \ 94 + BRCMF_ENUM_DEF(AP_STARTED, 64) \ 95 + BRCMF_ENUM_DEF(DFS_AP_STOP, 65) \ 96 + BRCMF_ENUM_DEF(DFS_AP_RESUME, 66) \ 97 + BRCMF_ENUM_DEF(ESCAN_RESULT, 69) \ 98 + BRCMF_ENUM_DEF(ACTION_FRAME_OFF_CHAN_COMPLETE, 70) \ 99 + BRCMF_ENUM_DEF(DCS_REQUEST, 73) \ 100 + BRCMF_ENUM_DEF(FIFO_CREDIT_MAP, 74) 101 + 102 + #define BRCMF_ENUM_DEF(id, val) \ 103 + BRCMF_E_##id = (val), 104 + 32 105 /* firmware event codes sent by the dongle */ 33 106 enum brcmf_fweh_event_code { 34 - BRCMF_E_SET_SSID = 0, 35 - BRCMF_E_JOIN = 1, 36 - BRCMF_E_START = 2, 37 - BRCMF_E_AUTH = 3, 38 - BRCMF_E_AUTH_IND = 4, 39 - BRCMF_E_DEAUTH = 5, 40 - BRCMF_E_DEAUTH_IND = 6, 41 - BRCMF_E_ASSOC = 7, 42 - BRCMF_E_ASSOC_IND = 8, 43 - BRCMF_E_REASSOC = 9, 44 - BRCMF_E_REASSOC_IND = 10, 45 - BRCMF_E_DISASSOC = 11, 46 - BRCMF_E_DISASSOC_IND = 12, 47 - BRCMF_E_QUIET_START = 13, 48 - BRCMF_E_QUIET_END = 14, 49 - BRCMF_E_BEACON_RX = 15, 50 - BRCMF_E_LINK = 16, 51 - BRCMF_E_MIC_ERROR = 17, 52 - BRCMF_E_NDIS_LINK = 18, 53 - BRCMF_E_ROAM = 19, 54 - BRCMF_E_TXFAIL = 20, 55 - BRCMF_E_PMKID_CACHE = 21, 56 - BRCMF_E_RETROGRADE_TSF = 22, 57 - BRCMF_E_PRUNE = 23, 58 - BRCMF_E_AUTOAUTH = 24, 59 - BRCMF_E_EAPOL_MSG = 25, 60 - BRCMF_E_SCAN_COMPLETE = 26, 61 - BRCMF_E_ADDTS_IND = 27, 62 - BRCMF_E_DELTS_IND = 28, 63 - BRCMF_E_BCNSENT_IND = 29, 64 - BRCMF_E_BCNRX_MSG = 30, 65 - BRCMF_E_BCNLOST_MSG = 31, 66 - BRCMF_E_ROAM_PREP = 32, 67 - BRCMF_E_PFN_NET_FOUND = 33, 68 - BRCMF_E_PFN_NET_LOST = 34, 69 - BRCMF_E_RESET_COMPLETE = 35, 70 - BRCMF_E_JOIN_START = 36, 71 - BRCMF_E_ROAM_START = 37, 72 - BRCMF_E_ASSOC_START = 38, 73 - BRCMF_E_IBSS_ASSOC = 39, 74 - BRCMF_E_RADIO = 40, 75 - BRCMF_E_PSM_WATCHDOG = 41, 76 - BRCMF_E_PROBREQ_MSG = 44, 77 - BRCMF_E_SCAN_CONFIRM_IND = 45, 78 - BRCMF_E_PSK_SUP = 46, 79 - BRCMF_E_COUNTRY_CODE_CHANGED = 47, 80 - BRCMF_E_EXCEEDED_MEDIUM_TIME = 48, 81 - BRCMF_E_ICV_ERROR = 49, 82 - BRCMF_E_UNICAST_DECODE_ERROR = 50, 83 - BRCMF_E_MULTICAST_DECODE_ERROR = 51, 84 - BRCMF_E_TRACE = 52, 85 - BRCMF_E_IF = 54, 86 - BRCMF_E_RSSI = 56, 87 - BRCMF_E_PFN_SCAN_COMPLETE = 57, 88 - BRCMF_E_EXTLOG_MSG = 58, 89 - BRCMF_E_ACTION_FRAME = 59, 90 - BRCMF_E_ACTION_FRAME_COMPLETE = 60, 91 - BRCMF_E_PRE_ASSOC_IND = 61, 92 - BRCMF_E_PRE_REASSOC_IND = 62, 93 - BRCMF_E_CHANNEL_ADOPTED = 63, 94 - BRCMF_E_AP_STARTED = 64, 95 - BRCMF_E_DFS_AP_STOP = 65, 96 - BRCMF_E_DFS_AP_RESUME = 66, 97 - BRCMF_E_ESCAN_RESULT = 69, 98 - BRCMF_E_ACTION_FRAME_OFF_CHAN_COMPLETE = 70, 99 - BRCMF_E_DCS_REQUEST = 73, 100 - BRCMF_E_FIFO_CREDIT_MAP = 74, 107 + BRCMF_FWEH_EVENT_ENUM_DEFLIST 101 108 BRCMF_E_LAST 102 109 }; 110 + #undef BRCMF_ENUM_DEF 103 111 104 112 /* flags field values in struct brcmf_event_msg */ 105 113 #define BRCMF_EVENT_MSG_LINK 0x01
+7 -7
drivers/net/wireless/brcm80211/brcmfmac/fwil.c
··· 38 38 s32 err; 39 39 40 40 if (drvr->bus_if->state != BRCMF_BUS_DATA) { 41 - brcmf_dbg(ERROR, "bus is down. we have nothing to do.\n"); 41 + brcmf_err("bus is down. we have nothing to do.\n"); 42 42 return -EIO; 43 43 } 44 44 ··· 53 53 if (err >= 0) 54 54 err = 0; 55 55 else 56 - brcmf_dbg(ERROR, "Failed err=%d\n", err); 56 + brcmf_err("Failed err=%d\n", err); 57 57 58 58 return err; 59 59 } ··· 161 161 buflen, true); 162 162 } else { 163 163 err = -EPERM; 164 - brcmf_dbg(ERROR, "Creating iovar failed\n"); 164 + brcmf_err("Creating iovar failed\n"); 165 165 } 166 166 167 167 mutex_unlock(&drvr->proto_block); ··· 187 187 memcpy(data, drvr->proto_buf, len); 188 188 } else { 189 189 err = -EPERM; 190 - brcmf_dbg(ERROR, "Creating iovar failed\n"); 190 + brcmf_err("Creating iovar failed\n"); 191 191 } 192 192 193 193 brcmf_dbg(FIL, "name=%s, len=%d\n", name, len); ··· 237 237 iolen = prefixlen + namelen + sizeof(bssidx_le) + datalen; 238 238 239 239 if (buflen < iolen) { 240 - brcmf_dbg(ERROR, "buffer is too short\n"); 240 + brcmf_err("buffer is too short\n"); 241 241 return 0; 242 242 } 243 243 ··· 284 284 buflen, true); 285 285 } else { 286 286 err = -EPERM; 287 - brcmf_dbg(ERROR, "Creating bsscfg failed\n"); 287 + brcmf_err("Creating bsscfg failed\n"); 288 288 } 289 289 290 290 mutex_unlock(&drvr->proto_block); ··· 310 310 memcpy(data, drvr->proto_buf, len); 311 311 } else { 312 312 err = -EPERM; 313 - brcmf_dbg(ERROR, "Creating bsscfg failed\n"); 313 + brcmf_err("Creating bsscfg failed\n"); 314 314 } 315 315 brcmf_dbg(FIL, "bssidx=%d, name=%s, len=%d\n", ifp->bssidx, name, len); 316 316 brcmf_dbg_hex_dump(BRCMF_FIL_ON(), data,
+7 -7
drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c
··· 186 186 CORE_SB(base, sbtmstatehigh), 187 187 NULL); 188 188 if (regdata & SSB_TMSHIGH_BUSY) 189 - brcmf_dbg(ERROR, "core state still busy\n"); 189 + brcmf_err("core state still busy\n"); 190 190 191 191 regdata = brcmf_sdio_regrl(sdiodev, CORE_SB(base, sbidlow), 192 192 NULL); ··· 438 438 ci->ramsize = 0x80000; 439 439 break; 440 440 default: 441 - brcmf_dbg(ERROR, "chipid 0x%x is not supported\n", ci->chip); 441 + brcmf_err("chipid 0x%x is not supported\n", ci->chip); 442 442 return -ENODEV; 443 443 } 444 444 ··· 456 456 ci->resetcore = brcmf_sdio_ai_resetcore; 457 457 break; 458 458 default: 459 - brcmf_dbg(ERROR, "socitype %u not supported\n", ci->socitype); 459 + brcmf_err("socitype %u not supported\n", ci->socitype); 460 460 return -ENODEV; 461 461 } 462 462 ··· 473 473 clkset = SBSDIO_FORCE_HW_CLKREQ_OFF | SBSDIO_ALP_AVAIL_REQ; 474 474 brcmf_sdio_regwb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, clkset, &err); 475 475 if (err) { 476 - brcmf_dbg(ERROR, "error writing for HT off\n"); 476 + brcmf_err("error writing for HT off\n"); 477 477 return err; 478 478 } 479 479 ··· 483 483 SBSDIO_FUNC1_CHIPCLKCSR, NULL); 484 484 485 485 if ((clkval & ~SBSDIO_AVBITS) != clkset) { 486 - brcmf_dbg(ERROR, "ChipClkCSR access: wrote 0x%02x read 0x%02x\n", 486 + brcmf_err("ChipClkCSR access: wrote 0x%02x read 0x%02x\n", 487 487 clkset, clkval); 488 488 return -EACCES; 489 489 } ··· 493 493 !SBSDIO_ALPAV(clkval)), 494 494 PMU_MAX_TRANSITION_DLY); 495 495 if (!SBSDIO_ALPAV(clkval)) { 496 - brcmf_dbg(ERROR, "timeout on ALPAV wait, clkval 0x%02x\n", 496 + brcmf_err("timeout on ALPAV wait, clkval 0x%02x\n", 497 497 clkval); 498 498 return -EBUSY; 499 499 } ··· 618 618 str_shift = 11; 619 619 break; 620 620 default: 621 - brcmf_dbg(ERROR, "No SDIO Drive strength init done for chip %s rev %d pmurev %d\n", 621 + brcmf_err("No SDIO Drive strength init done for chip %s rev %d pmurev %d\n", 622 622 brcmf_sdio_chip_name(ci->chip, chn, 8), 623 623 ci->chiprev, ci->pmurev); 624 624 break;
+48 -43
drivers/net/wireless/brcm80211/brcmfmac/usb.c
··· 216 216 217 217 ret = usb_submit_urb(devinfo->ctl_urb, GFP_ATOMIC); 218 218 if (ret < 0) 219 - brcmf_dbg(ERROR, "usb_submit_urb failed %d\n", ret); 219 + brcmf_err("usb_submit_urb failed %d\n", ret); 220 220 221 221 return ret; 222 222 } ··· 250 250 251 251 ret = usb_submit_urb(devinfo->ctl_urb, GFP_ATOMIC); 252 252 if (ret < 0) 253 - brcmf_dbg(ERROR, "usb_submit_urb failed %d\n", ret); 253 + brcmf_err("usb_submit_urb failed %d\n", ret); 254 254 255 255 return ret; 256 256 } ··· 271 271 devinfo->ctl_completed = false; 272 272 err = brcmf_usb_send_ctl(devinfo, buf, len); 273 273 if (err) { 274 - brcmf_dbg(ERROR, "fail %d bytes: %d\n", err, len); 274 + brcmf_err("fail %d bytes: %d\n", err, len); 275 275 clear_bit(0, &devinfo->ctl_op); 276 276 return err; 277 277 } 278 278 timeout = brcmf_usb_ioctl_resp_wait(devinfo); 279 279 clear_bit(0, &devinfo->ctl_op); 280 280 if (!timeout) { 281 - brcmf_dbg(ERROR, "Txctl wait timed out\n"); 281 + brcmf_err("Txctl wait timed out\n"); 282 282 err = -EIO; 283 283 } 284 284 return err; ··· 300 300 devinfo->ctl_completed = false; 301 301 err = brcmf_usb_recv_ctl(devinfo, buf, len); 302 302 if (err) { 303 - brcmf_dbg(ERROR, "fail %d bytes: %d\n", err, len); 303 + brcmf_err("fail %d bytes: %d\n", err, len); 304 304 clear_bit(0, &devinfo->ctl_op); 305 305 return err; 306 306 } ··· 308 308 err = devinfo->ctl_urb_status; 309 309 clear_bit(0, &devinfo->ctl_op); 310 310 if (!timeout) { 311 - brcmf_dbg(ERROR, "rxctl wait timed out\n"); 311 + brcmf_err("rxctl wait timed out\n"); 312 312 err = -EIO; 313 313 } 314 314 if (!err) ··· 356 356 357 357 reqs = kzalloc(sizeof(struct brcmf_usbreq) * qsize, GFP_ATOMIC); 358 358 if (reqs == NULL) { 359 - brcmf_dbg(ERROR, "fail to allocate memory!\n"); 359 + brcmf_err("fail to allocate memory!\n"); 360 360 return NULL; 361 361 } 362 362 req = reqs; ··· 372 372 } 373 373 return reqs; 374 374 fail: 375 - brcmf_dbg(ERROR, "fail!\n"); 375 + brcmf_err("fail!\n"); 376 376 while (!list_empty(q)) { 377 377 req = list_entry(q->next, struct brcmf_usbreq, list); 378 378 if (req && req->urb) ··· 389 389 int i = 0; 390 390 list_for_each_entry_safe(req, next, q, list) { 391 391 if (!req->urb) { 392 - brcmf_dbg(ERROR, "bad req\n"); 392 + brcmf_err("bad req\n"); 393 393 break; 394 394 } 395 395 i++; ··· 462 462 if (devinfo->bus_pub.state == BRCMFMAC_USB_STATE_UP) { 463 463 skb_put(skb, urb->actual_length); 464 464 if (brcmf_proto_hdrpull(devinfo->dev, &ifidx, skb) != 0) { 465 - brcmf_dbg(ERROR, "rx protocol error\n"); 465 + brcmf_err("rx protocol error\n"); 466 466 brcmu_pkt_buf_free_skb(skb); 467 467 devinfo->bus_pub.bus->dstats.rx_errors++; 468 468 } else ··· 513 513 struct brcmf_usbreq *req; 514 514 515 515 if (devinfo->bus_pub.state != BRCMFMAC_USB_STATE_UP) { 516 - brcmf_dbg(ERROR, "bus is not up=%d\n", devinfo->bus_pub.state); 516 + brcmf_err("bus is not up=%d\n", devinfo->bus_pub.state); 517 517 return; 518 518 } 519 519 while ((req = brcmf_usb_deq(devinfo, &devinfo->rx_freeq, NULL)) != NULL) ··· 569 569 } 570 570 571 571 if (devinfo->bus_pub.state == BRCMFMAC_USB_STATE_DOWN) { 572 - brcmf_dbg(ERROR, "intr cb when DBUS down, ignoring\n"); 572 + brcmf_err("intr cb when DBUS down, ignoring\n"); 573 573 return; 574 574 } 575 575 576 576 if (devinfo->bus_pub.state == BRCMFMAC_USB_STATE_UP) { 577 577 err = usb_submit_urb(devinfo->intr_urb, GFP_ATOMIC); 578 578 if (err) 579 - brcmf_dbg(ERROR, "usb_submit_urb, err=%d\n", err); 579 + brcmf_err("usb_submit_urb, err=%d\n", err); 580 580 } 581 581 } 582 582 ··· 594 594 &devinfo->tx_freecount); 595 595 if (!req) { 596 596 brcmu_pkt_buf_free_skb(skb); 597 - brcmf_dbg(ERROR, "no req to send\n"); 597 + brcmf_err("no req to send\n"); 598 598 return -ENOMEM; 599 599 } 600 600 ··· 606 606 brcmf_usb_enq(devinfo, &devinfo->tx_postq, req, NULL); 607 607 ret = usb_submit_urb(req->urb, GFP_ATOMIC); 608 608 if (ret) { 609 - brcmf_dbg(ERROR, "brcmf_usb_tx usb_submit_urb FAILED\n"); 609 + brcmf_err("brcmf_usb_tx usb_submit_urb FAILED\n"); 610 610 brcmf_usb_del_fromq(devinfo, req); 611 611 brcmu_pkt_buf_free_skb(req->skb); 612 612 req->skb = NULL; ··· 648 648 649 649 ret = usb_submit_urb(devinfo->intr_urb, GFP_ATOMIC); 650 650 if (ret) { 651 - brcmf_dbg(ERROR, "USB_SUBMIT_URB failed with status %d\n", 651 + brcmf_err("USB_SUBMIT_URB failed with status %d\n", 652 652 ret); 653 653 return -EINVAL; 654 654 } ··· 745 745 devinfo->ctl_completed = false; 746 746 ret = usb_submit_urb(devinfo->ctl_urb, GFP_ATOMIC); 747 747 if (ret < 0) { 748 - brcmf_dbg(ERROR, "usb_submit_urb failed %d\n", ret); 748 + brcmf_err("usb_submit_urb failed %d\n", ret); 749 749 kfree(tmpbuf); 750 750 return false; 751 751 } ··· 815 815 brcmf_usb_dl_cmd(devinfo, DL_RESETCFG, &id, sizeof(id)); 816 816 return 0; 817 817 } else { 818 - brcmf_dbg(ERROR, "Cannot talk to Dongle. Firmware is not UP, %d ms\n", 818 + brcmf_err("Cannot talk to Dongle. Firmware is not UP, %d ms\n", 819 819 BRCMF_USB_RESET_GETVER_SPINWAIT * loop_cnt); 820 820 return -EINVAL; 821 821 } ··· 840 840 devinfo->ctl_completed = false; 841 841 ret = usb_submit_urb(devinfo->bulk_urb, GFP_ATOMIC); 842 842 if (ret) { 843 - brcmf_dbg(ERROR, "usb_submit_urb failed %d\n", ret); 843 + brcmf_err("usb_submit_urb failed %d\n", ret); 844 844 return ret; 845 845 } 846 846 ret = brcmf_usb_ioctl_resp_wait(devinfo); ··· 873 873 874 874 /* 2) Check we are in the Waiting state */ 875 875 if (rdlstate != DL_WAITING) { 876 - brcmf_dbg(ERROR, "Failed to DL_START\n"); 876 + brcmf_err("Failed to DL_START\n"); 877 877 err = -EINVAL; 878 878 goto fail; 879 879 } ··· 902 902 memcpy(bulkchunk, dlpos, sendlen); 903 903 if (brcmf_usb_dl_send_bulk(devinfo, bulkchunk, 904 904 sendlen)) { 905 - brcmf_dbg(ERROR, "send_bulk failed\n"); 905 + brcmf_err("send_bulk failed\n"); 906 906 err = -EINVAL; 907 907 goto fail; 908 908 } ··· 912 912 } 913 913 if (!brcmf_usb_dl_cmd(devinfo, DL_GETSTATE, &state, 914 914 sizeof(struct rdl_state_le))) { 915 - brcmf_dbg(ERROR, "DL_GETSTATE Failed xxxx\n"); 915 + brcmf_err("DL_GETSTATE Failed xxxx\n"); 916 916 err = -EINVAL; 917 917 goto fail; 918 918 } ··· 922 922 923 923 /* restart if an error is reported */ 924 924 if (rdlstate == DL_BAD_HDR || rdlstate == DL_BAD_CRC) { 925 - brcmf_dbg(ERROR, "Bad Hdr or Bad CRC state %d\n", 925 + brcmf_err("Bad Hdr or Bad CRC state %d\n", 926 926 rdlstate); 927 927 err = -EINVAL; 928 928 goto fail; ··· 981 981 return -ENODEV; 982 982 /* The Dongle may go for re-enumeration. */ 983 983 } else { 984 - brcmf_dbg(ERROR, "Dongle not runnable\n"); 984 + brcmf_err("Dongle not runnable\n"); 985 985 return -EINVAL; 986 986 } 987 987 brcmf_dbg(USB, "Exit\n"); ··· 1019 1019 chiprev = devinfo->bus_pub.chiprev; 1020 1020 1021 1021 if (!brcmf_usb_chip_support(devid, chiprev)) { 1022 - brcmf_dbg(ERROR, "unsupported chip %d rev %d\n", 1022 + brcmf_err("unsupported chip %d rev %d\n", 1023 1023 devid, chiprev); 1024 1024 return -EINVAL; 1025 1025 } 1026 1026 1027 1027 if (!devinfo->image) { 1028 - brcmf_dbg(ERROR, "No firmware!\n"); 1028 + brcmf_err("No firmware!\n"); 1029 1029 return -ENOENT; 1030 1030 } 1031 1031 ··· 1124 1124 /* fw image not yet loaded. Load it now and add to list */ 1125 1125 err = request_firmware(&fw, fwname, devinfo->dev); 1126 1126 if (!fw) { 1127 - brcmf_dbg(ERROR, "fail to request firmware %s\n", fwname); 1127 + brcmf_err("fail to request firmware %s\n", fwname); 1128 1128 return err; 1129 1129 } 1130 1130 if (check_file(fw->data) < 0) { 1131 - brcmf_dbg(ERROR, "invalid firmware %s\n", fwname); 1131 + brcmf_err("invalid firmware %s\n", fwname); 1132 1132 return -EINVAL; 1133 1133 } 1134 1134 ··· 1196 1196 1197 1197 devinfo->intr_urb = usb_alloc_urb(0, GFP_ATOMIC); 1198 1198 if (!devinfo->intr_urb) { 1199 - brcmf_dbg(ERROR, "usb_alloc_urb (intr) failed\n"); 1199 + brcmf_err("usb_alloc_urb (intr) failed\n"); 1200 1200 goto error; 1201 1201 } 1202 1202 devinfo->ctl_urb = usb_alloc_urb(0, GFP_ATOMIC); 1203 1203 if (!devinfo->ctl_urb) { 1204 - brcmf_dbg(ERROR, "usb_alloc_urb (ctl) failed\n"); 1204 + brcmf_err("usb_alloc_urb (ctl) failed\n"); 1205 1205 goto error; 1206 1206 } 1207 1207 devinfo->bulk_urb = usb_alloc_urb(0, GFP_ATOMIC); 1208 1208 if (!devinfo->bulk_urb) { 1209 - brcmf_dbg(ERROR, "usb_alloc_urb (bulk) failed\n"); 1209 + brcmf_err("usb_alloc_urb (bulk) failed\n"); 1210 1210 goto error; 1211 1211 } 1212 1212 ··· 1223 1223 return &devinfo->bus_pub; 1224 1224 1225 1225 error: 1226 - brcmf_dbg(ERROR, "failed!\n"); 1226 + brcmf_err("failed!\n"); 1227 1227 brcmf_usb_detach(devinfo); 1228 1228 return NULL; 1229 1229 } 1230 + 1231 + static struct brcmf_bus_ops brcmf_usb_bus_ops = { 1232 + .txdata = brcmf_usb_tx, 1233 + .init = brcmf_usb_up, 1234 + .stop = brcmf_usb_down, 1235 + .txctl = brcmf_usb_tx_ctlpkt, 1236 + .rxctl = brcmf_usb_rx_ctlpkt, 1237 + }; 1230 1238 1231 1239 static int brcmf_usb_probe_cb(struct brcmf_usbdev_info *devinfo) 1232 1240 { ··· 1254 1246 goto fail; 1255 1247 } 1256 1248 1249 + bus->dev = dev; 1257 1250 bus_pub->bus = bus; 1258 - bus->brcmf_bus_txdata = brcmf_usb_tx; 1259 - bus->brcmf_bus_init = brcmf_usb_up; 1260 - bus->brcmf_bus_stop = brcmf_usb_down; 1261 - bus->brcmf_bus_txctl = brcmf_usb_tx_ctlpkt; 1262 - bus->brcmf_bus_rxctl = brcmf_usb_rx_ctlpkt; 1263 1251 bus->bus_priv.usb = bus_pub; 1264 1252 dev_set_drvdata(dev, bus); 1253 + bus->ops = &brcmf_usb_bus_ops; 1265 1254 1266 1255 /* Attach to the common driver interface */ 1267 1256 ret = brcmf_attach(0, dev); 1268 1257 if (ret) { 1269 - brcmf_dbg(ERROR, "brcmf_attach failed\n"); 1258 + brcmf_err("brcmf_attach failed\n"); 1270 1259 goto fail; 1271 1260 } 1272 1261 1273 1262 ret = brcmf_bus_start(dev); 1274 1263 if (ret) { 1275 - brcmf_dbg(ERROR, "dongle is not responding\n"); 1264 + brcmf_err("dongle is not responding\n"); 1276 1265 brcmf_detach(dev); 1277 1266 goto fail; 1278 1267 } ··· 1344 1339 if (IFDESC(usb, CONTROL_IF).bInterfaceClass != USB_CLASS_VENDOR_SPEC || 1345 1340 IFDESC(usb, CONTROL_IF).bInterfaceSubClass != 2 || 1346 1341 IFDESC(usb, CONTROL_IF).bInterfaceProtocol != 0xff) { 1347 - brcmf_dbg(ERROR, "invalid control interface: class %d, subclass %d, proto %d\n", 1342 + brcmf_err("invalid control interface: class %d, subclass %d, proto %d\n", 1348 1343 IFDESC(usb, CONTROL_IF).bInterfaceClass, 1349 1344 IFDESC(usb, CONTROL_IF).bInterfaceSubClass, 1350 1345 IFDESC(usb, CONTROL_IF).bInterfaceProtocol); ··· 1356 1351 endpoint = &IFEPDESC(usb, CONTROL_IF, 0); 1357 1352 if ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) 1358 1353 != USB_ENDPOINT_XFER_INT) { 1359 - brcmf_dbg(ERROR, "invalid control endpoint %d\n", 1354 + brcmf_err("invalid control endpoint %d\n", 1360 1355 endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK); 1361 1356 ret = -1; 1362 1357 goto fail; ··· 1375 1370 endpoint = &IFEPDESC(usb, BULK_IF, ep); 1376 1371 if ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != 1377 1372 USB_ENDPOINT_XFER_BULK) { 1378 - brcmf_dbg(ERROR, "invalid data endpoint %d\n", ep); 1373 + brcmf_err("invalid data endpoint %d\n", ep); 1379 1374 ret = -1; 1380 1375 goto fail; 1381 1376 } ··· 1418 1413 return 0; 1419 1414 1420 1415 fail: 1421 - brcmf_dbg(ERROR, "failed with errno %d\n", ret); 1416 + brcmf_err("failed with errno %d\n", ret); 1422 1417 kfree(devinfo); 1423 1418 usb_set_intfdata(intf, NULL); 1424 1419 return ret;
+409 -408
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
··· 27 27 #include <defs.h> 28 28 #include <brcmu_wifi.h> 29 29 #include "dhd.h" 30 + #include "dhd_dbg.h" 30 31 #include "wl_cfg80211.h" 31 32 #include "fwil.h" 32 33 ··· 88 87 #define BRCMF_ASSOC_PARAMS_FIXED_SIZE \ 89 88 (sizeof(struct brcmf_assoc_params_le) - sizeof(u16)) 90 89 91 - static u32 brcmf_dbg_level = WL_DBG_ERR; 92 - 93 90 static bool check_vif_up(struct brcmf_cfg80211_vif *vif) 94 91 { 95 92 if (!test_bit(BRCMF_VIF_STATUS_READY, &vif->sme_state)) { 96 - WL_INFO("device is not ready : status (%lu)\n", 97 - vif->sme_state); 93 + brcmf_dbg(INFO, "device is not ready : status (%lu)\n", 94 + vif->sme_state); 98 95 return false; 99 96 } 100 97 return true; ··· 436 437 sizeof(key_le)); 437 438 438 439 if (err) 439 - WL_ERR("wsec_key error (%d)\n", err); 440 + brcmf_err("wsec_key error (%d)\n", err); 440 441 return err; 441 442 } 442 443 ··· 451 452 s32 ap = 0; 452 453 s32 err = 0; 453 454 454 - WL_TRACE("Enter, ndev=%p, type=%d\n", ndev, type); 455 + brcmf_dbg(TRACE, "Enter, ndev=%p, type=%d\n", ndev, type); 455 456 456 457 switch (type) { 457 458 case NL80211_IFTYPE_MONITOR: 458 459 case NL80211_IFTYPE_WDS: 459 - WL_ERR("type (%d) : currently we do not support this type\n", 460 - type); 460 + brcmf_err("type (%d) : currently we do not support this type\n", 461 + type); 461 462 return -EOPNOTSUPP; 462 463 case NL80211_IFTYPE_ADHOC: 463 464 vif->mode = WL_MODE_IBSS; ··· 478 479 479 480 if (ap) { 480 481 set_bit(BRCMF_VIF_STATUS_AP_CREATING, &vif->sme_state); 481 - WL_INFO("IF Type = AP\n"); 482 + brcmf_dbg(INFO, "IF Type = AP\n"); 482 483 } else { 483 484 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_INFRA, infra); 484 485 if (err) { 485 - WL_ERR("WLC_SET_INFRA error (%d)\n", err); 486 + brcmf_err("WLC_SET_INFRA error (%d)\n", err); 486 487 err = -EAGAIN; 487 488 goto done; 488 489 } 489 - WL_INFO("IF Type = %s\n", (vif->mode == WL_MODE_IBSS) ? 490 - "Adhoc" : "Infra"); 490 + brcmf_dbg(INFO, "IF Type = %s\n", (vif->mode == WL_MODE_IBSS) ? 491 + "Adhoc" : "Infra"); 491 492 } 492 493 ndev->ieee80211_ptr->iftype = type; 493 494 494 495 done: 495 - WL_TRACE("Exit\n"); 496 + brcmf_dbg(TRACE, "Exit\n"); 496 497 497 498 return err; 498 499 } ··· 505 506 if (check_vif_up(ifp->vif)) { 506 507 err = brcmf_fil_iovar_int_set(ifp, "mpc", mpc); 507 508 if (err) { 508 - WL_ERR("fail to set mpc\n"); 509 + brcmf_err("fail to set mpc\n"); 509 510 return; 510 511 } 511 - WL_INFO("MPC : %d\n", mpc); 512 + brcmf_dbg(INFO, "MPC : %d\n", mpc); 512 513 } 513 514 } 514 515 ··· 540 541 n_ssids = request->n_ssids; 541 542 n_channels = request->n_channels; 542 543 /* Copy channel array if applicable */ 543 - WL_SCAN("### List of channelspecs to scan ### %d\n", n_channels); 544 + brcmf_dbg(SCAN, "### List of channelspecs to scan ### %d\n", 545 + n_channels); 544 546 if (n_channels > 0) { 545 547 for (i = 0; i < n_channels; i++) { 546 548 chanspec = channel_to_chanspec(request->channels[i]); 547 - WL_SCAN("Chan : %d, Channel spec: %x\n", 548 - request->channels[i]->hw_value, chanspec); 549 + brcmf_dbg(SCAN, "Chan : %d, Channel spec: %x\n", 550 + request->channels[i]->hw_value, chanspec); 549 551 params_le->channel_list[i] = cpu_to_le16(chanspec); 550 552 } 551 553 } else { 552 - WL_SCAN("Scanning all channels\n"); 554 + brcmf_dbg(SCAN, "Scanning all channels\n"); 553 555 } 554 556 /* Copy ssid array if applicable */ 555 - WL_SCAN("### List of SSIDs to scan ### %d\n", n_ssids); 557 + brcmf_dbg(SCAN, "### List of SSIDs to scan ### %d\n", n_ssids); 556 558 if (n_ssids > 0) { 557 559 offset = offsetof(struct brcmf_scan_params_le, channel_list) + 558 560 n_channels * sizeof(u16); ··· 566 566 memcpy(ssid_le.SSID, request->ssids[i].ssid, 567 567 request->ssids[i].ssid_len); 568 568 if (!ssid_le.SSID_len) 569 - WL_SCAN("%d: Broadcast scan\n", i); 569 + brcmf_dbg(SCAN, "%d: Broadcast scan\n", i); 570 570 else 571 - WL_SCAN("%d: scan for %s size =%d\n", i, 572 - ssid_le.SSID, ssid_le.SSID_len); 571 + brcmf_dbg(SCAN, "%d: scan for %s size =%d\n", 572 + i, ssid_le.SSID, ssid_le.SSID_len); 573 573 memcpy(ptr, &ssid_le, sizeof(ssid_le)); 574 574 ptr += sizeof(ssid_le); 575 575 } 576 576 } else { 577 - WL_SCAN("Broadcast scan %p\n", request->ssids); 577 + brcmf_dbg(SCAN, "Broadcast scan %p\n", request->ssids); 578 578 if ((request->ssids) && request->ssids->ssid_len) { 579 - WL_SCAN("SSID %s len=%d\n", params_le->ssid_le.SSID, 580 - request->ssids->ssid_len); 579 + brcmf_dbg(SCAN, "SSID %s len=%d\n", 580 + params_le->ssid_le.SSID, 581 + request->ssids->ssid_len); 581 582 params_le->ssid_le.SSID_len = 582 583 cpu_to_le32(request->ssids->ssid_len); 583 584 memcpy(&params_le->ssid_le.SSID, request->ssids->ssid, ··· 600 599 struct cfg80211_scan_request *scan_request; 601 600 s32 err = 0; 602 601 603 - WL_SCAN("Enter\n"); 602 + brcmf_dbg(SCAN, "Enter\n"); 604 603 605 604 /* clear scan request, because the FW abort can cause a second call */ 606 605 /* to this functon and might cause a double cfg80211_scan_done */ ··· 612 611 613 612 if (fw_abort) { 614 613 /* Do a scan abort to stop the driver's scan engine */ 615 - WL_SCAN("ABORT scan in firmware\n"); 614 + brcmf_dbg(SCAN, "ABORT scan in firmware\n"); 616 615 memset(&params_le, 0, sizeof(params_le)); 617 616 memset(params_le.bssid, 0xFF, ETH_ALEN); 618 617 params_le.bss_type = DOT11_BSSTYPE_ANY; ··· 628 627 err = brcmf_fil_cmd_data_set(netdev_priv(ndev), BRCMF_C_SCAN, 629 628 &params_le, sizeof(params_le)); 630 629 if (err) 631 - WL_ERR("Scan abort failed\n"); 630 + brcmf_err("Scan abort failed\n"); 632 631 } 633 632 /* 634 633 * e-scan can be initiated by scheduled scan 635 634 * which takes precedence. 636 635 */ 637 636 if (cfg->sched_escan) { 638 - WL_SCAN("scheduled scan completed\n"); 637 + brcmf_dbg(SCAN, "scheduled scan completed\n"); 639 638 cfg->sched_escan = false; 640 639 if (!aborted) 641 640 cfg80211_sched_scan_results(cfg_to_wiphy(cfg)); 642 641 brcmf_set_mpc(ndev, 1); 643 642 } else if (scan_request) { 644 - WL_SCAN("ESCAN Completed scan: %s\n", 645 - aborted ? "Aborted" : "Done"); 643 + brcmf_dbg(SCAN, "ESCAN Completed scan: %s\n", 644 + aborted ? "Aborted" : "Done"); 646 645 cfg80211_scan_done(scan_request, aborted); 647 646 brcmf_set_mpc(ndev, 1); 648 647 } 649 648 if (!test_and_clear_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)) { 650 - WL_ERR("Scan complete while device not scanning\n"); 649 + brcmf_err("Scan complete while device not scanning\n"); 651 650 return -EPERM; 652 651 } 653 652 ··· 663 662 struct brcmf_escan_params_le *params; 664 663 s32 err = 0; 665 664 666 - WL_SCAN("E-SCAN START\n"); 665 + brcmf_dbg(SCAN, "E-SCAN START\n"); 667 666 668 667 if (request != NULL) { 669 668 /* Allocate space for populating ssids in struct */ ··· 688 687 params, params_size); 689 688 if (err) { 690 689 if (err == -EBUSY) 691 - WL_INFO("system busy : escan canceled\n"); 690 + brcmf_dbg(INFO, "system busy : escan canceled\n"); 692 691 else 693 - WL_ERR("error (%d)\n", err); 692 + brcmf_err("error (%d)\n", err); 694 693 } 695 694 696 695 kfree(params); ··· 706 705 u32 passive_scan; 707 706 struct brcmf_scan_results *results; 708 707 709 - WL_SCAN("Enter\n"); 708 + brcmf_dbg(SCAN, "Enter\n"); 710 709 cfg->escan_info.ndev = ndev; 711 710 cfg->escan_info.wiphy = wiphy; 712 711 cfg->escan_info.escan_state = WL_ESCAN_STATE_SCANNING; ··· 714 713 err = brcmf_fil_cmd_int_set(netdev_priv(ndev), BRCMF_C_SET_PASSIVE_SCAN, 715 714 passive_scan); 716 715 if (err) { 717 - WL_ERR("error (%d)\n", err); 716 + brcmf_err("error (%d)\n", err); 718 717 return err; 719 718 } 720 719 brcmf_set_mpc(ndev, 0); ··· 744 743 s32 err; 745 744 u32 SSID_len; 746 745 747 - WL_SCAN("START ESCAN\n"); 746 + brcmf_dbg(SCAN, "START ESCAN\n"); 748 747 749 748 if (test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)) { 750 - WL_ERR("Scanning already: status (%lu)\n", cfg->scan_status); 749 + brcmf_err("Scanning already: status (%lu)\n", cfg->scan_status); 751 750 return -EAGAIN; 752 751 } 753 752 if (test_bit(BRCMF_SCAN_STATUS_ABORT, &cfg->scan_status)) { 754 - WL_ERR("Scanning being aborted: status (%lu)\n", 755 - cfg->scan_status); 753 + brcmf_err("Scanning being aborted: status (%lu)\n", 754 + cfg->scan_status); 756 755 return -EAGAIN; 757 756 } 758 757 if (test_bit(BRCMF_VIF_STATUS_CONNECTING, &ifp->vif->sme_state)) { 759 - WL_ERR("Connecting: status (%lu)\n", ifp->vif->sme_state); 758 + brcmf_err("Connecting: status (%lu)\n", ifp->vif->sme_state); 760 759 return -EAGAIN; 761 760 } 762 761 ··· 782 781 if (err) 783 782 goto scan_out; 784 783 } else { 785 - WL_SCAN("ssid \"%s\", ssid_len (%d)\n", 786 - ssids->ssid, ssids->ssid_len); 784 + brcmf_dbg(SCAN, "ssid \"%s\", ssid_len (%d)\n", 785 + ssids->ssid, ssids->ssid_len); 787 786 memset(&sr->ssid_le, 0, sizeof(sr->ssid_le)); 788 787 SSID_len = min_t(u8, sizeof(sr->ssid_le.SSID), ssids->ssid_len); 789 788 sr->ssid_le.SSID_len = cpu_to_le32(0); ··· 793 792 sr->ssid_le.SSID_len = cpu_to_le32(SSID_len); 794 793 spec_scan = true; 795 794 } else 796 - WL_SCAN("Broadcast scan\n"); 795 + brcmf_dbg(SCAN, "Broadcast scan\n"); 797 796 798 797 passive_scan = cfg->active_scan ? 0 : 1; 799 798 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PASSIVE_SCAN, 800 799 passive_scan); 801 800 if (err) { 802 - WL_ERR("WLC_SET_PASSIVE_SCAN error (%d)\n", err); 801 + brcmf_err("WLC_SET_PASSIVE_SCAN error (%d)\n", err); 803 802 goto scan_out; 804 803 } 805 804 brcmf_set_mpc(ndev, 0); ··· 807 806 &sr->ssid_le, sizeof(sr->ssid_le)); 808 807 if (err) { 809 808 if (err == -EBUSY) 810 - WL_INFO("BUSY: scan for \"%s\" canceled\n", 811 - sr->ssid_le.SSID); 809 + brcmf_dbg(INFO, "BUSY: scan for \"%s\" canceled\n", 810 + sr->ssid_le.SSID); 812 811 else 813 - WL_ERR("WLC_SCAN error (%d)\n", err); 812 + brcmf_err("WLC_SCAN error (%d)\n", err); 814 813 815 814 brcmf_set_mpc(ndev, 1); 816 815 goto scan_out; ··· 833 832 struct net_device *ndev = request->wdev->netdev; 834 833 s32 err = 0; 835 834 836 - WL_TRACE("Enter\n"); 835 + brcmf_dbg(TRACE, "Enter\n"); 837 836 838 837 if (!check_vif_up(container_of(request->wdev, 839 838 struct brcmf_cfg80211_vif, wdev))) ··· 842 841 err = brcmf_cfg80211_escan(wiphy, ndev, request, NULL); 843 842 844 843 if (err) 845 - WL_ERR("scan error (%d)\n", err); 844 + brcmf_err("scan error (%d)\n", err); 846 845 847 - WL_TRACE("Exit\n"); 846 + brcmf_dbg(TRACE, "Exit\n"); 848 847 return err; 849 848 } 850 849 ··· 855 854 err = brcmf_fil_iovar_int_set(netdev_priv(ndev), "rtsthresh", 856 855 rts_threshold); 857 856 if (err) 858 - WL_ERR("Error (%d)\n", err); 857 + brcmf_err("Error (%d)\n", err); 859 858 860 859 return err; 861 860 } ··· 867 866 err = brcmf_fil_iovar_int_set(netdev_priv(ndev), "fragthresh", 868 867 frag_threshold); 869 868 if (err) 870 - WL_ERR("Error (%d)\n", err); 869 + brcmf_err("Error (%d)\n", err); 871 870 872 871 return err; 873 872 } ··· 879 878 880 879 err = brcmf_fil_cmd_int_set(netdev_priv(ndev), cmd, retry); 881 880 if (err) { 882 - WL_ERR("cmd (%d) , error (%d)\n", cmd, err); 881 + brcmf_err("cmd (%d) , error (%d)\n", cmd, err); 883 882 return err; 884 883 } 885 884 return err; ··· 892 891 struct brcmf_if *ifp = netdev_priv(ndev); 893 892 s32 err = 0; 894 893 895 - WL_TRACE("Enter\n"); 894 + brcmf_dbg(TRACE, "Enter\n"); 896 895 if (!check_vif_up(ifp->vif)) 897 896 return -EIO; 898 897 ··· 926 925 } 927 926 928 927 done: 929 - WL_TRACE("Exit\n"); 928 + brcmf_dbg(TRACE, "Exit\n"); 930 929 return err; 931 930 } 932 931 ··· 956 955 join_params->params_le.chanspec_list[0] = cpu_to_le16(chanspec); 957 956 join_params->params_le.chanspec_num = cpu_to_le32(1); 958 957 959 - WL_CONN("join_params->params.chanspec_list[0]= %#X," 960 - "channel %d, chanspec %#X\n", 961 - chanspec, ch, chanspec); 958 + brcmf_dbg(CONN, "channel %d, chanspec %#X\n", ch, chanspec); 962 959 } 963 960 } 964 961 ··· 964 965 { 965 966 s32 err = 0; 966 967 967 - WL_TRACE("Enter\n"); 968 + brcmf_dbg(TRACE, "Enter\n"); 968 969 969 970 if (test_bit(BRCMF_VIF_STATUS_CONNECTED, &vif->sme_state)) { 970 - WL_INFO("Call WLC_DISASSOC to stop excess roaming\n "); 971 + brcmf_dbg(INFO, "Call WLC_DISASSOC to stop excess roaming\n "); 971 972 err = brcmf_fil_cmd_data_set(vif->ifp, 972 973 BRCMF_C_DISASSOC, NULL, 0); 973 974 if (err) 974 - WL_ERR("WLC_DISASSOC failed (%d)\n", err); 975 + brcmf_err("WLC_DISASSOC failed (%d)\n", err); 975 976 clear_bit(BRCMF_VIF_STATUS_CONNECTED, &vif->sme_state); 976 977 } 977 978 clear_bit(BRCMF_VIF_STATUS_CONNECTING, &vif->sme_state); 978 - WL_TRACE("Exit\n"); 979 + brcmf_dbg(TRACE, "Exit\n"); 979 980 } 980 981 981 982 static s32 ··· 991 992 s32 wsec = 0; 992 993 s32 bcnprd; 993 994 994 - WL_TRACE("Enter\n"); 995 + brcmf_dbg(TRACE, "Enter\n"); 995 996 if (!check_vif_up(ifp->vif)) 996 997 return -EIO; 997 998 998 999 if (params->ssid) 999 - WL_CONN("SSID: %s\n", params->ssid); 1000 + brcmf_dbg(CONN, "SSID: %s\n", params->ssid); 1000 1001 else { 1001 - WL_CONN("SSID: NULL, Not supported\n"); 1002 + brcmf_dbg(CONN, "SSID: NULL, Not supported\n"); 1002 1003 return -EOPNOTSUPP; 1003 1004 } 1004 1005 1005 1006 set_bit(BRCMF_VIF_STATUS_CONNECTING, &ifp->vif->sme_state); 1006 1007 1007 1008 if (params->bssid) 1008 - WL_CONN("BSSID: %pM\n", params->bssid); 1009 + brcmf_dbg(CONN, "BSSID: %pM\n", params->bssid); 1009 1010 else 1010 - WL_CONN("No BSSID specified\n"); 1011 + brcmf_dbg(CONN, "No BSSID specified\n"); 1011 1012 1012 1013 if (params->chandef.chan) 1013 - WL_CONN("channel: %d\n", params->chandef.chan->center_freq); 1014 + brcmf_dbg(CONN, "channel: %d\n", 1015 + params->chandef.chan->center_freq); 1014 1016 else 1015 - WL_CONN("no channel specified\n"); 1017 + brcmf_dbg(CONN, "no channel specified\n"); 1016 1018 1017 1019 if (params->channel_fixed) 1018 - WL_CONN("fixed channel required\n"); 1020 + brcmf_dbg(CONN, "fixed channel required\n"); 1019 1021 else 1020 - WL_CONN("no fixed channel required\n"); 1022 + brcmf_dbg(CONN, "no fixed channel required\n"); 1021 1023 1022 1024 if (params->ie && params->ie_len) 1023 - WL_CONN("ie len: %d\n", params->ie_len); 1025 + brcmf_dbg(CONN, "ie len: %d\n", params->ie_len); 1024 1026 else 1025 - WL_CONN("no ie specified\n"); 1027 + brcmf_dbg(CONN, "no ie specified\n"); 1026 1028 1027 1029 if (params->beacon_interval) 1028 - WL_CONN("beacon interval: %d\n", params->beacon_interval); 1030 + brcmf_dbg(CONN, "beacon interval: %d\n", 1031 + params->beacon_interval); 1029 1032 else 1030 - WL_CONN("no beacon interval specified\n"); 1033 + brcmf_dbg(CONN, "no beacon interval specified\n"); 1031 1034 1032 1035 if (params->basic_rates) 1033 - WL_CONN("basic rates: %08X\n", params->basic_rates); 1036 + brcmf_dbg(CONN, "basic rates: %08X\n", params->basic_rates); 1034 1037 else 1035 - WL_CONN("no basic rates specified\n"); 1038 + brcmf_dbg(CONN, "no basic rates specified\n"); 1036 1039 1037 1040 if (params->privacy) 1038 - WL_CONN("privacy required\n"); 1041 + brcmf_dbg(CONN, "privacy required\n"); 1039 1042 else 1040 - WL_CONN("no privacy required\n"); 1043 + brcmf_dbg(CONN, "no privacy required\n"); 1041 1044 1042 1045 /* Configure Privacy for starter */ 1043 1046 if (params->privacy) ··· 1047 1046 1048 1047 err = brcmf_fil_iovar_int_set(ifp, "wsec", wsec); 1049 1048 if (err) { 1050 - WL_ERR("wsec failed (%d)\n", err); 1049 + brcmf_err("wsec failed (%d)\n", err); 1051 1050 goto done; 1052 1051 } 1053 1052 ··· 1059 1058 1060 1059 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_BCNPRD, bcnprd); 1061 1060 if (err) { 1062 - WL_ERR("WLC_SET_BCNPRD failed (%d)\n", err); 1061 + brcmf_err("WLC_SET_BCNPRD failed (%d)\n", err); 1063 1062 goto done; 1064 1063 } 1065 1064 ··· 1102 1101 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_CHANNEL, 1103 1102 target_channel); 1104 1103 if (err) { 1105 - WL_ERR("WLC_SET_CHANNEL failed (%d)\n", err); 1104 + brcmf_err("WLC_SET_CHANNEL failed (%d)\n", err); 1106 1105 goto done; 1107 1106 } 1108 1107 } else ··· 1114 1113 err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID, 1115 1114 &join_params, join_params_size); 1116 1115 if (err) { 1117 - WL_ERR("WLC_SET_SSID failed (%d)\n", err); 1116 + brcmf_err("WLC_SET_SSID failed (%d)\n", err); 1118 1117 goto done; 1119 1118 } 1120 1119 1121 1120 done: 1122 1121 if (err) 1123 1122 clear_bit(BRCMF_VIF_STATUS_CONNECTING, &ifp->vif->sme_state); 1124 - WL_TRACE("Exit\n"); 1123 + brcmf_dbg(TRACE, "Exit\n"); 1125 1124 return err; 1126 1125 } 1127 1126 ··· 1131 1130 struct brcmf_if *ifp = netdev_priv(ndev); 1132 1131 s32 err = 0; 1133 1132 1134 - WL_TRACE("Enter\n"); 1133 + brcmf_dbg(TRACE, "Enter\n"); 1135 1134 if (!check_vif_up(ifp->vif)) 1136 1135 return -EIO; 1137 1136 1138 1137 brcmf_link_down(ifp->vif); 1139 1138 1140 - WL_TRACE("Exit\n"); 1139 + brcmf_dbg(TRACE, "Exit\n"); 1141 1140 1142 1141 return err; 1143 1142 } ··· 1156 1155 val = WPA2_AUTH_PSK | WPA2_AUTH_UNSPECIFIED; 1157 1156 else 1158 1157 val = WPA_AUTH_DISABLED; 1159 - WL_CONN("setting wpa_auth to 0x%0x\n", val); 1158 + brcmf_dbg(CONN, "setting wpa_auth to 0x%0x\n", val); 1160 1159 err = brcmf_fil_iovar_int_set(netdev_priv(ndev), "wpa_auth", val); 1161 1160 if (err) { 1162 - WL_ERR("set wpa_auth failed (%d)\n", err); 1161 + brcmf_err("set wpa_auth failed (%d)\n", err); 1163 1162 return err; 1164 1163 } 1165 1164 sec = &profile->sec; ··· 1178 1177 switch (sme->auth_type) { 1179 1178 case NL80211_AUTHTYPE_OPEN_SYSTEM: 1180 1179 val = 0; 1181 - WL_CONN("open system\n"); 1180 + brcmf_dbg(CONN, "open system\n"); 1182 1181 break; 1183 1182 case NL80211_AUTHTYPE_SHARED_KEY: 1184 1183 val = 1; 1185 - WL_CONN("shared key\n"); 1184 + brcmf_dbg(CONN, "shared key\n"); 1186 1185 break; 1187 1186 case NL80211_AUTHTYPE_AUTOMATIC: 1188 1187 val = 2; 1189 - WL_CONN("automatic\n"); 1188 + brcmf_dbg(CONN, "automatic\n"); 1190 1189 break; 1191 1190 case NL80211_AUTHTYPE_NETWORK_EAP: 1192 - WL_CONN("network eap\n"); 1191 + brcmf_dbg(CONN, "network eap\n"); 1193 1192 default: 1194 1193 val = 2; 1195 - WL_ERR("invalid auth type (%d)\n", sme->auth_type); 1194 + brcmf_err("invalid auth type (%d)\n", sme->auth_type); 1196 1195 break; 1197 1196 } 1198 1197 1199 1198 err = brcmf_fil_iovar_int_set(netdev_priv(ndev), "auth", val); 1200 1199 if (err) { 1201 - WL_ERR("set auth failed (%d)\n", err); 1200 + brcmf_err("set auth failed (%d)\n", err); 1202 1201 return err; 1203 1202 } 1204 1203 sec = &profile->sec; ··· 1232 1231 pval = AES_ENABLED; 1233 1232 break; 1234 1233 default: 1235 - WL_ERR("invalid cipher pairwise (%d)\n", 1236 - sme->crypto.ciphers_pairwise[0]); 1234 + brcmf_err("invalid cipher pairwise (%d)\n", 1235 + sme->crypto.ciphers_pairwise[0]); 1237 1236 return -EINVAL; 1238 1237 } 1239 1238 } ··· 1253 1252 gval = AES_ENABLED; 1254 1253 break; 1255 1254 default: 1256 - WL_ERR("invalid cipher group (%d)\n", 1257 - sme->crypto.cipher_group); 1255 + brcmf_err("invalid cipher group (%d)\n", 1256 + sme->crypto.cipher_group); 1258 1257 return -EINVAL; 1259 1258 } 1260 1259 } 1261 1260 1262 - WL_CONN("pval (%d) gval (%d)\n", pval, gval); 1261 + brcmf_dbg(CONN, "pval (%d) gval (%d)\n", pval, gval); 1263 1262 err = brcmf_fil_iovar_int_set(netdev_priv(ndev), "wsec", pval | gval); 1264 1263 if (err) { 1265 - WL_ERR("error (%d)\n", err); 1264 + brcmf_err("error (%d)\n", err); 1266 1265 return err; 1267 1266 } 1268 1267 ··· 1285 1284 err = brcmf_fil_iovar_int_get(netdev_priv(ndev), 1286 1285 "wpa_auth", &val); 1287 1286 if (err) { 1288 - WL_ERR("could not get wpa_auth (%d)\n", err); 1287 + brcmf_err("could not get wpa_auth (%d)\n", err); 1289 1288 return err; 1290 1289 } 1291 1290 if (val & (WPA_AUTH_PSK | WPA_AUTH_UNSPECIFIED)) { ··· 1297 1296 val = WPA_AUTH_PSK; 1298 1297 break; 1299 1298 default: 1300 - WL_ERR("invalid cipher group (%d)\n", 1301 - sme->crypto.cipher_group); 1299 + brcmf_err("invalid cipher group (%d)\n", 1300 + sme->crypto.cipher_group); 1302 1301 return -EINVAL; 1303 1302 } 1304 1303 } else if (val & (WPA2_AUTH_PSK | WPA2_AUTH_UNSPECIFIED)) { ··· 1310 1309 val = WPA2_AUTH_PSK; 1311 1310 break; 1312 1311 default: 1313 - WL_ERR("invalid cipher group (%d)\n", 1314 - sme->crypto.cipher_group); 1312 + brcmf_err("invalid cipher group (%d)\n", 1313 + sme->crypto.cipher_group); 1315 1314 return -EINVAL; 1316 1315 } 1317 1316 } 1318 1317 1319 - WL_CONN("setting wpa_auth to %d\n", val); 1318 + brcmf_dbg(CONN, "setting wpa_auth to %d\n", val); 1320 1319 err = brcmf_fil_iovar_int_set(netdev_priv(ndev), 1321 1320 "wpa_auth", val); 1322 1321 if (err) { 1323 - WL_ERR("could not set wpa_auth (%d)\n", err); 1322 + brcmf_err("could not set wpa_auth (%d)\n", err); 1324 1323 return err; 1325 1324 } 1326 1325 } ··· 1340 1339 s32 val; 1341 1340 s32 err = 0; 1342 1341 1343 - WL_CONN("key len (%d)\n", sme->key_len); 1342 + brcmf_dbg(CONN, "key len (%d)\n", sme->key_len); 1344 1343 1345 1344 if (sme->key_len == 0) 1346 1345 return 0; 1347 1346 1348 1347 sec = &profile->sec; 1349 - WL_CONN("wpa_versions 0x%x cipher_pairwise 0x%x\n", 1350 - sec->wpa_versions, sec->cipher_pairwise); 1348 + brcmf_dbg(CONN, "wpa_versions 0x%x cipher_pairwise 0x%x\n", 1349 + sec->wpa_versions, sec->cipher_pairwise); 1351 1350 1352 1351 if (sec->wpa_versions & (NL80211_WPA_VERSION_1 | NL80211_WPA_VERSION_2)) 1353 1352 return 0; ··· 1360 1359 key.len = (u32) sme->key_len; 1361 1360 key.index = (u32) sme->key_idx; 1362 1361 if (key.len > sizeof(key.data)) { 1363 - WL_ERR("Too long key length (%u)\n", key.len); 1362 + brcmf_err("Too long key length (%u)\n", key.len); 1364 1363 return -EINVAL; 1365 1364 } 1366 1365 memcpy(key.data, sme->key, key.len); ··· 1373 1372 key.algo = CRYPTO_ALGO_WEP128; 1374 1373 break; 1375 1374 default: 1376 - WL_ERR("Invalid algorithm (%d)\n", 1377 - sme->crypto.ciphers_pairwise[0]); 1375 + brcmf_err("Invalid algorithm (%d)\n", 1376 + sme->crypto.ciphers_pairwise[0]); 1378 1377 return -EINVAL; 1379 1378 } 1380 1379 /* Set the new key/index */ 1381 - WL_CONN("key length (%d) key index (%d) algo (%d)\n", 1382 - key.len, key.index, key.algo); 1383 - WL_CONN("key \"%s\"\n", key.data); 1380 + brcmf_dbg(CONN, "key length (%d) key index (%d) algo (%d)\n", 1381 + key.len, key.index, key.algo); 1382 + brcmf_dbg(CONN, "key \"%s\"\n", key.data); 1384 1383 err = send_key_to_dongle(ndev, &key); 1385 1384 if (err) 1386 1385 return err; 1387 1386 1388 1387 if (sec->auth_type == NL80211_AUTHTYPE_SHARED_KEY) { 1389 - WL_CONN("set auth_type to shared key\n"); 1388 + brcmf_dbg(CONN, "set auth_type to shared key\n"); 1390 1389 val = WL_AUTH_SHARED_KEY; /* shared key */ 1391 1390 err = brcmf_fil_bsscfg_int_set(netdev_priv(ndev), "auth", val); 1392 1391 if (err) 1393 - WL_ERR("set auth failed (%d)\n", err); 1392 + brcmf_err("set auth failed (%d)\n", err); 1394 1393 } 1395 1394 return err; 1396 1395 } ··· 1409 1408 1410 1409 s32 err = 0; 1411 1410 1412 - WL_TRACE("Enter\n"); 1411 + brcmf_dbg(TRACE, "Enter\n"); 1413 1412 if (!check_vif_up(ifp->vif)) 1414 1413 return -EIO; 1415 1414 1416 1415 if (!sme->ssid) { 1417 - WL_ERR("Invalid ssid\n"); 1416 + brcmf_err("Invalid ssid\n"); 1418 1417 return -EOPNOTSUPP; 1419 1418 } 1420 1419 ··· 1423 1422 if (chan) { 1424 1423 cfg->channel = 1425 1424 ieee80211_frequency_to_channel(chan->center_freq); 1426 - WL_CONN("channel (%d), center_req (%d)\n", 1427 - cfg->channel, chan->center_freq); 1425 + brcmf_dbg(CONN, "channel (%d), center_req (%d)\n", 1426 + cfg->channel, chan->center_freq); 1428 1427 } else 1429 1428 cfg->channel = 0; 1430 1429 1431 - WL_INFO("ie (%p), ie_len (%zd)\n", sme->ie, sme->ie_len); 1430 + brcmf_dbg(INFO, "ie (%p), ie_len (%zd)\n", sme->ie, sme->ie_len); 1432 1431 1433 1432 err = brcmf_set_wpa_version(ndev, sme); 1434 1433 if (err) { 1435 - WL_ERR("wl_set_wpa_version failed (%d)\n", err); 1434 + brcmf_err("wl_set_wpa_version failed (%d)\n", err); 1436 1435 goto done; 1437 1436 } 1438 1437 1439 1438 err = brcmf_set_auth_type(ndev, sme); 1440 1439 if (err) { 1441 - WL_ERR("wl_set_auth_type failed (%d)\n", err); 1440 + brcmf_err("wl_set_auth_type failed (%d)\n", err); 1442 1441 goto done; 1443 1442 } 1444 1443 1445 1444 err = brcmf_set_set_cipher(ndev, sme); 1446 1445 if (err) { 1447 - WL_ERR("wl_set_set_cipher failed (%d)\n", err); 1446 + brcmf_err("wl_set_set_cipher failed (%d)\n", err); 1448 1447 goto done; 1449 1448 } 1450 1449 1451 1450 err = brcmf_set_key_mgmt(ndev, sme); 1452 1451 if (err) { 1453 - WL_ERR("wl_set_key_mgmt failed (%d)\n", err); 1452 + brcmf_err("wl_set_key_mgmt failed (%d)\n", err); 1454 1453 goto done; 1455 1454 } 1456 1455 1457 1456 err = brcmf_set_sharedkey(ndev, sme); 1458 1457 if (err) { 1459 - WL_ERR("brcmf_set_sharedkey failed (%d)\n", err); 1458 + brcmf_err("brcmf_set_sharedkey failed (%d)\n", err); 1460 1459 goto done; 1461 1460 } 1462 1461 ··· 1472 1471 memset(join_params.params_le.bssid, 0xFF, ETH_ALEN); 1473 1472 1474 1473 if (ssid.SSID_len < IEEE80211_MAX_SSID_LEN) 1475 - WL_CONN("ssid \"%s\", len (%d)\n", 1476 - ssid.SSID, ssid.SSID_len); 1474 + brcmf_dbg(CONN, "ssid \"%s\", len (%d)\n", 1475 + ssid.SSID, ssid.SSID_len); 1477 1476 1478 1477 brcmf_ch_to_chanspec(cfg->channel, 1479 1478 &join_params, &join_params_size); 1480 1479 err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID, 1481 1480 &join_params, join_params_size); 1482 1481 if (err) 1483 - WL_ERR("WLC_SET_SSID failed (%d)\n", err); 1482 + brcmf_err("WLC_SET_SSID failed (%d)\n", err); 1484 1483 1485 1484 done: 1486 1485 if (err) 1487 1486 clear_bit(BRCMF_VIF_STATUS_CONNECTING, &ifp->vif->sme_state); 1488 - WL_TRACE("Exit\n"); 1487 + brcmf_dbg(TRACE, "Exit\n"); 1489 1488 return err; 1490 1489 } 1491 1490 ··· 1498 1497 struct brcmf_scb_val_le scbval; 1499 1498 s32 err = 0; 1500 1499 1501 - WL_TRACE("Enter. Reason code = %d\n", reason_code); 1500 + brcmf_dbg(TRACE, "Enter. Reason code = %d\n", reason_code); 1502 1501 if (!check_vif_up(ifp->vif)) 1503 1502 return -EIO; 1504 1503 ··· 1509 1508 err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_DISASSOC, 1510 1509 &scbval, sizeof(scbval)); 1511 1510 if (err) 1512 - WL_ERR("error (%d)\n", err); 1511 + brcmf_err("error (%d)\n", err); 1513 1512 1514 - WL_TRACE("Exit\n"); 1513 + brcmf_dbg(TRACE, "Exit\n"); 1515 1514 return err; 1516 1515 } 1517 1516 ··· 1528 1527 s32 disable = 0; 1529 1528 s32 dbm = MBM_TO_DBM(mbm); 1530 1529 1531 - WL_TRACE("Enter\n"); 1530 + brcmf_dbg(TRACE, "Enter\n"); 1532 1531 if (!check_vif_up(ifp->vif)) 1533 1532 return -EIO; 1534 1533 ··· 1538 1537 case NL80211_TX_POWER_LIMITED: 1539 1538 case NL80211_TX_POWER_FIXED: 1540 1539 if (dbm < 0) { 1541 - WL_ERR("TX_POWER_FIXED - dbm is negative\n"); 1540 + brcmf_err("TX_POWER_FIXED - dbm is negative\n"); 1542 1541 err = -EINVAL; 1543 1542 goto done; 1544 1543 } ··· 1548 1547 disable = WL_RADIO_SW_DISABLE << 16; 1549 1548 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_RADIO, disable); 1550 1549 if (err) 1551 - WL_ERR("WLC_SET_RADIO error (%d)\n", err); 1550 + brcmf_err("WLC_SET_RADIO error (%d)\n", err); 1552 1551 1553 1552 if (dbm > 0xffff) 1554 1553 txpwrmw = 0xffff; ··· 1557 1556 err = brcmf_fil_iovar_int_set(ifp, "qtxpower", 1558 1557 (s32)brcmf_mw_to_qdbm(txpwrmw)); 1559 1558 if (err) 1560 - WL_ERR("qtxpower error (%d)\n", err); 1559 + brcmf_err("qtxpower error (%d)\n", err); 1561 1560 cfg->conf->tx_power = dbm; 1562 1561 1563 1562 done: 1564 - WL_TRACE("Exit\n"); 1563 + brcmf_dbg(TRACE, "Exit\n"); 1565 1564 return err; 1566 1565 } 1567 1566 ··· 1575 1574 u8 result; 1576 1575 s32 err = 0; 1577 1576 1578 - WL_TRACE("Enter\n"); 1577 + brcmf_dbg(TRACE, "Enter\n"); 1579 1578 if (!check_vif_up(ifp->vif)) 1580 1579 return -EIO; 1581 1580 1582 1581 err = brcmf_fil_iovar_int_get(ifp, "qtxpower", &txpwrdbm); 1583 1582 if (err) { 1584 - WL_ERR("error (%d)\n", err); 1583 + brcmf_err("error (%d)\n", err); 1585 1584 goto done; 1586 1585 } 1587 1586 ··· 1589 1588 *dbm = (s32) brcmf_qdbm_to_mw(result); 1590 1589 1591 1590 done: 1592 - WL_TRACE("Exit\n"); 1591 + brcmf_dbg(TRACE, "Exit\n"); 1593 1592 return err; 1594 1593 } 1595 1594 ··· 1602 1601 u32 wsec; 1603 1602 s32 err = 0; 1604 1603 1605 - WL_TRACE("Enter\n"); 1606 - WL_CONN("key index (%d)\n", key_idx); 1604 + brcmf_dbg(TRACE, "Enter\n"); 1605 + brcmf_dbg(CONN, "key index (%d)\n", key_idx); 1607 1606 if (!check_vif_up(ifp->vif)) 1608 1607 return -EIO; 1609 1608 1610 1609 err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec); 1611 1610 if (err) { 1612 - WL_ERR("WLC_GET_WSEC error (%d)\n", err); 1611 + brcmf_err("WLC_GET_WSEC error (%d)\n", err); 1613 1612 goto done; 1614 1613 } 1615 1614 ··· 1619 1618 err = brcmf_fil_cmd_int_set(ifp, 1620 1619 BRCMF_C_SET_KEY_PRIMARY, index); 1621 1620 if (err) 1622 - WL_ERR("error (%d)\n", err); 1621 + brcmf_err("error (%d)\n", err); 1623 1622 } 1624 1623 done: 1625 - WL_TRACE("Exit\n"); 1624 + brcmf_dbg(TRACE, "Exit\n"); 1626 1625 return err; 1627 1626 } 1628 1627 ··· 1645 1644 /* key delete */ 1646 1645 err = send_key_to_dongle(ndev, &key); 1647 1646 if (err) 1648 - WL_ERR("key delete error (%d)\n", err); 1647 + brcmf_err("key delete error (%d)\n", err); 1649 1648 } else { 1650 1649 if (key.len > sizeof(key.data)) { 1651 - WL_ERR("Invalid key length (%d)\n", key.len); 1650 + brcmf_err("Invalid key length (%d)\n", key.len); 1652 1651 return -EINVAL; 1653 1652 } 1654 1653 1655 - WL_CONN("Setting the key index %d\n", key.index); 1654 + brcmf_dbg(CONN, "Setting the key index %d\n", key.index); 1656 1655 memcpy(key.data, params->key, key.len); 1657 1656 1658 1657 if (params->cipher == WLAN_CIPHER_SUITE_TKIP) { ··· 1676 1675 switch (params->cipher) { 1677 1676 case WLAN_CIPHER_SUITE_WEP40: 1678 1677 key.algo = CRYPTO_ALGO_WEP1; 1679 - WL_CONN("WLAN_CIPHER_SUITE_WEP40\n"); 1678 + brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_WEP40\n"); 1680 1679 break; 1681 1680 case WLAN_CIPHER_SUITE_WEP104: 1682 1681 key.algo = CRYPTO_ALGO_WEP128; 1683 - WL_CONN("WLAN_CIPHER_SUITE_WEP104\n"); 1682 + brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_WEP104\n"); 1684 1683 break; 1685 1684 case WLAN_CIPHER_SUITE_TKIP: 1686 1685 key.algo = CRYPTO_ALGO_TKIP; 1687 - WL_CONN("WLAN_CIPHER_SUITE_TKIP\n"); 1686 + brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_TKIP\n"); 1688 1687 break; 1689 1688 case WLAN_CIPHER_SUITE_AES_CMAC: 1690 1689 key.algo = CRYPTO_ALGO_AES_CCM; 1691 - WL_CONN("WLAN_CIPHER_SUITE_AES_CMAC\n"); 1690 + brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_AES_CMAC\n"); 1692 1691 break; 1693 1692 case WLAN_CIPHER_SUITE_CCMP: 1694 1693 key.algo = CRYPTO_ALGO_AES_CCM; 1695 - WL_CONN("WLAN_CIPHER_SUITE_CCMP\n"); 1694 + brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_CCMP\n"); 1696 1695 break; 1697 1696 default: 1698 - WL_ERR("Invalid cipher (0x%x)\n", params->cipher); 1697 + brcmf_err("Invalid cipher (0x%x)\n", params->cipher); 1699 1698 return -EINVAL; 1700 1699 } 1701 1700 err = send_key_to_dongle(ndev, &key); 1702 1701 if (err) 1703 - WL_ERR("wsec_key error (%d)\n", err); 1702 + brcmf_err("wsec_key error (%d)\n", err); 1704 1703 } 1705 1704 return err; 1706 1705 } ··· 1717 1716 s32 err = 0; 1718 1717 u8 keybuf[8]; 1719 1718 1720 - WL_TRACE("Enter\n"); 1721 - WL_CONN("key index (%d)\n", key_idx); 1719 + brcmf_dbg(TRACE, "Enter\n"); 1720 + brcmf_dbg(CONN, "key index (%d)\n", key_idx); 1722 1721 if (!check_vif_up(ifp->vif)) 1723 1722 return -EIO; 1724 1723 1725 1724 if (mac_addr) { 1726 - WL_TRACE("Exit"); 1725 + brcmf_dbg(TRACE, "Exit"); 1727 1726 return brcmf_add_keyext(wiphy, ndev, key_idx, mac_addr, params); 1728 1727 } 1729 1728 memset(&key, 0, sizeof(key)); ··· 1732 1731 key.index = (u32) key_idx; 1733 1732 1734 1733 if (key.len > sizeof(key.data)) { 1735 - WL_ERR("Too long key length (%u)\n", key.len); 1734 + brcmf_err("Too long key length (%u)\n", key.len); 1736 1735 err = -EINVAL; 1737 1736 goto done; 1738 1737 } ··· 1743 1742 case WLAN_CIPHER_SUITE_WEP40: 1744 1743 key.algo = CRYPTO_ALGO_WEP1; 1745 1744 val = WEP_ENABLED; 1746 - WL_CONN("WLAN_CIPHER_SUITE_WEP40\n"); 1745 + brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_WEP40\n"); 1747 1746 break; 1748 1747 case WLAN_CIPHER_SUITE_WEP104: 1749 1748 key.algo = CRYPTO_ALGO_WEP128; 1750 1749 val = WEP_ENABLED; 1751 - WL_CONN("WLAN_CIPHER_SUITE_WEP104\n"); 1750 + brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_WEP104\n"); 1752 1751 break; 1753 1752 case WLAN_CIPHER_SUITE_TKIP: 1754 1753 if (ifp->vif->mode != WL_MODE_AP) { 1755 - WL_CONN("Swapping key\n"); 1754 + brcmf_dbg(CONN, "Swapping key\n"); 1756 1755 memcpy(keybuf, &key.data[24], sizeof(keybuf)); 1757 1756 memcpy(&key.data[24], &key.data[16], sizeof(keybuf)); 1758 1757 memcpy(&key.data[16], keybuf, sizeof(keybuf)); 1759 1758 } 1760 1759 key.algo = CRYPTO_ALGO_TKIP; 1761 1760 val = TKIP_ENABLED; 1762 - WL_CONN("WLAN_CIPHER_SUITE_TKIP\n"); 1761 + brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_TKIP\n"); 1763 1762 break; 1764 1763 case WLAN_CIPHER_SUITE_AES_CMAC: 1765 1764 key.algo = CRYPTO_ALGO_AES_CCM; 1766 1765 val = AES_ENABLED; 1767 - WL_CONN("WLAN_CIPHER_SUITE_AES_CMAC\n"); 1766 + brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_AES_CMAC\n"); 1768 1767 break; 1769 1768 case WLAN_CIPHER_SUITE_CCMP: 1770 1769 key.algo = CRYPTO_ALGO_AES_CCM; 1771 1770 val = AES_ENABLED; 1772 - WL_CONN("WLAN_CIPHER_SUITE_CCMP\n"); 1771 + brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_CCMP\n"); 1773 1772 break; 1774 1773 default: 1775 - WL_ERR("Invalid cipher (0x%x)\n", params->cipher); 1774 + brcmf_err("Invalid cipher (0x%x)\n", params->cipher); 1776 1775 err = -EINVAL; 1777 1776 goto done; 1778 1777 } ··· 1783 1782 1784 1783 err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec); 1785 1784 if (err) { 1786 - WL_ERR("get wsec error (%d)\n", err); 1785 + brcmf_err("get wsec error (%d)\n", err); 1787 1786 goto done; 1788 1787 } 1789 1788 wsec |= val; 1790 1789 err = brcmf_fil_bsscfg_int_set(ifp, "wsec", wsec); 1791 1790 if (err) { 1792 - WL_ERR("set wsec error (%d)\n", err); 1791 + brcmf_err("set wsec error (%d)\n", err); 1793 1792 goto done; 1794 1793 } 1795 1794 1796 1795 done: 1797 - WL_TRACE("Exit\n"); 1796 + brcmf_dbg(TRACE, "Exit\n"); 1798 1797 return err; 1799 1798 } 1800 1799 ··· 1806 1805 struct brcmf_wsec_key key; 1807 1806 s32 err = 0; 1808 1807 1809 - WL_TRACE("Enter\n"); 1808 + brcmf_dbg(TRACE, "Enter\n"); 1810 1809 if (!check_vif_up(ifp->vif)) 1811 1810 return -EIO; 1812 1811 1813 1812 if (key_idx >= DOT11_MAX_DEFAULT_KEYS) { 1814 1813 /* we ignore this key index in this case */ 1815 - WL_ERR("invalid key index (%d)\n", key_idx); 1814 + brcmf_err("invalid key index (%d)\n", key_idx); 1816 1815 return -EINVAL; 1817 1816 } 1818 1817 ··· 1822 1821 key.flags = BRCMF_PRIMARY_KEY; 1823 1822 key.algo = CRYPTO_ALGO_OFF; 1824 1823 1825 - WL_CONN("key index (%d)\n", key_idx); 1824 + brcmf_dbg(CONN, "key index (%d)\n", key_idx); 1826 1825 1827 1826 /* Set the new key/index */ 1828 1827 err = send_key_to_dongle(ndev, &key); 1829 1828 1830 - WL_TRACE("Exit\n"); 1829 + brcmf_dbg(TRACE, "Exit\n"); 1831 1830 return err; 1832 1831 } 1833 1832 ··· 1843 1842 s32 wsec; 1844 1843 s32 err = 0; 1845 1844 1846 - WL_TRACE("Enter\n"); 1847 - WL_CONN("key index (%d)\n", key_idx); 1845 + brcmf_dbg(TRACE, "Enter\n"); 1846 + brcmf_dbg(CONN, "key index (%d)\n", key_idx); 1848 1847 if (!check_vif_up(ifp->vif)) 1849 1848 return -EIO; 1850 1849 ··· 1852 1851 1853 1852 err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec); 1854 1853 if (err) { 1855 - WL_ERR("WLC_GET_WSEC error (%d)\n", err); 1854 + brcmf_err("WLC_GET_WSEC error (%d)\n", err); 1856 1855 /* Ignore this error, may happen during DISASSOC */ 1857 1856 err = -EAGAIN; 1858 1857 goto done; ··· 1862 1861 sec = &profile->sec; 1863 1862 if (sec->cipher_pairwise & WLAN_CIPHER_SUITE_WEP40) { 1864 1863 params.cipher = WLAN_CIPHER_SUITE_WEP40; 1865 - WL_CONN("WLAN_CIPHER_SUITE_WEP40\n"); 1864 + brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_WEP40\n"); 1866 1865 } else if (sec->cipher_pairwise & WLAN_CIPHER_SUITE_WEP104) { 1867 1866 params.cipher = WLAN_CIPHER_SUITE_WEP104; 1868 - WL_CONN("WLAN_CIPHER_SUITE_WEP104\n"); 1867 + brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_WEP104\n"); 1869 1868 } 1870 1869 break; 1871 1870 case TKIP_ENABLED: 1872 1871 params.cipher = WLAN_CIPHER_SUITE_TKIP; 1873 - WL_CONN("WLAN_CIPHER_SUITE_TKIP\n"); 1872 + brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_TKIP\n"); 1874 1873 break; 1875 1874 case AES_ENABLED: 1876 1875 params.cipher = WLAN_CIPHER_SUITE_AES_CMAC; 1877 - WL_CONN("WLAN_CIPHER_SUITE_AES_CMAC\n"); 1876 + brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_AES_CMAC\n"); 1878 1877 break; 1879 1878 default: 1880 - WL_ERR("Invalid algo (0x%x)\n", wsec); 1879 + brcmf_err("Invalid algo (0x%x)\n", wsec); 1881 1880 err = -EINVAL; 1882 1881 goto done; 1883 1882 } 1884 1883 callback(cookie, &params); 1885 1884 1886 1885 done: 1887 - WL_TRACE("Exit\n"); 1886 + brcmf_dbg(TRACE, "Exit\n"); 1888 1887 return err; 1889 1888 } 1890 1889 ··· 1892 1891 brcmf_cfg80211_config_default_mgmt_key(struct wiphy *wiphy, 1893 1892 struct net_device *ndev, u8 key_idx) 1894 1893 { 1895 - WL_INFO("Not supported\n"); 1894 + brcmf_dbg(INFO, "Not supported\n"); 1896 1895 1897 1896 return -EOPNOTSUPP; 1898 1897 } ··· 1910 1909 u8 *bssid = profile->bssid; 1911 1910 struct brcmf_sta_info_le sta_info_le; 1912 1911 1913 - WL_TRACE("Enter, MAC %pM\n", mac); 1912 + brcmf_dbg(TRACE, "Enter, MAC %pM\n", mac); 1914 1913 if (!check_vif_up(ifp->vif)) 1915 1914 return -EIO; 1916 1915 ··· 1920 1919 &sta_info_le, 1921 1920 sizeof(sta_info_le)); 1922 1921 if (err < 0) { 1923 - WL_ERR("GET STA INFO failed, %d\n", err); 1922 + brcmf_err("GET STA INFO failed, %d\n", err); 1924 1923 goto done; 1925 1924 } 1926 1925 sinfo->filled = STATION_INFO_INACTIVE_TIME; ··· 1929 1928 sinfo->filled |= STATION_INFO_CONNECTED_TIME; 1930 1929 sinfo->connected_time = le32_to_cpu(sta_info_le.in); 1931 1930 } 1932 - WL_TRACE("STA idle time : %d ms, connected time :%d sec\n", 1933 - sinfo->inactive_time, sinfo->connected_time); 1931 + brcmf_dbg(TRACE, "STA idle time : %d ms, connected time :%d sec\n", 1932 + sinfo->inactive_time, sinfo->connected_time); 1934 1933 } else if (ifp->vif->mode == WL_MODE_BSS) { 1935 1934 if (memcmp(mac, bssid, ETH_ALEN)) { 1936 - WL_ERR("Wrong Mac address cfg_mac-%pM wl_bssid-%pM\n", 1937 - mac, bssid); 1935 + brcmf_err("Wrong Mac address cfg_mac-%pM wl_bssid-%pM\n", 1936 + mac, bssid); 1938 1937 err = -ENOENT; 1939 1938 goto done; 1940 1939 } 1941 1940 /* Report the current tx rate */ 1942 1941 err = brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_RATE, &rate); 1943 1942 if (err) { 1944 - WL_ERR("Could not get rate (%d)\n", err); 1943 + brcmf_err("Could not get rate (%d)\n", err); 1945 1944 goto done; 1946 1945 } else { 1947 1946 sinfo->filled |= STATION_INFO_TX_BITRATE; 1948 1947 sinfo->txrate.legacy = rate * 5; 1949 - WL_CONN("Rate %d Mbps\n", rate / 2); 1948 + brcmf_dbg(CONN, "Rate %d Mbps\n", rate / 2); 1950 1949 } 1951 1950 1952 1951 if (test_bit(BRCMF_VIF_STATUS_CONNECTED, ··· 1955 1954 err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_RSSI, 1956 1955 &scb_val, sizeof(scb_val)); 1957 1956 if (err) { 1958 - WL_ERR("Could not get rssi (%d)\n", err); 1957 + brcmf_err("Could not get rssi (%d)\n", err); 1959 1958 goto done; 1960 1959 } else { 1961 1960 rssi = le32_to_cpu(scb_val.val); 1962 1961 sinfo->filled |= STATION_INFO_SIGNAL; 1963 1962 sinfo->signal = rssi; 1964 - WL_CONN("RSSI %d dBm\n", rssi); 1963 + brcmf_dbg(CONN, "RSSI %d dBm\n", rssi); 1965 1964 } 1966 1965 } 1967 1966 } else 1968 1967 err = -EPERM; 1969 1968 done: 1970 - WL_TRACE("Exit\n"); 1969 + brcmf_dbg(TRACE, "Exit\n"); 1971 1970 return err; 1972 1971 } 1973 1972 ··· 1980 1979 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); 1981 1980 struct brcmf_if *ifp = netdev_priv(ndev); 1982 1981 1983 - WL_TRACE("Enter\n"); 1982 + brcmf_dbg(TRACE, "Enter\n"); 1984 1983 1985 1984 /* 1986 1985 * Powersave enable/disable request is coming from the ··· 1992 1991 cfg->pwr_save = enabled; 1993 1992 if (!check_vif_up(ifp->vif)) { 1994 1993 1995 - WL_INFO("Device is not ready, storing the value in cfg_info struct\n"); 1994 + brcmf_dbg(INFO, "Device is not ready, storing the value in cfg_info struct\n"); 1996 1995 goto done; 1997 1996 } 1998 1997 1999 1998 pm = enabled ? PM_FAST : PM_OFF; 2000 - WL_INFO("power save %s\n", (pm ? "enabled" : "disabled")); 1999 + brcmf_dbg(INFO, "power save %s\n", (pm ? "enabled" : "disabled")); 2001 2000 2002 2001 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PM, pm); 2003 2002 if (err) { 2004 2003 if (err == -ENODEV) 2005 - WL_ERR("net_device is not ready yet\n"); 2004 + brcmf_err("net_device is not ready yet\n"); 2006 2005 else 2007 - WL_ERR("error (%d)\n", err); 2006 + brcmf_err("error (%d)\n", err); 2008 2007 } 2009 2008 done: 2010 - WL_TRACE("Exit\n"); 2009 + brcmf_dbg(TRACE, "Exit\n"); 2011 2010 return err; 2012 2011 } 2013 2012 ··· 2025 2024 u32 legacy; 2026 2025 s32 err = 0; 2027 2026 2028 - WL_TRACE("Enter\n"); 2027 + brcmf_dbg(TRACE, "Enter\n"); 2029 2028 if (!check_vif_up(ifp->vif)) 2030 2029 return -EIO; 2031 2030 ··· 2034 2033 err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_CURR_RATESET, 2035 2034 &rateset_le, sizeof(rateset_le)); 2036 2035 if (err) { 2037 - WL_ERR("could not get current rateset (%d)\n", err); 2036 + brcmf_err("could not get current rateset (%d)\n", err); 2038 2037 goto done; 2039 2038 } 2040 2039 ··· 2052 2051 /* Specified rate in bps */ 2053 2052 rate = val / 500000; 2054 2053 2055 - WL_CONN("rate %d mbps\n", rate / 2); 2054 + brcmf_dbg(CONN, "rate %d mbps\n", rate / 2); 2056 2055 2057 2056 /* 2058 2057 * ··· 2062 2061 err_bg = brcmf_fil_iovar_int_set(ifp, "bg_rate", rate); 2063 2062 err_a = brcmf_fil_iovar_int_set(ifp, "a_rate", rate); 2064 2063 if (err_bg && err_a) { 2065 - WL_ERR("could not set fixed rate (%d) (%d)\n", err_bg, err_a); 2064 + brcmf_err("could not set fixed rate (%d) (%d)\n", err_bg, 2065 + err_a); 2066 2066 err = err_bg | err_a; 2067 2067 } 2068 2068 2069 2069 done: 2070 - WL_TRACE("Exit\n"); 2070 + brcmf_dbg(TRACE, "Exit\n"); 2071 2071 return err; 2072 2072 } 2073 2073 ··· 2089 2087 s32 notify_signal; 2090 2088 2091 2089 if (le32_to_cpu(bi->length) > WL_BSS_INFO_MAX) { 2092 - WL_ERR("Bss info is larger than buffer. Discarding\n"); 2090 + brcmf_err("Bss info is larger than buffer. Discarding\n"); 2093 2091 return 0; 2094 2092 } 2095 2093 ··· 2110 2108 notify_ielen = le32_to_cpu(bi->ie_length); 2111 2109 notify_signal = (s16)le16_to_cpu(bi->RSSI) * 100; 2112 2110 2113 - WL_CONN("bssid: %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", 2114 - bi->BSSID[0], bi->BSSID[1], bi->BSSID[2], 2115 - bi->BSSID[3], bi->BSSID[4], bi->BSSID[5]); 2116 - WL_CONN("Channel: %d(%d)\n", channel, freq); 2117 - WL_CONN("Capability: %X\n", notify_capability); 2118 - WL_CONN("Beacon interval: %d\n", notify_interval); 2119 - WL_CONN("Signal: %d\n", notify_signal); 2111 + brcmf_dbg(CONN, "bssid: %pM\n", bi->BSSID); 2112 + brcmf_dbg(CONN, "Channel: %d(%d)\n", channel, freq); 2113 + brcmf_dbg(CONN, "Capability: %X\n", notify_capability); 2114 + brcmf_dbg(CONN, "Beacon interval: %d\n", notify_interval); 2115 + brcmf_dbg(CONN, "Signal: %d\n", notify_signal); 2120 2116 2121 2117 bss = cfg80211_inform_bss(wiphy, notify_channel, (const u8 *)bi->BSSID, 2122 2118 0, notify_capability, notify_interval, notify_ie, ··· 2147 2147 bss_list = cfg->bss_list; 2148 2148 if (bss_list->count != 0 && 2149 2149 bss_list->version != BRCMF_BSS_INFO_VERSION) { 2150 - WL_ERR("Version %d != WL_BSS_INFO_VERSION\n", 2151 - bss_list->version); 2150 + brcmf_err("Version %d != WL_BSS_INFO_VERSION\n", 2151 + bss_list->version); 2152 2152 return -EOPNOTSUPP; 2153 2153 } 2154 - WL_SCAN("scanned AP count (%d)\n", bss_list->count); 2154 + brcmf_dbg(SCAN, "scanned AP count (%d)\n", bss_list->count); 2155 2155 for (i = 0; i < bss_list->count; i++) { 2156 2156 bi = next_bss_le(bss_list, bi); 2157 2157 err = brcmf_inform_single_bss(cfg, bi); ··· 2179 2179 size_t notify_ielen; 2180 2180 s32 notify_signal; 2181 2181 2182 - WL_TRACE("Enter\n"); 2182 + brcmf_dbg(TRACE, "Enter\n"); 2183 2183 2184 2184 buf = kzalloc(WL_BSS_INFO_MAX, GFP_KERNEL); 2185 2185 if (buf == NULL) { ··· 2192 2192 err = brcmf_fil_cmd_data_get(netdev_priv(ndev), BRCMF_C_GET_BSS_INFO, 2193 2193 buf, WL_BSS_INFO_MAX); 2194 2194 if (err) { 2195 - WL_ERR("WLC_GET_BSS_INFO failed: %d\n", err); 2195 + brcmf_err("WLC_GET_BSS_INFO failed: %d\n", err); 2196 2196 goto CleanUp; 2197 2197 } 2198 2198 ··· 2215 2215 notify_ielen = le32_to_cpu(bi->ie_length); 2216 2216 notify_signal = (s16)le16_to_cpu(bi->RSSI) * 100; 2217 2217 2218 - WL_CONN("channel: %d(%d)\n", channel, freq); 2219 - WL_CONN("capability: %X\n", notify_capability); 2220 - WL_CONN("beacon interval: %d\n", notify_interval); 2221 - WL_CONN("signal: %d\n", notify_signal); 2218 + brcmf_dbg(CONN, "channel: %d(%d)\n", channel, freq); 2219 + brcmf_dbg(CONN, "capability: %X\n", notify_capability); 2220 + brcmf_dbg(CONN, "beacon interval: %d\n", notify_interval); 2221 + brcmf_dbg(CONN, "signal: %d\n", notify_signal); 2222 2222 2223 2223 bss = cfg80211_inform_bss(wiphy, notify_channel, bssid, 2224 2224 0, notify_capability, notify_interval, ··· 2235 2235 2236 2236 kfree(buf); 2237 2237 2238 - WL_TRACE("Exit\n"); 2238 + brcmf_dbg(TRACE, "Exit\n"); 2239 2239 2240 2240 return err; 2241 2241 } ··· 2326 2326 u8 *ie; 2327 2327 s32 err = 0; 2328 2328 2329 - WL_TRACE("Enter\n"); 2329 + brcmf_dbg(TRACE, "Enter\n"); 2330 2330 if (brcmf_is_ibssmode(ifp->vif)) 2331 2331 return err; 2332 2332 ··· 2336 2336 err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BSS_INFO, 2337 2337 cfg->extra_buf, WL_EXTRA_BUF_MAX); 2338 2338 if (err) { 2339 - WL_ERR("Could not get bss info %d\n", err); 2339 + brcmf_err("Could not get bss info %d\n", err); 2340 2340 goto update_bss_info_out; 2341 2341 } 2342 2342 ··· 2361 2361 u32 var; 2362 2362 err = brcmf_fil_iovar_int_get(ifp, "dtim_assoc", &var); 2363 2363 if (err) { 2364 - WL_ERR("wl dtim_assoc failed (%d)\n", err); 2364 + brcmf_err("wl dtim_assoc failed (%d)\n", err); 2365 2365 goto update_bss_info_out; 2366 2366 } 2367 2367 dtim_period = (u8)var; 2368 2368 } 2369 2369 2370 2370 update_bss_info_out: 2371 - WL_TRACE("Exit"); 2371 + brcmf_dbg(TRACE, "Exit"); 2372 2372 return err; 2373 2373 } 2374 2374 ··· 2401 2401 (struct brcmf_cfg80211_info *)data; 2402 2402 2403 2403 if (cfg->scan_request) { 2404 - WL_ERR("timer expired\n"); 2404 + brcmf_err("timer expired\n"); 2405 2405 schedule_work(&cfg->escan_timeout_work); 2406 2406 } 2407 2407 } ··· 2457 2457 status = e->status; 2458 2458 2459 2459 if (!ndev || !test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)) { 2460 - WL_ERR("scan not ready ndev %p drv_status %x\n", ndev, 2461 - !test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)); 2460 + brcmf_err("scan not ready ndev %p drv_status %x\n", ndev, 2461 + !test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)); 2462 2462 return -EPERM; 2463 2463 } 2464 2464 2465 2465 if (status == BRCMF_E_STATUS_PARTIAL) { 2466 - WL_SCAN("ESCAN Partial result\n"); 2466 + brcmf_dbg(SCAN, "ESCAN Partial result\n"); 2467 2467 escan_result_le = (struct brcmf_escan_result_le *) data; 2468 2468 if (!escan_result_le) { 2469 - WL_ERR("Invalid escan result (NULL pointer)\n"); 2469 + brcmf_err("Invalid escan result (NULL pointer)\n"); 2470 2470 goto exit; 2471 2471 } 2472 2472 if (!cfg->scan_request) { 2473 - WL_SCAN("result without cfg80211 request\n"); 2473 + brcmf_dbg(SCAN, "result without cfg80211 request\n"); 2474 2474 goto exit; 2475 2475 } 2476 2476 2477 2477 if (le16_to_cpu(escan_result_le->bss_count) != 1) { 2478 - WL_ERR("Invalid bss_count %d: ignoring\n", 2479 - escan_result_le->bss_count); 2478 + brcmf_err("Invalid bss_count %d: ignoring\n", 2479 + escan_result_le->bss_count); 2480 2480 goto exit; 2481 2481 } 2482 2482 bss_info_le = &escan_result_le->bss_info_le; ··· 2484 2484 bi_length = le32_to_cpu(bss_info_le->length); 2485 2485 if (bi_length != (le32_to_cpu(escan_result_le->buflen) - 2486 2486 WL_ESCAN_RESULTS_FIXED_SIZE)) { 2487 - WL_ERR("Invalid bss_info length %d: ignoring\n", 2488 - bi_length); 2487 + brcmf_err("Invalid bss_info length %d: ignoring\n", 2488 + bi_length); 2489 2489 goto exit; 2490 2490 } 2491 2491 ··· 2493 2493 BIT(NL80211_IFTYPE_ADHOC))) { 2494 2494 if (le16_to_cpu(bss_info_le->capability) & 2495 2495 WLAN_CAPABILITY_IBSS) { 2496 - WL_ERR("Ignoring IBSS result\n"); 2496 + brcmf_err("Ignoring IBSS result\n"); 2497 2497 goto exit; 2498 2498 } 2499 2499 } ··· 2501 2501 list = (struct brcmf_scan_results *) 2502 2502 cfg->escan_info.escan_buf; 2503 2503 if (bi_length > WL_ESCAN_BUF_SIZE - list->buflen) { 2504 - WL_ERR("Buffer is too small: ignoring\n"); 2504 + brcmf_err("Buffer is too small: ignoring\n"); 2505 2505 goto exit; 2506 2506 } 2507 2507 ··· 2527 2527 brcmf_notify_escan_complete(cfg, ndev, aborted, 2528 2528 false); 2529 2529 } else 2530 - WL_ERR("Unexpected scan result 0x%x\n", status); 2530 + brcmf_err("Unexpected scan result 0x%x\n", status); 2531 2531 } 2532 2532 exit: 2533 2533 return err; ··· 2558 2558 2559 2559 static s32 brcmf_cfg80211_resume(struct wiphy *wiphy) 2560 2560 { 2561 - WL_TRACE("Enter\n"); 2561 + brcmf_dbg(TRACE, "Enter\n"); 2562 2562 2563 2563 return 0; 2564 2564 } ··· 2570 2570 struct net_device *ndev = cfg_to_ndev(cfg); 2571 2571 struct brcmf_cfg80211_vif *vif; 2572 2572 2573 - WL_TRACE("Enter\n"); 2573 + brcmf_dbg(TRACE, "Enter\n"); 2574 2574 2575 2575 /* 2576 2576 * if the primary net_device is not READY there is nothing ··· 2604 2604 brcmf_set_mpc(ndev, 1); 2605 2605 2606 2606 exit: 2607 - WL_TRACE("Exit\n"); 2607 + brcmf_dbg(TRACE, "Exit\n"); 2608 2608 /* clear any scanning activity */ 2609 2609 cfg->scan_status = 0; 2610 2610 return 0; ··· 2619 2619 2620 2620 pmkid_len = le32_to_cpu(pmk_list->pmkids.npmkid); 2621 2621 2622 - WL_CONN("No of elements %d\n", pmkid_len); 2622 + brcmf_dbg(CONN, "No of elements %d\n", pmkid_len); 2623 2623 for (i = 0; i < pmkid_len; i++) { 2624 - WL_CONN("PMKID[%d]: %pM =\n", i, 2625 - &pmk_list->pmkids.pmkid[i].BSSID); 2624 + brcmf_dbg(CONN, "PMKID[%d]: %pM =\n", i, 2625 + &pmk_list->pmkids.pmkid[i].BSSID); 2626 2626 for (j = 0; j < WLAN_PMKID_LEN; j++) 2627 - WL_CONN("%02x\n", pmk_list->pmkids.pmkid[i].PMKID[j]); 2627 + brcmf_dbg(CONN, "%02x\n", 2628 + pmk_list->pmkids.pmkid[i].PMKID[j]); 2628 2629 } 2629 2630 2630 2631 if (!err) ··· 2646 2645 int i; 2647 2646 int pmkid_len; 2648 2647 2649 - WL_TRACE("Enter\n"); 2648 + brcmf_dbg(TRACE, "Enter\n"); 2650 2649 if (!check_vif_up(ifp->vif)) 2651 2650 return -EIO; 2652 2651 ··· 2664 2663 } else 2665 2664 err = -EINVAL; 2666 2665 2667 - WL_CONN("set_pmksa,IW_PMKSA_ADD - PMKID: %pM =\n", 2668 - pmkids->pmkid[pmkid_len].BSSID); 2666 + brcmf_dbg(CONN, "set_pmksa,IW_PMKSA_ADD - PMKID: %pM =\n", 2667 + pmkids->pmkid[pmkid_len].BSSID); 2669 2668 for (i = 0; i < WLAN_PMKID_LEN; i++) 2670 - WL_CONN("%02x\n", pmkids->pmkid[pmkid_len].PMKID[i]); 2669 + brcmf_dbg(CONN, "%02x\n", pmkids->pmkid[pmkid_len].PMKID[i]); 2671 2670 2672 2671 err = brcmf_update_pmklist(ndev, cfg->pmk_list, err); 2673 2672 2674 - WL_TRACE("Exit\n"); 2673 + brcmf_dbg(TRACE, "Exit\n"); 2675 2674 return err; 2676 2675 } 2677 2676 ··· 2685 2684 s32 err = 0; 2686 2685 int i, pmkid_len; 2687 2686 2688 - WL_TRACE("Enter\n"); 2687 + brcmf_dbg(TRACE, "Enter\n"); 2689 2688 if (!check_vif_up(ifp->vif)) 2690 2689 return -EIO; 2691 2690 2692 2691 memcpy(&pmkid.pmkid[0].BSSID, pmksa->bssid, ETH_ALEN); 2693 2692 memcpy(&pmkid.pmkid[0].PMKID, pmksa->pmkid, WLAN_PMKID_LEN); 2694 2693 2695 - WL_CONN("del_pmksa,IW_PMKSA_REMOVE - PMKID: %pM =\n", 2696 - &pmkid.pmkid[0].BSSID); 2694 + brcmf_dbg(CONN, "del_pmksa,IW_PMKSA_REMOVE - PMKID: %pM =\n", 2695 + &pmkid.pmkid[0].BSSID); 2697 2696 for (i = 0; i < WLAN_PMKID_LEN; i++) 2698 - WL_CONN("%02x\n", pmkid.pmkid[0].PMKID[i]); 2697 + brcmf_dbg(CONN, "%02x\n", pmkid.pmkid[0].PMKID[i]); 2699 2698 2700 2699 pmkid_len = le32_to_cpu(cfg->pmk_list->pmkids.npmkid); 2701 2700 for (i = 0; i < pmkid_len; i++) ··· 2722 2721 2723 2722 err = brcmf_update_pmklist(ndev, cfg->pmk_list, err); 2724 2723 2725 - WL_TRACE("Exit\n"); 2724 + brcmf_dbg(TRACE, "Exit\n"); 2726 2725 return err; 2727 2726 2728 2727 } ··· 2734 2733 struct brcmf_if *ifp = netdev_priv(ndev); 2735 2734 s32 err = 0; 2736 2735 2737 - WL_TRACE("Enter\n"); 2736 + brcmf_dbg(TRACE, "Enter\n"); 2738 2737 if (!check_vif_up(ifp->vif)) 2739 2738 return -EIO; 2740 2739 2741 2740 memset(cfg->pmk_list, 0, sizeof(*cfg->pmk_list)); 2742 2741 err = brcmf_update_pmklist(ndev, cfg->pmk_list, err); 2743 2742 2744 - WL_TRACE("Exit\n"); 2743 + brcmf_dbg(TRACE, "Exit\n"); 2745 2744 return err; 2746 2745 2747 2746 } ··· 2772 2771 u32 result_count; 2773 2772 u32 status; 2774 2773 2775 - WL_SCAN("Enter\n"); 2774 + brcmf_dbg(SCAN, "Enter\n"); 2776 2775 2777 2776 if (e->event_code == BRCMF_E_PFN_NET_LOST) { 2778 - WL_SCAN("PFN NET LOST event. Do Nothing\n"); 2777 + brcmf_dbg(SCAN, "PFN NET LOST event. Do Nothing\n"); 2779 2778 return 0; 2780 2779 } 2781 2780 ··· 2788 2787 * multiple NET_FOUND events. For now place a warning here. 2789 2788 */ 2790 2789 WARN_ON(status != BRCMF_PNO_SCAN_COMPLETE); 2791 - WL_SCAN("PFN NET FOUND event. count: %d\n", result_count); 2790 + brcmf_dbg(SCAN, "PFN NET FOUND event. count: %d\n", result_count); 2792 2791 if (result_count > 0) { 2793 2792 int i; 2794 2793 ··· 2807 2806 for (i = 0; i < result_count; i++) { 2808 2807 netinfo = &netinfo_start[i]; 2809 2808 if (!netinfo) { 2810 - WL_ERR("Invalid netinfo ptr. index: %d\n", i); 2809 + brcmf_err("Invalid netinfo ptr. index: %d\n", 2810 + i); 2811 2811 err = -EINVAL; 2812 2812 goto out_err; 2813 2813 } 2814 2814 2815 - WL_SCAN("SSID:%s Channel:%d\n", 2816 - netinfo->SSID, netinfo->channel); 2815 + brcmf_dbg(SCAN, "SSID:%s Channel:%d\n", 2816 + netinfo->SSID, netinfo->channel); 2817 2817 memcpy(ssid[i].ssid, netinfo->SSID, netinfo->SSID_len); 2818 2818 ssid[i].ssid_len = netinfo->SSID_len; 2819 2819 request->n_ssids++; ··· 2851 2849 cfg->sched_escan = true; 2852 2850 cfg->scan_request = request; 2853 2851 } else { 2854 - WL_ERR("FALSE PNO Event. (pfn_count == 0)\n"); 2852 + brcmf_err("FALSE PNO Event. (pfn_count == 0)\n"); 2855 2853 goto out_err; 2856 2854 } 2857 2855 ··· 2880 2878 NULL, 0); 2881 2879 } 2882 2880 if (ret < 0) 2883 - WL_ERR("failed code %d\n", ret); 2881 + brcmf_err("failed code %d\n", ret); 2884 2882 2885 2883 return ret; 2886 2884 } ··· 2915 2913 int i; 2916 2914 int ret = 0; 2917 2915 2918 - WL_SCAN("Enter n_match_sets:%d n_ssids:%d\n", 2919 - request->n_match_sets, request->n_ssids); 2916 + brcmf_dbg(SCAN, "Enter n_match_sets:%d n_ssids:%d\n", 2917 + request->n_match_sets, request->n_ssids); 2920 2918 if (test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)) { 2921 - WL_ERR("Scanning already: status (%lu)\n", cfg->scan_status); 2919 + brcmf_err("Scanning already: status (%lu)\n", cfg->scan_status); 2922 2920 return -EAGAIN; 2923 2921 } 2924 2922 2925 2923 if (!request || !request->n_ssids || !request->n_match_sets) { 2926 - WL_ERR("Invalid sched scan req!! n_ssids:%d\n", 2927 - request ? request->n_ssids : 0); 2924 + brcmf_err("Invalid sched scan req!! n_ssids:%d\n", 2925 + request ? request->n_ssids : 0); 2928 2926 return -EINVAL; 2929 2927 } 2930 2928 2931 2929 if (request->n_ssids > 0) { 2932 2930 for (i = 0; i < request->n_ssids; i++) { 2933 2931 /* Active scan req for ssids */ 2934 - WL_SCAN(">>> Active scan req for ssid (%s)\n", 2935 - request->ssids[i].ssid); 2932 + brcmf_dbg(SCAN, ">>> Active scan req for ssid (%s)\n", 2933 + request->ssids[i].ssid); 2936 2934 2937 2935 /* 2938 2936 * match_set ssids is a supert set of n_ssid list, ··· 2945 2943 /* clean up everything */ 2946 2944 ret = brcmf_dev_pno_clean(ndev); 2947 2945 if (ret < 0) { 2948 - WL_ERR("failed error=%d\n", ret); 2946 + brcmf_err("failed error=%d\n", ret); 2949 2947 return ret; 2950 2948 } 2951 2949 2952 2950 /* configure pno */ 2953 2951 ret = brcmf_dev_pno_config(ndev); 2954 2952 if (ret < 0) { 2955 - WL_ERR("PNO setup failed!! ret=%d\n", ret); 2953 + brcmf_err("PNO setup failed!! ret=%d\n", ret); 2956 2954 return -EINVAL; 2957 2955 } 2958 2956 ··· 2965 2963 ssid_len = ssid->ssid_len; 2966 2964 2967 2965 if (!ssid_len) { 2968 - WL_ERR("skip broadcast ssid\n"); 2966 + brcmf_err("skip broadcast ssid\n"); 2969 2967 continue; 2970 2968 } 2971 2969 pfn.auth = cpu_to_le32(WLAN_AUTH_OPEN); ··· 2977 2975 memcpy(pfn.ssid.SSID, ssid->ssid, ssid_len); 2978 2976 ret = brcmf_fil_iovar_data_set(ifp, "pfn_add", &pfn, 2979 2977 sizeof(pfn)); 2980 - WL_SCAN(">>> PNO filter %s for ssid (%s)\n", 2981 - ret == 0 ? "set" : "failed", 2982 - ssid->ssid); 2978 + brcmf_dbg(SCAN, ">>> PNO filter %s for ssid (%s)\n", 2979 + ret == 0 ? "set" : "failed", ssid->ssid); 2983 2980 } 2984 2981 /* Enable the PNO */ 2985 2982 if (brcmf_fil_iovar_int_set(ifp, "pfn", 1) < 0) { 2986 - WL_ERR("PNO enable failed!! ret=%d\n", ret); 2983 + brcmf_err("PNO enable failed!! ret=%d\n", ret); 2987 2984 return -EINVAL; 2988 2985 } 2989 2986 } else { ··· 2997 2996 { 2998 2997 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); 2999 2998 3000 - WL_SCAN("enter\n"); 2999 + brcmf_dbg(SCAN, "enter\n"); 3001 3000 brcmf_dev_pno_clean(ndev); 3002 3001 if (cfg->sched_escan) 3003 3002 brcmf_notify_escan_complete(cfg, ndev, true, true); ··· 3013 3012 struct sk_buff *reply; 3014 3013 int ret; 3015 3014 3016 - WL_TRACE("cmd %x set %d buf %p len %d\n", dcmd->cmd, dcmd->set, 3017 - dcmd->buf, dcmd->len); 3015 + brcmf_dbg(TRACE, "cmd %x set %d buf %p len %d\n", dcmd->cmd, dcmd->set, 3016 + dcmd->buf, dcmd->len); 3018 3017 3019 3018 if (dcmd->set) 3020 3019 ret = brcmf_fil_cmd_data_set(netdev_priv(ndev), dcmd->cmd, ··· 3039 3038 /* set auth */ 3040 3039 err = brcmf_fil_bsscfg_int_set(ifp, "auth", 0); 3041 3040 if (err < 0) { 3042 - WL_ERR("auth error %d\n", err); 3041 + brcmf_err("auth error %d\n", err); 3043 3042 return err; 3044 3043 } 3045 3044 /* set wsec */ 3046 3045 err = brcmf_fil_bsscfg_int_set(ifp, "wsec", 0); 3047 3046 if (err < 0) { 3048 - WL_ERR("wsec error %d\n", err); 3047 + brcmf_err("wsec error %d\n", err); 3049 3048 return err; 3050 3049 } 3051 3050 /* set upper-layer auth */ 3052 3051 err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", WPA_AUTH_NONE); 3053 3052 if (err < 0) { 3054 - WL_ERR("wpa_auth error %d\n", err); 3053 + brcmf_err("wpa_auth error %d\n", err); 3055 3054 return err; 3056 3055 } 3057 3056 ··· 3085 3084 u16 rsn_cap; 3086 3085 u32 wme_bss_disable; 3087 3086 3088 - WL_TRACE("Enter\n"); 3087 + brcmf_dbg(TRACE, "Enter\n"); 3089 3088 if (wpa_ie == NULL) 3090 3089 goto exit; 3091 3090 ··· 3099 3098 /* check for multicast cipher suite */ 3100 3099 if (offset + WPA_IE_MIN_OUI_LEN > len) { 3101 3100 err = -EINVAL; 3102 - WL_ERR("no multicast cipher suite\n"); 3101 + brcmf_err("no multicast cipher suite\n"); 3103 3102 goto exit; 3104 3103 } 3105 3104 3106 3105 if (!brcmf_valid_wpa_oui(&data[offset], is_rsn_ie)) { 3107 3106 err = -EINVAL; 3108 - WL_ERR("ivalid OUI\n"); 3107 + brcmf_err("ivalid OUI\n"); 3109 3108 goto exit; 3110 3109 } 3111 3110 offset += TLV_OUI_LEN; ··· 3127 3126 break; 3128 3127 default: 3129 3128 err = -EINVAL; 3130 - WL_ERR("Invalid multi cast cipher info\n"); 3129 + brcmf_err("Invalid multi cast cipher info\n"); 3131 3130 goto exit; 3132 3131 } 3133 3132 ··· 3138 3137 /* Check for unicast suite(s) */ 3139 3138 if (offset + (WPA_IE_MIN_OUI_LEN * count) > len) { 3140 3139 err = -EINVAL; 3141 - WL_ERR("no unicast cipher suite\n"); 3140 + brcmf_err("no unicast cipher suite\n"); 3142 3141 goto exit; 3143 3142 } 3144 3143 for (i = 0; i < count; i++) { 3145 3144 if (!brcmf_valid_wpa_oui(&data[offset], is_rsn_ie)) { 3146 3145 err = -EINVAL; 3147 - WL_ERR("ivalid OUI\n"); 3146 + brcmf_err("ivalid OUI\n"); 3148 3147 goto exit; 3149 3148 } 3150 3149 offset += TLV_OUI_LEN; ··· 3162 3161 pval |= AES_ENABLED; 3163 3162 break; 3164 3163 default: 3165 - WL_ERR("Ivalid unicast security info\n"); 3164 + brcmf_err("Ivalid unicast security info\n"); 3166 3165 } 3167 3166 offset++; 3168 3167 } ··· 3172 3171 /* Check for auth key management suite(s) */ 3173 3172 if (offset + (WPA_IE_MIN_OUI_LEN * count) > len) { 3174 3173 err = -EINVAL; 3175 - WL_ERR("no auth key mgmt suite\n"); 3174 + brcmf_err("no auth key mgmt suite\n"); 3176 3175 goto exit; 3177 3176 } 3178 3177 for (i = 0; i < count; i++) { 3179 3178 if (!brcmf_valid_wpa_oui(&data[offset], is_rsn_ie)) { 3180 3179 err = -EINVAL; 3181 - WL_ERR("ivalid OUI\n"); 3180 + brcmf_err("ivalid OUI\n"); 3182 3181 goto exit; 3183 3182 } 3184 3183 offset += TLV_OUI_LEN; 3185 3184 switch (data[offset]) { 3186 3185 case RSN_AKM_NONE: 3187 - WL_TRACE("RSN_AKM_NONE\n"); 3186 + brcmf_dbg(TRACE, "RSN_AKM_NONE\n"); 3188 3187 wpa_auth |= WPA_AUTH_NONE; 3189 3188 break; 3190 3189 case RSN_AKM_UNSPECIFIED: 3191 - WL_TRACE("RSN_AKM_UNSPECIFIED\n"); 3190 + brcmf_dbg(TRACE, "RSN_AKM_UNSPECIFIED\n"); 3192 3191 is_rsn_ie ? (wpa_auth |= WPA2_AUTH_UNSPECIFIED) : 3193 3192 (wpa_auth |= WPA_AUTH_UNSPECIFIED); 3194 3193 break; 3195 3194 case RSN_AKM_PSK: 3196 - WL_TRACE("RSN_AKM_PSK\n"); 3195 + brcmf_dbg(TRACE, "RSN_AKM_PSK\n"); 3197 3196 is_rsn_ie ? (wpa_auth |= WPA2_AUTH_PSK) : 3198 3197 (wpa_auth |= WPA_AUTH_PSK); 3199 3198 break; 3200 3199 default: 3201 - WL_ERR("Ivalid key mgmt info\n"); 3200 + brcmf_err("Ivalid key mgmt info\n"); 3202 3201 } 3203 3202 offset++; 3204 3203 } ··· 3214 3213 err = brcmf_fil_bsscfg_int_set(ifp, "wme_bss_disable", 3215 3214 wme_bss_disable); 3216 3215 if (err < 0) { 3217 - WL_ERR("wme_bss_disable error %d\n", err); 3216 + brcmf_err("wme_bss_disable error %d\n", err); 3218 3217 goto exit; 3219 3218 } 3220 3219 } ··· 3224 3223 /* set auth */ 3225 3224 err = brcmf_fil_bsscfg_int_set(ifp, "auth", auth); 3226 3225 if (err < 0) { 3227 - WL_ERR("auth error %d\n", err); 3226 + brcmf_err("auth error %d\n", err); 3228 3227 goto exit; 3229 3228 } 3230 3229 /* set wsec */ 3231 3230 err = brcmf_fil_bsscfg_int_set(ifp, "wsec", wsec); 3232 3231 if (err < 0) { 3233 - WL_ERR("wsec error %d\n", err); 3232 + brcmf_err("wsec error %d\n", err); 3234 3233 goto exit; 3235 3234 } 3236 3235 /* set upper-layer auth */ 3237 3236 err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", wpa_auth); 3238 3237 if (err < 0) { 3239 - WL_ERR("wpa_auth error %d\n", err); 3238 + brcmf_err("wpa_auth error %d\n", err); 3240 3239 goto exit; 3241 3240 } 3242 3241 ··· 3264 3263 vndrie = (struct brcmf_vs_tlv *)ie; 3265 3264 /* len should be bigger than OUI length + one */ 3266 3265 if (vndrie->len < (VS_IE_FIXED_HDR_LEN - TLV_HDR_LEN + 1)) { 3267 - WL_ERR("invalid vndr ie. length is too small %d\n", 3268 - vndrie->len); 3266 + brcmf_err("invalid vndr ie. length is too small %d\n", 3267 + vndrie->len); 3269 3268 goto next; 3270 3269 } 3271 3270 /* if wpa or wme ie, do not add ie */ 3272 3271 if (!memcmp(vndrie->oui, (u8 *)WPA_OUI, TLV_OUI_LEN) && 3273 3272 ((vndrie->oui_type == WPA_OUI_TYPE) || 3274 3273 (vndrie->oui_type == WME_OUI_TYPE))) { 3275 - WL_TRACE("Found WPA/WME oui. Do not add it\n"); 3274 + brcmf_dbg(TRACE, "Found WPA/WME oui. Do not add it\n"); 3276 3275 goto next; 3277 3276 } 3278 3277 ··· 3285 3284 3286 3285 vndr_ies->count++; 3287 3286 3288 - WL_TRACE("** OUI %02x %02x %02x, type 0x%02x\n", 3289 - parsed_info->vndrie.oui[0], 3290 - parsed_info->vndrie.oui[1], 3291 - parsed_info->vndrie.oui[2], 3292 - parsed_info->vndrie.oui_type); 3287 + brcmf_dbg(TRACE, "** OUI %02x %02x %02x, type 0x%02x\n", 3288 + parsed_info->vndrie.oui[0], 3289 + parsed_info->vndrie.oui[1], 3290 + parsed_info->vndrie.oui[2], 3291 + parsed_info->vndrie.oui_type); 3293 3292 3294 3293 if (vndr_ies->count >= MAX_VNDR_IE_NUMBER) 3295 3294 break; ··· 3352 3351 ifp = vif->ifp; 3353 3352 saved_ie = &vif->saved_ie; 3354 3353 3355 - WL_TRACE("bssidx %d, pktflag : 0x%02X\n", ifp->bssidx, pktflag); 3354 + brcmf_dbg(TRACE, "bssidx %d, pktflag : 0x%02X\n", ifp->bssidx, pktflag); 3356 3355 iovar_ie_buf = kzalloc(WL_EXTRA_BUF_MAX, GFP_KERNEL); 3357 3356 if (!iovar_ie_buf) 3358 3357 return -ENOMEM; ··· 3371 3370 break; 3372 3371 default: 3373 3372 err = -EPERM; 3374 - WL_ERR("not suitable type\n"); 3373 + brcmf_err("not suitable type\n"); 3375 3374 goto exit; 3376 3375 } 3377 3376 } else { 3378 3377 err = -EPERM; 3379 - WL_ERR("not suitable type\n"); 3378 + brcmf_err("not suitable type\n"); 3380 3379 goto exit; 3381 3380 } 3382 3381 3383 3382 if (vndr_ie_len > mgmt_ie_buf_len) { 3384 3383 err = -ENOMEM; 3385 - WL_ERR("extra IE size too big\n"); 3384 + brcmf_err("extra IE size too big\n"); 3386 3385 goto exit; 3387 3386 } 3388 3387 ··· 3402 3401 if (parsed_ie_buf_len && (parsed_ie_buf_len == *mgmt_ie_len) && 3403 3402 (memcmp(mgmt_ie_buf, curr_ie_buf, 3404 3403 parsed_ie_buf_len) == 0)) { 3405 - WL_TRACE("Previous mgmt IE equals to current IE\n"); 3404 + brcmf_dbg(TRACE, "Previous mgmt IE equals to current IE\n"); 3406 3405 goto exit; 3407 3406 } 3408 3407 ··· 3413 3412 for (i = 0; i < old_vndr_ies.count; i++) { 3414 3413 vndrie_info = &old_vndr_ies.ie_info[i]; 3415 3414 3416 - WL_TRACE("DEL ID : %d, Len: %d , OUI:%02x:%02x:%02x\n", 3417 - vndrie_info->vndrie.id, 3418 - vndrie_info->vndrie.len, 3419 - vndrie_info->vndrie.oui[0], 3420 - vndrie_info->vndrie.oui[1], 3421 - vndrie_info->vndrie.oui[2]); 3415 + brcmf_dbg(TRACE, "DEL ID : %d, Len: %d , OUI:%02x:%02x:%02x\n", 3416 + vndrie_info->vndrie.id, 3417 + vndrie_info->vndrie.len, 3418 + vndrie_info->vndrie.oui[0], 3419 + vndrie_info->vndrie.oui[1], 3420 + vndrie_info->vndrie.oui[2]); 3422 3421 3423 3422 del_add_ie_buf_len = brcmf_vndr_ie(curr_ie_buf, pktflag, 3424 3423 vndrie_info->ie_ptr, ··· 3443 3442 /* verify remained buf size before copy data */ 3444 3443 if (remained_buf_len < (vndrie_info->vndrie.len + 3445 3444 VNDR_IE_VSIE_OFFSET)) { 3446 - WL_ERR("no space in mgmt_ie_buf: len left %d", 3447 - remained_buf_len); 3445 + brcmf_err("no space in mgmt_ie_buf: len left %d", 3446 + remained_buf_len); 3448 3447 break; 3449 3448 } 3450 3449 remained_buf_len -= (vndrie_info->ie_len + 3451 3450 VNDR_IE_VSIE_OFFSET); 3452 3451 3453 - WL_TRACE("ADDED ID : %d, Len: %d, OUI:%02x:%02x:%02x\n", 3454 - vndrie_info->vndrie.id, 3455 - vndrie_info->vndrie.len, 3456 - vndrie_info->vndrie.oui[0], 3457 - vndrie_info->vndrie.oui[1], 3458 - vndrie_info->vndrie.oui[2]); 3452 + brcmf_dbg(TRACE, "ADDED ID : %d, Len: %d, OUI:%02x:%02x:%02x\n", 3453 + vndrie_info->vndrie.id, 3454 + vndrie_info->vndrie.len, 3455 + vndrie_info->vndrie.oui[0], 3456 + vndrie_info->vndrie.oui[1], 3457 + vndrie_info->vndrie.oui[2]); 3459 3458 3460 3459 del_add_ie_buf_len = brcmf_vndr_ie(curr_ie_buf, pktflag, 3461 3460 vndrie_info->ie_ptr, ··· 3475 3474 err = brcmf_fil_bsscfg_data_set(ifp, "vndr_ie", iovar_ie_buf, 3476 3475 total_ie_buf_len); 3477 3476 if (err) 3478 - WL_ERR("vndr ie set error : %d\n", err); 3477 + brcmf_err("vndr ie set error : %d\n", err); 3479 3478 } 3480 3479 3481 3480 exit: ··· 3497 3496 struct brcmf_join_params join_params; 3498 3497 s32 bssidx = 0; 3499 3498 3500 - WL_TRACE("channel_type=%d, beacon_interval=%d, dtim_period=%d,\n", 3501 - cfg80211_get_chandef_type(&settings->chandef), 3502 - settings->beacon_interval, 3503 - settings->dtim_period); 3504 - WL_TRACE("ssid=%s(%zu), auth_type=%d, inactivity_timeout=%d\n", 3505 - settings->ssid, settings->ssid_len, settings->auth_type, 3506 - settings->inactivity_timeout); 3499 + brcmf_dbg(TRACE, "channel_type=%d, beacon_interval=%d, dtim_period=%d,\n", 3500 + cfg80211_get_chandef_type(&settings->chandef), 3501 + settings->beacon_interval, 3502 + settings->dtim_period); 3503 + brcmf_dbg(TRACE, "ssid=%s(%zu), auth_type=%d, inactivity_timeout=%d\n", 3504 + settings->ssid, settings->ssid_len, settings->auth_type, 3505 + settings->inactivity_timeout); 3507 3506 3508 3507 if (!test_bit(BRCMF_VIF_STATUS_AP_CREATING, &ifp->vif->sme_state)) { 3509 - WL_ERR("Not in AP creation mode\n"); 3508 + brcmf_err("Not in AP creation mode\n"); 3510 3509 return -EPERM; 3511 3510 } 3512 3511 ··· 3522 3521 3523 3522 memcpy(ssid_le.SSID, ssid_ie->data, ssid_ie->len); 3524 3523 ssid_le.SSID_len = cpu_to_le32(ssid_ie->len); 3525 - WL_TRACE("SSID is (%s) in Head\n", ssid_le.SSID); 3524 + brcmf_dbg(TRACE, "SSID is (%s) in Head\n", ssid_le.SSID); 3526 3525 } else { 3527 3526 memcpy(ssid_le.SSID, settings->ssid, settings->ssid_len); 3528 3527 ssid_le.SSID_len = cpu_to_le32((u32)settings->ssid_len); ··· 3531 3530 brcmf_set_mpc(ndev, 0); 3532 3531 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_DOWN, 1); 3533 3532 if (err < 0) { 3534 - WL_ERR("BRCMF_C_DOWN error %d\n", err); 3533 + brcmf_err("BRCMF_C_DOWN error %d\n", err); 3535 3534 goto exit; 3536 3535 } 3537 3536 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_INFRA, 1); 3538 3537 if (err < 0) { 3539 - WL_ERR("SET INFRA error %d\n", err); 3538 + brcmf_err("SET INFRA error %d\n", err); 3540 3539 goto exit; 3541 3540 } 3542 3541 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 1); 3543 3542 if (err < 0) { 3544 - WL_ERR("setting AP mode failed %d\n", err); 3543 + brcmf_err("setting AP mode failed %d\n", err); 3545 3544 goto exit; 3546 3545 } 3547 3546 ··· 3554 3553 settings->beacon.tail_len); 3555 3554 3556 3555 if ((wpa_ie != NULL || rsn_ie != NULL)) { 3557 - WL_TRACE("WPA(2) IE is found\n"); 3556 + brcmf_dbg(TRACE, "WPA(2) IE is found\n"); 3558 3557 if (wpa_ie != NULL) { 3559 3558 /* WPA IE */ 3560 3559 err = brcmf_configure_wpaie(ndev, wpa_ie, false); ··· 3568 3567 goto exit; 3569 3568 } 3570 3569 } else { 3571 - WL_TRACE("No WPA(2) IEs found\n"); 3570 + brcmf_dbg(TRACE, "No WPA(2) IEs found\n"); 3572 3571 brcmf_configure_opensecurity(ndev, bssidx); 3573 3572 } 3574 3573 /* Set Beacon IEs to FW */ ··· 3577 3576 settings->beacon.tail, 3578 3577 settings->beacon.tail_len); 3579 3578 if (err) 3580 - WL_ERR("Set Beacon IE Failed\n"); 3579 + brcmf_err("Set Beacon IE Failed\n"); 3581 3580 else 3582 - WL_TRACE("Applied Vndr IEs for Beacon\n"); 3581 + brcmf_dbg(TRACE, "Applied Vndr IEs for Beacon\n"); 3583 3582 3584 3583 /* Set Probe Response IEs to FW */ 3585 3584 err = brcmf_vif_set_mgmt_ie(ndev_to_vif(ndev), ··· 3587 3586 settings->beacon.proberesp_ies, 3588 3587 settings->beacon.proberesp_ies_len); 3589 3588 if (err) 3590 - WL_ERR("Set Probe Resp IE Failed\n"); 3589 + brcmf_err("Set Probe Resp IE Failed\n"); 3591 3590 else 3592 - WL_TRACE("Applied Vndr IEs for Probe Resp\n"); 3591 + brcmf_dbg(TRACE, "Applied Vndr IEs for Probe Resp\n"); 3593 3592 3594 3593 if (settings->beacon_interval) { 3595 3594 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_BCNPRD, 3596 3595 settings->beacon_interval); 3597 3596 if (err < 0) { 3598 - WL_ERR("Beacon Interval Set Error, %d\n", err); 3597 + brcmf_err("Beacon Interval Set Error, %d\n", err); 3599 3598 goto exit; 3600 3599 } 3601 3600 } ··· 3603 3602 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_DTIMPRD, 3604 3603 settings->dtim_period); 3605 3604 if (err < 0) { 3606 - WL_ERR("DTIM Interval Set Error, %d\n", err); 3605 + brcmf_err("DTIM Interval Set Error, %d\n", err); 3607 3606 goto exit; 3608 3607 } 3609 3608 } 3610 3609 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 1); 3611 3610 if (err < 0) { 3612 - WL_ERR("BRCMF_C_UP error (%d)\n", err); 3611 + brcmf_err("BRCMF_C_UP error (%d)\n", err); 3613 3612 goto exit; 3614 3613 } 3615 3614 ··· 3620 3619 err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID, 3621 3620 &join_params, sizeof(join_params)); 3622 3621 if (err < 0) { 3623 - WL_ERR("SET SSID error (%d)\n", err); 3622 + brcmf_err("SET SSID error (%d)\n", err); 3624 3623 goto exit; 3625 3624 } 3626 3625 clear_bit(BRCMF_VIF_STATUS_AP_CREATING, &ifp->vif->sme_state); ··· 3637 3636 struct brcmf_if *ifp = netdev_priv(ndev); 3638 3637 s32 err = -EPERM; 3639 3638 3640 - WL_TRACE("Enter\n"); 3639 + brcmf_dbg(TRACE, "Enter\n"); 3641 3640 3642 3641 if (ifp->vif->mode == WL_MODE_AP) { 3643 3642 /* Due to most likely deauths outstanding we sleep */ ··· 3645 3644 msleep(400); 3646 3645 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 0); 3647 3646 if (err < 0) { 3648 - WL_ERR("setting AP mode failed %d\n", err); 3647 + brcmf_err("setting AP mode failed %d\n", err); 3649 3648 goto exit; 3650 3649 } 3651 3650 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 0); 3652 3651 if (err < 0) { 3653 - WL_ERR("BRCMF_C_UP error %d\n", err); 3652 + brcmf_err("BRCMF_C_UP error %d\n", err); 3654 3653 goto exit; 3655 3654 } 3656 3655 brcmf_set_mpc(ndev, 1); ··· 3672 3671 if (!mac) 3673 3672 return -EFAULT; 3674 3673 3675 - WL_TRACE("Enter %pM\n", mac); 3674 + brcmf_dbg(TRACE, "Enter %pM\n", mac); 3676 3675 3677 3676 if (!check_vif_up(ifp->vif)) 3678 3677 return -EIO; ··· 3682 3681 err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SCB_DEAUTHENTICATE_FOR_REASON, 3683 3682 &scbval, sizeof(scbval)); 3684 3683 if (err) 3685 - WL_ERR("SCB_DEAUTHENTICATE_FOR_REASON failed %d\n", err); 3684 + brcmf_err("SCB_DEAUTHENTICATE_FOR_REASON failed %d\n", err); 3686 3685 3687 - WL_TRACE("Exit\n"); 3686 + brcmf_dbg(TRACE, "Exit\n"); 3688 3687 return err; 3689 3688 } 3690 3689 ··· 3753 3752 3754 3753 wiphy = wiphy_new(&wl_cfg80211_ops, sizeof(struct brcmf_cfg80211_info)); 3755 3754 if (!wiphy) { 3756 - WL_ERR("Could not allocate wiphy device\n"); 3755 + brcmf_err("Could not allocate wiphy device\n"); 3757 3756 return ERR_PTR(-ENOMEM); 3758 3757 } 3759 3758 set_wiphy_dev(wiphy, phydev); ··· 3780 3779 brcmf_wiphy_pno_params(wiphy); 3781 3780 err = wiphy_register(wiphy); 3782 3781 if (err < 0) { 3783 - WL_ERR("Could not register wiphy device (%d)\n", err); 3782 + brcmf_err("Could not register wiphy device (%d)\n", err); 3784 3783 wiphy_free(wiphy); 3785 3784 return ERR_PTR(err); 3786 3785 } ··· 3845 3844 u32 status = e->status; 3846 3845 3847 3846 if (event == BRCMF_E_SET_SSID && status == BRCMF_E_STATUS_SUCCESS) { 3848 - WL_CONN("Processing set ssid\n"); 3847 + brcmf_dbg(CONN, "Processing set ssid\n"); 3849 3848 return true; 3850 3849 } 3851 3850 ··· 3858 3857 u16 flags = e->flags; 3859 3858 3860 3859 if (event == BRCMF_E_LINK && (!(flags & BRCMF_EVENT_MSG_LINK))) { 3861 - WL_CONN("Processing link down\n"); 3860 + brcmf_dbg(CONN, "Processing link down\n"); 3862 3861 return true; 3863 3862 } 3864 3863 return false; ··· 3871 3870 u32 status = e->status; 3872 3871 3873 3872 if (event == BRCMF_E_LINK && status == BRCMF_E_STATUS_NO_NETWORKS) { 3874 - WL_CONN("Processing Link %s & no network found\n", 3875 - e->flags & BRCMF_EVENT_MSG_LINK ? "up" : "down"); 3873 + brcmf_dbg(CONN, "Processing Link %s & no network found\n", 3874 + e->flags & BRCMF_EVENT_MSG_LINK ? "up" : "down"); 3876 3875 return true; 3877 3876 } 3878 3877 3879 3878 if (event == BRCMF_E_SET_SSID && status != BRCMF_E_STATUS_SUCCESS) { 3880 - WL_CONN("Processing connecting & no network found\n"); 3879 + brcmf_dbg(CONN, "Processing connecting & no network found\n"); 3881 3880 return true; 3882 3881 } 3883 3882 ··· 3910 3909 err = brcmf_fil_iovar_data_get(ifp, "assoc_info", 3911 3910 cfg->extra_buf, WL_ASSOC_INFO_MAX); 3912 3911 if (err) { 3913 - WL_ERR("could not get assoc info (%d)\n", err); 3912 + brcmf_err("could not get assoc info (%d)\n", err); 3914 3913 return err; 3915 3914 } 3916 3915 assoc_info = ··· 3922 3921 cfg->extra_buf, 3923 3922 WL_ASSOC_INFO_MAX); 3924 3923 if (err) { 3925 - WL_ERR("could not get assoc req (%d)\n", err); 3924 + brcmf_err("could not get assoc req (%d)\n", err); 3926 3925 return err; 3927 3926 } 3928 3927 conn_info->req_ie_len = req_len; ··· 3938 3937 cfg->extra_buf, 3939 3938 WL_ASSOC_INFO_MAX); 3940 3939 if (err) { 3941 - WL_ERR("could not get assoc resp (%d)\n", err); 3940 + brcmf_err("could not get assoc resp (%d)\n", err); 3942 3941 return err; 3943 3942 } 3944 3943 conn_info->resp_ie_len = resp_len; ··· 3949 3948 conn_info->resp_ie_len = 0; 3950 3949 conn_info->resp_ie = NULL; 3951 3950 } 3952 - WL_CONN("req len (%d) resp len (%d)\n", 3953 - conn_info->req_ie_len, conn_info->resp_ie_len); 3951 + brcmf_dbg(CONN, "req len (%d) resp len (%d)\n", 3952 + conn_info->req_ie_len, conn_info->resp_ie_len); 3954 3953 3955 3954 return err; 3956 3955 } ··· 3972 3971 u32 target_channel; 3973 3972 u8 *buf; 3974 3973 3975 - WL_TRACE("Enter\n"); 3974 + brcmf_dbg(TRACE, "Enter\n"); 3976 3975 3977 3976 brcmf_get_assoc_ies(cfg); 3978 3977 memcpy(profile->bssid, e->addr, ETH_ALEN); ··· 4009 4008 cfg80211_roamed(ndev, notify_channel, (u8 *)profile->bssid, 4010 4009 conn_info->req_ie, conn_info->req_ie_len, 4011 4010 conn_info->resp_ie, conn_info->resp_ie_len, GFP_KERNEL); 4012 - WL_CONN("Report roaming result\n"); 4011 + brcmf_dbg(CONN, "Report roaming result\n"); 4013 4012 4014 4013 set_bit(BRCMF_VIF_STATUS_CONNECTED, &ifp->vif->sme_state); 4015 - WL_TRACE("Exit\n"); 4014 + brcmf_dbg(TRACE, "Exit\n"); 4016 4015 return err; 4017 4016 } 4018 4017 ··· 4026 4025 struct brcmf_cfg80211_connect_info *conn_info = cfg_to_conn(cfg); 4027 4026 s32 err = 0; 4028 4027 4029 - WL_TRACE("Enter\n"); 4028 + brcmf_dbg(TRACE, "Enter\n"); 4030 4029 4031 4030 if (test_and_clear_bit(BRCMF_VIF_STATUS_CONNECTING, 4032 4031 &ifp->vif->sme_state)) { ··· 4047 4046 if (completed) 4048 4047 set_bit(BRCMF_VIF_STATUS_CONNECTED, 4049 4048 &ifp->vif->sme_state); 4050 - WL_CONN("Report connect result - connection %s\n", 4051 - completed ? "succeeded" : "failed"); 4049 + brcmf_dbg(CONN, "Report connect result - connection %s\n", 4050 + completed ? "succeeded" : "failed"); 4052 4051 } 4053 - WL_TRACE("Exit\n"); 4052 + brcmf_dbg(TRACE, "Exit\n"); 4054 4053 return err; 4055 4054 } 4056 4055 ··· 4067 4066 4068 4067 struct station_info sinfo; 4069 4068 4070 - WL_CONN("event %d, reason %d\n", event, reason); 4069 + brcmf_dbg(CONN, "event %d, reason %d\n", event, reason); 4071 4070 memset(&sinfo, 0, sizeof(sinfo)); 4072 4071 4073 4072 sinfo.filled = 0; ··· 4075 4074 reason == BRCMF_E_STATUS_SUCCESS) { 4076 4075 sinfo.filled = STATION_INFO_ASSOC_REQ_IES; 4077 4076 if (!data) { 4078 - WL_ERR("No IEs present in ASSOC/REASSOC_IND"); 4077 + brcmf_err("No IEs present in ASSOC/REASSOC_IND"); 4079 4078 return -EINVAL; 4080 4079 } 4081 4080 sinfo.assoc_req_ies = data; ··· 4105 4104 if (ifp->vif->mode == WL_MODE_AP) { 4106 4105 err = brcmf_notify_connect_status_ap(cfg, ndev, e, data); 4107 4106 } else if (brcmf_is_linkup(e)) { 4108 - WL_CONN("Linkup\n"); 4107 + brcmf_dbg(CONN, "Linkup\n"); 4109 4108 if (brcmf_is_ibssmode(ifp->vif)) { 4110 4109 memcpy(profile->bssid, e->addr, ETH_ALEN); 4111 4110 wl_inform_ibss(cfg, ndev, e->addr); ··· 4117 4116 } else 4118 4117 brcmf_bss_connect_done(cfg, ndev, e, true); 4119 4118 } else if (brcmf_is_linkdown(e)) { 4120 - WL_CONN("Linkdown\n"); 4119 + brcmf_dbg(CONN, "Linkdown\n"); 4121 4120 if (!brcmf_is_ibssmode(ifp->vif)) { 4122 4121 brcmf_bss_connect_done(cfg, ndev, e, false); 4123 4122 if (test_and_clear_bit(BRCMF_VIF_STATUS_CONNECTED, ··· 4272 4271 brcmf_deinit_priv_mem(cfg); 4273 4272 } 4274 4273 4275 - struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr) 4274 + struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr, 4275 + struct device *busdev) 4276 4276 { 4277 4277 struct net_device *ndev = drvr->iflist[0]->ndev; 4278 - struct device *busdev = drvr->dev; 4279 4278 struct brcmf_cfg80211_info *cfg; 4280 4279 struct wiphy *wiphy; 4281 4280 struct brcmf_cfg80211_vif *vif; ··· 4283 4282 s32 err = 0; 4284 4283 4285 4284 if (!ndev) { 4286 - WL_ERR("ndev is invalid\n"); 4285 + brcmf_err("ndev is invalid\n"); 4287 4286 return NULL; 4288 4287 } 4289 4288 ··· 4305 4304 4306 4305 err = wl_init_priv(cfg); 4307 4306 if (err) { 4308 - WL_ERR("Failed to init iwm_priv (%d)\n", err); 4307 + brcmf_err("Failed to init iwm_priv (%d)\n", err); 4309 4308 goto cfg80211_attach_out; 4310 4309 } 4311 4310 ··· 4343 4342 if (roamvar) { 4344 4343 err = brcmf_fil_iovar_int_set(ifp, "bcn_timeout", bcn_timeout); 4345 4344 if (err) { 4346 - WL_ERR("bcn_timeout error (%d)\n", err); 4345 + brcmf_err("bcn_timeout error (%d)\n", err); 4347 4346 goto dongle_rom_out; 4348 4347 } 4349 4348 } ··· 4352 4351 * Enable/Disable built-in roaming to allow supplicant 4353 4352 * to take care of roaming 4354 4353 */ 4355 - WL_INFO("Internal Roaming = %s\n", roamvar ? "Off" : "On"); 4354 + brcmf_dbg(INFO, "Internal Roaming = %s\n", roamvar ? "Off" : "On"); 4356 4355 err = brcmf_fil_iovar_int_set(ifp, "roam_off", roamvar); 4357 4356 if (err) { 4358 - WL_ERR("roam_off error (%d)\n", err); 4357 + brcmf_err("roam_off error (%d)\n", err); 4359 4358 goto dongle_rom_out; 4360 4359 } 4361 4360 ··· 4364 4363 err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_ROAM_TRIGGER, 4365 4364 (void *)roamtrigger, sizeof(roamtrigger)); 4366 4365 if (err) { 4367 - WL_ERR("WLC_SET_ROAM_TRIGGER error (%d)\n", err); 4366 + brcmf_err("WLC_SET_ROAM_TRIGGER error (%d)\n", err); 4368 4367 goto dongle_rom_out; 4369 4368 } 4370 4369 ··· 4373 4372 err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_ROAM_DELTA, 4374 4373 (void *)roam_delta, sizeof(roam_delta)); 4375 4374 if (err) { 4376 - WL_ERR("WLC_SET_ROAM_DELTA error (%d)\n", err); 4375 + brcmf_err("WLC_SET_ROAM_DELTA error (%d)\n", err); 4377 4376 goto dongle_rom_out; 4378 4377 } 4379 4378 ··· 4392 4391 scan_assoc_time); 4393 4392 if (err) { 4394 4393 if (err == -EOPNOTSUPP) 4395 - WL_INFO("Scan assoc time is not supported\n"); 4394 + brcmf_dbg(INFO, "Scan assoc time is not supported\n"); 4396 4395 else 4397 - WL_ERR("Scan assoc time error (%d)\n", err); 4396 + brcmf_err("Scan assoc time error (%d)\n", err); 4398 4397 goto dongle_scantime_out; 4399 4398 } 4400 4399 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_UNASSOC_TIME, 4401 4400 scan_unassoc_time); 4402 4401 if (err) { 4403 4402 if (err == -EOPNOTSUPP) 4404 - WL_INFO("Scan unassoc time is not supported\n"); 4403 + brcmf_dbg(INFO, "Scan unassoc time is not supported\n"); 4405 4404 else 4406 - WL_ERR("Scan unassoc time error (%d)\n", err); 4405 + brcmf_err("Scan unassoc time error (%d)\n", err); 4407 4406 goto dongle_scantime_out; 4408 4407 } 4409 4408 ··· 4411 4410 scan_passive_time); 4412 4411 if (err) { 4413 4412 if (err == -EOPNOTSUPP) 4414 - WL_INFO("Scan passive time is not supported\n"); 4413 + brcmf_dbg(INFO, "Scan passive time is not supported\n"); 4415 4414 else 4416 - WL_ERR("Scan passive time error (%d)\n", err); 4415 + brcmf_err("Scan passive time error (%d)\n", err); 4417 4416 goto dongle_scantime_out; 4418 4417 } 4419 4418 ··· 4432 4431 err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_PHYLIST, 4433 4432 &phy_list, sizeof(phy_list)); 4434 4433 if (err) { 4435 - WL_ERR("error (%d)\n", err); 4434 + brcmf_err("error (%d)\n", err); 4436 4435 return err; 4437 4436 } 4438 4437 4439 4438 phy = ((char *)&phy_list)[0]; 4440 - WL_INFO("%c phy\n", phy); 4439 + brcmf_dbg(INFO, "%c phy\n", phy); 4441 4440 if (phy == 'n' || phy == 'a') { 4442 4441 wiphy = cfg_to_wiphy(cfg); 4443 4442 wiphy->bands[IEEE80211_BAND_5GHZ] = &__wl_band_5ghz_n; ··· 4472 4471 power_mode); 4473 4472 if (err) 4474 4473 goto default_conf_out; 4475 - WL_INFO("power save set to %s\n", 4476 - (power_mode ? "enabled" : "disabled")); 4474 + brcmf_dbg(INFO, "power save set to %s\n", 4475 + (power_mode ? "enabled" : "disabled")); 4477 4476 4478 4477 err = brcmf_dongle_roam(ndev, (cfg->roam_on ? 0 : 1), 4479 4478 WL_BEACON_TIMEOUT);
+2 -68
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h
··· 17 17 #ifndef _wl_cfg80211_h_ 18 18 #define _wl_cfg80211_h_ 19 19 20 - #define WL_DBG_NONE 0 21 - #define WL_DBG_CONN (1 << 5) 22 - #define WL_DBG_SCAN (1 << 4) 23 - #define WL_DBG_TRACE (1 << 3) 24 - #define WL_DBG_INFO (1 << 1) 25 - #define WL_DBG_ERR (1 << 0) 26 - #define WL_DBG_MASK ((WL_DBG_INFO | WL_DBG_ERR | WL_DBG_TRACE) | \ 27 - (WL_DBG_SCAN) | (WL_DBG_CONN)) 28 - 29 - #define WL_ERR(fmt, ...) \ 30 - do { \ 31 - if (brcmf_dbg_level & WL_DBG_ERR) { \ 32 - if (net_ratelimit()) { \ 33 - pr_err("ERROR @%s : " fmt, \ 34 - __func__, ##__VA_ARGS__); \ 35 - } \ 36 - } \ 37 - } while (0) 38 - 39 - #if (defined DEBUG) 40 - #define WL_INFO(fmt, ...) \ 41 - do { \ 42 - if (brcmf_dbg_level & WL_DBG_INFO) { \ 43 - if (net_ratelimit()) { \ 44 - pr_err("INFO @%s : " fmt, \ 45 - __func__, ##__VA_ARGS__); \ 46 - } \ 47 - } \ 48 - } while (0) 49 - 50 - #define WL_TRACE(fmt, ...) \ 51 - do { \ 52 - if (brcmf_dbg_level & WL_DBG_TRACE) { \ 53 - if (net_ratelimit()) { \ 54 - pr_err("TRACE @%s : " fmt, \ 55 - __func__, ##__VA_ARGS__); \ 56 - } \ 57 - } \ 58 - } while (0) 59 - 60 - #define WL_SCAN(fmt, ...) \ 61 - do { \ 62 - if (brcmf_dbg_level & WL_DBG_SCAN) { \ 63 - if (net_ratelimit()) { \ 64 - pr_err("SCAN @%s : " fmt, \ 65 - __func__, ##__VA_ARGS__); \ 66 - } \ 67 - } \ 68 - } while (0) 69 - 70 - #define WL_CONN(fmt, ...) \ 71 - do { \ 72 - if (brcmf_dbg_level & WL_DBG_CONN) { \ 73 - if (net_ratelimit()) { \ 74 - pr_err("CONN @%s : " fmt, \ 75 - __func__, ##__VA_ARGS__); \ 76 - } \ 77 - } \ 78 - } while (0) 79 - 80 - #else /* (defined DEBUG) */ 81 - #define WL_INFO(fmt, args...) 82 - #define WL_TRACE(fmt, args...) 83 - #define WL_SCAN(fmt, args...) 84 - #define WL_CONN(fmt, args...) 85 - #endif /* (defined DEBUG) */ 86 - 87 20 #define WL_NUM_SCAN_MAX 10 88 21 #define WL_NUM_PMKIDS_MAX MAXPMKID 89 22 #define WL_TLV_INFO_MAX 1024 ··· 383 450 return &cfg->conn_info; 384 451 } 385 452 386 - struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr); 453 + struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr, 454 + struct device *busdev); 387 455 void brcmf_cfg80211_detach(struct brcmf_cfg80211_info *cfg); 388 456 s32 brcmf_cfg80211_up(struct net_device *ndev); 389 457 s32 brcmf_cfg80211_down(struct net_device *ndev);
+1 -1
drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
··· 721 721 /* check if the device is removed */ 722 722 bool ai_deviceremoved(struct si_pub *sih) 723 723 { 724 - u32 w; 724 + u32 w = 0; 725 725 struct si_info *sii; 726 726 727 727 sii = container_of(sih, struct si_info, pub);
+1
drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
··· 93 93 94 94 /* recognized BCMA Core IDs */ 95 95 static struct bcma_device_id brcms_coreid_table[] = { 96 + BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 17, BCMA_ANY_CLASS), 96 97 BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 23, BCMA_ANY_CLASS), 97 98 BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 24, BCMA_ANY_CLASS), 98 99 BCMA_CORETABLE_END
+7 -6
drivers/net/wireless/brcm80211/brcmsmac/main.c
··· 717 717 brcms_c_write_mhf(wlc_hw, wlc_hw->band->mhfs); 718 718 719 719 /* do band-specific ucode IHR, SHM, and SCR inits */ 720 - if (D11REV_IS(wlc_hw->corerev, 23)) { 720 + if (D11REV_IS(wlc_hw->corerev, 17) || D11REV_IS(wlc_hw->corerev, 23)) { 721 721 if (BRCMS_ISNPHY(wlc_hw->band)) 722 722 brcms_c_write_inits(wlc_hw, ucode->d11n0bsinitvals16); 723 723 else ··· 2264 2264 if (wlc_hw->ucode_loaded) 2265 2265 return; 2266 2266 2267 - if (D11REV_IS(wlc_hw->corerev, 23)) { 2267 + if (D11REV_IS(wlc_hw->corerev, 17) || D11REV_IS(wlc_hw->corerev, 23)) { 2268 2268 if (BRCMS_ISNPHY(wlc_hw->band)) { 2269 2269 brcms_ucode_write(wlc_hw, ucode->bcm43xx_16_mimo, 2270 2270 ucode->bcm43xx_16_mimosz); ··· 2920 2920 if (offset & 2) 2921 2921 objoff += 2; 2922 2922 2923 - bcma_write16(core, objoff, v); 2923 + bcma_wflush16(core, objoff, v); 2924 2924 } 2925 2925 2926 2926 /* ··· 3216 3216 3217 3217 sflags = bcma_aread32(core, BCMA_IOST); 3218 3218 3219 - if (D11REV_IS(wlc_hw->corerev, 23)) { 3219 + if (D11REV_IS(wlc_hw->corerev, 17) || D11REV_IS(wlc_hw->corerev, 23)) { 3220 3220 if (BRCMS_ISNPHY(wlc_hw->band)) 3221 3221 brcms_c_write_inits(wlc_hw, ucode->d11n0initvals16); 3222 3222 else ··· 4500 4500 4501 4501 /* check device id(srom, nvram etc.) to set bands */ 4502 4502 if (wlc_hw->deviceid == BCM43224_D11N_ID || 4503 - wlc_hw->deviceid == BCM43224_D11N_ID_VEN1) 4503 + wlc_hw->deviceid == BCM43224_D11N_ID_VEN1 || 4504 + wlc_hw->deviceid == BCM43224_CHIP_ID) 4504 4505 /* Dualband boards */ 4505 4506 wlc_hw->_nbands = 2; 4506 4507 else ··· 5654 5653 return false; 5655 5654 } 5656 5655 5657 - if (device == BCM43224_D11N_ID_VEN1) 5656 + if (device == BCM43224_D11N_ID_VEN1 || device == BCM43224_CHIP_ID) 5658 5657 return true; 5659 5658 if ((device == BCM43224_D11N_ID) || (device == BCM43225_D11N2G_ID)) 5660 5659 return true;
+7 -7
drivers/net/wireless/iwlwifi/dvm/calib.c
··· 833 833 * To be safe, simply mask out any chains that we know 834 834 * are not on the device. 835 835 */ 836 - active_chains &= priv->eeprom_data->valid_rx_ant; 836 + active_chains &= priv->nvm_data->valid_rx_ant; 837 837 838 838 num_tx_chains = 0; 839 839 for (i = 0; i < NUM_RX_CHAINS; i++) { 840 840 /* loops on all the bits of 841 841 * priv->hw_setting.valid_tx_ant */ 842 842 u8 ant_msk = (1 << i); 843 - if (!(priv->eeprom_data->valid_tx_ant & ant_msk)) 843 + if (!(priv->nvm_data->valid_tx_ant & ant_msk)) 844 844 continue; 845 845 846 846 num_tx_chains++; ··· 854 854 * connect the first valid tx chain 855 855 */ 856 856 first_chain = 857 - find_first_chain(priv->eeprom_data->valid_tx_ant); 857 + find_first_chain(priv->nvm_data->valid_tx_ant); 858 858 data->disconn_array[first_chain] = 0; 859 859 active_chains |= BIT(first_chain); 860 860 IWL_DEBUG_CALIB(priv, ··· 864 864 } 865 865 } 866 866 867 - if (active_chains != priv->eeprom_data->valid_rx_ant && 867 + if (active_chains != priv->nvm_data->valid_rx_ant && 868 868 active_chains != priv->chain_noise_data.active_chains) 869 869 IWL_DEBUG_CALIB(priv, 870 870 "Detected that not all antennas are connected! " 871 871 "Connected: %#x, valid: %#x.\n", 872 872 active_chains, 873 - priv->eeprom_data->valid_rx_ant); 873 + priv->nvm_data->valid_rx_ant); 874 874 875 875 /* Save for use within RXON, TX, SCAN commands, etc. */ 876 876 data->active_chains = active_chains; ··· 1055 1055 priv->cfg->bt_params->advanced_bt_coexist) { 1056 1056 /* Disable disconnected antenna algorithm for advanced 1057 1057 bt coex, assuming valid antennas are connected */ 1058 - data->active_chains = priv->eeprom_data->valid_rx_ant; 1058 + data->active_chains = priv->nvm_data->valid_rx_ant; 1059 1059 for (i = 0; i < NUM_RX_CHAINS; i++) 1060 1060 if (!(data->active_chains & (1<<i))) 1061 1061 data->disconn_array[i] = 1; ··· 1086 1086 1087 1087 iwlagn_gain_computation( 1088 1088 priv, average_noise, 1089 - find_first_chain(priv->eeprom_data->valid_rx_ant)); 1089 + find_first_chain(priv->nvm_data->valid_rx_ant)); 1090 1090 1091 1091 /* Some power changes may have been made during the calibration. 1092 1092 * Update and commit the RXON
+6 -6
drivers/net/wireless/iwlwifi/dvm/debugfs.c
··· 305 305 int pos = 0, ofs = 0, buf_size = 0; 306 306 const u8 *ptr; 307 307 char *buf; 308 - u16 eeprom_ver; 308 + u16 nvm_ver; 309 309 size_t eeprom_len = priv->eeprom_blob_size; 310 310 buf_size = 4 * eeprom_len + 256; 311 311 ··· 321 321 if (!buf) 322 322 return -ENOMEM; 323 323 324 - eeprom_ver = priv->eeprom_data->eeprom_version; 324 + nvm_ver = priv->nvm_data->nvm_version; 325 325 pos += scnprintf(buf + pos, buf_size - pos, 326 - "NVM version: 0x%x\n", eeprom_ver); 326 + "NVM version: 0x%x\n", nvm_ver); 327 327 for (ofs = 0 ; ofs < eeprom_len ; ofs += 16) { 328 328 pos += scnprintf(buf + pos, buf_size - pos, "0x%.4x ", ofs); 329 329 hex_dump_to_buffer(ptr + ofs, 16 , 16, 2, buf + pos, ··· 1333 1333 if (tx->tx_power.ant_a || tx->tx_power.ant_b || tx->tx_power.ant_c) { 1334 1334 pos += scnprintf(buf + pos, bufsz - pos, 1335 1335 "tx power: (1/2 dB step)\n"); 1336 - if ((priv->eeprom_data->valid_tx_ant & ANT_A) && 1336 + if ((priv->nvm_data->valid_tx_ant & ANT_A) && 1337 1337 tx->tx_power.ant_a) 1338 1338 pos += scnprintf(buf + pos, bufsz - pos, 1339 1339 fmt_hex, "antenna A:", 1340 1340 tx->tx_power.ant_a); 1341 - if ((priv->eeprom_data->valid_tx_ant & ANT_B) && 1341 + if ((priv->nvm_data->valid_tx_ant & ANT_B) && 1342 1342 tx->tx_power.ant_b) 1343 1343 pos += scnprintf(buf + pos, bufsz - pos, 1344 1344 fmt_hex, "antenna B:", 1345 1345 tx->tx_power.ant_b); 1346 - if ((priv->eeprom_data->valid_tx_ant & ANT_C) && 1346 + if ((priv->nvm_data->valid_tx_ant & ANT_C) && 1347 1347 tx->tx_power.ant_c) 1348 1348 pos += scnprintf(buf + pos, bufsz - pos, 1349 1349 fmt_hex, "antenna C:",
+1 -1
drivers/net/wireless/iwlwifi/dvm/dev.h
··· 843 843 void *wowlan_sram; 844 844 #endif /* CONFIG_IWLWIFI_DEBUGFS */ 845 845 846 - struct iwl_eeprom_data *eeprom_data; 846 + struct iwl_nvm_data *nvm_data; 847 847 /* eeprom blob for debugfs/testmode */ 848 848 u8 *eeprom_blob; 849 849 size_t eeprom_blob_size;
+4 -4
drivers/net/wireless/iwlwifi/dvm/devices.c
··· 305 305 { 306 306 u16 temperature, voltage; 307 307 308 - temperature = le16_to_cpu(priv->eeprom_data->kelvin_temperature); 309 - voltage = le16_to_cpu(priv->eeprom_data->kelvin_voltage); 308 + temperature = le16_to_cpu(priv->nvm_data->kelvin_temperature); 309 + voltage = le16_to_cpu(priv->nvm_data->kelvin_voltage); 310 310 311 311 /* offset = temp - volt / coeff */ 312 312 return (s32)(temperature - ··· 460 460 break; 461 461 case IWL_DEVICE_FAMILY_6050: 462 462 /* Indicate calibration version to uCode. */ 463 - if (priv->eeprom_data->calib_version >= 6) 463 + if (priv->nvm_data->calib_version >= 6) 464 464 iwl_set_bit(priv->trans, CSR_GP_DRIVER_REG, 465 465 CSR_GP_DRIVER_REG_BIT_CALIB_VERSION6); 466 466 break; 467 467 case IWL_DEVICE_FAMILY_6150: 468 468 /* Indicate calibration version to uCode. */ 469 - if (priv->eeprom_data->calib_version >= 6) 469 + if (priv->nvm_data->calib_version >= 6) 470 470 iwl_set_bit(priv->trans, CSR_GP_DRIVER_REG, 471 471 CSR_GP_DRIVER_REG_BIT_CALIB_VERSION6); 472 472 iwl_set_bit(priv->trans, CSR_GP_DRIVER_REG,
+4 -4
drivers/net/wireless/iwlwifi/dvm/lib.c
··· 59 59 /* half dBm need to multiply */ 60 60 tx_power_cmd.global_lmt = (s8)(2 * priv->tx_power_user_lmt); 61 61 62 - if (tx_power_cmd.global_lmt > priv->eeprom_data->max_tx_pwr_half_dbm) { 62 + if (tx_power_cmd.global_lmt > priv->nvm_data->max_tx_pwr_half_dbm) { 63 63 /* 64 64 * For the newer devices which using enhanced/extend tx power 65 65 * table in EEPROM, the format is in half dBm. driver need to ··· 72 72 * half-dBm format), lower the tx power based on EEPROM 73 73 */ 74 74 tx_power_cmd.global_lmt = 75 - priv->eeprom_data->max_tx_pwr_half_dbm; 75 + priv->nvm_data->max_tx_pwr_half_dbm; 76 76 } 77 77 tx_power_cmd.flags = IWLAGN_TX_POWER_NO_CLOSED; 78 78 tx_power_cmd.srv_chan_lmt = IWLAGN_TX_POWER_AUTO; ··· 159 159 IWL_PAN_SCD_MGMT_MSK | 160 160 IWL_PAN_SCD_MULTICAST_MSK; 161 161 162 - if (priv->eeprom_data->sku & EEPROM_SKU_CAP_11N_ENABLE) 162 + if (priv->nvm_data->sku_cap_11n_enable) 163 163 flush_cmd.queue_control |= IWL_AGG_TX_QUEUE_MSK; 164 164 165 165 IWL_DEBUG_INFO(priv, "queue control: 0x%x\n", ··· 825 825 if (priv->chain_noise_data.active_chains) 826 826 active_chains = priv->chain_noise_data.active_chains; 827 827 else 828 - active_chains = priv->eeprom_data->valid_rx_ant; 828 + active_chains = priv->nvm_data->valid_rx_ant; 829 829 830 830 if (priv->cfg->bt_params && 831 831 priv->cfg->bt_params->advanced_bt_coexist &&
+6 -6
drivers/net/wireless/iwlwifi/dvm/mac80211.c
··· 164 164 hw->max_tx_aggregation_subframes = LINK_QUAL_AGG_FRAME_LIMIT_DEF; 165 165 */ 166 166 167 - if (priv->eeprom_data->sku & EEPROM_SKU_CAP_11N_ENABLE) 167 + if (priv->nvm_data->sku_cap_11n_enable) 168 168 hw->flags |= IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS | 169 169 IEEE80211_HW_SUPPORTS_STATIC_SMPS; 170 170 ··· 242 242 243 243 hw->max_listen_interval = IWL_CONN_MAX_LISTEN_INTERVAL; 244 244 245 - if (priv->eeprom_data->bands[IEEE80211_BAND_2GHZ].n_channels) 245 + if (priv->nvm_data->bands[IEEE80211_BAND_2GHZ].n_channels) 246 246 priv->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = 247 - &priv->eeprom_data->bands[IEEE80211_BAND_2GHZ]; 248 - if (priv->eeprom_data->bands[IEEE80211_BAND_5GHZ].n_channels) 247 + &priv->nvm_data->bands[IEEE80211_BAND_2GHZ]; 248 + if (priv->nvm_data->bands[IEEE80211_BAND_5GHZ].n_channels) 249 249 priv->hw->wiphy->bands[IEEE80211_BAND_5GHZ] = 250 - &priv->eeprom_data->bands[IEEE80211_BAND_5GHZ]; 250 + &priv->nvm_data->bands[IEEE80211_BAND_5GHZ]; 251 251 252 252 hw->wiphy->hw_version = priv->trans->hw_id; 253 253 ··· 654 654 IWL_DEBUG_HT(priv, "A-MPDU action on addr %pM tid %d\n", 655 655 sta->addr, tid); 656 656 657 - if (!(priv->eeprom_data->sku & EEPROM_SKU_CAP_11N_ENABLE)) 657 + if (!(priv->nvm_data->sku_cap_11n_enable)) 658 658 return -EACCES; 659 659 660 660 IWL_DEBUG_MAC80211(priv, "enter\n");
+32 -25
drivers/net/wireless/iwlwifi/dvm/main.c
··· 185 185 rate = info->control.rates[0].idx; 186 186 187 187 priv->mgmt_tx_ant = iwl_toggle_tx_ant(priv, priv->mgmt_tx_ant, 188 - priv->eeprom_data->valid_tx_ant); 188 + priv->nvm_data->valid_tx_ant); 189 189 rate_flags = iwl_ant_idx_to_flags(priv->mgmt_tx_ant); 190 190 191 191 /* In mac80211, rates for 5 GHz start at 0 */ ··· 776 776 ieee80211_wake_queues(priv->hw); 777 777 778 778 /* Configure Tx antenna selection based on H/W config */ 779 - iwlagn_send_tx_ant_config(priv, priv->eeprom_data->valid_tx_ant); 779 + iwlagn_send_tx_ant_config(priv, priv->nvm_data->valid_tx_ant); 780 780 781 781 if (iwl_is_associated_ctx(ctx) && !priv->wowlan) { 782 782 struct iwl_rxon_cmd *active_rxon = ··· 1191 1191 1192 1192 static int iwl_eeprom_init_hw_params(struct iwl_priv *priv) 1193 1193 { 1194 - if (priv->eeprom_data->sku & EEPROM_SKU_CAP_11N_ENABLE && 1194 + struct iwl_nvm_data *data = priv->nvm_data; 1195 + char *debug_msg; 1196 + 1197 + if (data->sku_cap_11n_enable && 1195 1198 !priv->cfg->ht_params) { 1196 1199 IWL_ERR(priv, "Invalid 11n configuration\n"); 1197 1200 return -EINVAL; 1198 1201 } 1199 1202 1200 - if (!priv->eeprom_data->sku) { 1203 + if (!data->sku_cap_11n_enable && !data->sku_cap_band_24GHz_enable && 1204 + !data->sku_cap_band_52GHz_enable) { 1201 1205 IWL_ERR(priv, "Invalid device sku\n"); 1202 1206 return -EINVAL; 1203 1207 } 1204 1208 1205 - IWL_DEBUG_INFO(priv, "Device SKU: 0x%X\n", priv->eeprom_data->sku); 1209 + debug_msg = "Device SKU: 24GHz %s %s, 52GHz %s %s, 11.n %s %s\n"; 1210 + IWL_DEBUG_INFO(priv, debug_msg, 1211 + data->sku_cap_band_24GHz_enable ? "" : "NOT", "enabled", 1212 + data->sku_cap_band_52GHz_enable ? "" : "NOT", "enabled", 1213 + data->sku_cap_11n_enable ? "" : "NOT", "enabled"); 1206 1214 1207 1215 priv->hw_params.tx_chains_num = 1208 - num_of_ant(priv->eeprom_data->valid_tx_ant); 1216 + num_of_ant(data->valid_tx_ant); 1209 1217 if (priv->cfg->rx_with_siso_diversity) 1210 1218 priv->hw_params.rx_chains_num = 1; 1211 1219 else 1212 1220 priv->hw_params.rx_chains_num = 1213 - num_of_ant(priv->eeprom_data->valid_rx_ant); 1221 + num_of_ant(data->valid_rx_ant); 1214 1222 1215 1223 IWL_DEBUG_INFO(priv, "Valid Tx ant: 0x%X, Valid Rx ant: 0x%X\n", 1216 - priv->eeprom_data->valid_tx_ant, 1217 - priv->eeprom_data->valid_rx_ant); 1224 + data->valid_tx_ant, 1225 + data->valid_rx_ant); 1218 1226 1219 1227 return 0; 1220 1228 } ··· 1382 1374 /* Reset chip to save power until we load uCode during "up". */ 1383 1375 iwl_trans_stop_hw(priv->trans, false); 1384 1376 1385 - priv->eeprom_data = iwl_parse_eeprom_data(priv->trans->dev, priv->cfg, 1377 + priv->nvm_data = iwl_parse_eeprom_data(priv->trans->dev, priv->cfg, 1386 1378 priv->eeprom_blob, 1387 1379 priv->eeprom_blob_size); 1388 - if (!priv->eeprom_data) 1380 + if (!priv->nvm_data) 1389 1381 goto out_free_eeprom_blob; 1390 1382 1391 - if (iwl_eeprom_check_version(priv->eeprom_data, priv->trans)) 1383 + if (iwl_nvm_check_version(priv->nvm_data, priv->trans)) 1392 1384 goto out_free_eeprom; 1393 1385 1394 1386 if (iwl_eeprom_init_hw_params(priv)) 1395 1387 goto out_free_eeprom; 1396 1388 1397 1389 /* extract MAC Address */ 1398 - memcpy(priv->addresses[0].addr, priv->eeprom_data->hw_addr, ETH_ALEN); 1390 + memcpy(priv->addresses[0].addr, priv->nvm_data->hw_addr, ETH_ALEN); 1399 1391 IWL_DEBUG_INFO(priv, "MAC address: %pM\n", priv->addresses[0].addr); 1400 1392 priv->hw->wiphy->addresses = priv->addresses; 1401 1393 priv->hw->wiphy->n_addresses = 1; 1402 - num_mac = priv->eeprom_data->n_hw_addrs; 1394 + num_mac = priv->nvm_data->n_hw_addrs; 1403 1395 if (num_mac > 1) { 1404 1396 memcpy(priv->addresses[1].addr, priv->addresses[0].addr, 1405 1397 ETH_ALEN); ··· 1412 1404 ************************/ 1413 1405 iwl_set_hw_params(priv); 1414 1406 1415 - if (!(priv->eeprom_data->sku & EEPROM_SKU_CAP_IPAN_ENABLE)) { 1407 + if (!(priv->nvm_data->sku_cap_ipan_enable)) { 1416 1408 IWL_DEBUG_INFO(priv, "Your EEPROM disabled PAN"); 1417 1409 ucode_flags &= ~IWL_UCODE_TLV_FLAGS_PAN; 1418 1410 /* ··· 1494 1486 out_free_eeprom_blob: 1495 1487 kfree(priv->eeprom_blob); 1496 1488 out_free_eeprom: 1497 - iwl_free_eeprom_data(priv->eeprom_data); 1489 + iwl_free_nvm_data(priv->nvm_data); 1498 1490 out_free_hw: 1499 1491 ieee80211_free_hw(priv->hw); 1500 1492 out: ··· 1514 1506 iwl_tt_exit(priv); 1515 1507 1516 1508 kfree(priv->eeprom_blob); 1517 - iwl_free_eeprom_data(priv->eeprom_data); 1509 + iwl_free_nvm_data(priv->nvm_data); 1518 1510 1519 1511 /*netif_stop_queue(dev); */ 1520 1512 flush_workqueue(priv->workqueue); ··· 1988 1980 static void iwl_nic_config(struct iwl_op_mode *op_mode) 1989 1981 { 1990 1982 struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode); 1991 - u16 radio_cfg = priv->eeprom_data->radio_cfg; 1992 1983 1993 1984 /* SKU Control */ 1994 1985 iwl_set_bits_mask(priv->trans, CSR_HW_IF_CONFIG_REG, ··· 1999 1992 CSR_HW_IF_CONFIG_REG_POS_MAC_DASH)); 2000 1993 2001 1994 /* write radio config values to register */ 2002 - if (EEPROM_RF_CFG_TYPE_MSK(radio_cfg) <= EEPROM_RF_CONFIG_TYPE_MAX) { 1995 + if (priv->nvm_data->radio_cfg_type <= EEPROM_RF_CONFIG_TYPE_MAX) { 2003 1996 u32 reg_val = 2004 - EEPROM_RF_CFG_TYPE_MSK(radio_cfg) << 1997 + priv->nvm_data->radio_cfg_type << 2005 1998 CSR_HW_IF_CONFIG_REG_POS_PHY_TYPE | 2006 - EEPROM_RF_CFG_STEP_MSK(radio_cfg) << 1999 + priv->nvm_data->radio_cfg_step << 2007 2000 CSR_HW_IF_CONFIG_REG_POS_PHY_STEP | 2008 - EEPROM_RF_CFG_DASH_MSK(radio_cfg) << 2001 + priv->nvm_data->radio_cfg_dash << 2009 2002 CSR_HW_IF_CONFIG_REG_POS_PHY_DASH; 2010 2003 2011 2004 iwl_set_bits_mask(priv->trans, CSR_HW_IF_CONFIG_REG, ··· 2014 2007 CSR_HW_IF_CONFIG_REG_MSK_PHY_DASH, reg_val); 2015 2008 2016 2009 IWL_INFO(priv, "Radio type=0x%x-0x%x-0x%x\n", 2017 - EEPROM_RF_CFG_TYPE_MSK(radio_cfg), 2018 - EEPROM_RF_CFG_STEP_MSK(radio_cfg), 2019 - EEPROM_RF_CFG_DASH_MSK(radio_cfg)); 2010 + priv->nvm_data->radio_cfg_type, 2011 + priv->nvm_data->radio_cfg_step, 2012 + priv->nvm_data->radio_cfg_dash); 2020 2013 } else { 2021 2014 WARN_ON(1); 2022 2015 }
+22 -22
drivers/net/wireless/iwlwifi/dvm/rs.c
··· 820 820 821 821 if (num_of_ant(tbl->ant_type) > 1) 822 822 tbl->ant_type = 823 - first_antenna(priv->eeprom_data->valid_tx_ant); 823 + first_antenna(priv->nvm_data->valid_tx_ant); 824 824 825 825 tbl->is_ht40 = 0; 826 826 tbl->is_SGI = 0; ··· 1448 1448 u32 sz = (sizeof(struct iwl_scale_tbl_info) - 1449 1449 (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); 1450 1450 u8 start_action; 1451 - u8 valid_tx_ant = priv->eeprom_data->valid_tx_ant; 1451 + u8 valid_tx_ant = priv->nvm_data->valid_tx_ant; 1452 1452 u8 tx_chains_num = priv->hw_params.tx_chains_num; 1453 1453 int ret = 0; 1454 1454 u8 update_search_tbl_counter = 0; ··· 1466 1466 case IWL_BT_COEX_TRAFFIC_LOAD_CONTINUOUS: 1467 1467 /* avoid antenna B and MIMO */ 1468 1468 valid_tx_ant = 1469 - first_antenna(priv->eeprom_data->valid_tx_ant); 1469 + first_antenna(priv->nvm_data->valid_tx_ant); 1470 1470 if (tbl->action >= IWL_LEGACY_SWITCH_ANTENNA2 && 1471 1471 tbl->action != IWL_LEGACY_SWITCH_SISO) 1472 1472 tbl->action = IWL_LEGACY_SWITCH_SISO; ··· 1490 1490 else if (tbl->action >= IWL_LEGACY_SWITCH_ANTENNA2) 1491 1491 tbl->action = IWL_LEGACY_SWITCH_SISO; 1492 1492 valid_tx_ant = 1493 - first_antenna(priv->eeprom_data->valid_tx_ant); 1493 + first_antenna(priv->nvm_data->valid_tx_ant); 1494 1494 } 1495 1495 1496 1496 start_action = tbl->action; ··· 1624 1624 u32 sz = (sizeof(struct iwl_scale_tbl_info) - 1625 1625 (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); 1626 1626 u8 start_action; 1627 - u8 valid_tx_ant = priv->eeprom_data->valid_tx_ant; 1627 + u8 valid_tx_ant = priv->nvm_data->valid_tx_ant; 1628 1628 u8 tx_chains_num = priv->hw_params.tx_chains_num; 1629 1629 u8 update_search_tbl_counter = 0; 1630 1630 int ret; ··· 1642 1642 case IWL_BT_COEX_TRAFFIC_LOAD_CONTINUOUS: 1643 1643 /* avoid antenna B and MIMO */ 1644 1644 valid_tx_ant = 1645 - first_antenna(priv->eeprom_data->valid_tx_ant); 1645 + first_antenna(priv->nvm_data->valid_tx_ant); 1646 1646 if (tbl->action != IWL_SISO_SWITCH_ANTENNA1) 1647 1647 tbl->action = IWL_SISO_SWITCH_ANTENNA1; 1648 1648 break; ··· 1660 1660 /* configure as 1x1 if bt full concurrency */ 1661 1661 if (priv->bt_full_concurrent) { 1662 1662 valid_tx_ant = 1663 - first_antenna(priv->eeprom_data->valid_tx_ant); 1663 + first_antenna(priv->nvm_data->valid_tx_ant); 1664 1664 if (tbl->action >= IWL_LEGACY_SWITCH_ANTENNA2) 1665 1665 tbl->action = IWL_SISO_SWITCH_ANTENNA1; 1666 1666 } ··· 1796 1796 u32 sz = (sizeof(struct iwl_scale_tbl_info) - 1797 1797 (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); 1798 1798 u8 start_action; 1799 - u8 valid_tx_ant = priv->eeprom_data->valid_tx_ant; 1799 + u8 valid_tx_ant = priv->nvm_data->valid_tx_ant; 1800 1800 u8 tx_chains_num = priv->hw_params.tx_chains_num; 1801 1801 u8 update_search_tbl_counter = 0; 1802 1802 int ret; ··· 1966 1966 u32 sz = (sizeof(struct iwl_scale_tbl_info) - 1967 1967 (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); 1968 1968 u8 start_action; 1969 - u8 valid_tx_ant = priv->eeprom_data->valid_tx_ant; 1969 + u8 valid_tx_ant = priv->nvm_data->valid_tx_ant; 1970 1970 u8 tx_chains_num = priv->hw_params.tx_chains_num; 1971 1971 int ret; 1972 1972 u8 update_search_tbl_counter = 0; ··· 2700 2700 2701 2701 i = lq_sta->last_txrate_idx; 2702 2702 2703 - valid_tx_ant = priv->eeprom_data->valid_tx_ant; 2703 + valid_tx_ant = priv->nvm_data->valid_tx_ant; 2704 2704 2705 2705 if (!lq_sta->search_better_tbl) 2706 2706 active_tbl = lq_sta->active_tbl; ··· 2894 2894 2895 2895 /* These values will be overridden later */ 2896 2896 lq_sta->lq.general_params.single_stream_ant_msk = 2897 - first_antenna(priv->eeprom_data->valid_tx_ant); 2897 + first_antenna(priv->nvm_data->valid_tx_ant); 2898 2898 lq_sta->lq.general_params.dual_stream_ant_msk = 2899 - priv->eeprom_data->valid_tx_ant & 2900 - ~first_antenna(priv->eeprom_data->valid_tx_ant); 2899 + priv->nvm_data->valid_tx_ant & 2900 + ~first_antenna(priv->nvm_data->valid_tx_ant); 2901 2901 if (!lq_sta->lq.general_params.dual_stream_ant_msk) { 2902 2902 lq_sta->lq.general_params.dual_stream_ant_msk = ANT_AB; 2903 - } else if (num_of_ant(priv->eeprom_data->valid_tx_ant) == 2) { 2903 + } else if (num_of_ant(priv->nvm_data->valid_tx_ant) == 2) { 2904 2904 lq_sta->lq.general_params.dual_stream_ant_msk = 2905 - priv->eeprom_data->valid_tx_ant; 2905 + priv->nvm_data->valid_tx_ant; 2906 2906 } 2907 2907 2908 2908 /* as default allow aggregation for all tids */ ··· 2948 2948 if (priv && priv->bt_full_concurrent) { 2949 2949 /* 1x1 only */ 2950 2950 tbl_type.ant_type = 2951 - first_antenna(priv->eeprom_data->valid_tx_ant); 2951 + first_antenna(priv->nvm_data->valid_tx_ant); 2952 2952 } 2953 2953 2954 2954 /* How many times should we repeat the initial rate? */ ··· 2980 2980 if (priv->bt_full_concurrent) 2981 2981 valid_tx_ant = ANT_A; 2982 2982 else 2983 - valid_tx_ant = priv->eeprom_data->valid_tx_ant; 2983 + valid_tx_ant = priv->nvm_data->valid_tx_ant; 2984 2984 } 2985 2985 2986 2986 /* Fill rest of rate table */ ··· 3014 3014 if (priv && priv->bt_full_concurrent) { 3015 3015 /* 1x1 only */ 3016 3016 tbl_type.ant_type = 3017 - first_antenna(priv->eeprom_data->valid_tx_ant); 3017 + first_antenna(priv->nvm_data->valid_tx_ant); 3018 3018 } 3019 3019 3020 3020 /* Indicate to uCode which entries might be MIMO. ··· 3101 3101 u8 ant_sel_tx; 3102 3102 3103 3103 priv = lq_sta->drv; 3104 - valid_tx_ant = priv->eeprom_data->valid_tx_ant; 3104 + valid_tx_ant = priv->nvm_data->valid_tx_ant; 3105 3105 if (lq_sta->dbg_fixed_rate) { 3106 3106 ant_sel_tx = 3107 3107 ((lq_sta->dbg_fixed_rate & RATE_MCS_ANT_ABC_MSK) ··· 3172 3172 desc += sprintf(buff+desc, "fixed rate 0x%X\n", 3173 3173 lq_sta->dbg_fixed_rate); 3174 3174 desc += sprintf(buff+desc, "valid_tx_ant %s%s%s\n", 3175 - (priv->eeprom_data->valid_tx_ant & ANT_A) ? "ANT_A," : "", 3176 - (priv->eeprom_data->valid_tx_ant & ANT_B) ? "ANT_B," : "", 3177 - (priv->eeprom_data->valid_tx_ant & ANT_C) ? "ANT_C" : ""); 3175 + (priv->nvm_data->valid_tx_ant & ANT_A) ? "ANT_A," : "", 3176 + (priv->nvm_data->valid_tx_ant & ANT_B) ? "ANT_B," : "", 3177 + (priv->nvm_data->valid_tx_ant & ANT_C) ? "ANT_C" : ""); 3178 3178 desc += sprintf(buff+desc, "lq type %s\n", 3179 3179 (is_legacy(tbl->lq_type)) ? "legacy" : "HT"); 3180 3180 if (is_Ht(tbl->lq_type)) {
+2 -2
drivers/net/wireless/iwlwifi/dvm/rxon.c
··· 420 420 return -EINVAL; 421 421 } 422 422 423 - if (tx_power > DIV_ROUND_UP(priv->eeprom_data->max_tx_pwr_half_dbm, 2)) { 423 + if (tx_power > DIV_ROUND_UP(priv->nvm_data->max_tx_pwr_half_dbm, 2)) { 424 424 IWL_WARN(priv, 425 425 "Requested user TXPOWER %d above upper limit %d.\n", 426 - tx_power, priv->eeprom_data->max_tx_pwr_half_dbm); 426 + tx_power, priv->nvm_data->max_tx_pwr_half_dbm); 427 427 return -EINVAL; 428 428 } 429 429
+7 -6
drivers/net/wireless/iwlwifi/dvm/scan.c
··· 660 660 u16 rx_chain = 0; 661 661 enum ieee80211_band band; 662 662 u8 n_probes = 0; 663 - u8 rx_ant = priv->eeprom_data->valid_rx_ant; 663 + u8 rx_ant = priv->nvm_data->valid_rx_ant; 664 664 u8 rate; 665 665 bool is_active = false; 666 666 int chan_mod; 667 667 u8 active_chains; 668 - u8 scan_tx_antennas = priv->eeprom_data->valid_tx_ant; 668 + u8 scan_tx_antennas = priv->nvm_data->valid_tx_ant; 669 669 int ret; 670 670 int scan_cmd_size = sizeof(struct iwl_scan_cmd) + 671 671 MAX_SCAN_CHANNEL * sizeof(struct iwl_scan_channel) + ··· 673 673 const u8 *ssid = NULL; 674 674 u8 ssid_len = 0; 675 675 676 - if (WARN_ON_ONCE(priv->scan_request && 677 - priv->scan_request->n_channels > MAX_SCAN_CHANNEL)) 676 + if (WARN_ON(priv->scan_type == IWL_SCAN_NORMAL && 677 + (!priv->scan_request || 678 + priv->scan_request->n_channels > MAX_SCAN_CHANNEL))) 678 679 return -EINVAL; 679 680 680 681 lockdep_assert_held(&priv->mutex); ··· 882 881 883 882 /* MIMO is not used here, but value is required */ 884 883 rx_chain |= 885 - priv->eeprom_data->valid_rx_ant << RXON_RX_CHAIN_VALID_POS; 884 + priv->nvm_data->valid_rx_ant << RXON_RX_CHAIN_VALID_POS; 886 885 rx_chain |= rx_ant << RXON_RX_CHAIN_FORCE_MIMO_SEL_POS; 887 886 rx_chain |= rx_ant << RXON_RX_CHAIN_FORCE_SEL_POS; 888 887 rx_chain |= 0x1 << RXON_RX_CHAIN_DRIVER_FORCE_POS; ··· 999 998 1000 999 void iwl_init_scan_params(struct iwl_priv *priv) 1001 1000 { 1002 - u8 ant_idx = fls(priv->eeprom_data->valid_tx_ant) - 1; 1001 + u8 ant_idx = fls(priv->nvm_data->valid_tx_ant) - 1; 1003 1002 if (!priv->scan_tx_ant[IEEE80211_BAND_5GHZ]) 1004 1003 priv->scan_tx_ant[IEEE80211_BAND_5GHZ] = ant_idx; 1005 1004 if (!priv->scan_tx_ant[IEEE80211_BAND_2GHZ])
+6 -6
drivers/net/wireless/iwlwifi/dvm/sta.c
··· 634 634 if (r >= IWL_FIRST_CCK_RATE && r <= IWL_LAST_CCK_RATE) 635 635 rate_flags |= RATE_MCS_CCK_MSK; 636 636 637 - rate_flags |= first_antenna(priv->eeprom_data->valid_tx_ant) << 637 + rate_flags |= first_antenna(priv->nvm_data->valid_tx_ant) << 638 638 RATE_MCS_ANT_POS; 639 639 rate_n_flags = iwl_hw_set_rate_n_flags(iwl_rates[r].plcp, rate_flags); 640 640 for (i = 0; i < LINK_QUAL_MAX_RETRY_NUM; i++) 641 641 link_cmd->rs_table[i].rate_n_flags = rate_n_flags; 642 642 643 643 link_cmd->general_params.single_stream_ant_msk = 644 - first_antenna(priv->eeprom_data->valid_tx_ant); 644 + first_antenna(priv->nvm_data->valid_tx_ant); 645 645 646 646 link_cmd->general_params.dual_stream_ant_msk = 647 - priv->eeprom_data->valid_tx_ant & 648 - ~first_antenna(priv->eeprom_data->valid_tx_ant); 647 + priv->nvm_data->valid_tx_ant & 648 + ~first_antenna(priv->nvm_data->valid_tx_ant); 649 649 if (!link_cmd->general_params.dual_stream_ant_msk) { 650 650 link_cmd->general_params.dual_stream_ant_msk = ANT_AB; 651 - } else if (num_of_ant(priv->eeprom_data->valid_tx_ant) == 2) { 651 + } else if (num_of_ant(priv->nvm_data->valid_tx_ant) == 2) { 652 652 link_cmd->general_params.dual_stream_ant_msk = 653 - priv->eeprom_data->valid_tx_ant; 653 + priv->nvm_data->valid_tx_ant; 654 654 } 655 655 656 656 link_cmd->agg_params.agg_dis_start_th =
+27 -40
drivers/net/wireless/iwlwifi/dvm/tx.c
··· 188 188 if (info->control.rates[0].flags & IEEE80211_TX_RC_MCS || 189 189 (rate_idx < 0) || (rate_idx > IWL_RATE_COUNT_LEGACY)) 190 190 rate_idx = rate_lowest_index( 191 - &priv->eeprom_data->bands[info->band], sta); 191 + &priv->nvm_data->bands[info->band], sta); 192 192 /* For 5 GHZ band, remap mac80211 rate indices into driver indices */ 193 193 if (info->band == IEEE80211_BAND_5GHZ) 194 194 rate_idx += IWL_FIRST_OFDM_RATE; ··· 207 207 priv->bt_full_concurrent) { 208 208 /* operated as 1x1 in full concurrency mode */ 209 209 priv->mgmt_tx_ant = iwl_toggle_tx_ant(priv, priv->mgmt_tx_ant, 210 - first_antenna(priv->eeprom_data->valid_tx_ant)); 210 + first_antenna(priv->nvm_data->valid_tx_ant)); 211 211 } else 212 212 priv->mgmt_tx_ant = iwl_toggle_tx_ant( 213 213 priv, priv->mgmt_tx_ant, 214 - priv->eeprom_data->valid_tx_ant); 214 + priv->nvm_data->valid_tx_ant); 215 215 rate_flags |= iwl_ant_idx_to_flags(priv->mgmt_tx_ant); 216 216 217 217 /* Set the rate in the TX cmd */ ··· 305 305 u8 hdr_len; 306 306 u16 len, seq_number = 0; 307 307 u8 sta_id, tid = IWL_MAX_TID_COUNT; 308 - bool is_agg = false; 308 + bool is_agg = false, is_data_qos = false; 309 309 int txq_id; 310 310 311 311 if (info->control.vif) ··· 378 378 iwl_sta_modify_sleep_tx_count(priv, sta_id, 1); 379 379 } 380 380 381 - if (info->flags & IEEE80211_TX_CTL_AMPDU) 382 - is_agg = true; 383 - 384 381 dev_cmd = iwl_trans_alloc_tx_cmd(priv->trans); 385 382 386 383 if (unlikely(!dev_cmd)) ··· 439 442 hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG); 440 443 hdr->seq_ctrl |= cpu_to_le16(seq_number); 441 444 seq_number += 0x10; 445 + 446 + if (info->flags & IEEE80211_TX_CTL_AMPDU) 447 + is_agg = true; 448 + is_data_qos = true; 442 449 } 443 450 444 451 /* Copy MAC header from skb into command buffer */ ··· 475 474 if (iwl_trans_tx(priv->trans, skb, dev_cmd, txq_id)) 476 475 goto drop_unlock_sta; 477 476 478 - if (ieee80211_is_data_qos(fc) && !ieee80211_is_qos_nullfunc(fc) && 479 - !ieee80211_has_morefrags(fc)) 477 + if (is_data_qos && !ieee80211_has_morefrags(fc)) 480 478 priv->tid_data[sta_id][tid].seq_number = seq_number; 481 479 482 480 spin_unlock(&priv->sta_lock); ··· 1097 1097 } 1098 1098 } 1099 1099 1100 - static int iwl_reclaim(struct iwl_priv *priv, int sta_id, int tid, 1101 - int txq_id, int ssn, struct sk_buff_head *skbs) 1102 - { 1103 - if (unlikely(txq_id >= IWLAGN_FIRST_AMPDU_QUEUE && 1104 - tid != IWL_TID_NON_QOS && 1105 - txq_id != priv->tid_data[sta_id][tid].agg.txq_id)) { 1106 - /* 1107 - * FIXME: this is a uCode bug which need to be addressed, 1108 - * log the information and return for now. 1109 - * Since it is can possibly happen very often and in order 1110 - * not to fill the syslog, don't use IWL_ERR or IWL_WARN 1111 - */ 1112 - IWL_DEBUG_TX_QUEUES(priv, 1113 - "Bad queue mapping txq_id=%d, agg_txq[sta:%d,tid:%d]=%d\n", 1114 - txq_id, sta_id, tid, 1115 - priv->tid_data[sta_id][tid].agg.txq_id); 1116 - return 1; 1117 - } 1118 - 1119 - iwl_trans_reclaim(priv->trans, txq_id, ssn, skbs); 1120 - return 0; 1121 - } 1122 - 1123 1100 int iwlagn_rx_reply_tx(struct iwl_priv *priv, struct iwl_rx_cmd_buffer *rxb, 1124 1101 struct iwl_device_cmd *cmd) 1125 1102 { ··· 1158 1181 next_reclaimed); 1159 1182 } 1160 1183 1161 - /*we can free until ssn % q.n_bd not inclusive */ 1162 - WARN_ON_ONCE(iwl_reclaim(priv, sta_id, tid, 1163 - txq_id, ssn, &skbs)); 1184 + iwl_trans_reclaim(priv->trans, txq_id, ssn, &skbs); 1185 + 1164 1186 iwlagn_check_ratid_empty(priv, sta_id, tid); 1165 1187 freed = 0; 1166 1188 ··· 1284 1308 return 0; 1285 1309 } 1286 1310 1311 + if (unlikely(scd_flow != agg->txq_id)) { 1312 + /* 1313 + * FIXME: this is a uCode bug which need to be addressed, 1314 + * log the information and return for now. 1315 + * Since it is can possibly happen very often and in order 1316 + * not to fill the syslog, don't use IWL_ERR or IWL_WARN 1317 + */ 1318 + IWL_DEBUG_TX_QUEUES(priv, 1319 + "Bad queue mapping txq_id=%d, agg_txq[sta:%d,tid:%d]=%d\n", 1320 + scd_flow, sta_id, tid, agg->txq_id); 1321 + spin_unlock(&priv->sta_lock); 1322 + return 0; 1323 + } 1324 + 1287 1325 __skb_queue_head_init(&reclaimed_skbs); 1288 1326 1289 1327 /* Release all TFDs before the SSN, i.e. all TFDs in front of 1290 1328 * block-ack window (we assume that they've been successfully 1291 1329 * transmitted ... if not, it's too late anyway). */ 1292 - if (iwl_reclaim(priv, sta_id, tid, scd_flow, 1293 - ba_resp_scd_ssn, &reclaimed_skbs)) { 1294 - spin_unlock(&priv->sta_lock); 1295 - return 0; 1296 - } 1330 + iwl_trans_reclaim(priv->trans, scd_flow, ba_resp_scd_ssn, 1331 + &reclaimed_skbs); 1297 1332 1298 1333 IWL_DEBUG_TX_REPLY(priv, "REPLY_COMPRESSED_BA [%d] Received from %pM, " 1299 1334 "sta_id = %d\n",
+6 -6
drivers/net/wireless/iwlwifi/dvm/ucode.c
··· 61 61 static int iwl_set_Xtal_calib(struct iwl_priv *priv) 62 62 { 63 63 struct iwl_calib_xtal_freq_cmd cmd; 64 - __le16 *xtal_calib = priv->eeprom_data->xtal_calib; 64 + __le16 *xtal_calib = priv->nvm_data->xtal_calib; 65 65 66 66 iwl_set_calib_hdr(&cmd.hdr, IWL_PHY_CALIBRATE_CRYSTAL_FRQ_CMD); 67 67 cmd.cap_pin1 = le16_to_cpu(xtal_calib[0]); ··· 75 75 76 76 memset(&cmd, 0, sizeof(cmd)); 77 77 iwl_set_calib_hdr(&cmd.hdr, IWL_PHY_CALIBRATE_TEMP_OFFSET_CMD); 78 - cmd.radio_sensor_offset = priv->eeprom_data->raw_temperature; 78 + cmd.radio_sensor_offset = priv->nvm_data->raw_temperature; 79 79 if (!(cmd.radio_sensor_offset)) 80 80 cmd.radio_sensor_offset = DEFAULT_RADIO_SENSOR_OFFSET; 81 81 ··· 90 90 91 91 memset(&cmd, 0, sizeof(cmd)); 92 92 iwl_set_calib_hdr(&cmd.hdr, IWL_PHY_CALIBRATE_TEMP_OFFSET_CMD); 93 - cmd.radio_sensor_offset_high = priv->eeprom_data->kelvin_temperature; 94 - cmd.radio_sensor_offset_low = priv->eeprom_data->raw_temperature; 93 + cmd.radio_sensor_offset_high = priv->nvm_data->kelvin_temperature; 94 + cmd.radio_sensor_offset_low = priv->nvm_data->raw_temperature; 95 95 if (!cmd.radio_sensor_offset_low) { 96 96 IWL_DEBUG_CALIB(priv, "no info in EEPROM, use default\n"); 97 97 cmd.radio_sensor_offset_low = DEFAULT_RADIO_SENSOR_OFFSET; 98 98 cmd.radio_sensor_offset_high = DEFAULT_RADIO_SENSOR_OFFSET; 99 99 } 100 - cmd.burntVoltageRef = priv->eeprom_data->calib_voltage; 100 + cmd.burntVoltageRef = priv->nvm_data->calib_voltage; 101 101 102 102 IWL_DEBUG_CALIB(priv, "Radio sensor offset high: %d\n", 103 103 le16_to_cpu(cmd.radio_sensor_offset_high)); ··· 257 257 iwl_trans_fw_alive(priv->trans, 0); 258 258 259 259 if (priv->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_PAN && 260 - priv->eeprom_data->sku & EEPROM_SKU_CAP_IPAN_ENABLE) { 260 + priv->nvm_data->sku_cap_ipan_enable) { 261 261 n_queues = ARRAY_SIZE(iwlagn_ipan_queue_to_tx_fifo); 262 262 queue_to_txf = iwlagn_ipan_queue_to_tx_fifo; 263 263 } else {
+4 -4
drivers/net/wireless/iwlwifi/iwl-config.h
··· 226 226 * @max_data_size: The maximal length of the fw data section 227 227 * @valid_tx_ant: valid transmit antenna 228 228 * @valid_rx_ant: valid receive antenna 229 - * @eeprom_ver: EEPROM version 230 - * @eeprom_calib_ver: EEPROM calibration version 229 + * @nvm_ver: NVM version 230 + * @nvm_calib_ver: NVM calibration version 231 231 * @lib: pointer to the lib ops 232 232 * @base_params: pointer to basic parameters 233 233 * @ht_params: point to ht patameters ··· 257 257 const u32 max_inst_size; 258 258 u8 valid_tx_ant; 259 259 u8 valid_rx_ant; 260 - u16 eeprom_ver; 261 - u16 eeprom_calib_ver; 260 + u16 nvm_ver; 261 + u16 nvm_calib_ver; 262 262 /* params not likely to change within a device family */ 263 263 const struct iwl_base_params *base_params; 264 264 /* params likely to change within a device family */
+34
drivers/net/wireless/iwlwifi/iwl-devtrace.h
··· 133 133 __get_str(dev), __entry->offs, __entry->val) 134 134 ); 135 135 136 + TRACE_EVENT(iwlwifi_dev_iowrite_prph32, 137 + TP_PROTO(const struct device *dev, u32 offs, u32 val), 138 + TP_ARGS(dev, offs, val), 139 + TP_STRUCT__entry( 140 + DEV_ENTRY 141 + __field(u32, offs) 142 + __field(u32, val) 143 + ), 144 + TP_fast_assign( 145 + DEV_ASSIGN; 146 + __entry->offs = offs; 147 + __entry->val = val; 148 + ), 149 + TP_printk("[%s] write PRPH[%#x] = %#x)", 150 + __get_str(dev), __entry->offs, __entry->val) 151 + ); 152 + 153 + TRACE_EVENT(iwlwifi_dev_ioread_prph32, 154 + TP_PROTO(const struct device *dev, u32 offs, u32 val), 155 + TP_ARGS(dev, offs, val), 156 + TP_STRUCT__entry( 157 + DEV_ENTRY 158 + __field(u32, offs) 159 + __field(u32, val) 160 + ), 161 + TP_fast_assign( 162 + DEV_ASSIGN; 163 + __entry->offs = offs; 164 + __entry->val = val; 165 + ), 166 + TP_printk("[%s] read PRPH[%#x] = %#x", 167 + __get_str(dev), __entry->offs, __entry->val) 168 + ); 169 + 136 170 TRACE_EVENT(iwlwifi_dev_irq, 137 171 TP_PROTO(const struct device *dev), 138 172 TP_ARGS(dev),
+3 -3
drivers/net/wireless/iwlwifi/iwl-drv.c
··· 1032 1032 1033 1033 if (!drv->dbgfs_drv) { 1034 1034 IWL_ERR(drv, "failed to create debugfs directory\n"); 1035 + ret = -ENOMEM; 1035 1036 goto err_free_drv; 1036 1037 } 1037 1038 ··· 1041 1040 1042 1041 if (!drv->trans->dbgfs_dir) { 1043 1042 IWL_ERR(drv, "failed to create transport debugfs directory\n"); 1043 + ret = -ENOMEM; 1044 1044 goto err_free_dbgfs; 1045 1045 } 1046 1046 #endif 1047 1047 1048 1048 ret = iwl_request_firmware(drv, true); 1049 - 1050 1049 if (ret) { 1051 1050 IWL_ERR(trans, "Couldn't request the fw\n"); 1052 1051 goto err_fw; ··· 1061 1060 err_free_drv: 1062 1061 #endif 1063 1062 kfree(drv); 1064 - drv = NULL; 1065 1063 1066 - return drv; 1064 + return ERR_PTR(ret); 1067 1065 } 1068 1066 1069 1067 void iwl_drv_stop(struct iwl_drv *drv)
+56 -28
drivers/net/wireless/iwlwifi/iwl-eeprom-parse.c
··· 116 116 #define EEPROM_KELVIN_TEMPERATURE ((2*0x12A) | EEPROM_CALIB_ALL) 117 117 #define EEPROM_RAW_TEMPERATURE ((2*0x12B) | EEPROM_CALIB_ALL) 118 118 119 + /* SKU Capabilities (actual values from EEPROM definition) */ 120 + enum eeprom_sku_bits { 121 + EEPROM_SKU_CAP_BAND_24GHZ = BIT(4), 122 + EEPROM_SKU_CAP_BAND_52GHZ = BIT(5), 123 + EEPROM_SKU_CAP_11N_ENABLE = BIT(6), 124 + EEPROM_SKU_CAP_AMT_ENABLE = BIT(7), 125 + EEPROM_SKU_CAP_IPAN_ENABLE = BIT(8) 126 + }; 127 + 128 + /* radio config bits (actual values from EEPROM definition) */ 129 + #define EEPROM_RF_CFG_TYPE_MSK(x) (x & 0x3) /* bits 0-1 */ 130 + #define EEPROM_RF_CFG_STEP_MSK(x) ((x >> 2) & 0x3) /* bits 2-3 */ 131 + #define EEPROM_RF_CFG_DASH_MSK(x) ((x >> 4) & 0x3) /* bits 4-5 */ 132 + #define EEPROM_RF_CFG_PNUM_MSK(x) ((x >> 6) & 0x3) /* bits 6-7 */ 133 + #define EEPROM_RF_CFG_TX_ANT_MSK(x) ((x >> 8) & 0xF) /* bits 8-11 */ 134 + #define EEPROM_RF_CFG_RX_ANT_MSK(x) ((x >> 12) & 0xF) /* bits 12-15 */ 135 + 136 + 119 137 /* 120 138 * EEPROM bands 121 139 * These are the channel numbers from each band in the order ··· 269 251 } 270 252 271 253 static int iwl_eeprom_read_calib(const u8 *eeprom, size_t eeprom_size, 272 - struct iwl_eeprom_data *data) 254 + struct iwl_nvm_data *data) 273 255 { 274 256 struct iwl_eeprom_calib_hdr *hdr; 275 257 ··· 348 330 s8 mimo3_max; 349 331 } __packed; 350 332 351 - static s8 iwl_get_max_txpwr_half_dbm(const struct iwl_eeprom_data *data, 333 + static s8 iwl_get_max_txpwr_half_dbm(const struct iwl_nvm_data *data, 352 334 struct iwl_eeprom_enhanced_txpwr *txp) 353 335 { 354 336 s8 result = 0; /* (.5 dBm) */ ··· 382 364 ((txp->flags & IWL_EEPROM_ENH_TXP_FL_##x) ? # x " " : "") 383 365 384 366 static void 385 - iwl_eeprom_enh_txp_read_element(struct iwl_eeprom_data *data, 367 + iwl_eeprom_enh_txp_read_element(struct iwl_nvm_data *data, 386 368 struct iwl_eeprom_enhanced_txpwr *txp, 387 369 int n_channels, s8 max_txpower_avg) 388 370 { ··· 410 392 } 411 393 412 394 static void iwl_eeprom_enhanced_txpower(struct device *dev, 413 - struct iwl_eeprom_data *data, 395 + struct iwl_nvm_data *data, 414 396 const u8 *eeprom, size_t eeprom_size, 415 397 int n_channels) 416 398 { ··· 522 504 ((eeprom_ch->flags & EEPROM_CHANNEL_##x) ? # x " " : "") 523 505 524 506 static void iwl_mod_ht40_chan_info(struct device *dev, 525 - struct iwl_eeprom_data *data, int n_channels, 507 + struct iwl_nvm_data *data, int n_channels, 526 508 enum ieee80211_band band, u16 channel, 527 509 const struct iwl_eeprom_channel *eeprom_ch, 528 510 u8 clear_ht40_extension_channel) ··· 565 547 ((eeprom_ch_info[ch_idx].flags & EEPROM_CHANNEL_##x) ? # x " " : "") 566 548 567 549 static int iwl_init_channel_map(struct device *dev, const struct iwl_cfg *cfg, 568 - struct iwl_eeprom_data *data, 550 + struct iwl_nvm_data *data, 569 551 const u8 *eeprom, size_t eeprom_size) 570 552 { 571 553 int band, ch_idx; ··· 703 685 return n_channels; 704 686 } 705 687 706 - static int iwl_init_sband_channels(struct iwl_eeprom_data *data, 688 + static int iwl_init_sband_channels(struct iwl_nvm_data *data, 707 689 struct ieee80211_supported_band *sband, 708 690 int n_channels, enum ieee80211_band band) 709 691 { ··· 729 711 #define MAX_BIT_RATE_20_MHZ 72 /* Mbps */ 730 712 731 713 static void iwl_init_ht_hw_capab(const struct iwl_cfg *cfg, 732 - struct iwl_eeprom_data *data, 714 + struct iwl_nvm_data *data, 733 715 struct ieee80211_sta_ht_cap *ht_info, 734 716 enum ieee80211_band band) 735 717 { ··· 743 725 else 744 726 rx_chains = hweight8(data->valid_rx_ant); 745 727 746 - if (!(data->sku & EEPROM_SKU_CAP_11N_ENABLE) || !cfg->ht_params) { 728 + if (!(data->sku_cap_11n_enable) || !cfg->ht_params) { 747 729 ht_info->ht_supported = false; 748 730 return; 749 731 } ··· 791 773 } 792 774 793 775 static void iwl_init_sbands(struct device *dev, const struct iwl_cfg *cfg, 794 - struct iwl_eeprom_data *data, 776 + struct iwl_nvm_data *data, 795 777 const u8 *eeprom, size_t eeprom_size) 796 778 { 797 779 int n_channels = iwl_init_channel_map(dev, cfg, data, ··· 822 804 823 805 /* EEPROM data functions */ 824 806 825 - struct iwl_eeprom_data * 807 + struct iwl_nvm_data * 826 808 iwl_parse_eeprom_data(struct device *dev, const struct iwl_cfg *cfg, 827 809 const u8 *eeprom, size_t eeprom_size) 828 810 { 829 - struct iwl_eeprom_data *data; 811 + struct iwl_nvm_data *data; 830 812 const void *tmp; 813 + u16 radio_cfg, sku; 831 814 832 815 if (WARN_ON(!cfg || !cfg->eeprom_params)) 833 816 return NULL; ··· 868 849 data->kelvin_temperature = *(__le16 *)tmp; 869 850 data->kelvin_voltage = *((__le16 *)tmp + 1); 870 851 871 - data->radio_cfg = iwl_eeprom_query16(eeprom, eeprom_size, 852 + radio_cfg = iwl_eeprom_query16(eeprom, eeprom_size, 872 853 EEPROM_RADIO_CONFIG); 873 - data->sku = iwl_eeprom_query16(eeprom, eeprom_size, 874 - EEPROM_SKU_CAP); 854 + data->radio_cfg_dash = EEPROM_RF_CFG_DASH_MSK(radio_cfg); 855 + data->radio_cfg_pnum = EEPROM_RF_CFG_PNUM_MSK(radio_cfg); 856 + data->radio_cfg_step = EEPROM_RF_CFG_STEP_MSK(radio_cfg); 857 + data->radio_cfg_type = EEPROM_RF_CFG_TYPE_MSK(radio_cfg); 858 + data->valid_rx_ant = EEPROM_RF_CFG_RX_ANT_MSK(radio_cfg); 859 + data->valid_tx_ant = EEPROM_RF_CFG_TX_ANT_MSK(radio_cfg); 860 + 861 + sku = iwl_eeprom_query16(eeprom, eeprom_size, 862 + EEPROM_SKU_CAP); 863 + data->sku_cap_11n_enable = sku & EEPROM_SKU_CAP_11N_ENABLE; 864 + data->sku_cap_amt_enable = sku & EEPROM_SKU_CAP_AMT_ENABLE; 865 + data->sku_cap_band_24GHz_enable = sku & EEPROM_SKU_CAP_BAND_24GHZ; 866 + data->sku_cap_band_52GHz_enable = sku & EEPROM_SKU_CAP_BAND_52GHZ; 867 + data->sku_cap_ipan_enable = sku & EEPROM_SKU_CAP_IPAN_ENABLE; 875 868 if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_ALL) 876 - data->sku &= ~EEPROM_SKU_CAP_11N_ENABLE; 869 + data->sku_cap_11n_enable = false; 877 870 878 - data->eeprom_version = iwl_eeprom_query16(eeprom, eeprom_size, 879 - EEPROM_VERSION); 880 - 881 - data->valid_tx_ant = EEPROM_RF_CFG_TX_ANT_MSK(data->radio_cfg); 882 - data->valid_rx_ant = EEPROM_RF_CFG_RX_ANT_MSK(data->radio_cfg); 871 + data->nvm_version = iwl_eeprom_query16(eeprom, eeprom_size, 872 + EEPROM_VERSION); 883 873 884 874 /* check overrides (some devices have wrong EEPROM) */ 885 875 if (cfg->valid_tx_ant) ··· 912 884 EXPORT_SYMBOL_GPL(iwl_parse_eeprom_data); 913 885 914 886 /* helper functions */ 915 - int iwl_eeprom_check_version(struct iwl_eeprom_data *data, 887 + int iwl_nvm_check_version(struct iwl_nvm_data *data, 916 888 struct iwl_trans *trans) 917 889 { 918 - if (data->eeprom_version >= trans->cfg->eeprom_ver || 919 - data->calib_version >= trans->cfg->eeprom_calib_ver) { 890 + if (data->nvm_version >= trans->cfg->nvm_ver || 891 + data->calib_version >= trans->cfg->nvm_calib_ver) { 920 892 IWL_DEBUG_INFO(trans, "device EEPROM VER=0x%x, CALIB=0x%x\n", 921 - data->eeprom_version, data->calib_version); 893 + data->nvm_version, data->calib_version); 922 894 return 0; 923 895 } 924 896 925 897 IWL_ERR(trans, 926 898 "Unsupported (too old) EEPROM VER=0x%x < 0x%x CALIB=0x%x < 0x%x\n", 927 - data->eeprom_version, trans->cfg->eeprom_ver, 928 - data->calib_version, trans->cfg->eeprom_calib_ver); 899 + data->nvm_version, trans->cfg->nvm_ver, 900 + data->calib_version, trans->cfg->nvm_calib_ver); 929 901 return -EINVAL; 930 902 } 931 - EXPORT_SYMBOL_GPL(iwl_eeprom_check_version); 903 + EXPORT_SYMBOL_GPL(iwl_nvm_check_version);
+19 -26
drivers/net/wireless/iwlwifi/iwl-eeprom-parse.h
··· 66 66 #include <linux/if_ether.h> 67 67 #include "iwl-trans.h" 68 68 69 - /* SKU Capabilities (actual values from EEPROM definition) */ 70 - #define EEPROM_SKU_CAP_BAND_24GHZ (1 << 4) 71 - #define EEPROM_SKU_CAP_BAND_52GHZ (1 << 5) 72 - #define EEPROM_SKU_CAP_11N_ENABLE (1 << 6) 73 - #define EEPROM_SKU_CAP_AMT_ENABLE (1 << 7) 74 - #define EEPROM_SKU_CAP_IPAN_ENABLE (1 << 8) 75 - 76 - /* radio config bits (actual values from EEPROM definition) */ 77 - #define EEPROM_RF_CFG_TYPE_MSK(x) (x & 0x3) /* bits 0-1 */ 78 - #define EEPROM_RF_CFG_STEP_MSK(x) ((x >> 2) & 0x3) /* bits 2-3 */ 79 - #define EEPROM_RF_CFG_DASH_MSK(x) ((x >> 4) & 0x3) /* bits 4-5 */ 80 - #define EEPROM_RF_CFG_PNUM_MSK(x) ((x >> 6) & 0x3) /* bits 6-7 */ 81 - #define EEPROM_RF_CFG_TX_ANT_MSK(x) ((x >> 8) & 0xF) /* bits 8-11 */ 82 - #define EEPROM_RF_CFG_RX_ANT_MSK(x) ((x >> 12) & 0xF) /* bits 12-15 */ 83 - 84 - struct iwl_eeprom_data { 69 + struct iwl_nvm_data { 85 70 int n_hw_addrs; 86 71 u8 hw_addr[ETH_ALEN]; 87 72 ··· 78 93 __le16 kelvin_voltage; 79 94 __le16 xtal_calib[2]; 80 95 81 - u16 sku; 82 - u16 radio_cfg; 83 - u16 eeprom_version; 84 - s8 max_tx_pwr_half_dbm; 96 + bool sku_cap_band_24GHz_enable; 97 + bool sku_cap_band_52GHz_enable; 98 + bool sku_cap_11n_enable; 99 + bool sku_cap_amt_enable; 100 + bool sku_cap_ipan_enable; 85 101 102 + u8 radio_cfg_type; 103 + u8 radio_cfg_step; 104 + u8 radio_cfg_dash; 105 + u8 radio_cfg_pnum; 86 106 u8 valid_tx_ant, valid_rx_ant; 107 + 108 + u16 nvm_version; 109 + s8 max_tx_pwr_half_dbm; 87 110 88 111 struct ieee80211_supported_band bands[IEEE80211_NUM_BANDS]; 89 112 struct ieee80211_channel channels[]; ··· 108 115 * This function parses all EEPROM values we need and then 109 116 * returns a (newly allocated) struct containing all the 110 117 * relevant values for driver use. The struct must be freed 111 - * later with iwl_free_eeprom_data(). 118 + * later with iwl_free_nvm_data(). 112 119 */ 113 - struct iwl_eeprom_data * 120 + struct iwl_nvm_data * 114 121 iwl_parse_eeprom_data(struct device *dev, const struct iwl_cfg *cfg, 115 122 const u8 *eeprom, size_t eeprom_size); 116 123 117 124 /** 118 - * iwl_free_eeprom_data - free EEPROM data 125 + * iwl_free_nvm_data - free NVM data 119 126 * @data: the data to free 120 127 */ 121 - static inline void iwl_free_eeprom_data(struct iwl_eeprom_data *data) 128 + static inline void iwl_free_nvm_data(struct iwl_nvm_data *data) 122 129 { 123 130 kfree(data); 124 131 } 125 132 126 - int iwl_eeprom_check_version(struct iwl_eeprom_data *data, 127 - struct iwl_trans *trans); 133 + int iwl_nvm_check_version(struct iwl_nvm_data *data, 134 + struct iwl_trans *trans); 128 135 129 136 #endif /* __iwl_eeprom_parse_h__ */
+20 -20
drivers/net/wireless/iwlwifi/iwl-io.c
··· 214 214 } 215 215 EXPORT_SYMBOL_GPL(iwl_poll_direct_bit); 216 216 217 - static inline u32 __iwl_read_prph(struct iwl_trans *trans, u32 reg) 217 + static inline u32 __iwl_read_prph(struct iwl_trans *trans, u32 ofs) 218 218 { 219 - iwl_write32(trans, HBUS_TARG_PRPH_RADDR, reg | (3 << 24)); 220 - return iwl_read32(trans, HBUS_TARG_PRPH_RDAT); 219 + u32 val = iwl_trans_read_prph(trans, ofs); 220 + trace_iwlwifi_dev_ioread_prph32(trans->dev, ofs, val); 221 + return val; 221 222 } 222 223 223 - static inline void __iwl_write_prph(struct iwl_trans *trans, u32 addr, u32 val) 224 + static inline void __iwl_write_prph(struct iwl_trans *trans, u32 ofs, u32 val) 224 225 { 225 - iwl_write32(trans, HBUS_TARG_PRPH_WADDR, 226 - ((addr & 0x0000FFFF) | (3 << 24))); 227 - iwl_write32(trans, HBUS_TARG_PRPH_WDAT, val); 226 + trace_iwlwifi_dev_iowrite_prph32(trans->dev, ofs, val); 227 + iwl_trans_write_prph(trans, ofs, val); 228 228 } 229 229 230 - u32 iwl_read_prph(struct iwl_trans *trans, u32 reg) 230 + u32 iwl_read_prph(struct iwl_trans *trans, u32 ofs) 231 231 { 232 232 unsigned long flags; 233 233 u32 val; 234 234 235 235 spin_lock_irqsave(&trans->reg_lock, flags); 236 236 iwl_grab_nic_access(trans); 237 - val = __iwl_read_prph(trans, reg); 237 + val = __iwl_read_prph(trans, ofs); 238 238 iwl_release_nic_access(trans); 239 239 spin_unlock_irqrestore(&trans->reg_lock, flags); 240 240 return val; 241 241 } 242 242 EXPORT_SYMBOL_GPL(iwl_read_prph); 243 243 244 - void iwl_write_prph(struct iwl_trans *trans, u32 addr, u32 val) 244 + void iwl_write_prph(struct iwl_trans *trans, u32 ofs, u32 val) 245 245 { 246 246 unsigned long flags; 247 247 248 248 spin_lock_irqsave(&trans->reg_lock, flags); 249 249 if (likely(iwl_grab_nic_access(trans))) { 250 - __iwl_write_prph(trans, addr, val); 250 + __iwl_write_prph(trans, ofs, val); 251 251 iwl_release_nic_access(trans); 252 252 } 253 253 spin_unlock_irqrestore(&trans->reg_lock, flags); 254 254 } 255 255 EXPORT_SYMBOL_GPL(iwl_write_prph); 256 256 257 - void iwl_set_bits_prph(struct iwl_trans *trans, u32 reg, u32 mask) 257 + void iwl_set_bits_prph(struct iwl_trans *trans, u32 ofs, u32 mask) 258 258 { 259 259 unsigned long flags; 260 260 261 261 spin_lock_irqsave(&trans->reg_lock, flags); 262 262 if (likely(iwl_grab_nic_access(trans))) { 263 - __iwl_write_prph(trans, reg, 264 - __iwl_read_prph(trans, reg) | mask); 263 + __iwl_write_prph(trans, ofs, 264 + __iwl_read_prph(trans, ofs) | mask); 265 265 iwl_release_nic_access(trans); 266 266 } 267 267 spin_unlock_irqrestore(&trans->reg_lock, flags); 268 268 } 269 269 EXPORT_SYMBOL_GPL(iwl_set_bits_prph); 270 270 271 - void iwl_set_bits_mask_prph(struct iwl_trans *trans, u32 reg, 271 + void iwl_set_bits_mask_prph(struct iwl_trans *trans, u32 ofs, 272 272 u32 bits, u32 mask) 273 273 { 274 274 unsigned long flags; 275 275 276 276 spin_lock_irqsave(&trans->reg_lock, flags); 277 277 if (likely(iwl_grab_nic_access(trans))) { 278 - __iwl_write_prph(trans, reg, 279 - (__iwl_read_prph(trans, reg) & mask) | bits); 278 + __iwl_write_prph(trans, ofs, 279 + (__iwl_read_prph(trans, ofs) & mask) | bits); 280 280 iwl_release_nic_access(trans); 281 281 } 282 282 spin_unlock_irqrestore(&trans->reg_lock, flags); 283 283 } 284 284 EXPORT_SYMBOL_GPL(iwl_set_bits_mask_prph); 285 285 286 - void iwl_clear_bits_prph(struct iwl_trans *trans, u32 reg, u32 mask) 286 + void iwl_clear_bits_prph(struct iwl_trans *trans, u32 ofs, u32 mask) 287 287 { 288 288 unsigned long flags; 289 289 u32 val; 290 290 291 291 spin_lock_irqsave(&trans->reg_lock, flags); 292 292 if (likely(iwl_grab_nic_access(trans))) { 293 - val = __iwl_read_prph(trans, reg); 294 - __iwl_write_prph(trans, reg, (val & ~mask)); 293 + val = __iwl_read_prph(trans, ofs); 294 + __iwl_write_prph(trans, ofs, (val & ~mask)); 295 295 iwl_release_nic_access(trans); 296 296 } 297 297 spin_unlock_irqrestore(&trans->reg_lock, flags);
+5 -5
drivers/net/wireless/iwlwifi/iwl-io.h
··· 69 69 void iwl_write_direct32(struct iwl_trans *trans, u32 reg, u32 value); 70 70 71 71 72 - u32 iwl_read_prph(struct iwl_trans *trans, u32 reg); 73 - void iwl_write_prph(struct iwl_trans *trans, u32 addr, u32 val); 74 - void iwl_set_bits_prph(struct iwl_trans *trans, u32 reg, u32 mask); 75 - void iwl_set_bits_mask_prph(struct iwl_trans *trans, u32 reg, 72 + u32 iwl_read_prph(struct iwl_trans *trans, u32 ofs); 73 + void iwl_write_prph(struct iwl_trans *trans, u32 ofs, u32 val); 74 + void iwl_set_bits_prph(struct iwl_trans *trans, u32 ofs, u32 mask); 75 + void iwl_set_bits_mask_prph(struct iwl_trans *trans, u32 ofs, 76 76 u32 bits, u32 mask); 77 - void iwl_clear_bits_prph(struct iwl_trans *trans, u32 reg, u32 mask); 77 + void iwl_clear_bits_prph(struct iwl_trans *trans, u32 ofs, u32 mask); 78 78 79 79 void _iwl_read_targ_mem_dwords(struct iwl_trans *trans, u32 addr, 80 80 void *buf, int dwords);
+18 -4
drivers/net/wireless/iwlwifi/iwl-trans.h
··· 385 385 * @write8: write a u8 to a register at offset ofs from the BAR 386 386 * @write32: write a u32 to a register at offset ofs from the BAR 387 387 * @read32: read a u32 register at offset ofs from the BAR 388 + * @read_prph: read a DWORD from a periphery register 389 + * @write_prph: write a DWORD to a periphery register 388 390 * @configure: configure parameters required by the transport layer from 389 391 * the op_mode. May be called several times before start_fw, can't be 390 392 * called after that. ··· 422 420 void (*write8)(struct iwl_trans *trans, u32 ofs, u8 val); 423 421 void (*write32)(struct iwl_trans *trans, u32 ofs, u32 val); 424 422 u32 (*read32)(struct iwl_trans *trans, u32 ofs); 423 + u32 (*read_prph)(struct iwl_trans *trans, u32 ofs); 424 + void (*write_prph)(struct iwl_trans *trans, u32 ofs, u32 val); 425 425 void (*configure)(struct iwl_trans *trans, 426 426 const struct iwl_trans_config *trans_cfg); 427 427 void (*set_pmi)(struct iwl_trans *trans, bool state); ··· 493 489 static inline void iwl_trans_configure(struct iwl_trans *trans, 494 490 const struct iwl_trans_config *trans_cfg) 495 491 { 496 - /* 497 - * only set the op_mode for the moment. Later on, this function will do 498 - * more 499 - */ 500 492 trans->op_mode = trans_cfg->op_mode; 501 493 502 494 trans->ops->configure(trans, trans_cfg); ··· 511 511 might_sleep(); 512 512 513 513 trans->ops->stop_hw(trans, op_mode_leaving); 514 + 515 + if (op_mode_leaving) 516 + trans->op_mode = NULL; 514 517 515 518 trans->state = IWL_TRANS_NO_FW; 516 519 } ··· 666 663 static inline u32 iwl_trans_read32(struct iwl_trans *trans, u32 ofs) 667 664 { 668 665 return trans->ops->read32(trans, ofs); 666 + } 667 + 668 + static inline u32 iwl_trans_read_prph(struct iwl_trans *trans, u32 ofs) 669 + { 670 + return trans->ops->read_prph(trans, ofs); 671 + } 672 + 673 + static inline void iwl_trans_write_prph(struct iwl_trans *trans, u32 ofs, 674 + u32 val) 675 + { 676 + return trans->ops->write_prph(trans, ofs, val); 669 677 } 670 678 671 679 static inline void iwl_trans_set_pmi(struct iwl_trans *trans, bool state)
+4 -4
drivers/net/wireless/iwlwifi/pcie/1000.c
··· 94 94 .device_family = IWL_DEVICE_FAMILY_1000, \ 95 95 .max_inst_size = IWLAGN_RTC_INST_SIZE, \ 96 96 .max_data_size = IWLAGN_RTC_DATA_SIZE, \ 97 - .eeprom_ver = EEPROM_1000_EEPROM_VERSION, \ 98 - .eeprom_calib_ver = EEPROM_1000_TX_POWER_VERSION, \ 97 + .nvm_ver = EEPROM_1000_EEPROM_VERSION, \ 98 + .nvm_calib_ver = EEPROM_1000_TX_POWER_VERSION, \ 99 99 .base_params = &iwl1000_base_params, \ 100 100 .eeprom_params = &iwl1000_eeprom_params, \ 101 101 .led_mode = IWL_LED_BLINK ··· 119 119 .device_family = IWL_DEVICE_FAMILY_100, \ 120 120 .max_inst_size = IWLAGN_RTC_INST_SIZE, \ 121 121 .max_data_size = IWLAGN_RTC_DATA_SIZE, \ 122 - .eeprom_ver = EEPROM_1000_EEPROM_VERSION, \ 123 - .eeprom_calib_ver = EEPROM_1000_TX_POWER_VERSION, \ 122 + .nvm_ver = EEPROM_1000_EEPROM_VERSION, \ 123 + .nvm_calib_ver = EEPROM_1000_TX_POWER_VERSION, \ 124 124 .base_params = &iwl1000_base_params, \ 125 125 .eeprom_params = &iwl1000_eeprom_params, \ 126 126 .led_mode = IWL_LED_RF_STATE, \
+8 -8
drivers/net/wireless/iwlwifi/pcie/2000.c
··· 138 138 .device_family = IWL_DEVICE_FAMILY_2000, \ 139 139 .max_inst_size = IWL60_RTC_INST_SIZE, \ 140 140 .max_data_size = IWL60_RTC_DATA_SIZE, \ 141 - .eeprom_ver = EEPROM_2000_EEPROM_VERSION, \ 142 - .eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION, \ 141 + .nvm_ver = EEPROM_2000_EEPROM_VERSION, \ 142 + .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \ 143 143 .base_params = &iwl2000_base_params, \ 144 144 .eeprom_params = &iwl20x0_eeprom_params, \ 145 145 .need_temp_offset_calib = true, \ ··· 166 166 .device_family = IWL_DEVICE_FAMILY_2030, \ 167 167 .max_inst_size = IWL60_RTC_INST_SIZE, \ 168 168 .max_data_size = IWL60_RTC_DATA_SIZE, \ 169 - .eeprom_ver = EEPROM_2000_EEPROM_VERSION, \ 170 - .eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION, \ 169 + .nvm_ver = EEPROM_2000_EEPROM_VERSION, \ 170 + .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \ 171 171 .base_params = &iwl2030_base_params, \ 172 172 .bt_params = &iwl2030_bt_params, \ 173 173 .eeprom_params = &iwl20x0_eeprom_params, \ ··· 190 190 .device_family = IWL_DEVICE_FAMILY_105, \ 191 191 .max_inst_size = IWL60_RTC_INST_SIZE, \ 192 192 .max_data_size = IWL60_RTC_DATA_SIZE, \ 193 - .eeprom_ver = EEPROM_2000_EEPROM_VERSION, \ 194 - .eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION, \ 193 + .nvm_ver = EEPROM_2000_EEPROM_VERSION, \ 194 + .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \ 195 195 .base_params = &iwl2000_base_params, \ 196 196 .eeprom_params = &iwl20x0_eeprom_params, \ 197 197 .need_temp_offset_calib = true, \ ··· 220 220 .device_family = IWL_DEVICE_FAMILY_135, \ 221 221 .max_inst_size = IWL60_RTC_INST_SIZE, \ 222 222 .max_data_size = IWL60_RTC_DATA_SIZE, \ 223 - .eeprom_ver = EEPROM_2000_EEPROM_VERSION, \ 224 - .eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION, \ 223 + .nvm_ver = EEPROM_2000_EEPROM_VERSION, \ 224 + .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \ 225 225 .base_params = &iwl2030_base_params, \ 226 226 .bt_params = &iwl2030_bt_params, \ 227 227 .eeprom_params = &iwl20x0_eeprom_params, \
+6 -6
drivers/net/wireless/iwlwifi/pcie/5000.c
··· 92 92 .device_family = IWL_DEVICE_FAMILY_5000, \ 93 93 .max_inst_size = IWLAGN_RTC_INST_SIZE, \ 94 94 .max_data_size = IWLAGN_RTC_DATA_SIZE, \ 95 - .eeprom_ver = EEPROM_5000_EEPROM_VERSION, \ 96 - .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, \ 95 + .nvm_ver = EEPROM_5000_EEPROM_VERSION, \ 96 + .nvm_calib_ver = EEPROM_5000_TX_POWER_VERSION, \ 97 97 .base_params = &iwl5000_base_params, \ 98 98 .eeprom_params = &iwl5000_eeprom_params, \ 99 99 .led_mode = IWL_LED_BLINK ··· 139 139 .device_family = IWL_DEVICE_FAMILY_5000, 140 140 .max_inst_size = IWLAGN_RTC_INST_SIZE, 141 141 .max_data_size = IWLAGN_RTC_DATA_SIZE, 142 - .eeprom_ver = EEPROM_5050_EEPROM_VERSION, 143 - .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION, 142 + .nvm_ver = EEPROM_5050_EEPROM_VERSION, 143 + .nvm_calib_ver = EEPROM_5050_TX_POWER_VERSION, 144 144 .base_params = &iwl5000_base_params, 145 145 .eeprom_params = &iwl5000_eeprom_params, 146 146 .ht_params = &iwl5000_ht_params, ··· 156 156 .device_family = IWL_DEVICE_FAMILY_5150, \ 157 157 .max_inst_size = IWLAGN_RTC_INST_SIZE, \ 158 158 .max_data_size = IWLAGN_RTC_DATA_SIZE, \ 159 - .eeprom_ver = EEPROM_5050_EEPROM_VERSION, \ 160 - .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION, \ 159 + .nvm_ver = EEPROM_5050_EEPROM_VERSION, \ 160 + .nvm_calib_ver = EEPROM_5050_TX_POWER_VERSION, \ 161 161 .base_params = &iwl5000_base_params, \ 162 162 .eeprom_params = &iwl5000_eeprom_params, \ 163 163 .no_xtal_calib = true, \
+14 -14
drivers/net/wireless/iwlwifi/pcie/6000.c
··· 160 160 .device_family = IWL_DEVICE_FAMILY_6005, \ 161 161 .max_inst_size = IWL60_RTC_INST_SIZE, \ 162 162 .max_data_size = IWL60_RTC_DATA_SIZE, \ 163 - .eeprom_ver = EEPROM_6005_EEPROM_VERSION, \ 164 - .eeprom_calib_ver = EEPROM_6005_TX_POWER_VERSION, \ 163 + .nvm_ver = EEPROM_6005_EEPROM_VERSION, \ 164 + .nvm_calib_ver = EEPROM_6005_TX_POWER_VERSION, \ 165 165 .base_params = &iwl6000_g2_base_params, \ 166 166 .eeprom_params = &iwl6000_eeprom_params, \ 167 167 .need_temp_offset_calib = true, \ ··· 215 215 .device_family = IWL_DEVICE_FAMILY_6030, \ 216 216 .max_inst_size = IWL60_RTC_INST_SIZE, \ 217 217 .max_data_size = IWL60_RTC_DATA_SIZE, \ 218 - .eeprom_ver = EEPROM_6030_EEPROM_VERSION, \ 219 - .eeprom_calib_ver = EEPROM_6030_TX_POWER_VERSION, \ 218 + .nvm_ver = EEPROM_6030_EEPROM_VERSION, \ 219 + .nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION, \ 220 220 .base_params = &iwl6000_g2_base_params, \ 221 221 .bt_params = &iwl6000_bt_params, \ 222 222 .eeprom_params = &iwl6000_eeprom_params, \ ··· 254 254 .device_family = IWL_DEVICE_FAMILY_6030, \ 255 255 .max_inst_size = IWL60_RTC_INST_SIZE, \ 256 256 .max_data_size = IWL60_RTC_DATA_SIZE, \ 257 - .eeprom_ver = EEPROM_6030_EEPROM_VERSION, \ 258 - .eeprom_calib_ver = EEPROM_6030_TX_POWER_VERSION, \ 257 + .nvm_ver = EEPROM_6030_EEPROM_VERSION, \ 258 + .nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION, \ 259 259 .base_params = &iwl6000_g2_base_params, \ 260 260 .bt_params = &iwl6000_bt_params, \ 261 261 .eeprom_params = &iwl6000_eeprom_params, \ ··· 306 306 .max_data_size = IWL60_RTC_DATA_SIZE, \ 307 307 .valid_tx_ant = ANT_BC, /* .cfg overwrite */ \ 308 308 .valid_rx_ant = ANT_BC, /* .cfg overwrite */ \ 309 - .eeprom_ver = EEPROM_6000_EEPROM_VERSION, \ 310 - .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION, \ 309 + .nvm_ver = EEPROM_6000_EEPROM_VERSION, \ 310 + .nvm_calib_ver = EEPROM_6000_TX_POWER_VERSION, \ 311 311 .base_params = &iwl6000_base_params, \ 312 312 .eeprom_params = &iwl6000_eeprom_params, \ 313 313 .led_mode = IWL_LED_BLINK ··· 337 337 .max_data_size = IWL60_RTC_DATA_SIZE, \ 338 338 .valid_tx_ant = ANT_AB, /* .cfg overwrite */ \ 339 339 .valid_rx_ant = ANT_AB, /* .cfg overwrite */ \ 340 - .eeprom_ver = EEPROM_6050_EEPROM_VERSION, \ 341 - .eeprom_calib_ver = EEPROM_6050_TX_POWER_VERSION, \ 340 + .nvm_ver = EEPROM_6050_EEPROM_VERSION, \ 341 + .nvm_calib_ver = EEPROM_6050_TX_POWER_VERSION, \ 342 342 .base_params = &iwl6050_base_params, \ 343 343 .eeprom_params = &iwl6000_eeprom_params, \ 344 344 .led_mode = IWL_LED_BLINK, \ ··· 362 362 .device_family = IWL_DEVICE_FAMILY_6150, \ 363 363 .max_inst_size = IWL60_RTC_INST_SIZE, \ 364 364 .max_data_size = IWL60_RTC_DATA_SIZE, \ 365 - .eeprom_ver = EEPROM_6150_EEPROM_VERSION, \ 366 - .eeprom_calib_ver = EEPROM_6150_TX_POWER_VERSION, \ 365 + .nvm_ver = EEPROM_6150_EEPROM_VERSION, \ 366 + .nvm_calib_ver = EEPROM_6150_TX_POWER_VERSION, \ 367 367 .base_params = &iwl6050_base_params, \ 368 368 .eeprom_params = &iwl6000_eeprom_params, \ 369 369 .led_mode = IWL_LED_BLINK, \ ··· 389 389 .device_family = IWL_DEVICE_FAMILY_6000, 390 390 .max_inst_size = IWL60_RTC_INST_SIZE, 391 391 .max_data_size = IWL60_RTC_DATA_SIZE, 392 - .eeprom_ver = EEPROM_6000_EEPROM_VERSION, 393 - .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION, 392 + .nvm_ver = EEPROM_6000_EEPROM_VERSION, 393 + .nvm_calib_ver = EEPROM_6000_TX_POWER_VERSION, 394 394 .base_params = &iwl6000_base_params, 395 395 .eeprom_params = &iwl6000_eeprom_params, 396 396 .ht_params = &iwl6000_ht_params,
+8 -3
drivers/net/wireless/iwlwifi/pcie/drv.c
··· 267 267 const struct iwl_cfg *cfg = (struct iwl_cfg *)(ent->driver_data); 268 268 struct iwl_trans *iwl_trans; 269 269 struct iwl_trans_pcie *trans_pcie; 270 + int ret; 270 271 271 272 iwl_trans = iwl_trans_pcie_alloc(pdev, ent, cfg); 272 273 if (iwl_trans == NULL) ··· 277 276 278 277 trans_pcie = IWL_TRANS_GET_PCIE_TRANS(iwl_trans); 279 278 trans_pcie->drv = iwl_drv_start(iwl_trans, cfg); 280 - if (!trans_pcie->drv) 279 + 280 + if (IS_ERR_OR_NULL(trans_pcie->drv)) { 281 + ret = PTR_ERR(trans_pcie->drv); 281 282 goto out_free_trans; 283 + } 282 284 283 285 /* register transport layer debugfs here */ 284 - if (iwl_trans_dbgfs_register(iwl_trans, iwl_trans->dbgfs_dir)) 286 + ret = iwl_trans_dbgfs_register(iwl_trans, iwl_trans->dbgfs_dir); 287 + if (ret) 285 288 goto out_free_drv; 286 289 287 290 return 0; ··· 295 290 out_free_trans: 296 291 iwl_trans_pcie_free(iwl_trans); 297 292 pci_set_drvdata(pdev, NULL); 298 - return -EFAULT; 293 + return ret; 299 294 } 300 295 301 296 static void iwl_pci_remove(struct pci_dev *pdev)
+11 -3
drivers/net/wireless/iwlwifi/pcie/rx.c
··· 717 717 718 718 /* uCode's read index (stored in shared DRAM) indicates the last Rx 719 719 * buffer that the driver may process (last buffer filled by ucode). */ 720 - r = le16_to_cpu(rxq->rb_stts->closed_rb_num) & 0x0FFF; 720 + r = le16_to_cpu(ACCESS_ONCE(rxq->rb_stts->closed_rb_num)) & 0x0FFF; 721 721 i = rxq->read; 722 722 723 723 /* Rx interrupt, but nothing sent from uCode */ ··· 1122 1122 * back-to-back ISRs and sporadic interrupts from our NIC. 1123 1123 * If we have something to service, the tasklet will re-enable ints. 1124 1124 * If we *don't* have something, we'll re-enable before leaving here. */ 1125 - inta_mask = iwl_read32(trans, CSR_INT_MASK); /* just for debug */ 1125 + inta_mask = iwl_read32(trans, CSR_INT_MASK); 1126 1126 iwl_write32(trans, CSR_INT_MASK, 0x00000000); 1127 1127 1128 1128 /* Discover which interrupts are active/pending */ 1129 1129 inta = iwl_read32(trans, CSR_INT); 1130 + 1131 + if (inta & (~inta_mask)) { 1132 + IWL_DEBUG_ISR(trans, 1133 + "We got a masked interrupt (0x%08x)...Ack and ignore\n", 1134 + inta & (~inta_mask)); 1135 + iwl_write32(trans, CSR_INT, inta & (~inta_mask)); 1136 + inta &= inta_mask; 1137 + } 1130 1138 1131 1139 /* Ignore interrupt if there's nothing in NIC to service. 1132 1140 * This may be due to IRQ shared with another device, ··· 1217 1209 * If we have something to service, the tasklet will re-enable ints. 1218 1210 * If we *don't* have something, we'll re-enable before leaving here. 1219 1211 */ 1220 - inta_mask = iwl_read32(trans, CSR_INT_MASK); /* just for debug */ 1212 + inta_mask = iwl_read32(trans, CSR_INT_MASK); 1221 1213 iwl_write32(trans, CSR_INT_MASK, 0x00000000); 1222 1214 1223 1215 /* Ignore interrupt if there's nothing in NIC to service.
+18
drivers/net/wireless/iwlwifi/pcie/trans.c
··· 633 633 iwl_disable_interrupts(trans); 634 634 spin_unlock_irqrestore(&trans_pcie->irq_lock, flags); 635 635 636 + iwl_pcie_disable_ict(trans); 637 + 636 638 if (!op_mode_leaving) { 637 639 /* 638 640 * Even if we stop the HW, we still want the RF kill ··· 666 664 static u32 iwl_trans_pcie_read32(struct iwl_trans *trans, u32 ofs) 667 665 { 668 666 return readl(IWL_TRANS_GET_PCIE_TRANS(trans)->hw_base + ofs); 667 + } 668 + 669 + static u32 iwl_trans_pcie_read_prph(struct iwl_trans *trans, u32 reg) 670 + { 671 + iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_RADDR, reg | (3 << 24)); 672 + return iwl_trans_pcie_read32(trans, HBUS_TARG_PRPH_RDAT); 673 + } 674 + 675 + static void iwl_trans_pcie_write_prph(struct iwl_trans *trans, u32 addr, 676 + u32 val) 677 + { 678 + iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_WADDR, 679 + ((addr & 0x0000FFFF) | (3 << 24))); 680 + iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_WDAT, val); 669 681 } 670 682 671 683 static void iwl_trans_pcie_configure(struct iwl_trans *trans, ··· 1237 1221 .write8 = iwl_trans_pcie_write8, 1238 1222 .write32 = iwl_trans_pcie_write32, 1239 1223 .read32 = iwl_trans_pcie_read32, 1224 + .read_prph = iwl_trans_pcie_read_prph, 1225 + .write_prph = iwl_trans_pcie_write_prph, 1240 1226 .configure = iwl_trans_pcie_configure, 1241 1227 .set_pmi = iwl_trans_pcie_set_pmi, 1242 1228 };
+1 -1
drivers/net/wireless/mac80211_hwsim.c
··· 2223 2223 IEEE80211_VHT_CAP_RXSTBC_2 | 2224 2224 IEEE80211_VHT_CAP_RXSTBC_3 | 2225 2225 IEEE80211_VHT_CAP_RXSTBC_4 | 2226 - IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT; 2226 + IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK; 2227 2227 sband->vht_cap.vht_mcs.rx_mcs_map = 2228 2228 cpu_to_le16(IEEE80211_VHT_MCS_SUPPORT_0_8 << 0 | 2229 2229 IEEE80211_VHT_MCS_SUPPORT_0_8 << 2 |
+2 -1
drivers/net/wireless/rt2x00/rt2800lib.c
··· 5090 5090 IEEE80211_HW_SUPPORTS_PS | 5091 5091 IEEE80211_HW_PS_NULLFUNC_STACK | 5092 5092 IEEE80211_HW_AMPDU_AGGREGATION | 5093 - IEEE80211_HW_REPORTS_TX_ACK_STATUS; 5093 + IEEE80211_HW_REPORTS_TX_ACK_STATUS | 5094 + IEEE80211_HW_TEARDOWN_AGGR_ON_BAR_FAIL; 5094 5095 5095 5096 /* 5096 5097 * Don't set IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING for USB devices
+1
drivers/net/wireless/rt2x00/rt2800usb.c
··· 1170 1170 { USB_DEVICE(0x2001, 0x3c19) }, 1171 1171 { USB_DEVICE(0x2001, 0x3c1c) }, 1172 1172 { USB_DEVICE(0x2001, 0x3c1d) }, 1173 + { USB_DEVICE(0x2001, 0x3c1e) }, 1173 1174 /* LG innotek */ 1174 1175 { USB_DEVICE(0x043e, 0x7a22) }, 1175 1176 /* Panasonic */
+3 -4
drivers/net/wireless/rt2x00/rt2x00dev.c
··· 392 392 tx_info->flags |= IEEE80211_TX_STAT_AMPDU; 393 393 tx_info->status.ampdu_len = 1; 394 394 tx_info->status.ampdu_ack_len = success ? 1 : 0; 395 - /* 396 - * TODO: Need to tear down BA session here 397 - * if not successful. 398 - */ 395 + 396 + if (!success) 397 + tx_info->flags |= IEEE80211_TX_STAT_AMPDU_NO_BACK; 399 398 } 400 399 401 400 if (rate_flags & IEEE80211_TX_RC_USE_RTS_CTS) {
+1 -2
drivers/ssb/main.c
··· 1126 1126 case SSB_IDLOW_SSBREV_27: /* same here */ 1127 1127 return SSB_TMSLOW_REJECT; /* this is a guess */ 1128 1128 default: 1129 - printk(KERN_INFO "ssb: Backplane Revision 0x%.8X\n", rev); 1130 - WARN_ON(1); 1129 + WARN(1, KERN_INFO "ssb: Backplane Revision 0x%.8X\n", rev); 1131 1130 } 1132 1131 return (SSB_TMSLOW_REJECT | SSB_TMSLOW_REJECT_23); 1133 1132 }
+2
include/linux/ath9k_platform.h
··· 22 22 #define ATH9K_PLAT_EEP_MAX_WORDS 2048 23 23 24 24 struct ath9k_platform_data { 25 + const char *eeprom_name; 26 + 25 27 u16 eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS]; 26 28 u8 *macaddr; 27 29
+28 -26
include/linux/ieee80211.h
··· 1251 1251 #define IEEE80211_VHT_MCS_NOT_SUPPORTED 3 1252 1252 1253 1253 /* 802.11ac VHT Capabilities */ 1254 - #define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895 0x00000000 1255 - #define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991 0x00000001 1256 - #define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 0x00000002 1257 - #define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ 0x00000004 1258 - #define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ 0x00000008 1259 - #define IEEE80211_VHT_CAP_RXLDPC 0x00000010 1260 - #define IEEE80211_VHT_CAP_SHORT_GI_80 0x00000020 1261 - #define IEEE80211_VHT_CAP_SHORT_GI_160 0x00000040 1262 - #define IEEE80211_VHT_CAP_TXSTBC 0x00000080 1263 - #define IEEE80211_VHT_CAP_RXSTBC_1 0x00000100 1264 - #define IEEE80211_VHT_CAP_RXSTBC_2 0x00000200 1265 - #define IEEE80211_VHT_CAP_RXSTBC_3 0x00000300 1266 - #define IEEE80211_VHT_CAP_RXSTBC_4 0x00000400 1267 - #define IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE 0x00000800 1268 - #define IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE 0x00001000 1269 - #define IEEE80211_VHT_CAP_BEAMFORMER_ANTENNAS_MAX 0x00006000 1270 - #define IEEE80211_VHT_CAP_SOUNDING_DIMENTION_MAX 0x00030000 1271 - #define IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE 0x00080000 1272 - #define IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE 0x00100000 1273 - #define IEEE80211_VHT_CAP_VHT_TXOP_PS 0x00200000 1274 - #define IEEE80211_VHT_CAP_HTC_VHT 0x00400000 1275 - #define IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT 0x00800000 1276 - #define IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_UNSOL_MFB 0x08000000 1277 - #define IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB 0x0c000000 1278 - #define IEEE80211_VHT_CAP_RX_ANTENNA_PATTERN 0x10000000 1279 - #define IEEE80211_VHT_CAP_TX_ANTENNA_PATTERN 0x20000000 1254 + #define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895 0x00000000 1255 + #define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991 0x00000001 1256 + #define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 0x00000002 1257 + #define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ 0x00000004 1258 + #define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ 0x00000008 1259 + #define IEEE80211_VHT_CAP_RXLDPC 0x00000010 1260 + #define IEEE80211_VHT_CAP_SHORT_GI_80 0x00000020 1261 + #define IEEE80211_VHT_CAP_SHORT_GI_160 0x00000040 1262 + #define IEEE80211_VHT_CAP_TXSTBC 0x00000080 1263 + #define IEEE80211_VHT_CAP_RXSTBC_1 0x00000100 1264 + #define IEEE80211_VHT_CAP_RXSTBC_2 0x00000200 1265 + #define IEEE80211_VHT_CAP_RXSTBC_3 0x00000300 1266 + #define IEEE80211_VHT_CAP_RXSTBC_4 0x00000400 1267 + #define IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE 0x00000800 1268 + #define IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE 0x00001000 1269 + #define IEEE80211_VHT_CAP_BEAMFORMER_ANTENNAS_MAX 0x00006000 1270 + #define IEEE80211_VHT_CAP_SOUNDING_DIMENTION_MAX 0x00030000 1271 + #define IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE 0x00080000 1272 + #define IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE 0x00100000 1273 + #define IEEE80211_VHT_CAP_VHT_TXOP_PS 0x00200000 1274 + #define IEEE80211_VHT_CAP_HTC_VHT 0x00400000 1275 + #define IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT 23 1276 + #define IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK \ 1277 + (7 << IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT) 1278 + #define IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_UNSOL_MFB 0x08000000 1279 + #define IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB 0x0c000000 1280 + #define IEEE80211_VHT_CAP_RX_ANTENNA_PATTERN 0x10000000 1281 + #define IEEE80211_VHT_CAP_TX_ANTENNA_PATTERN 0x20000000 1280 1282 1281 1283 /* Authentication algorithms */ 1282 1284 #define WLAN_AUTH_OPEN 0
+5
include/net/mac80211.h
··· 1369 1369 * @IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF: Use the P2P Device address for any 1370 1370 * P2P Interface. This will be honoured even if more than one interface 1371 1371 * is supported. 1372 + * 1373 + * @IEEE80211_HW_TEARDOWN_AGGR_ON_BAR_FAIL: On this hardware TX BA session 1374 + * should be tear down once BAR frame will not be acked. 1375 + * 1372 1376 */ 1373 1377 enum ieee80211_hw_flags { 1374 1378 IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, ··· 1401 1397 IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23, 1402 1398 IEEE80211_HW_SCAN_WHILE_IDLE = 1<<24, 1403 1399 IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF = 1<<25, 1400 + IEEE80211_HW_TEARDOWN_AGGR_ON_BAR_FAIL = 1<<26, 1404 1401 }; 1405 1402 1406 1403 /**
+1 -1
net/mac80211/agg-tx.c
··· 445 445 446 446 trace_api_start_tx_ba_session(pubsta, tid); 447 447 448 - if (WARN_ON(!local->ops->ampdu_action)) 448 + if (WARN_ON_ONCE(!local->ops->ampdu_action)) 449 449 return -EINVAL; 450 450 451 451 if ((tid >= IEEE80211_NUM_TIDS) ||
+17
net/mac80211/debugfs_key.c
··· 199 199 } 200 200 KEY_OPS(icverrors); 201 201 202 + static ssize_t key_mic_failures_read(struct file *file, char __user *userbuf, 203 + size_t count, loff_t *ppos) 204 + { 205 + struct ieee80211_key *key = file->private_data; 206 + char buf[20]; 207 + int len; 208 + 209 + if (key->conf.cipher != WLAN_CIPHER_SUITE_TKIP) 210 + return -EINVAL; 211 + 212 + len = scnprintf(buf, sizeof(buf), "%u\n", key->u.tkip.mic_failures); 213 + 214 + return simple_read_from_buffer(userbuf, count, ppos, buf, len); 215 + } 216 + KEY_OPS(mic_failures); 217 + 202 218 static ssize_t key_key_read(struct file *file, char __user *userbuf, 203 219 size_t count, loff_t *ppos) 204 220 { ··· 276 260 DEBUGFS_ADD(rx_spec); 277 261 DEBUGFS_ADD(replays); 278 262 DEBUGFS_ADD(icverrors); 263 + DEBUGFS_ADD(mic_failures); 279 264 DEBUGFS_ADD(key); 280 265 DEBUGFS_ADD(ifindex); 281 266 };
+14
net/mac80211/ibss.c
··· 201 201 bss_change |= BSS_CHANGED_BASIC_RATES; 202 202 bss_change |= BSS_CHANGED_HT; 203 203 bss_change |= BSS_CHANGED_IBSS; 204 + 205 + /* 206 + * In 5 GHz/802.11a, we can always use short slot time. 207 + * (IEEE 802.11-2012 18.3.8.7) 208 + * 209 + * In 2.4GHz, we must always use long slots in IBSS for compatibility 210 + * reasons. 211 + * (IEEE 802.11-2012 19.4.5) 212 + * 213 + * HT follows these specifications (IEEE 802.11-2012 20.3.18) 214 + */ 215 + sdata->vif.bss_conf.use_short_slot = chan->band == IEEE80211_BAND_5GHZ; 216 + bss_change |= BSS_CHANGED_ERP_SLOT; 217 + 204 218 sdata->vif.bss_conf.ibss_joined = true; 205 219 sdata->vif.bss_conf.ibss_creator = creator; 206 220 ieee80211_bss_info_change_notify(sdata, bss_change);
+1 -1
net/mac80211/iface.c
··· 862 862 rcu_assign_pointer(local->p2p_sdata, NULL); 863 863 /* fall through */ 864 864 default: 865 - flush_work(&sdata->work); 865 + cancel_work_sync(&sdata->work); 866 866 /* 867 867 * When we get here, the interface is marked down. 868 868 * Call rcu_barrier() to wait both for the RX path
+3
net/mac80211/key.h
··· 81 81 82 82 /* last received RSC */ 83 83 struct tkip_ctx rx[IEEE80211_NUM_TIDS]; 84 + 85 + /* number of mic failures */ 86 + u32 mic_failures; 84 87 } tkip; 85 88 struct { 86 89 atomic64_t tx_pn;
+2 -2
net/mac80211/mlme.c
··· 2360 2360 2361 2361 return RX_MGMT_CFG80211_RX_ASSOC; 2362 2362 } 2363 + 2363 2364 static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, 2364 - struct ieee80211_mgmt *mgmt, 2365 - size_t len, 2365 + struct ieee80211_mgmt *mgmt, size_t len, 2366 2366 struct ieee80211_rx_status *rx_status, 2367 2367 struct ieee802_11_elems *elems, 2368 2368 bool beacon)
+5 -4
net/mac80211/rc80211_minstrel.c
··· 154 154 struct ieee80211_sta *sta, void *priv_sta, 155 155 struct sk_buff *skb) 156 156 { 157 + struct minstrel_priv *mp = priv; 157 158 struct minstrel_sta_info *mi = priv_sta; 158 159 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 159 160 struct ieee80211_tx_rate *ar = info->status.rates; ··· 182 181 183 182 if (mi->sample_deferred > 0) 184 183 mi->sample_deferred--; 184 + 185 + if (time_after(jiffies, mi->stats_update + 186 + (mp->update_interval * HZ) / 1000)) 187 + minstrel_update_stats(mp, mi); 185 188 } 186 189 187 190 ··· 239 234 return; 240 235 241 236 mrr = mp->has_mrr && !txrc->rts && !txrc->bss_conf->use_cts_prot; 242 - 243 - if (time_after(jiffies, mi->stats_update + (mp->update_interval * 244 - HZ) / 1000)) 245 - minstrel_update_stats(mp, mi); 246 237 247 238 ndx = mi->max_tp_rate; 248 239
+5 -4
net/mac80211/rx.c
··· 378 378 * the SKB because it has a bad FCS/PLCP checksum. 379 379 */ 380 380 381 - /* room for the radiotap header based on driver features */ 382 - needed_headroom = ieee80211_rx_radiotap_space(local, status); 383 - 384 381 if (local->hw.flags & IEEE80211_HW_RX_INCLUDES_FCS) 385 382 present_fcs_len = FCS_LEN; 386 383 ··· 395 398 396 399 return remove_monitor_info(local, origskb); 397 400 } 401 + 402 + /* room for the radiotap header based on driver features */ 403 + needed_headroom = ieee80211_rx_radiotap_space(local, status); 398 404 399 405 if (should_drop_frame(origskb, present_fcs_len)) { 400 406 /* only need to expand headroom if necessary */ ··· 2333 2333 if (len < IEEE80211_MIN_ACTION_SIZE) 2334 2334 return RX_DROP_UNUSABLE; 2335 2335 2336 - if (!rx->sta && mgmt->u.action.category != WLAN_CATEGORY_PUBLIC) 2336 + if (!rx->sta && mgmt->u.action.category != WLAN_CATEGORY_PUBLIC && 2337 + mgmt->u.action.category != WLAN_CATEGORY_SELF_PROTECTED) 2337 2338 return RX_DROP_UNUSABLE; 2338 2339 2339 2340 if (!(status->rx_flags & IEEE80211_RX_RA_MATCH))
+1 -1
net/mac80211/scan.c
··· 118 118 struct ieee80211_tim_ie *tim_ie = elems->tim; 119 119 bss->dtim_period = tim_ie->dtim_period; 120 120 if (!elems->parse_error) 121 - bss->valid_data |= IEEE80211_BSS_VALID_DTIM; 121 + bss->valid_data |= IEEE80211_BSS_VALID_DTIM; 122 122 } 123 123 124 124 /* If the beacon had no TIM IE, or it was invalid, use 1 */
+5 -1
net/mac80211/status.c
··· 502 502 IEEE80211_BAR_CTRL_TID_INFO_MASK) >> 503 503 IEEE80211_BAR_CTRL_TID_INFO_SHIFT; 504 504 505 - ieee80211_set_bar_pending(sta, tid, ssn); 505 + if (local->hw.flags & 506 + IEEE80211_HW_TEARDOWN_AGGR_ON_BAR_FAIL) 507 + ieee80211_stop_tx_ba_session(&sta->sta, tid); 508 + else 509 + ieee80211_set_bar_pending(sta, tid, ssn); 506 510 } 507 511 } 508 512
+4 -1
net/mac80211/wpa.c
··· 104 104 */ 105 105 if (status->flag & (RX_FLAG_MMIC_STRIPPED | RX_FLAG_IV_STRIPPED)) { 106 106 if (status->flag & RX_FLAG_MMIC_ERROR) 107 - goto mic_fail; 107 + goto mic_fail_no_key; 108 108 109 109 if (!(status->flag & RX_FLAG_IV_STRIPPED) && rx->key && 110 110 rx->key->conf.cipher == WLAN_CIPHER_SUITE_TKIP) ··· 161 161 return RX_CONTINUE; 162 162 163 163 mic_fail: 164 + rx->key->u.tkip.mic_failures++; 165 + 166 + mic_fail_no_key: 164 167 /* 165 168 * In some cases the key can be unset - e.g. a multicast packet, in 166 169 * a driver that supports HW encryption. Send up the key idx only if
+3
net/wireless/chan.c
··· 265 265 266 266 /* TODO: missing regulatory check on 80/160 bandwidth */ 267 267 268 + if (width > 20) 269 + prohibited_flags |= IEEE80211_CHAN_NO_OFDM; 270 + 268 271 if (!cfg80211_secondary_chans_ok(wiphy, chandef->center_freq1, 269 272 width, prohibited_flags)) 270 273 return false;
+1 -1
net/wireless/wext-compat.c
··· 176 176 case CFG80211_SIGNAL_TYPE_NONE: 177 177 break; 178 178 case CFG80211_SIGNAL_TYPE_MBM: 179 - range->max_qual.level = -110; 179 + range->max_qual.level = (u8)-110; 180 180 range->max_qual.qual = 70; 181 181 range->avg_qual.qual = 35; 182 182 range->max_qual.updated |= IW_QUAL_DBM;