Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
This commit is contained in:
commit
f9c4d420c1
@ -48,8 +48,8 @@ void bcma_chipco_serial_init(struct bcma_drv_cc *cc);
|
||||
#endif /* CONFIG_BCMA_DRIVER_MIPS */
|
||||
|
||||
/* driver_chipcommon_pmu.c */
|
||||
u32 bcma_pmu_alp_clock(struct bcma_drv_cc *cc);
|
||||
u32 bcma_pmu_get_clockcpu(struct bcma_drv_cc *cc);
|
||||
u32 bcma_pmu_get_alp_clock(struct bcma_drv_cc *cc);
|
||||
u32 bcma_pmu_get_cpu_clock(struct bcma_drv_cc *cc);
|
||||
|
||||
#ifdef CONFIG_BCMA_SFLASH
|
||||
/* driver_chipcommon_sflash.c */
|
||||
|
@ -25,10 +25,10 @@ static inline u32 bcma_cc_write32_masked(struct bcma_drv_cc *cc, u16 offset,
|
||||
return value;
|
||||
}
|
||||
|
||||
static u32 bcma_chipco_alp_clock(struct bcma_drv_cc *cc)
|
||||
static u32 bcma_chipco_get_alp_clock(struct bcma_drv_cc *cc)
|
||||
{
|
||||
if (cc->capabilities & BCMA_CC_CAP_PMU)
|
||||
return bcma_pmu_alp_clock(cc);
|
||||
return bcma_pmu_get_alp_clock(cc);
|
||||
|
||||
return 20000000;
|
||||
}
|
||||
@ -79,12 +79,12 @@ static int bcma_chipco_watchdog_ticks_per_ms(struct bcma_drv_cc *cc)
|
||||
if (cc->capabilities & BCMA_CC_CAP_PMU) {
|
||||
if (bus->chipinfo.id == BCMA_CHIP_ID_BCM4706)
|
||||
/* 4706 CC and PMU watchdogs are clocked at 1/4 of ALP clock */
|
||||
return bcma_chipco_alp_clock(cc) / 4000;
|
||||
return bcma_chipco_get_alp_clock(cc) / 4000;
|
||||
else
|
||||
/* based on 32KHz ILP clock */
|
||||
return 32;
|
||||
} else {
|
||||
return bcma_chipco_alp_clock(cc) / 1000;
|
||||
return bcma_chipco_get_alp_clock(cc) / 1000;
|
||||
}
|
||||
}
|
||||
|
||||
@ -236,7 +236,7 @@ void bcma_chipco_serial_init(struct bcma_drv_cc *cc)
|
||||
struct bcma_serial_port *ports = cc->serial_ports;
|
||||
|
||||
if (ccrev >= 11 && ccrev != 15) {
|
||||
baud_base = bcma_chipco_alp_clock(cc);
|
||||
baud_base = bcma_chipco_get_alp_clock(cc);
|
||||
if (ccrev >= 21) {
|
||||
/* Turn off UART clock before switching clocksource. */
|
||||
bcma_cc_write32(cc, BCMA_CC_CORECTL,
|
||||
|
@ -168,7 +168,7 @@ void bcma_pmu_init(struct bcma_drv_cc *cc)
|
||||
bcma_pmu_workarounds(cc);
|
||||
}
|
||||
|
||||
u32 bcma_pmu_alp_clock(struct bcma_drv_cc *cc)
|
||||
u32 bcma_pmu_get_alp_clock(struct bcma_drv_cc *cc)
|
||||
{
|
||||
struct bcma_bus *bus = cc->core->bus;
|
||||
|
||||
@ -196,7 +196,7 @@ u32 bcma_pmu_alp_clock(struct bcma_drv_cc *cc)
|
||||
/* Find the output of the "m" pll divider given pll controls that start with
|
||||
* pllreg "pll0" i.e. 12 for main 6 for phy, 0 for misc.
|
||||
*/
|
||||
static u32 bcma_pmu_clock(struct bcma_drv_cc *cc, u32 pll0, u32 m)
|
||||
static u32 bcma_pmu_pll_clock(struct bcma_drv_cc *cc, u32 pll0, u32 m)
|
||||
{
|
||||
u32 tmp, div, ndiv, p1, p2, fc;
|
||||
struct bcma_bus *bus = cc->core->bus;
|
||||
@ -225,14 +225,14 @@ static u32 bcma_pmu_clock(struct bcma_drv_cc *cc, u32 pll0, u32 m)
|
||||
ndiv = (tmp & BCMA_CC_PPL_NDIV_MASK) >> BCMA_CC_PPL_NDIV_SHIFT;
|
||||
|
||||
/* Do calculation in Mhz */
|
||||
fc = bcma_pmu_alp_clock(cc) / 1000000;
|
||||
fc = bcma_pmu_get_alp_clock(cc) / 1000000;
|
||||
fc = (p1 * ndiv * fc) / p2;
|
||||
|
||||
/* Return clock in Hertz */
|
||||
return (fc / div) * 1000000;
|
||||
}
|
||||
|
||||
static u32 bcma_pmu_clock_bcm4706(struct bcma_drv_cc *cc, u32 pll0, u32 m)
|
||||
static u32 bcma_pmu_pll_clock_bcm4706(struct bcma_drv_cc *cc, u32 pll0, u32 m)
|
||||
{
|
||||
u32 tmp, ndiv, p1div, p2div;
|
||||
u32 clock;
|
||||
@ -263,7 +263,7 @@ static u32 bcma_pmu_clock_bcm4706(struct bcma_drv_cc *cc, u32 pll0, u32 m)
|
||||
}
|
||||
|
||||
/* query bus clock frequency for PMU-enabled chipcommon */
|
||||
static u32 bcma_pmu_get_clockcontrol(struct bcma_drv_cc *cc)
|
||||
static u32 bcma_pmu_get_bus_clock(struct bcma_drv_cc *cc)
|
||||
{
|
||||
struct bcma_bus *bus = cc->core->bus;
|
||||
|
||||
@ -271,40 +271,42 @@ static u32 bcma_pmu_get_clockcontrol(struct bcma_drv_cc *cc)
|
||||
case BCMA_CHIP_ID_BCM4716:
|
||||
case BCMA_CHIP_ID_BCM4748:
|
||||
case BCMA_CHIP_ID_BCM47162:
|
||||
return bcma_pmu_clock(cc, BCMA_CC_PMU4716_MAINPLL_PLL0,
|
||||
BCMA_CC_PMU5_MAINPLL_SSB);
|
||||
return bcma_pmu_pll_clock(cc, BCMA_CC_PMU4716_MAINPLL_PLL0,
|
||||
BCMA_CC_PMU5_MAINPLL_SSB);
|
||||
case BCMA_CHIP_ID_BCM5356:
|
||||
return bcma_pmu_clock(cc, BCMA_CC_PMU5356_MAINPLL_PLL0,
|
||||
BCMA_CC_PMU5_MAINPLL_SSB);
|
||||
return bcma_pmu_pll_clock(cc, BCMA_CC_PMU5356_MAINPLL_PLL0,
|
||||
BCMA_CC_PMU5_MAINPLL_SSB);
|
||||
case BCMA_CHIP_ID_BCM5357:
|
||||
case BCMA_CHIP_ID_BCM4749:
|
||||
return bcma_pmu_clock(cc, BCMA_CC_PMU5357_MAINPLL_PLL0,
|
||||
BCMA_CC_PMU5_MAINPLL_SSB);
|
||||
return bcma_pmu_pll_clock(cc, BCMA_CC_PMU5357_MAINPLL_PLL0,
|
||||
BCMA_CC_PMU5_MAINPLL_SSB);
|
||||
case BCMA_CHIP_ID_BCM4706:
|
||||
return bcma_pmu_clock_bcm4706(cc, BCMA_CC_PMU4706_MAINPLL_PLL0,
|
||||
BCMA_CC_PMU5_MAINPLL_SSB);
|
||||
return bcma_pmu_pll_clock_bcm4706(cc,
|
||||
BCMA_CC_PMU4706_MAINPLL_PLL0,
|
||||
BCMA_CC_PMU5_MAINPLL_SSB);
|
||||
case BCMA_CHIP_ID_BCM53572:
|
||||
return 75000000;
|
||||
default:
|
||||
bcma_warn(bus, "No backplane clock specified for %04X device, pmu rev. %d, using default %d Hz\n",
|
||||
bcma_warn(bus, "No bus clock specified for %04X device, pmu rev. %d, using default %d Hz\n",
|
||||
bus->chipinfo.id, cc->pmu.rev, BCMA_CC_PMU_HT_CLOCK);
|
||||
}
|
||||
return BCMA_CC_PMU_HT_CLOCK;
|
||||
}
|
||||
|
||||
/* query cpu clock frequency for PMU-enabled chipcommon */
|
||||
u32 bcma_pmu_get_clockcpu(struct bcma_drv_cc *cc)
|
||||
u32 bcma_pmu_get_cpu_clock(struct bcma_drv_cc *cc)
|
||||
{
|
||||
struct bcma_bus *bus = cc->core->bus;
|
||||
|
||||
if (bus->chipinfo.id == BCMA_CHIP_ID_BCM53572)
|
||||
return 300000000;
|
||||
|
||||
/* New PMUs can have different clock for bus and CPU */
|
||||
if (cc->pmu.rev >= 5) {
|
||||
u32 pll;
|
||||
switch (bus->chipinfo.id) {
|
||||
case BCMA_CHIP_ID_BCM4706:
|
||||
return bcma_pmu_clock_bcm4706(cc,
|
||||
return bcma_pmu_pll_clock_bcm4706(cc,
|
||||
BCMA_CC_PMU4706_MAINPLL_PLL0,
|
||||
BCMA_CC_PMU5_MAINPLL_CPU);
|
||||
case BCMA_CHIP_ID_BCM5356:
|
||||
@ -319,10 +321,11 @@ u32 bcma_pmu_get_clockcpu(struct bcma_drv_cc *cc)
|
||||
break;
|
||||
}
|
||||
|
||||
return bcma_pmu_clock(cc, pll, BCMA_CC_PMU5_MAINPLL_CPU);
|
||||
return bcma_pmu_pll_clock(cc, pll, BCMA_CC_PMU5_MAINPLL_CPU);
|
||||
}
|
||||
|
||||
return bcma_pmu_get_clockcontrol(cc);
|
||||
/* On old PMUs CPU has the same clock as the bus */
|
||||
return bcma_pmu_get_bus_clock(cc);
|
||||
}
|
||||
|
||||
static void bcma_pmu_spuravoid_pll_write(struct bcma_drv_cc *cc, u32 offset,
|
||||
|
@ -115,7 +115,7 @@ static void bcma_core_mips_set_irq(struct bcma_device *dev, unsigned int irq)
|
||||
bcma_read32(mdev, BCMA_MIPS_MIPS74K_INTMASK(0)) &
|
||||
~(1 << irqflag));
|
||||
else
|
||||
bcma_write32(mdev, BCMA_MIPS_MIPS74K_INTMASK(irq), 0);
|
||||
bcma_write32(mdev, BCMA_MIPS_MIPS74K_INTMASK(oldirq), 0);
|
||||
|
||||
/* assign the new one */
|
||||
if (irq == 0) {
|
||||
@ -171,7 +171,7 @@ u32 bcma_cpu_clock(struct bcma_drv_mips *mcore)
|
||||
struct bcma_bus *bus = mcore->core->bus;
|
||||
|
||||
if (bus->drv_cc.capabilities & BCMA_CC_CAP_PMU)
|
||||
return bcma_pmu_get_clockcpu(&bus->drv_cc);
|
||||
return bcma_pmu_get_cpu_clock(&bus->drv_cc);
|
||||
|
||||
bcma_err(bus, "No PMU available, need this to get the cpu clock\n");
|
||||
return 0;
|
||||
|
@ -849,7 +849,7 @@ ath5k_txbuf_free_skb(struct ath5k_hw *ah, struct ath5k_buf *bf)
|
||||
return;
|
||||
dma_unmap_single(ah->dev, bf->skbaddr, bf->skb->len,
|
||||
DMA_TO_DEVICE);
|
||||
dev_kfree_skb_any(bf->skb);
|
||||
ieee80211_free_txskb(ah->hw, bf->skb);
|
||||
bf->skb = NULL;
|
||||
bf->skbaddr = 0;
|
||||
bf->desc->ds_data = 0;
|
||||
@ -1336,20 +1336,9 @@ ath5k_receive_frame(struct ath5k_hw *ah, struct sk_buff *skb,
|
||||
* 15bit only. that means TSF extension has to be done within
|
||||
* 32768usec (about 32ms). it might be necessary to move this to
|
||||
* the interrupt handler, like it is done in madwifi.
|
||||
*
|
||||
* Unfortunately we don't know when the hardware takes the rx
|
||||
* timestamp (beginning of phy frame, data frame, end of rx?).
|
||||
* The only thing we know is that it is hardware specific...
|
||||
* On AR5213 it seems the rx timestamp is at the end of the
|
||||
* frame, but I'm not sure.
|
||||
*
|
||||
* NOTE: mac80211 defines mactime at the beginning of the first
|
||||
* data symbol. Since we don't have any time references it's
|
||||
* impossible to comply to that. This affects IBSS merge only
|
||||
* right now, so it's not too bad...
|
||||
*/
|
||||
rxs->mactime = ath5k_extend_tsf(ah, rs->rs_tstamp);
|
||||
rxs->flag |= RX_FLAG_MACTIME_START;
|
||||
rxs->flag |= RX_FLAG_MACTIME_END;
|
||||
|
||||
rxs->freq = ah->curchan->center_freq;
|
||||
rxs->band = ah->curchan->band;
|
||||
@ -1576,7 +1565,7 @@ ath5k_tx_queue(struct ieee80211_hw *hw, struct sk_buff *skb,
|
||||
return;
|
||||
|
||||
drop_packet:
|
||||
dev_kfree_skb_any(skb);
|
||||
ieee80211_free_txskb(hw, skb);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -62,7 +62,7 @@ ath5k_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control,
|
||||
u16 qnum = skb_get_queue_mapping(skb);
|
||||
|
||||
if (WARN_ON(qnum >= ah->ah_capabilities.cap_queues.q_tx_num)) {
|
||||
dev_kfree_skb_any(skb);
|
||||
ieee80211_free_txskb(hw, skb);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -534,98 +534,98 @@ static const u32 ar9300_2p2_baseband_core[][2] = {
|
||||
|
||||
static const u32 ar9300Modes_high_power_tx_gain_table_2p2[][5] = {
|
||||
/* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
|
||||
{0x0000a2dc, 0x00033800, 0x00033800, 0x03aaa352, 0x03aaa352},
|
||||
{0x0000a2e0, 0x0003c000, 0x0003c000, 0x03ccc584, 0x03ccc584},
|
||||
{0x0000a2e4, 0x03fc0000, 0x03fc0000, 0x03f0f800, 0x03f0f800},
|
||||
{0x0000a2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
|
||||
{0x0000a2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
|
||||
{0x0000a2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
|
||||
{0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
|
||||
{0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9},
|
||||
{0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
|
||||
{0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002},
|
||||
{0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004},
|
||||
{0x0000a50c, 0x10000023, 0x10000023, 0x0b000200, 0x0b000200},
|
||||
{0x0000a510, 0x16000220, 0x16000220, 0x0f000202, 0x0f000202},
|
||||
{0x0000a514, 0x1c000223, 0x1c000223, 0x12000400, 0x12000400},
|
||||
{0x0000a518, 0x21002220, 0x21002220, 0x16000402, 0x16000402},
|
||||
{0x0000a51c, 0x27002223, 0x27002223, 0x19000404, 0x19000404},
|
||||
{0x0000a520, 0x2b022220, 0x2b022220, 0x1c000603, 0x1c000603},
|
||||
{0x0000a524, 0x2f022222, 0x2f022222, 0x21000a02, 0x21000a02},
|
||||
{0x0000a528, 0x34022225, 0x34022225, 0x25000a04, 0x25000a04},
|
||||
{0x0000a52c, 0x3a02222a, 0x3a02222a, 0x28000a20, 0x28000a20},
|
||||
{0x0000a530, 0x3e02222c, 0x3e02222c, 0x2c000e20, 0x2c000e20},
|
||||
{0x0000a534, 0x4202242a, 0x4202242a, 0x30000e22, 0x30000e22},
|
||||
{0x0000a538, 0x4702244a, 0x4702244a, 0x34000e24, 0x34000e24},
|
||||
{0x0000a53c, 0x4b02244c, 0x4b02244c, 0x38001640, 0x38001640},
|
||||
{0x0000a540, 0x4e02246c, 0x4e02246c, 0x3c001660, 0x3c001660},
|
||||
{0x0000a544, 0x52022470, 0x52022470, 0x3f001861, 0x3f001861},
|
||||
{0x0000a548, 0x55022490, 0x55022490, 0x43001a81, 0x43001a81},
|
||||
{0x0000a54c, 0x59022492, 0x59022492, 0x47001a83, 0x47001a83},
|
||||
{0x0000a550, 0x5d022692, 0x5d022692, 0x4a001c84, 0x4a001c84},
|
||||
{0x0000a554, 0x61022892, 0x61022892, 0x4e001ce3, 0x4e001ce3},
|
||||
{0x0000a558, 0x65024890, 0x65024890, 0x52001ce5, 0x52001ce5},
|
||||
{0x0000a55c, 0x69024892, 0x69024892, 0x56001ce9, 0x56001ce9},
|
||||
{0x0000a560, 0x6e024c92, 0x6e024c92, 0x5a001ceb, 0x5a001ceb},
|
||||
{0x0000a564, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
|
||||
{0x0000a568, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
|
||||
{0x0000a56c, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
|
||||
{0x0000a570, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
|
||||
{0x0000a574, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
|
||||
{0x0000a578, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
|
||||
{0x0000a57c, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
|
||||
{0x0000a580, 0x00800000, 0x00800000, 0x00800000, 0x00800000},
|
||||
{0x0000a584, 0x06800003, 0x06800003, 0x04800002, 0x04800002},
|
||||
{0x0000a588, 0x0a800020, 0x0a800020, 0x08800004, 0x08800004},
|
||||
{0x0000a58c, 0x10800023, 0x10800023, 0x0b800200, 0x0b800200},
|
||||
{0x0000a590, 0x16800220, 0x16800220, 0x0f800202, 0x0f800202},
|
||||
{0x0000a594, 0x1c800223, 0x1c800223, 0x12800400, 0x12800400},
|
||||
{0x0000a598, 0x21802220, 0x21802220, 0x16800402, 0x16800402},
|
||||
{0x0000a59c, 0x27802223, 0x27802223, 0x19800404, 0x19800404},
|
||||
{0x0000a5a0, 0x2b822220, 0x2b822220, 0x1c800603, 0x1c800603},
|
||||
{0x0000a5a4, 0x2f822222, 0x2f822222, 0x21800a02, 0x21800a02},
|
||||
{0x0000a5a8, 0x34822225, 0x34822225, 0x25800a04, 0x25800a04},
|
||||
{0x0000a5ac, 0x3a82222a, 0x3a82222a, 0x28800a20, 0x28800a20},
|
||||
{0x0000a5b0, 0x3e82222c, 0x3e82222c, 0x2c800e20, 0x2c800e20},
|
||||
{0x0000a5b4, 0x4282242a, 0x4282242a, 0x30800e22, 0x30800e22},
|
||||
{0x0000a5b8, 0x4782244a, 0x4782244a, 0x34800e24, 0x34800e24},
|
||||
{0x0000a5bc, 0x4b82244c, 0x4b82244c, 0x38801640, 0x38801640},
|
||||
{0x0000a5c0, 0x4e82246c, 0x4e82246c, 0x3c801660, 0x3c801660},
|
||||
{0x0000a5c4, 0x52822470, 0x52822470, 0x3f801861, 0x3f801861},
|
||||
{0x0000a5c8, 0x55822490, 0x55822490, 0x43801a81, 0x43801a81},
|
||||
{0x0000a5cc, 0x59822492, 0x59822492, 0x47801a83, 0x47801a83},
|
||||
{0x0000a5d0, 0x5d822692, 0x5d822692, 0x4a801c84, 0x4a801c84},
|
||||
{0x0000a5d4, 0x61822892, 0x61822892, 0x4e801ce3, 0x4e801ce3},
|
||||
{0x0000a5d8, 0x65824890, 0x65824890, 0x52801ce5, 0x52801ce5},
|
||||
{0x0000a5dc, 0x69824892, 0x69824892, 0x56801ce9, 0x56801ce9},
|
||||
{0x0000a5e0, 0x6e824c92, 0x6e824c92, 0x5a801ceb, 0x5a801ceb},
|
||||
{0x0000a5e4, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
|
||||
{0x0000a5e8, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
|
||||
{0x0000a5ec, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
|
||||
{0x0000a5f0, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
|
||||
{0x0000a5f4, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
|
||||
{0x0000a5f8, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
|
||||
{0x0000a5fc, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
|
||||
{0x0000a410, 0x000050d8, 0x000050d8, 0x000050d9, 0x000050d9},
|
||||
{0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000},
|
||||
{0x0000a504, 0x04002222, 0x04002222, 0x04000002, 0x04000002},
|
||||
{0x0000a508, 0x09002421, 0x09002421, 0x08000004, 0x08000004},
|
||||
{0x0000a50c, 0x0d002621, 0x0d002621, 0x0b000200, 0x0b000200},
|
||||
{0x0000a510, 0x13004620, 0x13004620, 0x0f000202, 0x0f000202},
|
||||
{0x0000a514, 0x19004a20, 0x19004a20, 0x11000400, 0x11000400},
|
||||
{0x0000a518, 0x1d004e20, 0x1d004e20, 0x15000402, 0x15000402},
|
||||
{0x0000a51c, 0x21005420, 0x21005420, 0x19000404, 0x19000404},
|
||||
{0x0000a520, 0x26005e20, 0x26005e20, 0x1b000603, 0x1b000603},
|
||||
{0x0000a524, 0x2b005e40, 0x2b005e40, 0x1f000a02, 0x1f000a02},
|
||||
{0x0000a528, 0x2f005e42, 0x2f005e42, 0x23000a04, 0x23000a04},
|
||||
{0x0000a52c, 0x33005e44, 0x33005e44, 0x26000a20, 0x26000a20},
|
||||
{0x0000a530, 0x38005e65, 0x38005e65, 0x2a000e20, 0x2a000e20},
|
||||
{0x0000a534, 0x3c005e69, 0x3c005e69, 0x2e000e22, 0x2e000e22},
|
||||
{0x0000a538, 0x40005e6b, 0x40005e6b, 0x31000e24, 0x31000e24},
|
||||
{0x0000a53c, 0x44005e6d, 0x44005e6d, 0x34001640, 0x34001640},
|
||||
{0x0000a540, 0x49005e72, 0x49005e72, 0x38001660, 0x38001660},
|
||||
{0x0000a544, 0x4e005eb2, 0x4e005eb2, 0x3b001861, 0x3b001861},
|
||||
{0x0000a548, 0x53005f12, 0x53005f12, 0x3e001a81, 0x3e001a81},
|
||||
{0x0000a54c, 0x59025eb2, 0x59025eb2, 0x42001a83, 0x42001a83},
|
||||
{0x0000a550, 0x5e025f12, 0x5e025f12, 0x44001c84, 0x44001c84},
|
||||
{0x0000a554, 0x61027f12, 0x61027f12, 0x48001ce3, 0x48001ce3},
|
||||
{0x0000a558, 0x6702bf12, 0x6702bf12, 0x4c001ce5, 0x4c001ce5},
|
||||
{0x0000a55c, 0x6b02bf14, 0x6b02bf14, 0x50001ce9, 0x50001ce9},
|
||||
{0x0000a560, 0x6f02bf16, 0x6f02bf16, 0x54001ceb, 0x54001ceb},
|
||||
{0x0000a564, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
|
||||
{0x0000a568, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
|
||||
{0x0000a56c, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
|
||||
{0x0000a570, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
|
||||
{0x0000a574, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
|
||||
{0x0000a578, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
|
||||
{0x0000a57c, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
|
||||
{0x0000a580, 0x00802220, 0x00802220, 0x00800000, 0x00800000},
|
||||
{0x0000a584, 0x04802222, 0x04802222, 0x04800002, 0x04800002},
|
||||
{0x0000a588, 0x09802421, 0x09802421, 0x08800004, 0x08800004},
|
||||
{0x0000a58c, 0x0d802621, 0x0d802621, 0x0b800200, 0x0b800200},
|
||||
{0x0000a590, 0x13804620, 0x13804620, 0x0f800202, 0x0f800202},
|
||||
{0x0000a594, 0x19804a20, 0x19804a20, 0x11800400, 0x11800400},
|
||||
{0x0000a598, 0x1d804e20, 0x1d804e20, 0x15800402, 0x15800402},
|
||||
{0x0000a59c, 0x21805420, 0x21805420, 0x19800404, 0x19800404},
|
||||
{0x0000a5a0, 0x26805e20, 0x26805e20, 0x1b800603, 0x1b800603},
|
||||
{0x0000a5a4, 0x2b805e40, 0x2b805e40, 0x1f800a02, 0x1f800a02},
|
||||
{0x0000a5a8, 0x2f805e42, 0x2f805e42, 0x23800a04, 0x23800a04},
|
||||
{0x0000a5ac, 0x33805e44, 0x33805e44, 0x26800a20, 0x26800a20},
|
||||
{0x0000a5b0, 0x38805e65, 0x38805e65, 0x2a800e20, 0x2a800e20},
|
||||
{0x0000a5b4, 0x3c805e69, 0x3c805e69, 0x2e800e22, 0x2e800e22},
|
||||
{0x0000a5b8, 0x40805e6b, 0x40805e6b, 0x31800e24, 0x31800e24},
|
||||
{0x0000a5bc, 0x44805e6d, 0x44805e6d, 0x34801640, 0x34801640},
|
||||
{0x0000a5c0, 0x49805e72, 0x49805e72, 0x38801660, 0x38801660},
|
||||
{0x0000a5c4, 0x4e805eb2, 0x4e805eb2, 0x3b801861, 0x3b801861},
|
||||
{0x0000a5c8, 0x53805f12, 0x53805f12, 0x3e801a81, 0x3e801a81},
|
||||
{0x0000a5cc, 0x59825eb2, 0x59825eb2, 0x42801a83, 0x42801a83},
|
||||
{0x0000a5d0, 0x5e825f12, 0x5e825f12, 0x44801c84, 0x44801c84},
|
||||
{0x0000a5d4, 0x61827f12, 0x61827f12, 0x48801ce3, 0x48801ce3},
|
||||
{0x0000a5d8, 0x6782bf12, 0x6782bf12, 0x4c801ce5, 0x4c801ce5},
|
||||
{0x0000a5dc, 0x6b82bf14, 0x6b82bf14, 0x50801ce9, 0x50801ce9},
|
||||
{0x0000a5e0, 0x6f82bf16, 0x6f82bf16, 0x54801ceb, 0x54801ceb},
|
||||
{0x0000a5e4, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
|
||||
{0x0000a5e8, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
|
||||
{0x0000a5ec, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
|
||||
{0x0000a5f0, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
|
||||
{0x0000a5f4, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
|
||||
{0x0000a5f8, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
|
||||
{0x0000a5fc, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
|
||||
{0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
|
||||
{0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
|
||||
{0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
|
||||
{0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
|
||||
{0x0000a610, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
|
||||
{0x0000a614, 0x02004000, 0x02004000, 0x01404000, 0x01404000},
|
||||
{0x0000a618, 0x02004801, 0x02004801, 0x01404501, 0x01404501},
|
||||
{0x0000a61c, 0x02808a02, 0x02808a02, 0x02008501, 0x02008501},
|
||||
{0x0000a620, 0x0380ce03, 0x0380ce03, 0x0280ca03, 0x0280ca03},
|
||||
{0x0000a624, 0x04411104, 0x04411104, 0x03010c04, 0x03010c04},
|
||||
{0x0000a628, 0x04411104, 0x04411104, 0x04014c04, 0x04014c04},
|
||||
{0x0000a62c, 0x04411104, 0x04411104, 0x04015005, 0x04015005},
|
||||
{0x0000a630, 0x04411104, 0x04411104, 0x04015005, 0x04015005},
|
||||
{0x0000a634, 0x04411104, 0x04411104, 0x04015005, 0x04015005},
|
||||
{0x0000a638, 0x04411104, 0x04411104, 0x04015005, 0x04015005},
|
||||
{0x0000a63c, 0x04411104, 0x04411104, 0x04015005, 0x04015005},
|
||||
{0x0000b2dc, 0x00033800, 0x00033800, 0x03aaa352, 0x03aaa352},
|
||||
{0x0000b2e0, 0x0003c000, 0x0003c000, 0x03ccc584, 0x03ccc584},
|
||||
{0x0000b2e4, 0x03fc0000, 0x03fc0000, 0x03f0f800, 0x03f0f800},
|
||||
{0x0000a610, 0x00804000, 0x00804000, 0x00000000, 0x00000000},
|
||||
{0x0000a614, 0x00804201, 0x00804201, 0x01404000, 0x01404000},
|
||||
{0x0000a618, 0x0280c802, 0x0280c802, 0x01404501, 0x01404501},
|
||||
{0x0000a61c, 0x0280ca03, 0x0280ca03, 0x02008501, 0x02008501},
|
||||
{0x0000a620, 0x04c15104, 0x04c15104, 0x0280ca03, 0x0280ca03},
|
||||
{0x0000a624, 0x04c15305, 0x04c15305, 0x03010c04, 0x03010c04},
|
||||
{0x0000a628, 0x04c15305, 0x04c15305, 0x04014c04, 0x04014c04},
|
||||
{0x0000a62c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
|
||||
{0x0000a630, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
|
||||
{0x0000a634, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
|
||||
{0x0000a638, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
|
||||
{0x0000a63c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
|
||||
{0x0000b2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
|
||||
{0x0000b2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
|
||||
{0x0000b2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
|
||||
{0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
|
||||
{0x0000c2dc, 0x00033800, 0x00033800, 0x03aaa352, 0x03aaa352},
|
||||
{0x0000c2e0, 0x0003c000, 0x0003c000, 0x03ccc584, 0x03ccc584},
|
||||
{0x0000c2e4, 0x03fc0000, 0x03fc0000, 0x03f0f800, 0x03f0f800},
|
||||
{0x0000c2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
|
||||
{0x0000c2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
|
||||
{0x0000c2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
|
||||
{0x0000c2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
|
||||
{0x00016044, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
|
||||
{0x00016048, 0x66480001, 0x66480001, 0x66480001, 0x66480001},
|
||||
|
@ -2987,10 +2987,6 @@ static u32 ath9k_hw_ar9300_get_eeprom(struct ath_hw *ah,
|
||||
case EEP_RX_MASK:
|
||||
return pBase->txrxMask & 0xf;
|
||||
case EEP_PAPRD:
|
||||
if (AR_SREV_9462(ah))
|
||||
return false;
|
||||
if (!ah->config.enable_paprd)
|
||||
return false;
|
||||
return !!(pBase->featureEnable & BIT(5));
|
||||
case EEP_CHAIN_MASK_REDUCE:
|
||||
return (pBase->miscConfiguration >> 0x3) & 0x1;
|
||||
@ -3005,24 +3001,24 @@ static u32 ath9k_hw_ar9300_get_eeprom(struct ath_hw *ah,
|
||||
}
|
||||
}
|
||||
|
||||
static bool ar9300_eeprom_read_byte(struct ath_common *common, int address,
|
||||
static bool ar9300_eeprom_read_byte(struct ath_hw *ah, int address,
|
||||
u8 *buffer)
|
||||
{
|
||||
u16 val;
|
||||
|
||||
if (unlikely(!ath9k_hw_nvram_read(common, address / 2, &val)))
|
||||
if (unlikely(!ath9k_hw_nvram_read(ah, address / 2, &val)))
|
||||
return false;
|
||||
|
||||
*buffer = (val >> (8 * (address % 2))) & 0xff;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool ar9300_eeprom_read_word(struct ath_common *common, int address,
|
||||
static bool ar9300_eeprom_read_word(struct ath_hw *ah, int address,
|
||||
u8 *buffer)
|
||||
{
|
||||
u16 val;
|
||||
|
||||
if (unlikely(!ath9k_hw_nvram_read(common, address / 2, &val)))
|
||||
if (unlikely(!ath9k_hw_nvram_read(ah, address / 2, &val)))
|
||||
return false;
|
||||
|
||||
buffer[0] = val >> 8;
|
||||
@ -3048,14 +3044,14 @@ static bool ar9300_read_eeprom(struct ath_hw *ah, int address, u8 *buffer,
|
||||
* the 16-bit word at that address
|
||||
*/
|
||||
if (address % 2 == 0) {
|
||||
if (!ar9300_eeprom_read_byte(common, address--, buffer++))
|
||||
if (!ar9300_eeprom_read_byte(ah, address--, buffer++))
|
||||
goto error;
|
||||
|
||||
count--;
|
||||
}
|
||||
|
||||
for (i = 0; i < count / 2; i++) {
|
||||
if (!ar9300_eeprom_read_word(common, address, buffer))
|
||||
if (!ar9300_eeprom_read_word(ah, address, buffer))
|
||||
goto error;
|
||||
|
||||
address -= 2;
|
||||
@ -3063,7 +3059,7 @@ static bool ar9300_read_eeprom(struct ath_hw *ah, int address, u8 *buffer,
|
||||
}
|
||||
|
||||
if (count % 2)
|
||||
if (!ar9300_eeprom_read_byte(common, address, buffer))
|
||||
if (!ar9300_eeprom_read_byte(ah, address, buffer))
|
||||
goto error;
|
||||
|
||||
return true;
|
||||
@ -3240,12 +3236,11 @@ static bool ar9300_check_eeprom_header(struct ath_hw *ah, eeprom_read_op read,
|
||||
static int ar9300_eeprom_restore_flash(struct ath_hw *ah, u8 *mptr,
|
||||
int mdata_size)
|
||||
{
|
||||
struct ath_common *common = ath9k_hw_common(ah);
|
||||
u16 *data = (u16 *) mptr;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < mdata_size / 2; i++, data++)
|
||||
ath9k_hw_nvram_read(common, i, data);
|
||||
ath9k_hw_nvram_read(ah, i, data);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -5076,6 +5071,33 @@ static inline u8 mcsidx_to_tgtpwridx(unsigned int mcs_idx, u8 base_pwridx)
|
||||
return base_pwridx + 4 * (mcs_idx / 8) + mod_idx - 2;
|
||||
}
|
||||
|
||||
static void ar9003_paprd_set_txpower(struct ath_hw *ah,
|
||||
struct ath9k_channel *chan,
|
||||
u8 *targetPowerValT2)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!ar9003_is_paprd_enabled(ah))
|
||||
return;
|
||||
|
||||
if (IS_CHAN_HT40(chan))
|
||||
i = ALL_TARGET_HT40_7;
|
||||
else
|
||||
i = ALL_TARGET_HT20_7;
|
||||
|
||||
if (IS_CHAN_2GHZ(chan)) {
|
||||
if (!AR_SREV_9330(ah) && !AR_SREV_9340(ah) &&
|
||||
!AR_SREV_9462(ah) && !AR_SREV_9565(ah)) {
|
||||
if (IS_CHAN_HT40(chan))
|
||||
i = ALL_TARGET_HT40_0_8_16;
|
||||
else
|
||||
i = ALL_TARGET_HT20_0_8_16;
|
||||
}
|
||||
}
|
||||
|
||||
ah->paprd_target_power = targetPowerValT2[i];
|
||||
}
|
||||
|
||||
static void ath9k_hw_ar9300_set_txpower(struct ath_hw *ah,
|
||||
struct ath9k_channel *chan, u16 cfgCtl,
|
||||
u8 twiceAntennaReduction,
|
||||
@ -5097,7 +5119,7 @@ static void ath9k_hw_ar9300_set_txpower(struct ath_hw *ah,
|
||||
*/
|
||||
ar9003_hw_get_target_power_eeprom(ah, chan, targetPowerValT2);
|
||||
|
||||
if (ah->eep_ops->get_eeprom(ah, EEP_PAPRD)) {
|
||||
if (ar9003_is_paprd_enabled(ah)) {
|
||||
if (IS_CHAN_2GHZ(chan))
|
||||
modal_hdr = &eep->modalHeader2G;
|
||||
else
|
||||
@ -5138,7 +5160,7 @@ static void ath9k_hw_ar9300_set_txpower(struct ath_hw *ah,
|
||||
twiceAntennaReduction,
|
||||
powerLimit);
|
||||
|
||||
if (ah->eep_ops->get_eeprom(ah, EEP_PAPRD)) {
|
||||
if (ar9003_is_paprd_enabled(ah)) {
|
||||
for (i = 0; i < ar9300RateSize; i++) {
|
||||
if ((ah->paprd_ratemask & (1 << i)) &&
|
||||
(abs(targetPowerValT2[i] -
|
||||
@ -5170,19 +5192,7 @@ static void ath9k_hw_ar9300_set_txpower(struct ath_hw *ah,
|
||||
/* Write target power array to registers */
|
||||
ar9003_hw_tx_power_regwrite(ah, targetPowerValT2);
|
||||
ar9003_hw_calibration_apply(ah, chan->channel);
|
||||
|
||||
if (IS_CHAN_2GHZ(chan)) {
|
||||
if (IS_CHAN_HT40(chan))
|
||||
i = ALL_TARGET_HT40_0_8_16;
|
||||
else
|
||||
i = ALL_TARGET_HT20_0_8_16;
|
||||
} else {
|
||||
if (IS_CHAN_HT40(chan))
|
||||
i = ALL_TARGET_HT40_7;
|
||||
else
|
||||
i = ALL_TARGET_HT20_7;
|
||||
}
|
||||
ah->paprd_target_power = targetPowerValT2[i];
|
||||
ar9003_paprd_set_txpower(ah, chan, targetPowerValT2);
|
||||
}
|
||||
|
||||
static u16 ath9k_hw_ar9300_get_spur_channel(struct ath_hw *ah,
|
||||
|
@ -68,13 +68,13 @@
|
||||
#define AR9300_BASE_ADDR 0x3ff
|
||||
#define AR9300_BASE_ADDR_512 0x1ff
|
||||
|
||||
#define AR9300_OTP_BASE 0x14000
|
||||
#define AR9300_OTP_STATUS 0x15f18
|
||||
#define AR9300_OTP_BASE (AR_SREV_9340(ah) ? 0x30000 : 0x14000)
|
||||
#define AR9300_OTP_STATUS (AR_SREV_9340(ah) ? 0x30018 : 0x15f18)
|
||||
#define AR9300_OTP_STATUS_TYPE 0x7
|
||||
#define AR9300_OTP_STATUS_VALID 0x4
|
||||
#define AR9300_OTP_STATUS_ACCESS_BUSY 0x2
|
||||
#define AR9300_OTP_STATUS_SM_BUSY 0x1
|
||||
#define AR9300_OTP_READ_DATA 0x15f1c
|
||||
#define AR9300_OTP_READ_DATA (AR_SREV_9340(ah) ? 0x3001c : 0x15f1c)
|
||||
|
||||
enum targetPowerHTRates {
|
||||
HT_TARGET_RATE_0_8_16,
|
||||
|
@ -74,15 +74,23 @@ static int ar9003_get_training_power_2g(struct ath_hw *ah)
|
||||
unsigned int power, scale, delta;
|
||||
|
||||
scale = ar9003_get_paprd_scale_factor(ah, chan);
|
||||
power = REG_READ_FIELD(ah, AR_PHY_POWERTX_RATE5,
|
||||
AR_PHY_POWERTX_RATE5_POWERTXHT20_0);
|
||||
|
||||
delta = abs((int) ah->paprd_target_power - (int) power);
|
||||
if (delta > scale)
|
||||
return -1;
|
||||
if (AR_SREV_9330(ah) || AR_SREV_9340(ah) ||
|
||||
AR_SREV_9462(ah) || AR_SREV_9565(ah)) {
|
||||
power = ah->paprd_target_power + 2;
|
||||
} else if (AR_SREV_9485(ah)) {
|
||||
power = 25;
|
||||
} else {
|
||||
power = REG_READ_FIELD(ah, AR_PHY_POWERTX_RATE5,
|
||||
AR_PHY_POWERTX_RATE5_POWERTXHT20_0);
|
||||
|
||||
if (delta < 4)
|
||||
power -= 4 - delta;
|
||||
delta = abs((int) ah->paprd_target_power - (int) power);
|
||||
if (delta > scale)
|
||||
return -1;
|
||||
|
||||
if (delta < 4)
|
||||
power -= 4 - delta;
|
||||
}
|
||||
|
||||
return power;
|
||||
}
|
||||
@ -169,6 +177,9 @@ static int ar9003_paprd_setup_single_table(struct ath_hw *ah)
|
||||
REG_RMW_FIELD(ah, AR_PHY_PAPRD_HT40, AR_PHY_PAPRD_HT40_MASK,
|
||||
ah->paprd_ratemask_ht40);
|
||||
|
||||
ath_dbg(common, CALIBRATE, "PAPRD HT20 mask: 0x%x, HT40 mask: 0x%x\n",
|
||||
ah->paprd_ratemask, ah->paprd_ratemask_ht40);
|
||||
|
||||
for (i = 0; i < ah->caps.max_txchains; i++) {
|
||||
REG_RMW_FIELD(ah, ctrl0[i],
|
||||
AR_PHY_PAPRD_CTRL0_USE_SINGLE_TABLE_MASK, 1);
|
||||
@ -204,7 +215,20 @@ static int ar9003_paprd_setup_single_table(struct ath_hw *ah)
|
||||
AR_PHY_PAPRD_TRAINER_CNTL1_CF_PAPRD_AGC2_SETTLING, 28);
|
||||
REG_RMW_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL1,
|
||||
AR_PHY_PAPRD_TRAINER_CNTL1_CF_CF_PAPRD_TRAIN_ENABLE, 1);
|
||||
val = AR_SREV_9462(ah) ? 0x91 : 147;
|
||||
|
||||
if (AR_SREV_9485(ah)) {
|
||||
val = 148;
|
||||
} else {
|
||||
if (IS_CHAN_2GHZ(ah->curchan)) {
|
||||
if (AR_SREV_9462(ah) || AR_SREV_9565(ah))
|
||||
val = 145;
|
||||
else
|
||||
val = 147;
|
||||
} else {
|
||||
val = 137;
|
||||
}
|
||||
}
|
||||
|
||||
REG_RMW_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL2,
|
||||
AR_PHY_PAPRD_TRAINER_CNTL2_CF_PAPRD_INIT_RX_BB_GAIN, val);
|
||||
REG_RMW_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL3,
|
||||
@ -215,15 +239,24 @@ static int ar9003_paprd_setup_single_table(struct ath_hw *ah)
|
||||
AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_NUM_CORR_STAGES, 7);
|
||||
REG_RMW_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL3,
|
||||
AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_MIN_LOOPBACK_DEL, 1);
|
||||
if (AR_SREV_9485(ah) || AR_SREV_9462(ah) || AR_SREV_9550(ah))
|
||||
|
||||
if (AR_SREV_9485(ah) ||
|
||||
AR_SREV_9462(ah) ||
|
||||
AR_SREV_9565(ah) ||
|
||||
AR_SREV_9550(ah) ||
|
||||
AR_SREV_9330(ah) ||
|
||||
AR_SREV_9340(ah))
|
||||
REG_RMW_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL3,
|
||||
AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_QUICK_DROP,
|
||||
-3);
|
||||
AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_QUICK_DROP, -3);
|
||||
else
|
||||
REG_RMW_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL3,
|
||||
AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_QUICK_DROP,
|
||||
-6);
|
||||
val = AR_SREV_9462(ah) ? -10 : -15;
|
||||
AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_QUICK_DROP, -6);
|
||||
|
||||
val = -10;
|
||||
|
||||
if (IS_CHAN_2GHZ(ah->curchan) && !AR_SREV_9462(ah) && !AR_SREV_9565(ah))
|
||||
val = -15;
|
||||
|
||||
REG_RMW_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL3,
|
||||
AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_ADC_DESIRED_SIZE,
|
||||
val);
|
||||
@ -262,9 +295,6 @@ static void ar9003_paprd_get_gain_table(struct ath_hw *ah)
|
||||
u32 reg = AR_PHY_TXGAIN_TABLE;
|
||||
int i;
|
||||
|
||||
memset(entry, 0, sizeof(ah->paprd_gain_table_entries));
|
||||
memset(index, 0, sizeof(ah->paprd_gain_table_index));
|
||||
|
||||
for (i = 0; i < PAPRD_GAIN_TABLE_ENTRIES; i++) {
|
||||
entry[i] = REG_READ(ah, reg);
|
||||
index[i] = (entry[i] >> 24) & 0xff;
|
||||
@ -763,7 +793,7 @@ void ar9003_paprd_populate_single_table(struct ath_hw *ah,
|
||||
}
|
||||
EXPORT_SYMBOL(ar9003_paprd_populate_single_table);
|
||||
|
||||
int ar9003_paprd_setup_gain_table(struct ath_hw *ah, int chain)
|
||||
void ar9003_paprd_setup_gain_table(struct ath_hw *ah, int chain)
|
||||
{
|
||||
unsigned int i, desired_gain, gain_index;
|
||||
unsigned int train_power = ah->paprd_training_power;
|
||||
@ -781,8 +811,6 @@ int ar9003_paprd_setup_gain_table(struct ath_hw *ah, int chain)
|
||||
|
||||
REG_CLR_BIT(ah, AR_PHY_PAPRD_TRAINER_STAT1,
|
||||
AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(ar9003_paprd_setup_gain_table);
|
||||
|
||||
@ -894,7 +922,7 @@ int ar9003_paprd_create_curve(struct ath_hw *ah,
|
||||
|
||||
memset(caldata->pa_table[chain], 0, sizeof(caldata->pa_table[chain]));
|
||||
|
||||
buf = kmalloc(2 * 48 * sizeof(u32), GFP_ATOMIC);
|
||||
buf = kmalloc(2 * 48 * sizeof(u32), GFP_KERNEL);
|
||||
if (!buf)
|
||||
return -ENOMEM;
|
||||
|
||||
@ -945,9 +973,13 @@ EXPORT_SYMBOL(ar9003_paprd_init_table);
|
||||
bool ar9003_paprd_is_done(struct ath_hw *ah)
|
||||
{
|
||||
int paprd_done, agc2_pwr;
|
||||
|
||||
paprd_done = REG_READ_FIELD(ah, AR_PHY_PAPRD_TRAINER_STAT1,
|
||||
AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE);
|
||||
|
||||
if (AR_SREV_9485(ah))
|
||||
goto exit;
|
||||
|
||||
if (paprd_done == 0x1) {
|
||||
agc2_pwr = REG_READ_FIELD(ah, AR_PHY_PAPRD_TRAINER_STAT1,
|
||||
AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_AGC2_PWR);
|
||||
@ -963,7 +995,16 @@ bool ar9003_paprd_is_done(struct ath_hw *ah)
|
||||
if (agc2_pwr <= PAPRD_IDEAL_AGC2_PWR_RANGE)
|
||||
paprd_done = 0;
|
||||
}
|
||||
|
||||
exit:
|
||||
return !!paprd_done;
|
||||
}
|
||||
EXPORT_SYMBOL(ar9003_paprd_is_done);
|
||||
|
||||
bool ar9003_is_paprd_enabled(struct ath_hw *ah)
|
||||
{
|
||||
if ((ah->caps.hw_caps & ATH9K_HW_CAP_PAPRD) && ah->config.enable_paprd)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
EXPORT_SYMBOL(ar9003_is_paprd_enabled);
|
||||
|
@ -1145,9 +1145,8 @@
|
||||
#define AR_PHY_PAPRD_CTRL1_PAPRD_MAG_SCALE_FACT 0x0ffe0000
|
||||
#define AR_PHY_PAPRD_CTRL1_PAPRD_MAG_SCALE_FACT_S 17
|
||||
|
||||
#define AR_PHY_PAPRD_TRAINER_CNTL1 (AR_SM_BASE + \
|
||||
(AR_SREV_9485(ah) ? \
|
||||
0x580 : 0x490))
|
||||
#define AR_PHY_PAPRD_TRAINER_CNTL1 (AR_SM_BASE + (AR_SREV_9485(ah) ? 0x580 : 0x490))
|
||||
|
||||
#define AR_PHY_PAPRD_TRAINER_CNTL1_CF_CF_PAPRD_TRAIN_ENABLE 0x00000001
|
||||
#define AR_PHY_PAPRD_TRAINER_CNTL1_CF_CF_PAPRD_TRAIN_ENABLE_S 0
|
||||
#define AR_PHY_PAPRD_TRAINER_CNTL1_CF_PAPRD_AGC2_SETTLING 0x0000007e
|
||||
@ -1163,15 +1162,13 @@
|
||||
#define AR_PHY_PAPRD_TRAINER_CNTL1_CF_PAPRD_LB_SKIP 0x0003f000
|
||||
#define AR_PHY_PAPRD_TRAINER_CNTL1_CF_PAPRD_LB_SKIP_S 12
|
||||
|
||||
#define AR_PHY_PAPRD_TRAINER_CNTL2 (AR_SM_BASE + \
|
||||
(AR_SREV_9485(ah) ? \
|
||||
0x584 : 0x494))
|
||||
#define AR_PHY_PAPRD_TRAINER_CNTL2 (AR_SM_BASE + (AR_SREV_9485(ah) ? 0x584 : 0x494))
|
||||
|
||||
#define AR_PHY_PAPRD_TRAINER_CNTL2_CF_PAPRD_INIT_RX_BB_GAIN 0xFFFFFFFF
|
||||
#define AR_PHY_PAPRD_TRAINER_CNTL2_CF_PAPRD_INIT_RX_BB_GAIN_S 0
|
||||
|
||||
#define AR_PHY_PAPRD_TRAINER_CNTL3 (AR_SM_BASE + \
|
||||
(AR_SREV_9485(ah) ? \
|
||||
0x588 : 0x498))
|
||||
#define AR_PHY_PAPRD_TRAINER_CNTL3 (AR_SM_BASE + (AR_SREV_9485(ah) ? 0x588 : 0x498))
|
||||
|
||||
#define AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_ADC_DESIRED_SIZE 0x0000003f
|
||||
#define AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_ADC_DESIRED_SIZE_S 0
|
||||
#define AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_QUICK_DROP 0x00000fc0
|
||||
@ -1187,9 +1184,8 @@
|
||||
#define AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_BBTXMIX_DISABLE 0x20000000
|
||||
#define AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_BBTXMIX_DISABLE_S 29
|
||||
|
||||
#define AR_PHY_PAPRD_TRAINER_CNTL4 (AR_SM_BASE + \
|
||||
(AR_SREV_9485(ah) ? \
|
||||
0x58c : 0x49c))
|
||||
#define AR_PHY_PAPRD_TRAINER_CNTL4 (AR_SM_BASE + (AR_SREV_9485(ah) ? 0x58c : 0x49c))
|
||||
|
||||
#define AR_PHY_PAPRD_TRAINER_CNTL4_CF_PAPRD_NUM_TRAIN_SAMPLES 0x03ff0000
|
||||
#define AR_PHY_PAPRD_TRAINER_CNTL4_CF_PAPRD_NUM_TRAIN_SAMPLES_S 16
|
||||
#define AR_PHY_PAPRD_TRAINER_CNTL4_CF_PAPRD_SAFETY_DELTA 0x0000f000
|
||||
@ -1208,7 +1204,8 @@
|
||||
#define AR_PHY_PAPRD_PRE_POST_SCALING 0x3FFFF
|
||||
#define AR_PHY_PAPRD_PRE_POST_SCALING_S 0
|
||||
|
||||
#define AR_PHY_PAPRD_TRAINER_STAT1 (AR_SM_BASE + 0x4a0)
|
||||
#define AR_PHY_PAPRD_TRAINER_STAT1 (AR_SM_BASE + (AR_SREV_9485(ah) ? 0x590 : 0x4a0))
|
||||
|
||||
#define AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE 0x00000001
|
||||
#define AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE_S 0
|
||||
#define AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_INCOMPLETE 0x00000002
|
||||
@ -1222,7 +1219,8 @@
|
||||
#define AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_AGC2_PWR 0x0001fe00
|
||||
#define AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_AGC2_PWR_S 9
|
||||
|
||||
#define AR_PHY_PAPRD_TRAINER_STAT2 (AR_SM_BASE + 0x4a4)
|
||||
#define AR_PHY_PAPRD_TRAINER_STAT2 (AR_SM_BASE + (AR_SREV_9485(ah) ? 0x594 : 0x4a4))
|
||||
|
||||
#define AR_PHY_PAPRD_TRAINER_STAT2_PAPRD_FINE_VAL 0x0000ffff
|
||||
#define AR_PHY_PAPRD_TRAINER_STAT2_PAPRD_FINE_VAL_S 0
|
||||
#define AR_PHY_PAPRD_TRAINER_STAT2_PAPRD_COARSE_IDX 0x001f0000
|
||||
@ -1230,7 +1228,8 @@
|
||||
#define AR_PHY_PAPRD_TRAINER_STAT2_PAPRD_FINE_IDX 0x00600000
|
||||
#define AR_PHY_PAPRD_TRAINER_STAT2_PAPRD_FINE_IDX_S 21
|
||||
|
||||
#define AR_PHY_PAPRD_TRAINER_STAT3 (AR_SM_BASE + 0x4a8)
|
||||
#define AR_PHY_PAPRD_TRAINER_STAT3 (AR_SM_BASE + (AR_SREV_9485(ah) ? 0x598 : 0x4a8))
|
||||
|
||||
#define AR_PHY_PAPRD_TRAINER_STAT3_PAPRD_TRAIN_SAMPLES_CNT 0x000fffff
|
||||
#define AR_PHY_PAPRD_TRAINER_STAT3_PAPRD_TRAIN_SAMPLES_CNT_S 0
|
||||
|
||||
|
@ -211,6 +211,8 @@ static const u32 ar9340_1p0_radio_core_40M[][2] = {
|
||||
{0x0001609c, 0x02566f3a},
|
||||
{0x000160ac, 0xa4647c00},
|
||||
{0x000160b0, 0x01885f5a},
|
||||
{0x00008244, 0x0010f400},
|
||||
{0x0000824c, 0x0001e800},
|
||||
};
|
||||
|
||||
#define ar9340_1p0_mac_postamble ar9300_2p2_mac_postamble
|
||||
@ -1273,9 +1275,9 @@ static const u32 ar9340_1p0_mac_core[][2] = {
|
||||
{0x000081f8, 0x00000000},
|
||||
{0x000081fc, 0x00000000},
|
||||
{0x00008240, 0x00100000},
|
||||
{0x00008244, 0x0010f424},
|
||||
{0x00008244, 0x0010f3d7},
|
||||
{0x00008248, 0x00000800},
|
||||
{0x0000824c, 0x0001e848},
|
||||
{0x0000824c, 0x0001e7ae},
|
||||
{0x00008250, 0x00000000},
|
||||
{0x00008254, 0x00000000},
|
||||
{0x00008258, 0x00000000},
|
||||
|
@ -69,6 +69,7 @@ s16 ath9k_hw_getchan_noise(struct ath_hw *ah, struct ath9k_channel *chan)
|
||||
|
||||
if (chan && chan->noisefloor) {
|
||||
s8 delta = chan->noisefloor -
|
||||
ATH9K_NF_CAL_NOISE_THRESH -
|
||||
ath9k_hw_get_default_nf(ah, chan);
|
||||
if (delta > 0)
|
||||
noise += delta;
|
||||
|
@ -21,6 +21,9 @@
|
||||
|
||||
#define AR_PHY_CCA_FILTERWINDOW_LENGTH 5
|
||||
|
||||
/* Internal noise floor can vary by about 6db depending on the frequency */
|
||||
#define ATH9K_NF_CAL_NOISE_THRESH 6
|
||||
|
||||
#define NUM_NF_READINGS 6
|
||||
#define ATH9K_NF_CAL_HIST_MAX 5
|
||||
|
||||
|
@ -242,7 +242,7 @@ struct ath_rx_stats {
|
||||
|
||||
struct ath_stats {
|
||||
struct ath_interrupt_stats istats;
|
||||
struct ath_tx_stats txstats[IEEE80211_NUM_ACS];
|
||||
struct ath_tx_stats txstats[ATH9K_NUM_TX_QUEUES];
|
||||
struct ath_rx_stats rxstats;
|
||||
struct ath_dfs_stats dfs_stats;
|
||||
u32 reset[__RESET_TYPE_MAX];
|
||||
|
@ -113,9 +113,34 @@ void ath9k_hw_usb_gen_fill_eeprom(struct ath_hw *ah, u16 *eep_data,
|
||||
}
|
||||
}
|
||||
|
||||
bool ath9k_hw_nvram_read(struct ath_common *common, u32 off, u16 *data)
|
||||
static bool ath9k_hw_nvram_read_blob(struct ath_hw *ah, u32 off,
|
||||
u16 *data)
|
||||
{
|
||||
return common->bus_ops->eeprom_read(common, off, data);
|
||||
u16 *blob_data;
|
||||
|
||||
if (off * sizeof(u16) > ah->eeprom_blob->size)
|
||||
return false;
|
||||
|
||||
blob_data = (u16 *)ah->eeprom_blob->data;
|
||||
*data = blob_data[off];
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ath9k_hw_nvram_read(struct ath_hw *ah, u32 off, u16 *data)
|
||||
{
|
||||
struct ath_common *common = ath9k_hw_common(ah);
|
||||
bool ret;
|
||||
|
||||
if (ah->eeprom_blob)
|
||||
ret = ath9k_hw_nvram_read_blob(ah, off, data);
|
||||
else
|
||||
ret = common->bus_ops->eeprom_read(common, off, data);
|
||||
|
||||
if (!ret)
|
||||
ath_dbg(common, EEPROM,
|
||||
"unable to read eeprom region at offset %u\n", off);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void ath9k_hw_fill_vpd_table(u8 pwrMin, u8 pwrMax, u8 *pPwrList,
|
||||
|
@ -663,7 +663,7 @@ int16_t ath9k_hw_interpolate(u16 target, u16 srcLeft, u16 srcRight,
|
||||
int16_t targetRight);
|
||||
bool ath9k_hw_get_lower_upper_index(u8 target, u8 *pList, u16 listSize,
|
||||
u16 *indexL, u16 *indexR);
|
||||
bool ath9k_hw_nvram_read(struct ath_common *common, u32 off, u16 *data);
|
||||
bool ath9k_hw_nvram_read(struct ath_hw *ah, u32 off, u16 *data);
|
||||
void ath9k_hw_usb_gen_fill_eeprom(struct ath_hw *ah, u16 *eep_data,
|
||||
int eep_start_loc, int size);
|
||||
void ath9k_hw_fill_vpd_table(u8 pwrMin, u8 pwrMax, u8 *pPwrList,
|
||||
|
@ -32,16 +32,12 @@ static int ath9k_hw_4k_get_eeprom_rev(struct ath_hw *ah)
|
||||
|
||||
static bool __ath9k_hw_4k_fill_eeprom(struct ath_hw *ah)
|
||||
{
|
||||
struct ath_common *common = ath9k_hw_common(ah);
|
||||
u16 *eep_data = (u16 *)&ah->eeprom.map4k;
|
||||
int addr, eep_start_loc = 64;
|
||||
|
||||
for (addr = 0; addr < SIZE_EEPROM_4K; addr++) {
|
||||
if (!ath9k_hw_nvram_read(common, addr + eep_start_loc, eep_data)) {
|
||||
ath_dbg(common, EEPROM,
|
||||
"Unable to read eeprom region\n");
|
||||
if (!ath9k_hw_nvram_read(ah, addr + eep_start_loc, eep_data))
|
||||
return false;
|
||||
}
|
||||
eep_data++;
|
||||
}
|
||||
|
||||
@ -196,7 +192,7 @@ static int ath9k_hw_4k_check_eeprom(struct ath_hw *ah)
|
||||
|
||||
|
||||
if (!ath9k_hw_use_flash(ah)) {
|
||||
if (!ath9k_hw_nvram_read(common, AR5416_EEPROM_MAGIC_OFFSET,
|
||||
if (!ath9k_hw_nvram_read(ah, AR5416_EEPROM_MAGIC_OFFSET,
|
||||
&magic)) {
|
||||
ath_err(common, "Reading Magic # failed\n");
|
||||
return false;
|
||||
|
@ -33,18 +33,13 @@ static int ath9k_hw_ar9287_get_eeprom_rev(struct ath_hw *ah)
|
||||
static bool __ath9k_hw_ar9287_fill_eeprom(struct ath_hw *ah)
|
||||
{
|
||||
struct ar9287_eeprom *eep = &ah->eeprom.map9287;
|
||||
struct ath_common *common = ath9k_hw_common(ah);
|
||||
u16 *eep_data;
|
||||
int addr, eep_start_loc = AR9287_EEP_START_LOC;
|
||||
eep_data = (u16 *)eep;
|
||||
|
||||
for (addr = 0; addr < SIZE_EEPROM_AR9287; addr++) {
|
||||
if (!ath9k_hw_nvram_read(common, addr + eep_start_loc,
|
||||
eep_data)) {
|
||||
ath_dbg(common, EEPROM,
|
||||
"Unable to read eeprom region\n");
|
||||
if (!ath9k_hw_nvram_read(ah, addr + eep_start_loc, eep_data))
|
||||
return false;
|
||||
}
|
||||
eep_data++;
|
||||
}
|
||||
|
||||
@ -190,7 +185,7 @@ static int ath9k_hw_ar9287_check_eeprom(struct ath_hw *ah)
|
||||
struct ath_common *common = ath9k_hw_common(ah);
|
||||
|
||||
if (!ath9k_hw_use_flash(ah)) {
|
||||
if (!ath9k_hw_nvram_read(common, AR5416_EEPROM_MAGIC_OFFSET,
|
||||
if (!ath9k_hw_nvram_read(ah, AR5416_EEPROM_MAGIC_OFFSET,
|
||||
&magic)) {
|
||||
ath_err(common, "Reading Magic # failed\n");
|
||||
return false;
|
||||
|
@ -91,17 +91,13 @@ static int ath9k_hw_def_get_eeprom_rev(struct ath_hw *ah)
|
||||
|
||||
static bool __ath9k_hw_def_fill_eeprom(struct ath_hw *ah)
|
||||
{
|
||||
struct ath_common *common = ath9k_hw_common(ah);
|
||||
u16 *eep_data = (u16 *)&ah->eeprom.def;
|
||||
int addr, ar5416_eep_start_loc = 0x100;
|
||||
|
||||
for (addr = 0; addr < SIZE_EEPROM_DEF; addr++) {
|
||||
if (!ath9k_hw_nvram_read(common, addr + ar5416_eep_start_loc,
|
||||
eep_data)) {
|
||||
ath_err(ath9k_hw_common(ah),
|
||||
"Unable to read eeprom region\n");
|
||||
if (!ath9k_hw_nvram_read(ah, addr + ar5416_eep_start_loc,
|
||||
eep_data))
|
||||
return false;
|
||||
}
|
||||
eep_data++;
|
||||
}
|
||||
return true;
|
||||
@ -271,7 +267,7 @@ static int ath9k_hw_def_check_eeprom(struct ath_hw *ah)
|
||||
bool need_swap = false;
|
||||
int i, addr, size;
|
||||
|
||||
if (!ath9k_hw_nvram_read(common, AR5416_EEPROM_MAGIC_OFFSET, &magic)) {
|
||||
if (!ath9k_hw_nvram_read(ah, AR5416_EEPROM_MAGIC_OFFSET, &magic)) {
|
||||
ath_err(common, "Reading Magic # failed\n");
|
||||
return false;
|
||||
}
|
||||
|
@ -1082,7 +1082,7 @@ static bool ath9k_rx_prepare(struct ath9k_htc_priv *priv,
|
||||
rx_status->freq = hw->conf.channel->center_freq;
|
||||
rx_status->signal = rxbuf->rxstatus.rs_rssi + ATH_DEFAULT_NOISE_FLOOR;
|
||||
rx_status->antenna = rxbuf->rxstatus.rs_antenna;
|
||||
rx_status->flag |= RX_FLAG_MACTIME_START;
|
||||
rx_status->flag |= RX_FLAG_MACTIME_END;
|
||||
|
||||
return true;
|
||||
|
||||
|
@ -2599,6 +2599,10 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)
|
||||
pCap->hw_caps |= ATH9K_HW_WOW_PATTERN_MATCH_DWORD;
|
||||
}
|
||||
|
||||
if (AR_SREV_9300_20_OR_LATER(ah) &&
|
||||
ah->eep_ops->get_eeprom(ah, EEP_PAPRD))
|
||||
pCap->hw_caps |= ATH9K_HW_CAP_PAPRD;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include <linux/if_ether.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/firmware.h>
|
||||
|
||||
#include "mac.h"
|
||||
#include "ani.h"
|
||||
@ -247,6 +248,7 @@ enum ath9k_hw_caps {
|
||||
ATH9K_HW_WOW_DEVICE_CAPABLE = BIT(17),
|
||||
ATH9K_HW_WOW_PATTERN_MATCH_EXACT = BIT(18),
|
||||
ATH9K_HW_WOW_PATTERN_MATCH_DWORD = BIT(19),
|
||||
ATH9K_HW_CAP_PAPRD = BIT(20),
|
||||
};
|
||||
|
||||
/*
|
||||
@ -920,6 +922,8 @@ struct ath_hw {
|
||||
bool is_clk_25mhz;
|
||||
int (*get_mac_revision)(void);
|
||||
int (*external_reset)(void);
|
||||
|
||||
const struct firmware *eeprom_blob;
|
||||
};
|
||||
|
||||
struct ath_bus_ops {
|
||||
@ -1058,9 +1062,10 @@ void ar9003_paprd_populate_single_table(struct ath_hw *ah,
|
||||
int chain);
|
||||
int ar9003_paprd_create_curve(struct ath_hw *ah,
|
||||
struct ath9k_hw_cal_data *caldata, int chain);
|
||||
int ar9003_paprd_setup_gain_table(struct ath_hw *ah, int chain);
|
||||
void ar9003_paprd_setup_gain_table(struct ath_hw *ah, int chain);
|
||||
int ar9003_paprd_init_table(struct ath_hw *ah);
|
||||
bool ar9003_paprd_is_done(struct ath_hw *ah);
|
||||
bool ar9003_is_paprd_enabled(struct ath_hw *ah);
|
||||
|
||||
/* Hardware family op attach helpers */
|
||||
void ar5008_hw_attach_phy_ops(struct ath_hw *ah);
|
||||
|
@ -23,6 +23,11 @@
|
||||
|
||||
#include "ath9k.h"
|
||||
|
||||
struct ath9k_eeprom_ctx {
|
||||
struct completion complete;
|
||||
struct ath_hw *ah;
|
||||
};
|
||||
|
||||
static char *dev_info = "ath9k";
|
||||
|
||||
MODULE_AUTHOR("Atheros Communications");
|
||||
@ -506,6 +511,51 @@ static void ath9k_init_misc(struct ath_softc *sc)
|
||||
sc->ant_comb.count = ATH_ANT_DIV_COMB_INIT_COUNT;
|
||||
}
|
||||
|
||||
static void ath9k_eeprom_request_cb(const struct firmware *eeprom_blob,
|
||||
void *ctx)
|
||||
{
|
||||
struct ath9k_eeprom_ctx *ec = ctx;
|
||||
|
||||
if (eeprom_blob)
|
||||
ec->ah->eeprom_blob = eeprom_blob;
|
||||
|
||||
complete(&ec->complete);
|
||||
}
|
||||
|
||||
static int ath9k_eeprom_request(struct ath_softc *sc, const char *name)
|
||||
{
|
||||
struct ath9k_eeprom_ctx ec;
|
||||
struct ath_hw *ah = ah = sc->sc_ah;
|
||||
int err;
|
||||
|
||||
/* try to load the EEPROM content asynchronously */
|
||||
init_completion(&ec.complete);
|
||||
ec.ah = sc->sc_ah;
|
||||
|
||||
err = request_firmware_nowait(THIS_MODULE, 1, name, sc->dev, GFP_KERNEL,
|
||||
&ec, ath9k_eeprom_request_cb);
|
||||
if (err < 0) {
|
||||
ath_err(ath9k_hw_common(ah),
|
||||
"EEPROM request failed\n");
|
||||
return err;
|
||||
}
|
||||
|
||||
wait_for_completion(&ec.complete);
|
||||
|
||||
if (!ah->eeprom_blob) {
|
||||
ath_err(ath9k_hw_common(ah),
|
||||
"Unable to load EEPROM file %s\n", name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void ath9k_eeprom_release(struct ath_softc *sc)
|
||||
{
|
||||
release_firmware(sc->sc_ah->eeprom_blob);
|
||||
}
|
||||
|
||||
static int ath9k_init_softc(u16 devid, struct ath_softc *sc,
|
||||
const struct ath_bus_ops *bus_ops)
|
||||
{
|
||||
@ -583,6 +633,12 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc,
|
||||
ath_read_cachesize(common, &csz);
|
||||
common->cachelsz = csz << 2; /* convert to bytes */
|
||||
|
||||
if (pdata && pdata->eeprom_name) {
|
||||
ret = ath9k_eeprom_request(sc, pdata->eeprom_name);
|
||||
if (ret)
|
||||
goto err_eeprom;
|
||||
}
|
||||
|
||||
/* Initializes the hardware for all supported chipsets */
|
||||
ret = ath9k_hw_init(ah);
|
||||
if (ret)
|
||||
@ -619,7 +675,8 @@ err_btcoex:
|
||||
err_queues:
|
||||
ath9k_hw_deinit(ah);
|
||||
err_hw:
|
||||
|
||||
ath9k_eeprom_release(sc);
|
||||
err_eeprom:
|
||||
kfree(ah);
|
||||
sc->sc_ah = NULL;
|
||||
|
||||
@ -882,6 +939,7 @@ static void ath9k_deinit_softc(struct ath_softc *sc)
|
||||
if (sc->dfs_detector != NULL)
|
||||
sc->dfs_detector->exit(sc->dfs_detector);
|
||||
|
||||
ath9k_eeprom_release(sc);
|
||||
kfree(sc->sc_ah);
|
||||
sc->sc_ah = NULL;
|
||||
}
|
||||
|
@ -179,13 +179,15 @@ void ath_rx_poll(unsigned long data)
|
||||
static void ath_paprd_activate(struct ath_softc *sc)
|
||||
{
|
||||
struct ath_hw *ah = sc->sc_ah;
|
||||
struct ath_common *common = ath9k_hw_common(ah);
|
||||
struct ath9k_hw_cal_data *caldata = ah->caldata;
|
||||
int chain;
|
||||
|
||||
if (!caldata || !caldata->paprd_done)
|
||||
if (!caldata || !caldata->paprd_done) {
|
||||
ath_dbg(common, CALIBRATE, "Failed to activate PAPRD\n");
|
||||
return;
|
||||
}
|
||||
|
||||
ath9k_ps_wakeup(sc);
|
||||
ar9003_paprd_enable(ah, false);
|
||||
for (chain = 0; chain < AR9300_MAX_CHAINS; chain++) {
|
||||
if (!(ah->txchainmask & BIT(chain)))
|
||||
@ -194,8 +196,8 @@ static void ath_paprd_activate(struct ath_softc *sc)
|
||||
ar9003_paprd_populate_single_table(ah, caldata, chain);
|
||||
}
|
||||
|
||||
ath_dbg(common, CALIBRATE, "Activating PAPRD\n");
|
||||
ar9003_paprd_enable(ah, true);
|
||||
ath9k_ps_restore(sc);
|
||||
}
|
||||
|
||||
static bool ath_paprd_send_frame(struct ath_softc *sc, struct sk_buff *skb, int chain)
|
||||
@ -253,8 +255,10 @@ void ath_paprd_calibrate(struct work_struct *work)
|
||||
int len = 1800;
|
||||
int ret;
|
||||
|
||||
if (!caldata || !caldata->paprd_packet_sent || caldata->paprd_done)
|
||||
if (!caldata || !caldata->paprd_packet_sent || caldata->paprd_done) {
|
||||
ath_dbg(common, CALIBRATE, "Skipping PAPRD calibration\n");
|
||||
return;
|
||||
}
|
||||
|
||||
ath9k_ps_wakeup(sc);
|
||||
|
||||
@ -430,11 +434,15 @@ set_timer:
|
||||
cal_interval = min(cal_interval, (u32)short_cal_interval);
|
||||
|
||||
mod_timer(&common->ani.timer, jiffies + msecs_to_jiffies(cal_interval));
|
||||
if (ah->eep_ops->get_eeprom(ah, EEP_PAPRD) && ah->caldata) {
|
||||
if (!ah->caldata->paprd_done)
|
||||
|
||||
if (ar9003_is_paprd_enabled(ah) && ah->caldata) {
|
||||
if (!ah->caldata->paprd_done) {
|
||||
ieee80211_queue_work(sc->hw, &sc->paprd_work);
|
||||
else if (!ah->paprd_table_write_done)
|
||||
} else if (!ah->paprd_table_write_done) {
|
||||
ath9k_ps_wakeup(sc);
|
||||
ath_paprd_activate(sc);
|
||||
ath9k_ps_restore(sc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -976,7 +976,7 @@ static int ath9k_rx_skb_preprocess(struct ath_common *common,
|
||||
rx_status->freq = hw->conf.channel->center_freq;
|
||||
rx_status->signal = ah->noise + rx_stats->rs_rssi;
|
||||
rx_status->antenna = rx_stats->rs_antenna;
|
||||
rx_status->flag |= RX_FLAG_MACTIME_START;
|
||||
rx_status->flag |= RX_FLAG_MACTIME_END;
|
||||
if (rx_stats->rs_moreaggr)
|
||||
rx_status->flag |= RX_FLAG_NO_SIGNAL_VAL;
|
||||
|
||||
|
@ -684,7 +684,7 @@ static int carl9170_handle_mpdu(struct ar9170 *ar, u8 *buf, int len,
|
||||
if (!skb)
|
||||
return -ENOMEM;
|
||||
|
||||
memcpy(IEEE80211_SKB_RXCB(skb), &status, sizeof(status));
|
||||
memcpy(IEEE80211_SKB_RXCB(skb), status, sizeof(*status));
|
||||
ieee80211_rx(ar->hw, skb);
|
||||
return 0;
|
||||
}
|
||||
|
@ -409,7 +409,10 @@ static inline
|
||||
struct b43_dmadesc_meta *meta)
|
||||
{
|
||||
if (meta->skb) {
|
||||
dev_kfree_skb_any(meta->skb);
|
||||
if (ring->tx)
|
||||
ieee80211_free_txskb(ring->dev->wl->hw, meta->skb);
|
||||
else
|
||||
dev_kfree_skb_any(meta->skb);
|
||||
meta->skb = NULL;
|
||||
}
|
||||
}
|
||||
@ -1454,7 +1457,7 @@ int b43_dma_tx(struct b43_wldev *dev, struct sk_buff *skb)
|
||||
if (unlikely(err == -ENOKEY)) {
|
||||
/* Drop this packet, as we don't have the encryption key
|
||||
* anymore and must not transmit it unencrypted. */
|
||||
dev_kfree_skb_any(skb);
|
||||
ieee80211_free_txskb(dev->wl->hw, skb);
|
||||
err = 0;
|
||||
goto out;
|
||||
}
|
||||
|
@ -3397,7 +3397,7 @@ static void b43_tx_work(struct work_struct *work)
|
||||
break;
|
||||
}
|
||||
if (unlikely(err))
|
||||
dev_kfree_skb(skb); /* Drop it */
|
||||
ieee80211_free_txskb(wl->hw, skb);
|
||||
err = 0;
|
||||
}
|
||||
|
||||
@ -3419,7 +3419,7 @@ static void b43_op_tx(struct ieee80211_hw *hw,
|
||||
|
||||
if (unlikely(skb->len < 2 + 2 + 6)) {
|
||||
/* Too short, this can't be a valid frame. */
|
||||
dev_kfree_skb_any(skb);
|
||||
ieee80211_free_txskb(hw, skb);
|
||||
return;
|
||||
}
|
||||
B43_WARN_ON(skb_shinfo(skb)->nr_frags);
|
||||
@ -4229,8 +4229,12 @@ redo:
|
||||
|
||||
/* Drain all TX queues. */
|
||||
for (queue_num = 0; queue_num < B43_QOS_QUEUE_NUM; queue_num++) {
|
||||
while (skb_queue_len(&wl->tx_queue[queue_num]))
|
||||
dev_kfree_skb(skb_dequeue(&wl->tx_queue[queue_num]));
|
||||
while (skb_queue_len(&wl->tx_queue[queue_num])) {
|
||||
struct sk_buff *skb;
|
||||
|
||||
skb = skb_dequeue(&wl->tx_queue[queue_num]);
|
||||
ieee80211_free_txskb(wl->hw, skb);
|
||||
}
|
||||
}
|
||||
|
||||
b43_mac_suspend(dev);
|
||||
|
@ -196,7 +196,7 @@ static void b43_pio_cancel_tx_packets(struct b43_pio_txqueue *q)
|
||||
for (i = 0; i < ARRAY_SIZE(q->packets); i++) {
|
||||
pack = &(q->packets[i]);
|
||||
if (pack->skb) {
|
||||
dev_kfree_skb_any(pack->skb);
|
||||
ieee80211_free_txskb(q->dev->wl->hw, pack->skb);
|
||||
pack->skb = NULL;
|
||||
}
|
||||
}
|
||||
@ -552,7 +552,7 @@ int b43_pio_tx(struct b43_wldev *dev, struct sk_buff *skb)
|
||||
if (unlikely(err == -ENOKEY)) {
|
||||
/* Drop this packet, as we don't have the encryption key
|
||||
* anymore and must not transmit it unencrypted. */
|
||||
dev_kfree_skb_any(skb);
|
||||
ieee80211_free_txskb(dev->wl->hw, skb);
|
||||
err = 0;
|
||||
goto out;
|
||||
}
|
||||
|
@ -13,6 +13,7 @@
|
||||
|
||||
#include <linux/ssb/ssb.h>
|
||||
#include <linux/ssb/ssb_driver_chipcommon.h>
|
||||
#include <linux/completion.h>
|
||||
|
||||
#include <net/mac80211.h>
|
||||
|
||||
@ -733,6 +734,10 @@ struct b43legacy_wldev {
|
||||
|
||||
/* Firmware data */
|
||||
struct b43legacy_firmware fw;
|
||||
const struct firmware *fwp; /* needed to pass fw pointer */
|
||||
|
||||
/* completion struct for firmware loading */
|
||||
struct completion fw_load_complete;
|
||||
|
||||
/* Devicelist in struct b43legacy_wl (all 802.11 cores) */
|
||||
struct list_head list;
|
||||
|
@ -1513,9 +1513,17 @@ static void b43legacy_print_fw_helptext(struct b43legacy_wl *wl)
|
||||
"and download the correct firmware (version 3).\n");
|
||||
}
|
||||
|
||||
static void b43legacy_fw_cb(const struct firmware *firmware, void *context)
|
||||
{
|
||||
struct b43legacy_wldev *dev = context;
|
||||
|
||||
dev->fwp = firmware;
|
||||
complete(&dev->fw_load_complete);
|
||||
}
|
||||
|
||||
static int do_request_fw(struct b43legacy_wldev *dev,
|
||||
const char *name,
|
||||
const struct firmware **fw)
|
||||
const struct firmware **fw, bool async)
|
||||
{
|
||||
char path[sizeof(modparam_fwpostfix) + 32];
|
||||
struct b43legacy_fw_header *hdr;
|
||||
@ -1528,7 +1536,24 @@ static int do_request_fw(struct b43legacy_wldev *dev,
|
||||
snprintf(path, ARRAY_SIZE(path),
|
||||
"b43legacy%s/%s.fw",
|
||||
modparam_fwpostfix, name);
|
||||
err = request_firmware(fw, path, dev->dev->dev);
|
||||
b43legacyinfo(dev->wl, "Loading firmware %s\n", path);
|
||||
if (async) {
|
||||
init_completion(&dev->fw_load_complete);
|
||||
err = request_firmware_nowait(THIS_MODULE, 1, path,
|
||||
dev->dev->dev, GFP_KERNEL,
|
||||
dev, b43legacy_fw_cb);
|
||||
if (err) {
|
||||
b43legacyerr(dev->wl, "Unable to load firmware\n");
|
||||
return err;
|
||||
}
|
||||
/* stall here until fw ready */
|
||||
wait_for_completion(&dev->fw_load_complete);
|
||||
if (!dev->fwp)
|
||||
err = -EINVAL;
|
||||
*fw = dev->fwp;
|
||||
} else {
|
||||
err = request_firmware(fw, path, dev->dev->dev);
|
||||
}
|
||||
if (err) {
|
||||
b43legacyerr(dev->wl, "Firmware file \"%s\" not found "
|
||||
"or load failed.\n", path);
|
||||
@ -1580,7 +1605,7 @@ static void b43legacy_request_firmware(struct work_struct *work)
|
||||
filename = "ucode4";
|
||||
else
|
||||
filename = "ucode5";
|
||||
err = do_request_fw(dev, filename, &fw->ucode);
|
||||
err = do_request_fw(dev, filename, &fw->ucode, true);
|
||||
if (err)
|
||||
goto err_load;
|
||||
}
|
||||
@ -1589,7 +1614,7 @@ static void b43legacy_request_firmware(struct work_struct *work)
|
||||
filename = "pcm4";
|
||||
else
|
||||
filename = "pcm5";
|
||||
err = do_request_fw(dev, filename, &fw->pcm);
|
||||
err = do_request_fw(dev, filename, &fw->pcm, false);
|
||||
if (err)
|
||||
goto err_load;
|
||||
}
|
||||
@ -1607,7 +1632,7 @@ static void b43legacy_request_firmware(struct work_struct *work)
|
||||
default:
|
||||
goto err_no_initvals;
|
||||
}
|
||||
err = do_request_fw(dev, filename, &fw->initvals);
|
||||
err = do_request_fw(dev, filename, &fw->initvals, false);
|
||||
if (err)
|
||||
goto err_load;
|
||||
}
|
||||
@ -1627,7 +1652,7 @@ static void b43legacy_request_firmware(struct work_struct *work)
|
||||
default:
|
||||
goto err_no_initvals;
|
||||
}
|
||||
err = do_request_fw(dev, filename, &fw->initvals_band);
|
||||
err = do_request_fw(dev, filename, &fw->initvals_band, false);
|
||||
if (err)
|
||||
goto err_load;
|
||||
}
|
||||
|
@ -67,9 +67,8 @@ int brcmf_sdio_intr_register(struct brcmf_sdio_dev *sdiodev)
|
||||
u8 data;
|
||||
unsigned long flags;
|
||||
|
||||
brcmf_dbg(TRACE, "Entering\n");
|
||||
brcmf_dbg(TRACE, "Entering: irq %d\n", sdiodev->irq);
|
||||
|
||||
brcmf_dbg(ERROR, "requesting irq %d\n", sdiodev->irq);
|
||||
ret = request_irq(sdiodev->irq, brcmf_sdio_irqhandler,
|
||||
sdiodev->irq_flags, "brcmf_oob_intr",
|
||||
&sdiodev->func[1]->dev);
|
||||
@ -184,7 +183,7 @@ brcmf_sdcard_set_sbaddr_window(struct brcmf_sdio_dev *sdiodev, u32 address)
|
||||
} while (err != 0 && retry++ < SDIOH_API_ACCESS_RETRY_LIMIT);
|
||||
|
||||
if (err) {
|
||||
brcmf_dbg(ERROR, "failed at addr:0x%0x\n",
|
||||
brcmf_err("failed at addr:0x%0x\n",
|
||||
SBSDIO_FUNC1_SBADDRLOW + i);
|
||||
break;
|
||||
}
|
||||
@ -246,7 +245,7 @@ brcmf_sdio_regrw_helper(struct brcmf_sdio_dev *sdiodev, u32 addr,
|
||||
} while (ret != 0 && retry++ < SDIOH_API_ACCESS_RETRY_LIMIT);
|
||||
|
||||
if (ret != 0)
|
||||
brcmf_dbg(ERROR, "failed with %d\n", ret);
|
||||
brcmf_err("failed with %d\n", ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -340,7 +339,7 @@ brcmf_sdcard_recv_buf(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
|
||||
|
||||
mypkt = brcmu_pkt_buf_get_skb(nbytes);
|
||||
if (!mypkt) {
|
||||
brcmf_dbg(ERROR, "brcmu_pkt_buf_get_skb failed: len %d\n",
|
||||
brcmf_err("brcmu_pkt_buf_get_skb failed: len %d\n",
|
||||
nbytes);
|
||||
return -EIO;
|
||||
}
|
||||
@ -409,7 +408,7 @@ brcmf_sdcard_send_buf(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
|
||||
|
||||
mypkt = brcmu_pkt_buf_get_skb(nbytes);
|
||||
if (!mypkt) {
|
||||
brcmf_dbg(ERROR, "brcmu_pkt_buf_get_skb failed: len %d\n",
|
||||
brcmf_err("brcmu_pkt_buf_get_skb failed: len %d\n",
|
||||
nbytes);
|
||||
return -EIO;
|
||||
}
|
||||
@ -472,7 +471,7 @@ int brcmf_sdcard_rwdata(struct brcmf_sdio_dev *sdiodev, uint rw, u32 addr,
|
||||
|
||||
mypkt = brcmu_pkt_buf_get_skb(nbytes);
|
||||
if (!mypkt) {
|
||||
brcmf_dbg(ERROR, "brcmu_pkt_buf_get_skb failed: len %d\n",
|
||||
brcmf_err("brcmu_pkt_buf_get_skb failed: len %d\n",
|
||||
nbytes);
|
||||
return -EIO;
|
||||
}
|
||||
@ -519,7 +518,7 @@ int brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev)
|
||||
/* try to attach to the target device */
|
||||
sdiodev->bus = brcmf_sdbrcm_probe(regs, sdiodev);
|
||||
if (!sdiodev->bus) {
|
||||
brcmf_dbg(ERROR, "device attach failed\n");
|
||||
brcmf_err("device attach failed\n");
|
||||
ret = -ENODEV;
|
||||
goto out;
|
||||
}
|
||||
|
@ -107,15 +107,13 @@ static inline int brcmf_sdioh_f0_write_byte(struct brcmf_sdio_dev *sdiodev,
|
||||
/* Enable Function 2 */
|
||||
err_ret = sdio_enable_func(sdfunc);
|
||||
if (err_ret)
|
||||
brcmf_dbg(ERROR,
|
||||
"enable F2 failed:%d\n",
|
||||
brcmf_err("enable F2 failed:%d\n",
|
||||
err_ret);
|
||||
} else {
|
||||
/* Disable Function 2 */
|
||||
err_ret = sdio_disable_func(sdfunc);
|
||||
if (err_ret)
|
||||
brcmf_dbg(ERROR,
|
||||
"Disable F2 failed:%d\n",
|
||||
brcmf_err("Disable F2 failed:%d\n",
|
||||
err_ret);
|
||||
}
|
||||
}
|
||||
@ -129,7 +127,7 @@ static inline int brcmf_sdioh_f0_write_byte(struct brcmf_sdio_dev *sdiodev,
|
||||
sdio_writeb(sdfunc, *byte, regaddr, &err_ret);
|
||||
kfree(sdfunc);
|
||||
} else if (regaddr < 0xF0) {
|
||||
brcmf_dbg(ERROR, "F0 Wr:0x%02x: write disallowed\n", regaddr);
|
||||
brcmf_err("F0 Wr:0x%02x: write disallowed\n", regaddr);
|
||||
err_ret = -EPERM;
|
||||
} else {
|
||||
sdio_f0_writeb(sdfunc, *byte, regaddr, &err_ret);
|
||||
@ -166,7 +164,7 @@ int brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw, uint func,
|
||||
}
|
||||
|
||||
if (err_ret)
|
||||
brcmf_dbg(ERROR, "Failed to %s byte F%d:@0x%05x=%02x, Err: %d\n",
|
||||
brcmf_err("Failed to %s byte F%d:@0x%05x=%02x, Err: %d\n",
|
||||
rw ? "write" : "read", func, regaddr, *byte, err_ret);
|
||||
|
||||
return err_ret;
|
||||
@ -179,7 +177,7 @@ int brcmf_sdioh_request_word(struct brcmf_sdio_dev *sdiodev,
|
||||
int err_ret = -EIO;
|
||||
|
||||
if (func == 0) {
|
||||
brcmf_dbg(ERROR, "Only CMD52 allowed to F0\n");
|
||||
brcmf_err("Only CMD52 allowed to F0\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@ -198,7 +196,7 @@ int brcmf_sdioh_request_word(struct brcmf_sdio_dev *sdiodev,
|
||||
sdio_writew(sdiodev->func[func], (*word & 0xFFFF),
|
||||
addr, &err_ret);
|
||||
else
|
||||
brcmf_dbg(ERROR, "Invalid nbytes: %d\n", nbytes);
|
||||
brcmf_err("Invalid nbytes: %d\n", nbytes);
|
||||
} else { /* CMD52 Read */
|
||||
if (nbytes == 4)
|
||||
*word = sdio_readl(sdiodev->func[func], addr, &err_ret);
|
||||
@ -206,11 +204,11 @@ int brcmf_sdioh_request_word(struct brcmf_sdio_dev *sdiodev,
|
||||
*word = sdio_readw(sdiodev->func[func], addr,
|
||||
&err_ret) & 0xFFFF;
|
||||
else
|
||||
brcmf_dbg(ERROR, "Invalid nbytes: %d\n", nbytes);
|
||||
brcmf_err("Invalid nbytes: %d\n", nbytes);
|
||||
}
|
||||
|
||||
if (err_ret)
|
||||
brcmf_dbg(ERROR, "Failed to %s word, Err: 0x%08x\n",
|
||||
brcmf_err("Failed to %s word, Err: 0x%08x\n",
|
||||
rw ? "write" : "read", err_ret);
|
||||
|
||||
return err_ret;
|
||||
@ -270,7 +268,7 @@ brcmf_sdioh_request_chain(struct brcmf_sdio_dev *sdiodev, uint fix_inc,
|
||||
err_ret = brcmf_sdioh_request_data(sdiodev, write, fifo, func,
|
||||
addr, pkt, pkt_len);
|
||||
if (err_ret) {
|
||||
brcmf_dbg(ERROR, "%s FAILED %p[%d], addr=0x%05x, pkt_len=%d, ERR=0x%08x\n",
|
||||
brcmf_err("%s FAILED %p[%d], addr=0x%05x, pkt_len=%d, ERR=0x%08x\n",
|
||||
write ? "TX" : "RX", pkt, SGCount, addr,
|
||||
pkt_len, err_ret);
|
||||
} else {
|
||||
@ -315,7 +313,7 @@ int brcmf_sdioh_request_buffer(struct brcmf_sdio_dev *sdiodev,
|
||||
status = brcmf_sdioh_request_data(sdiodev, write, fifo, func,
|
||||
addr, pkt, pkt_len);
|
||||
if (status) {
|
||||
brcmf_dbg(ERROR, "%s FAILED %p, addr=0x%05x, pkt_len=%d, ERR=0x%08x\n",
|
||||
brcmf_err("%s FAILED %p, addr=0x%05x, pkt_len=%d, ERR=0x%08x\n",
|
||||
write ? "TX" : "RX", pkt, addr, pkt_len, status);
|
||||
} else {
|
||||
brcmf_dbg(TRACE, "%s xfr'd %p, addr=0x%05x, len=%d\n",
|
||||
@ -336,7 +334,7 @@ static int brcmf_sdioh_get_cisaddr(struct brcmf_sdio_dev *sdiodev, u32 regaddr)
|
||||
for (i = 0; i < 3; i++) {
|
||||
regdata = brcmf_sdio_regrl(sdiodev, regaddr, &ret);
|
||||
if (ret != 0)
|
||||
brcmf_dbg(ERROR, "Can't read!\n");
|
||||
brcmf_err("Can't read!\n");
|
||||
|
||||
*ptr++ = (u8) regdata;
|
||||
regaddr++;
|
||||
@ -374,7 +372,7 @@ static int brcmf_sdioh_enablefuncs(struct brcmf_sdio_dev *sdiodev)
|
||||
/* Enable Function 1 */
|
||||
err_ret = sdio_enable_func(sdiodev->func[1]);
|
||||
if (err_ret)
|
||||
brcmf_dbg(ERROR, "Failed to enable F1 Err: 0x%08x\n", err_ret);
|
||||
brcmf_err("Failed to enable F1 Err: 0x%08x\n", err_ret);
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -394,13 +392,13 @@ int brcmf_sdioh_attach(struct brcmf_sdio_dev *sdiodev)
|
||||
|
||||
err_ret = sdio_set_block_size(sdiodev->func[1], SDIO_FUNC1_BLOCKSIZE);
|
||||
if (err_ret) {
|
||||
brcmf_dbg(ERROR, "Failed to set F1 blocksize\n");
|
||||
brcmf_err("Failed to set F1 blocksize\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
err_ret = sdio_set_block_size(sdiodev->func[2], SDIO_FUNC2_BLOCKSIZE);
|
||||
if (err_ret) {
|
||||
brcmf_dbg(ERROR, "Failed to set F2 blocksize\n");
|
||||
brcmf_err("Failed to set F2 blocksize\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
@ -434,7 +432,7 @@ static int brcmf_sdio_getintrcfg(struct brcmf_sdio_dev *sdiodev)
|
||||
struct brcmf_sdio_oobirq *oobirq_entry;
|
||||
|
||||
if (list_empty(&oobirq_lh)) {
|
||||
brcmf_dbg(ERROR, "no valid oob irq resource\n");
|
||||
brcmf_err("no valid oob irq resource\n");
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
@ -508,7 +506,7 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func,
|
||||
brcmf_dbg(TRACE, "F2 found, calling brcmf_sdio_probe...\n");
|
||||
err = brcmf_sdio_probe(sdiodev);
|
||||
if (err) {
|
||||
brcmf_dbg(ERROR, "F2 error, probe failed %d...\n", err);
|
||||
brcmf_err("F2 error, probe failed %d...\n", err);
|
||||
goto fail;
|
||||
}
|
||||
brcmf_dbg(TRACE, "F2 init completed...\n");
|
||||
@ -564,13 +562,13 @@ static int brcmf_sdio_suspend(struct device *dev)
|
||||
|
||||
sdio_flags = sdio_get_host_pm_caps(sdiodev->func[1]);
|
||||
if (!(sdio_flags & MMC_PM_KEEP_POWER)) {
|
||||
brcmf_dbg(ERROR, "Host can't keep power while suspended\n");
|
||||
brcmf_err("Host can't keep power while suspended\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ret = sdio_set_host_pm_flags(sdiodev->func[1], MMC_PM_KEEP_POWER);
|
||||
if (ret) {
|
||||
brcmf_dbg(ERROR, "Failed to set pm_flags\n");
|
||||
brcmf_err("Failed to set pm_flags\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -635,7 +633,7 @@ static int brcmf_sdio_pd_probe(struct platform_device *pdev)
|
||||
ret = sdio_register_driver(&brcmf_sdmmc_driver);
|
||||
|
||||
if (ret)
|
||||
brcmf_dbg(ERROR, "sdio_register_driver failed: %d\n", ret);
|
||||
brcmf_err("sdio_register_driver failed: %d\n", ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -665,7 +663,7 @@ void brcmf_sdio_init(void)
|
||||
ret = platform_driver_register(&brcmf_sdio_pd);
|
||||
|
||||
if (ret)
|
||||
brcmf_dbg(ERROR, "platform_driver_register failed: %d\n", ret);
|
||||
brcmf_err("platform_driver_register failed: %d\n", ret);
|
||||
}
|
||||
#else
|
||||
void brcmf_sdio_exit(void)
|
||||
@ -684,6 +682,6 @@ void brcmf_sdio_init(void)
|
||||
ret = sdio_register_driver(&brcmf_sdmmc_driver);
|
||||
|
||||
if (ret)
|
||||
brcmf_dbg(ERROR, "sdio_register_driver failed: %d\n", ret);
|
||||
brcmf_err("sdio_register_driver failed: %d\n", ret);
|
||||
}
|
||||
#endif /* CONFIG_BRCMFMAC_SDIO_OOB */
|
||||
|
@ -470,7 +470,6 @@ struct brcmf_pub {
|
||||
struct brcmf_bus *bus_if;
|
||||
struct brcmf_proto *prot;
|
||||
struct brcmf_cfg80211_info *config;
|
||||
struct device *dev; /* fullmac dongle device pointer */
|
||||
|
||||
/* Internal brcmf items */
|
||||
uint hdrlen; /* Total BRCMF header length (proto + bus) */
|
||||
|
@ -43,35 +43,89 @@ struct brcmf_bus_dcmd {
|
||||
struct list_head list;
|
||||
};
|
||||
|
||||
/* interface structure between common and bus layer */
|
||||
/**
|
||||
* struct brcmf_bus_ops - bus callback operations.
|
||||
*
|
||||
* @init: prepare for communication with dongle.
|
||||
* @stop: clear pending frames, disable data flow.
|
||||
* @txdata: send a data frame to the dongle (callee disposes skb).
|
||||
* @txctl: transmit a control request message to dongle.
|
||||
* @rxctl: receive a control response message from dongle.
|
||||
*
|
||||
* This structure provides an abstract interface towards the
|
||||
* bus specific driver. For control messages to common driver
|
||||
* will assure there is only one active transaction.
|
||||
*/
|
||||
struct brcmf_bus_ops {
|
||||
int (*init)(struct device *dev);
|
||||
void (*stop)(struct device *dev);
|
||||
int (*txdata)(struct device *dev, struct sk_buff *skb);
|
||||
int (*txctl)(struct device *dev, unsigned char *msg, uint len);
|
||||
int (*rxctl)(struct device *dev, unsigned char *msg, uint len);
|
||||
};
|
||||
|
||||
/**
|
||||
* struct brcmf_bus - interface structure between common and bus layer
|
||||
*
|
||||
* @bus_priv: pointer to private bus device.
|
||||
* @dev: device pointer of bus device.
|
||||
* @drvr: public driver information.
|
||||
* @state: operational state of the bus interface.
|
||||
* @maxctl: maximum size for rxctl request message.
|
||||
* @drvr_up: indicates driver up/down status.
|
||||
* @tx_realloc: number of tx packets realloced for headroom.
|
||||
* @dstats: dongle-based statistical data.
|
||||
* @align: alignment requirement for the bus.
|
||||
* @dcmd_list: bus/device specific dongle initialization commands.
|
||||
*/
|
||||
struct brcmf_bus {
|
||||
union {
|
||||
struct brcmf_sdio_dev *sdio;
|
||||
struct brcmf_usbdev *usb;
|
||||
} bus_priv;
|
||||
struct brcmf_pub *drvr; /* pointer to driver pub structure brcmf_pub */
|
||||
struct device *dev;
|
||||
struct brcmf_pub *drvr;
|
||||
enum brcmf_bus_state state;
|
||||
uint maxctl; /* Max size rxctl request from proto to bus */
|
||||
bool drvr_up; /* Status flag of driver up/down */
|
||||
unsigned long tx_realloc; /* Tx packets realloced for headroom */
|
||||
struct dngl_stats dstats; /* Stats for dongle-based data */
|
||||
u8 align; /* bus alignment requirement */
|
||||
uint maxctl;
|
||||
bool drvr_up;
|
||||
unsigned long tx_realloc;
|
||||
struct dngl_stats dstats;
|
||||
u8 align;
|
||||
struct list_head dcmd_list;
|
||||
|
||||
/* interface functions pointers */
|
||||
/* Stop bus module: clear pending frames, disable data flow */
|
||||
void (*brcmf_bus_stop)(struct device *);
|
||||
/* Initialize bus module: prepare for communication w/dongle */
|
||||
int (*brcmf_bus_init)(struct device *);
|
||||
/* Send a data frame to the dongle. Callee disposes of txp. */
|
||||
int (*brcmf_bus_txdata)(struct device *, struct sk_buff *);
|
||||
/* Send/receive a control message to/from the dongle.
|
||||
* Expects caller to enforce a single outstanding transaction.
|
||||
*/
|
||||
int (*brcmf_bus_txctl)(struct device *, unsigned char *, uint);
|
||||
int (*brcmf_bus_rxctl)(struct device *, unsigned char *, uint);
|
||||
struct brcmf_bus_ops *ops;
|
||||
};
|
||||
|
||||
/*
|
||||
* callback wrappers
|
||||
*/
|
||||
static inline int brcmf_bus_init(struct brcmf_bus *bus)
|
||||
{
|
||||
return bus->ops->init(bus->dev);
|
||||
}
|
||||
|
||||
static inline void brcmf_bus_stop(struct brcmf_bus *bus)
|
||||
{
|
||||
bus->ops->stop(bus->dev);
|
||||
}
|
||||
|
||||
static inline int brcmf_bus_txdata(struct brcmf_bus *bus, struct sk_buff *skb)
|
||||
{
|
||||
return bus->ops->txdata(bus->dev, skb);
|
||||
}
|
||||
|
||||
static inline
|
||||
int brcmf_bus_txctl(struct brcmf_bus *bus, unsigned char *msg, uint len)
|
||||
{
|
||||
return bus->ops->txctl(bus->dev, msg, len);
|
||||
}
|
||||
|
||||
static inline
|
||||
int brcmf_bus_rxctl(struct brcmf_bus *bus, unsigned char *msg, uint len)
|
||||
{
|
||||
return bus->ops->rxctl(bus->dev, msg, len);
|
||||
}
|
||||
|
||||
/*
|
||||
* interface functions from common layer
|
||||
*/
|
||||
|
@ -117,9 +117,7 @@ static int brcmf_proto_cdc_msg(struct brcmf_pub *drvr)
|
||||
len = CDC_MAX_MSG_SIZE;
|
||||
|
||||
/* Send request */
|
||||
return drvr->bus_if->brcmf_bus_txctl(drvr->dev,
|
||||
(unsigned char *)&prot->msg,
|
||||
len);
|
||||
return brcmf_bus_txctl(drvr->bus_if, (unsigned char *)&prot->msg, len);
|
||||
}
|
||||
|
||||
static int brcmf_proto_cdc_cmplt(struct brcmf_pub *drvr, u32 id, u32 len)
|
||||
@ -128,11 +126,10 @@ static int brcmf_proto_cdc_cmplt(struct brcmf_pub *drvr, u32 id, u32 len)
|
||||
struct brcmf_proto *prot = drvr->prot;
|
||||
|
||||
brcmf_dbg(TRACE, "Enter\n");
|
||||
|
||||
len += sizeof(struct brcmf_proto_cdc_dcmd);
|
||||
do {
|
||||
ret = drvr->bus_if->brcmf_bus_rxctl(drvr->dev,
|
||||
(unsigned char *)&prot->msg,
|
||||
len + sizeof(struct brcmf_proto_cdc_dcmd));
|
||||
ret = brcmf_bus_rxctl(drvr->bus_if, (unsigned char *)&prot->msg,
|
||||
len);
|
||||
if (ret < 0)
|
||||
break;
|
||||
} while (CDC_DCMD_ID(le32_to_cpu(prot->msg.flags)) != id);
|
||||
@ -179,7 +176,7 @@ brcmf_proto_cdc_query_dcmd(struct brcmf_pub *drvr, int ifidx, uint cmd,
|
||||
|
||||
ret = brcmf_proto_cdc_msg(drvr);
|
||||
if (ret < 0) {
|
||||
brcmf_dbg(ERROR, "brcmf_proto_cdc_msg failed w/status %d\n",
|
||||
brcmf_err("brcmf_proto_cdc_msg failed w/status %d\n",
|
||||
ret);
|
||||
goto done;
|
||||
}
|
||||
@ -196,7 +193,7 @@ retry:
|
||||
if ((id < prot->reqid) && (++retries < RETRIES))
|
||||
goto retry;
|
||||
if (id != prot->reqid) {
|
||||
brcmf_dbg(ERROR, "%s: unexpected request id %d (expected %d)\n",
|
||||
brcmf_err("%s: unexpected request id %d (expected %d)\n",
|
||||
brcmf_ifname(drvr, ifidx), id, prot->reqid);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
@ -258,7 +255,7 @@ int brcmf_proto_cdc_set_dcmd(struct brcmf_pub *drvr, int ifidx, uint cmd,
|
||||
id = (flags & CDC_DCMD_ID_MASK) >> CDC_DCMD_ID_SHIFT;
|
||||
|
||||
if (id != prot->reqid) {
|
||||
brcmf_dbg(ERROR, "%s: unexpected request id %d (expected %d)\n",
|
||||
brcmf_err("%s: unexpected request id %d (expected %d)\n",
|
||||
brcmf_ifname(drvr, ifidx), id, prot->reqid);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
@ -320,7 +317,7 @@ int brcmf_proto_hdrpull(struct device *dev, int *ifidx,
|
||||
/* Pop BDC header used to convey priority for buses that don't */
|
||||
|
||||
if (pktbuf->len < BDC_HEADER_LEN) {
|
||||
brcmf_dbg(ERROR, "rx data too short (%d < %d)\n",
|
||||
brcmf_err("rx data too short (%d < %d)\n",
|
||||
pktbuf->len, BDC_HEADER_LEN);
|
||||
return -EBADE;
|
||||
}
|
||||
@ -329,13 +326,13 @@ int brcmf_proto_hdrpull(struct device *dev, int *ifidx,
|
||||
|
||||
*ifidx = BDC_GET_IF_IDX(h);
|
||||
if (*ifidx >= BRCMF_MAX_IFS) {
|
||||
brcmf_dbg(ERROR, "rx data ifnum out of range (%d)\n", *ifidx);
|
||||
brcmf_err("rx data ifnum out of range (%d)\n", *ifidx);
|
||||
return -EBADE;
|
||||
}
|
||||
|
||||
if (((h->flags & BDC_FLAG_VER_MASK) >> BDC_FLAG_VER_SHIFT) !=
|
||||
BDC_PROTO_VER) {
|
||||
brcmf_dbg(ERROR, "%s: non-BDC packet received, flags 0x%x\n",
|
||||
brcmf_err("%s: non-BDC packet received, flags 0x%x\n",
|
||||
brcmf_ifname(drvr, *ifidx), h->flags);
|
||||
return -EBADE;
|
||||
}
|
||||
@ -364,7 +361,7 @@ int brcmf_proto_attach(struct brcmf_pub *drvr)
|
||||
|
||||
/* ensure that the msg buf directly follows the cdc msg struct */
|
||||
if ((unsigned long)(&cdc->msg + 1) != (unsigned long)cdc->buf) {
|
||||
brcmf_dbg(ERROR, "struct brcmf_proto is not correctly defined\n");
|
||||
brcmf_err("struct brcmf_proto is not correctly defined\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,7 @@ bool brcmf_c_prec_enq(struct device *dev, struct pktq *q,
|
||||
p = discard_oldest ? brcmu_pktq_pdeq(q, eprec) :
|
||||
brcmu_pktq_pdeq_tail(q, eprec);
|
||||
if (p == NULL)
|
||||
brcmf_dbg(ERROR, "brcmu_pktq_penq() failed, oldest %d\n",
|
||||
brcmf_err("brcmu_pktq_penq() failed, oldest %d\n",
|
||||
discard_oldest);
|
||||
|
||||
brcmu_pkt_buf_free_skb(p);
|
||||
@ -89,7 +89,7 @@ bool brcmf_c_prec_enq(struct device *dev, struct pktq *q,
|
||||
/* Enqueue */
|
||||
p = brcmu_pktq_penq(q, prec, pkt);
|
||||
if (p == NULL)
|
||||
brcmf_dbg(ERROR, "brcmu_pktq_penq() failed\n");
|
||||
brcmf_err("brcmu_pktq_penq() failed\n");
|
||||
|
||||
return p != NULL;
|
||||
}
|
||||
@ -99,12 +99,12 @@ static int brcmf_c_pattern_atoh(char *src, char *dst)
|
||||
{
|
||||
int i;
|
||||
if (strncmp(src, "0x", 2) != 0 && strncmp(src, "0X", 2) != 0) {
|
||||
brcmf_dbg(ERROR, "Mask invalid format. Needs to start with 0x\n");
|
||||
brcmf_err("Mask invalid format. Needs to start with 0x\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
src = src + 2; /* Skip past 0x */
|
||||
if (strlen(src) % 2 != 0) {
|
||||
brcmf_dbg(ERROR, "Mask invalid format. Length must be even.\n");
|
||||
brcmf_err("Mask invalid format. Length must be even.\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
for (i = 0; *src != '\0'; i++) {
|
||||
@ -139,7 +139,7 @@ brcmf_c_pktfilter_offload_enable(struct brcmf_if *ifp, char *arg, int enable,
|
||||
argv = strsep(&arg_save, " ");
|
||||
|
||||
if (argv == NULL) {
|
||||
brcmf_dbg(ERROR, "No args provided\n");
|
||||
brcmf_err("No args provided\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@ -154,12 +154,12 @@ brcmf_c_pktfilter_offload_enable(struct brcmf_if *ifp, char *arg, int enable,
|
||||
err = brcmf_fil_iovar_data_set(ifp, "pkt_filter_enable", &enable_parm,
|
||||
sizeof(enable_parm));
|
||||
if (err)
|
||||
brcmf_dbg(ERROR, "Set pkt_filter_enable error (%d)\n", err);
|
||||
brcmf_err("Set pkt_filter_enable error (%d)\n", err);
|
||||
|
||||
/* Control the master mode */
|
||||
err = brcmf_fil_iovar_int_set(ifp, "pkt_filter_mode", master_mode);
|
||||
if (err)
|
||||
brcmf_dbg(ERROR, "Set pkt_filter_mode error (%d)\n", err);
|
||||
brcmf_err("Set pkt_filter_mode error (%d)\n", err);
|
||||
|
||||
fail:
|
||||
kfree(arg_org);
|
||||
@ -191,14 +191,14 @@ static void brcmf_c_pktfilter_offload_set(struct brcmf_if *ifp, char *arg)
|
||||
while (argv[i]) {
|
||||
i++;
|
||||
if (i >= 8) {
|
||||
brcmf_dbg(ERROR, "Too many parameters\n");
|
||||
brcmf_err("Too many parameters\n");
|
||||
goto fail;
|
||||
}
|
||||
argv[i] = strsep(&arg_save, " ");
|
||||
}
|
||||
|
||||
if (i != 6) {
|
||||
brcmf_dbg(ERROR, "Not enough args provided %d\n", i);
|
||||
brcmf_err("Not enough args provided %d\n", i);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@ -233,7 +233,7 @@ static void brcmf_c_pktfilter_offload_set(struct brcmf_if *ifp, char *arg)
|
||||
(char *)&pkt_filter->u.pattern.mask_and_pattern[mask_size]);
|
||||
|
||||
if (mask_size != pattern_size) {
|
||||
brcmf_dbg(ERROR, "Mask and pattern not the same size\n");
|
||||
brcmf_err("Mask and pattern not the same size\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@ -245,7 +245,7 @@ static void brcmf_c_pktfilter_offload_set(struct brcmf_if *ifp, char *arg)
|
||||
err = brcmf_fil_iovar_data_set(ifp, "pkt_filter_add", pkt_filter,
|
||||
buf_len);
|
||||
if (err)
|
||||
brcmf_dbg(ERROR, "Set pkt_filter_add error (%d)\n", err);
|
||||
brcmf_err("Set pkt_filter_add error (%d)\n", err);
|
||||
|
||||
fail:
|
||||
kfree(arg_org);
|
||||
@ -266,7 +266,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_if *ifp)
|
||||
err = brcmf_fil_iovar_data_get(ifp, "cur_etheraddr", ifp->mac_addr,
|
||||
sizeof(ifp->mac_addr));
|
||||
if (err < 0) {
|
||||
brcmf_dbg(ERROR, "Retreiving cur_etheraddr failed, %d\n",
|
||||
brcmf_err("Retreiving cur_etheraddr failed, %d\n",
|
||||
err);
|
||||
goto done;
|
||||
}
|
||||
@ -277,14 +277,14 @@ int brcmf_c_preinit_dcmds(struct brcmf_if *ifp)
|
||||
strcpy(buf, "ver");
|
||||
err = brcmf_fil_iovar_data_get(ifp, "ver", buf, sizeof(buf));
|
||||
if (err < 0) {
|
||||
brcmf_dbg(ERROR, "Retreiving version information failed, %d\n",
|
||||
brcmf_err("Retreiving version information failed, %d\n",
|
||||
err);
|
||||
goto done;
|
||||
}
|
||||
ptr = (char *)buf;
|
||||
strsep(&ptr, "\n");
|
||||
/* Print fw version info */
|
||||
brcmf_dbg(ERROR, "Firmware version = %s\n", buf);
|
||||
brcmf_err("Firmware version = %s\n", buf);
|
||||
|
||||
/*
|
||||
* Setup timeout if Beacons are lost and roam is off to report
|
||||
@ -293,7 +293,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_if *ifp)
|
||||
err = brcmf_fil_iovar_int_set(ifp, "bcn_timeout",
|
||||
BRCMF_DEFAULT_BCN_TIMEOUT);
|
||||
if (err) {
|
||||
brcmf_dbg(ERROR, "bcn_timeout error (%d)\n", err);
|
||||
brcmf_err("bcn_timeout error (%d)\n", err);
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -302,7 +302,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_if *ifp)
|
||||
*/
|
||||
err = brcmf_fil_iovar_int_set(ifp, "roam_off", 1);
|
||||
if (err) {
|
||||
brcmf_dbg(ERROR, "roam_off error (%d)\n", err);
|
||||
brcmf_err("roam_off error (%d)\n", err);
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -310,14 +310,14 @@ int brcmf_c_preinit_dcmds(struct brcmf_if *ifp)
|
||||
err = brcmf_fil_iovar_data_get(ifp, "event_msgs", eventmask,
|
||||
BRCMF_EVENTING_MASK_LEN);
|
||||
if (err) {
|
||||
brcmf_dbg(ERROR, "Get event_msgs error (%d)\n", err);
|
||||
brcmf_err("Get event_msgs error (%d)\n", err);
|
||||
goto done;
|
||||
}
|
||||
setbit(eventmask, BRCMF_E_IF);
|
||||
err = brcmf_fil_iovar_data_set(ifp, "event_msgs", eventmask,
|
||||
BRCMF_EVENTING_MASK_LEN);
|
||||
if (err) {
|
||||
brcmf_dbg(ERROR, "Set event_msgs error (%d)\n", err);
|
||||
brcmf_err("Set event_msgs error (%d)\n", err);
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -325,7 +325,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_if *ifp)
|
||||
err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_CHANNEL_TIME,
|
||||
BRCMF_DEFAULT_SCAN_CHANNEL_TIME);
|
||||
if (err) {
|
||||
brcmf_dbg(ERROR, "BRCMF_C_SET_SCAN_CHANNEL_TIME error (%d)\n",
|
||||
brcmf_err("BRCMF_C_SET_SCAN_CHANNEL_TIME error (%d)\n",
|
||||
err);
|
||||
goto done;
|
||||
}
|
||||
@ -334,7 +334,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_if *ifp)
|
||||
err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_UNASSOC_TIME,
|
||||
BRCMF_DEFAULT_SCAN_UNASSOC_TIME);
|
||||
if (err) {
|
||||
brcmf_dbg(ERROR, "BRCMF_C_SET_SCAN_UNASSOC_TIME error (%d)\n",
|
||||
brcmf_err("BRCMF_C_SET_SCAN_UNASSOC_TIME error (%d)\n",
|
||||
err);
|
||||
goto done;
|
||||
}
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include <brcmu_wifi.h>
|
||||
#include <brcmu_utils.h>
|
||||
#include "dhd.h"
|
||||
#include "dhd_bus.h"
|
||||
#include "dhd_dbg.h"
|
||||
|
||||
static struct dentry *root_folder;
|
||||
@ -42,10 +43,12 @@ void brcmf_debugfs_exit(void)
|
||||
|
||||
int brcmf_debugfs_attach(struct brcmf_pub *drvr)
|
||||
{
|
||||
struct device *dev = drvr->bus_if->dev;
|
||||
|
||||
if (!root_folder)
|
||||
return -ENODEV;
|
||||
|
||||
drvr->dbgfs_dir = debugfs_create_dir(dev_name(drvr->dev), root_folder);
|
||||
drvr->dbgfs_dir = debugfs_create_dir(dev_name(dev), root_folder);
|
||||
return PTR_RET(drvr->dbgfs_dir);
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,6 @@
|
||||
#define _BRCMF_DBG_H_
|
||||
|
||||
/* message levels */
|
||||
#define BRCMF_ERROR_VAL 0x0001
|
||||
#define BRCMF_TRACE_VAL 0x0002
|
||||
#define BRCMF_INFO_VAL 0x0004
|
||||
#define BRCMF_DATA_VAL 0x0008
|
||||
@ -32,23 +31,29 @@
|
||||
#define BRCMF_BTA_VAL 0x0800
|
||||
#define BRCMF_FIL_VAL 0x1000
|
||||
#define BRCMF_USB_VAL 0x2000
|
||||
#define BRCMF_SCAN_VAL 0x4000
|
||||
#define BRCMF_CONN_VAL 0x8000
|
||||
|
||||
/* Macro for error messages. net_ratelimit() is used when driver
|
||||
* debugging is not selected. When debugging the driver error
|
||||
* messages are as important as other tracing or even more so.
|
||||
*/
|
||||
#ifdef CONFIG_BRCMDBG
|
||||
#define brcmf_err(fmt, ...) pr_err("%s: " fmt, __func__, ##__VA_ARGS__)
|
||||
#else
|
||||
#define brcmf_err(fmt, ...) \
|
||||
do { \
|
||||
if (net_ratelimit()) \
|
||||
pr_err("%s: " fmt, __func__, ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#if defined(DEBUG)
|
||||
|
||||
#define brcmf_dbg(level, fmt, ...) \
|
||||
do { \
|
||||
if (BRCMF_ERROR_VAL == BRCMF_##level##_VAL) { \
|
||||
if (brcmf_msg_level & BRCMF_##level##_VAL) { \
|
||||
if (net_ratelimit()) \
|
||||
pr_debug("%s: " fmt, \
|
||||
__func__, ##__VA_ARGS__); \
|
||||
} \
|
||||
} else { \
|
||||
if (brcmf_msg_level & BRCMF_##level##_VAL) { \
|
||||
pr_debug("%s: " fmt, \
|
||||
__func__, ##__VA_ARGS__); \
|
||||
} \
|
||||
} \
|
||||
#define brcmf_dbg(level, fmt, ...) \
|
||||
do { \
|
||||
if (brcmf_msg_level & BRCMF_##level##_VAL) \
|
||||
pr_debug("%s: " fmt, __func__, ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
#define BRCMF_DATA_ON() (brcmf_msg_level & BRCMF_DATA_VAL)
|
||||
|
@ -39,19 +39,19 @@ MODULE_LICENSE("Dual BSD/GPL");
|
||||
#define MAX_WAIT_FOR_8021X_TX 50 /* msecs */
|
||||
|
||||
/* Error bits */
|
||||
int brcmf_msg_level = BRCMF_ERROR_VAL;
|
||||
int brcmf_msg_level;
|
||||
module_param(brcmf_msg_level, int, 0);
|
||||
|
||||
|
||||
char *brcmf_ifname(struct brcmf_pub *drvr, int ifidx)
|
||||
{
|
||||
if (ifidx < 0 || ifidx >= BRCMF_MAX_IFS) {
|
||||
brcmf_dbg(ERROR, "ifidx %d out of range\n", ifidx);
|
||||
brcmf_err("ifidx %d out of range\n", ifidx);
|
||||
return "<if_bad>";
|
||||
}
|
||||
|
||||
if (drvr->iflist[ifidx] == NULL) {
|
||||
brcmf_dbg(ERROR, "null i/f %d\n", ifidx);
|
||||
brcmf_err("null i/f %d\n", ifidx);
|
||||
return "<if_null>";
|
||||
}
|
||||
|
||||
@ -102,7 +102,7 @@ static void _brcmf_set_multicast_list(struct work_struct *work)
|
||||
|
||||
err = brcmf_fil_iovar_data_set(ifp, "mcast_list", buf, buflen);
|
||||
if (err < 0) {
|
||||
brcmf_dbg(ERROR, "Setting mcast_list failed, %d\n", err);
|
||||
brcmf_err("Setting mcast_list failed, %d\n", err);
|
||||
cmd_value = cnt ? true : cmd_value;
|
||||
}
|
||||
|
||||
@ -115,13 +115,13 @@ static void _brcmf_set_multicast_list(struct work_struct *work)
|
||||
*/
|
||||
err = brcmf_fil_iovar_int_set(ifp, "allmulti", cmd_value);
|
||||
if (err < 0)
|
||||
brcmf_dbg(ERROR, "Setting allmulti failed, %d\n", err);
|
||||
brcmf_err("Setting allmulti failed, %d\n", err);
|
||||
|
||||
/*Finally, pick up the PROMISC flag */
|
||||
cmd_value = (ndev->flags & IFF_PROMISC) ? true : false;
|
||||
err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PROMISC, cmd_value);
|
||||
if (err < 0)
|
||||
brcmf_dbg(ERROR, "Setting BRCMF_C_SET_PROMISC failed, %d\n",
|
||||
brcmf_err("Setting BRCMF_C_SET_PROMISC failed, %d\n",
|
||||
err);
|
||||
}
|
||||
|
||||
@ -137,7 +137,7 @@ _brcmf_set_mac_address(struct work_struct *work)
|
||||
err = brcmf_fil_iovar_data_set(ifp, "cur_etheraddr", ifp->mac_addr,
|
||||
ETH_ALEN);
|
||||
if (err < 0) {
|
||||
brcmf_dbg(ERROR, "Setting cur_etheraddr failed, %d\n", err);
|
||||
brcmf_err("Setting cur_etheraddr failed, %d\n", err);
|
||||
} else {
|
||||
brcmf_dbg(TRACE, "MAC address updated to %pM\n",
|
||||
ifp->mac_addr);
|
||||
@ -173,7 +173,7 @@ static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *ndev)
|
||||
/* Reject if down */
|
||||
if (!drvr->bus_if->drvr_up ||
|
||||
(drvr->bus_if->state != BRCMF_BUS_DATA)) {
|
||||
brcmf_dbg(ERROR, "xmit rejected drvup=%d state=%d\n",
|
||||
brcmf_err("xmit rejected drvup=%d state=%d\n",
|
||||
drvr->bus_if->drvr_up,
|
||||
drvr->bus_if->state);
|
||||
netif_stop_queue(ndev);
|
||||
@ -181,7 +181,7 @@ static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *ndev)
|
||||
}
|
||||
|
||||
if (!drvr->iflist[ifp->idx]) {
|
||||
brcmf_dbg(ERROR, "bad ifidx %d\n", ifp->idx);
|
||||
brcmf_err("bad ifidx %d\n", ifp->idx);
|
||||
netif_stop_queue(ndev);
|
||||
return -ENODEV;
|
||||
}
|
||||
@ -197,7 +197,7 @@ static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *ndev)
|
||||
dev_kfree_skb(skb);
|
||||
skb = skb2;
|
||||
if (skb == NULL) {
|
||||
brcmf_dbg(ERROR, "%s: skb_realloc_headroom failed\n",
|
||||
brcmf_err("%s: skb_realloc_headroom failed\n",
|
||||
brcmf_ifname(drvr, ifp->idx));
|
||||
ret = -ENOMEM;
|
||||
goto done;
|
||||
@ -219,7 +219,7 @@ static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *ndev)
|
||||
brcmf_proto_hdrpush(drvr, ifp->idx, skb);
|
||||
|
||||
/* Use bus module to send data frame */
|
||||
ret = drvr->bus_if->brcmf_bus_txdata(drvr->dev, skb);
|
||||
ret = brcmf_bus_txdata(drvr->bus_if, skb);
|
||||
|
||||
done:
|
||||
if (ret)
|
||||
@ -377,13 +377,13 @@ static int brcmf_toe_set(struct brcmf_if *ifp, u32 toe_ol)
|
||||
|
||||
err = brcmf_fil_iovar_int_set(ifp, "toe_ol", toe_ol);
|
||||
if (err < 0) {
|
||||
brcmf_dbg(ERROR, "Setting toe_ol failed, %d\n", err);
|
||||
brcmf_err("Setting toe_ol failed, %d\n", err);
|
||||
return err;
|
||||
}
|
||||
|
||||
err = brcmf_fil_iovar_int_set(ifp, "toe", (toe_ol != 0));
|
||||
if (err < 0)
|
||||
brcmf_dbg(ERROR, "Setting toe failed, %d\n", err);
|
||||
brcmf_err("Setting toe failed, %d\n", err);
|
||||
|
||||
return err;
|
||||
|
||||
@ -397,7 +397,7 @@ static void brcmf_ethtool_get_drvinfo(struct net_device *ndev,
|
||||
|
||||
sprintf(info->driver, KBUILD_MODNAME);
|
||||
sprintf(info->version, "%lu", drvr->drv_version);
|
||||
sprintf(info->bus_info, "%s", dev_name(drvr->dev));
|
||||
sprintf(info->bus_info, "%s", dev_name(drvr->bus_if->dev));
|
||||
}
|
||||
|
||||
static const struct ethtool_ops brcmf_ethtool_ops = {
|
||||
@ -440,7 +440,7 @@ static int brcmf_ethtool(struct brcmf_if *ifp, void __user *uaddr)
|
||||
|
||||
/* otherwise, require dongle to be up */
|
||||
else if (!drvr->bus_if->drvr_up) {
|
||||
brcmf_dbg(ERROR, "dongle is not up\n");
|
||||
brcmf_err("dongle is not up\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
/* finally, report dongle driver type */
|
||||
@ -559,7 +559,7 @@ static int brcmf_netdev_open(struct net_device *ndev)
|
||||
|
||||
/* If bus is not ready, can't continue */
|
||||
if (bus_if->state != BRCMF_BUS_DATA) {
|
||||
brcmf_dbg(ERROR, "failed bus is not ready\n");
|
||||
brcmf_err("failed bus is not ready\n");
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
@ -583,7 +583,7 @@ static int brcmf_netdev_open(struct net_device *ndev)
|
||||
netif_start_queue(ndev);
|
||||
drvr->bus_if->drvr_up = true;
|
||||
if (brcmf_cfg80211_up(ndev)) {
|
||||
brcmf_dbg(ERROR, "failed to bring up cfg80211\n");
|
||||
brcmf_err("failed to bring up cfg80211\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -634,7 +634,7 @@ int brcmf_net_attach(struct brcmf_if *ifp)
|
||||
memcpy(ndev->dev_addr, ifp->mac_addr, ETH_ALEN);
|
||||
|
||||
if (register_netdev(ndev) != 0) {
|
||||
brcmf_dbg(ERROR, "couldn't register the net device\n");
|
||||
brcmf_err("couldn't register the net device\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@ -662,7 +662,7 @@ struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, int ifidx, s32 bssidx,
|
||||
* in case we missed the BRCMF_E_IF_DEL event.
|
||||
*/
|
||||
if (ifp) {
|
||||
brcmf_dbg(ERROR, "ERROR: netdev:%s already exists\n",
|
||||
brcmf_err("ERROR: netdev:%s already exists\n",
|
||||
ifp->ndev->name);
|
||||
if (ifidx) {
|
||||
netif_stop_queue(ifp->ndev);
|
||||
@ -670,7 +670,7 @@ struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, int ifidx, s32 bssidx,
|
||||
free_netdev(ifp->ndev);
|
||||
drvr->iflist[ifidx] = NULL;
|
||||
} else {
|
||||
brcmf_dbg(ERROR, "ignore IF event\n");
|
||||
brcmf_err("ignore IF event\n");
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
}
|
||||
@ -678,7 +678,7 @@ struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, int ifidx, s32 bssidx,
|
||||
/* Allocate netdev, including space for private structure */
|
||||
ndev = alloc_netdev(sizeof(struct brcmf_if), name, ether_setup);
|
||||
if (!ndev) {
|
||||
brcmf_dbg(ERROR, "OOM - alloc_netdev\n");
|
||||
brcmf_err("OOM - alloc_netdev\n");
|
||||
return ERR_PTR(-ENOMEM);
|
||||
}
|
||||
|
||||
@ -710,7 +710,7 @@ void brcmf_del_if(struct brcmf_pub *drvr, int ifidx)
|
||||
|
||||
ifp = drvr->iflist[ifidx];
|
||||
if (!ifp) {
|
||||
brcmf_dbg(ERROR, "Null interface\n");
|
||||
brcmf_err("Null interface\n");
|
||||
return;
|
||||
}
|
||||
if (ifp->ndev) {
|
||||
@ -753,7 +753,6 @@ int brcmf_attach(uint bus_hdrlen, struct device *dev)
|
||||
drvr->hdrlen = bus_hdrlen;
|
||||
drvr->bus_if = dev_get_drvdata(dev);
|
||||
drvr->bus_if->drvr = drvr;
|
||||
drvr->dev = dev;
|
||||
|
||||
/* create device debugfs folder */
|
||||
brcmf_debugfs_attach(drvr);
|
||||
@ -761,7 +760,7 @@ int brcmf_attach(uint bus_hdrlen, struct device *dev)
|
||||
/* Attach and link in the protocol */
|
||||
ret = brcmf_proto_attach(drvr);
|
||||
if (ret != 0) {
|
||||
brcmf_dbg(ERROR, "brcmf_prot_attach failed\n");
|
||||
brcmf_err("brcmf_prot_attach failed\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@ -790,9 +789,9 @@ int brcmf_bus_start(struct device *dev)
|
||||
brcmf_dbg(TRACE, "\n");
|
||||
|
||||
/* Bring up the bus */
|
||||
ret = bus_if->brcmf_bus_init(dev);
|
||||
ret = brcmf_bus_init(bus_if);
|
||||
if (ret != 0) {
|
||||
brcmf_dbg(ERROR, "brcmf_sdbrcm_bus_init failed %d\n", ret);
|
||||
brcmf_err("brcmf_sdbrcm_bus_init failed %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -809,7 +808,7 @@ int brcmf_bus_start(struct device *dev)
|
||||
if (ret < 0)
|
||||
goto fail;
|
||||
|
||||
drvr->config = brcmf_cfg80211_attach(drvr);
|
||||
drvr->config = brcmf_cfg80211_attach(drvr, bus_if->dev);
|
||||
if (drvr->config == NULL) {
|
||||
ret = -ENOMEM;
|
||||
goto fail;
|
||||
@ -822,7 +821,7 @@ int brcmf_bus_start(struct device *dev)
|
||||
ret = brcmf_net_attach(ifp);
|
||||
fail:
|
||||
if (ret < 0) {
|
||||
brcmf_dbg(ERROR, "failed: %d\n", ret);
|
||||
brcmf_err("failed: %d\n", ret);
|
||||
if (drvr->config)
|
||||
brcmf_cfg80211_detach(drvr->config);
|
||||
free_netdev(drvr->iflist[0]->ndev);
|
||||
@ -842,7 +841,7 @@ static void brcmf_bus_detach(struct brcmf_pub *drvr)
|
||||
brcmf_proto_stop(drvr);
|
||||
|
||||
/* Stop the bus module */
|
||||
drvr->bus_if->brcmf_bus_stop(drvr->dev);
|
||||
brcmf_bus_stop(drvr->bus_if);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -689,7 +689,7 @@ static int brcmf_sdbrcm_htclk(struct brcmf_sdio *bus, bool on, bool pendok)
|
||||
brcmf_sdio_regwb(bus->sdiodev, SBSDIO_FUNC1_CHIPCLKCSR,
|
||||
clkreq, &err);
|
||||
if (err) {
|
||||
brcmf_dbg(ERROR, "HT Avail request error: %d\n", err);
|
||||
brcmf_err("HT Avail request error: %d\n", err);
|
||||
return -EBADE;
|
||||
}
|
||||
|
||||
@ -697,7 +697,7 @@ static int brcmf_sdbrcm_htclk(struct brcmf_sdio *bus, bool on, bool pendok)
|
||||
clkctl = brcmf_sdio_regrb(bus->sdiodev,
|
||||
SBSDIO_FUNC1_CHIPCLKCSR, &err);
|
||||
if (err) {
|
||||
brcmf_dbg(ERROR, "HT Avail read error: %d\n", err);
|
||||
brcmf_err("HT Avail read error: %d\n", err);
|
||||
return -EBADE;
|
||||
}
|
||||
|
||||
@ -707,7 +707,7 @@ static int brcmf_sdbrcm_htclk(struct brcmf_sdio *bus, bool on, bool pendok)
|
||||
devctl = brcmf_sdio_regrb(bus->sdiodev,
|
||||
SBSDIO_DEVICE_CTL, &err);
|
||||
if (err) {
|
||||
brcmf_dbg(ERROR, "Devctl error setting CA: %d\n",
|
||||
brcmf_err("Devctl error setting CA: %d\n",
|
||||
err);
|
||||
return -EBADE;
|
||||
}
|
||||
@ -741,11 +741,11 @@ static int brcmf_sdbrcm_htclk(struct brcmf_sdio *bus, bool on, bool pendok)
|
||||
usleep_range(5000, 10000);
|
||||
}
|
||||
if (err) {
|
||||
brcmf_dbg(ERROR, "HT Avail request error: %d\n", err);
|
||||
brcmf_err("HT Avail request error: %d\n", err);
|
||||
return -EBADE;
|
||||
}
|
||||
if (!SBSDIO_CLKAV(clkctl, bus->alp_only)) {
|
||||
brcmf_dbg(ERROR, "HT Avail timeout (%d): clkctl 0x%02x\n",
|
||||
brcmf_err("HT Avail timeout (%d): clkctl 0x%02x\n",
|
||||
PMU_MAX_TRANSITION_DLY, clkctl);
|
||||
return -EBADE;
|
||||
}
|
||||
@ -757,7 +757,7 @@ static int brcmf_sdbrcm_htclk(struct brcmf_sdio *bus, bool on, bool pendok)
|
||||
#if defined(DEBUG)
|
||||
if (!bus->alp_only) {
|
||||
if (SBSDIO_ALPONLY(clkctl))
|
||||
brcmf_dbg(ERROR, "HT Clock should be on\n");
|
||||
brcmf_err("HT Clock should be on\n");
|
||||
}
|
||||
#endif /* defined (DEBUG) */
|
||||
|
||||
@ -779,7 +779,7 @@ static int brcmf_sdbrcm_htclk(struct brcmf_sdio *bus, bool on, bool pendok)
|
||||
clkreq, &err);
|
||||
brcmf_dbg(INFO, "CLKCTL: turned OFF\n");
|
||||
if (err) {
|
||||
brcmf_dbg(ERROR, "Failed access turning clock off: %d\n",
|
||||
brcmf_err("Failed access turning clock off: %d\n",
|
||||
err);
|
||||
return -EBADE;
|
||||
}
|
||||
@ -836,7 +836,7 @@ static int brcmf_sdbrcm_clkctl(struct brcmf_sdio *bus, uint target, bool pendok)
|
||||
else if (bus->clkstate == CLK_AVAIL)
|
||||
brcmf_sdbrcm_htclk(bus, false, false);
|
||||
else
|
||||
brcmf_dbg(ERROR, "request for %d -> %d\n",
|
||||
brcmf_err("request for %d -> %d\n",
|
||||
bus->clkstate, target);
|
||||
brcmf_sdbrcm_wd_timer(bus, BRCMF_WD_POLL_MS);
|
||||
break;
|
||||
@ -880,7 +880,7 @@ static u32 brcmf_sdbrcm_hostmail(struct brcmf_sdio *bus)
|
||||
brcmf_dbg(INFO, "Dongle reports NAK handled, expect rtx of %d\n",
|
||||
bus->rx_seq);
|
||||
if (!bus->rxskip)
|
||||
brcmf_dbg(ERROR, "unexpected NAKHANDLED!\n");
|
||||
brcmf_err("unexpected NAKHANDLED!\n");
|
||||
|
||||
bus->rxskip = false;
|
||||
intstatus |= I_HMB_FRAME_IND;
|
||||
@ -894,7 +894,7 @@ static u32 brcmf_sdbrcm_hostmail(struct brcmf_sdio *bus)
|
||||
(hmb_data & HMB_DATA_VERSION_MASK) >>
|
||||
HMB_DATA_VERSION_SHIFT;
|
||||
if (bus->sdpcm_ver != SDPCM_PROT_VERSION)
|
||||
brcmf_dbg(ERROR, "Version mismatch, dongle reports %d, "
|
||||
brcmf_err("Version mismatch, dongle reports %d, "
|
||||
"expecting %d\n",
|
||||
bus->sdpcm_ver, SDPCM_PROT_VERSION);
|
||||
else
|
||||
@ -927,7 +927,7 @@ static u32 brcmf_sdbrcm_hostmail(struct brcmf_sdio *bus)
|
||||
HMB_DATA_FC |
|
||||
HMB_DATA_FWREADY |
|
||||
HMB_DATA_FCDATA_MASK | HMB_DATA_VERSION_MASK))
|
||||
brcmf_dbg(ERROR, "Unknown mailbox data content: 0x%02x\n",
|
||||
brcmf_err("Unknown mailbox data content: 0x%02x\n",
|
||||
hmb_data);
|
||||
|
||||
return intstatus;
|
||||
@ -940,7 +940,7 @@ static void brcmf_sdbrcm_rxfail(struct brcmf_sdio *bus, bool abort, bool rtx)
|
||||
u8 hi, lo;
|
||||
int err;
|
||||
|
||||
brcmf_dbg(ERROR, "%sterminate frame%s\n",
|
||||
brcmf_err("%sterminate frame%s\n",
|
||||
abort ? "abort command, " : "",
|
||||
rtx ? ", send NAK" : "");
|
||||
|
||||
@ -963,14 +963,14 @@ static void brcmf_sdbrcm_rxfail(struct brcmf_sdio *bus, bool abort, bool rtx)
|
||||
break;
|
||||
|
||||
if ((hi > (lastrbc >> 8)) && (lo > (lastrbc & 0x00ff))) {
|
||||
brcmf_dbg(ERROR, "count growing: last 0x%04x now 0x%04x\n",
|
||||
brcmf_err("count growing: last 0x%04x now 0x%04x\n",
|
||||
lastrbc, (hi << 8) + lo);
|
||||
}
|
||||
lastrbc = (hi << 8) + lo;
|
||||
}
|
||||
|
||||
if (!retries)
|
||||
brcmf_dbg(ERROR, "count never zeroed: last 0x%04x\n", lastrbc);
|
||||
brcmf_err("count never zeroed: last 0x%04x\n", lastrbc);
|
||||
else
|
||||
brcmf_dbg(INFO, "flush took %d iterations\n", 0xffff - retries);
|
||||
|
||||
@ -1057,22 +1057,22 @@ static int brcmf_sdio_hdparser(struct brcmf_sdio *bus, u8 *header,
|
||||
return -ENODATA;
|
||||
}
|
||||
if ((u16)(~(len ^ checksum))) {
|
||||
brcmf_dbg(ERROR, "HW header checksum error\n");
|
||||
brcmf_err("HW header checksum error\n");
|
||||
bus->sdcnt.rx_badhdr++;
|
||||
brcmf_sdbrcm_rxfail(bus, false, false);
|
||||
return -EIO;
|
||||
}
|
||||
if (len < SDPCM_HDRLEN) {
|
||||
brcmf_dbg(ERROR, "HW header length error\n");
|
||||
brcmf_err("HW header length error\n");
|
||||
return -EPROTO;
|
||||
}
|
||||
if (type == BRCMF_SDIO_FT_SUPER &&
|
||||
(roundup(len, bus->blocksize) != rd->len)) {
|
||||
brcmf_dbg(ERROR, "HW superframe header length error\n");
|
||||
brcmf_err("HW superframe header length error\n");
|
||||
return -EPROTO;
|
||||
}
|
||||
if (type == BRCMF_SDIO_FT_SUB && len > rd->len) {
|
||||
brcmf_dbg(ERROR, "HW subframe header length error\n");
|
||||
brcmf_err("HW subframe header length error\n");
|
||||
return -EPROTO;
|
||||
}
|
||||
rd->len = len;
|
||||
@ -1089,7 +1089,7 @@ static int brcmf_sdio_hdparser(struct brcmf_sdio *bus, u8 *header,
|
||||
*/
|
||||
if (type == BRCMF_SDIO_FT_SUPER &&
|
||||
SDPCM_GLOMDESC(&header[SDPCM_FRAMETAG_LEN])) {
|
||||
brcmf_dbg(ERROR, "Glom descriptor found in superframe head\n");
|
||||
brcmf_err("Glom descriptor found in superframe head\n");
|
||||
rd->len = 0;
|
||||
return -EINVAL;
|
||||
}
|
||||
@ -1097,7 +1097,7 @@ static int brcmf_sdio_hdparser(struct brcmf_sdio *bus, u8 *header,
|
||||
rd->channel = SDPCM_PACKET_CHANNEL(&header[SDPCM_FRAMETAG_LEN]);
|
||||
if (len > MAX_RX_DATASZ && rd->channel != SDPCM_CONTROL_CHANNEL &&
|
||||
type != BRCMF_SDIO_FT_SUPER) {
|
||||
brcmf_dbg(ERROR, "HW header length too long\n");
|
||||
brcmf_err("HW header length too long\n");
|
||||
bus->sdiodev->bus_if->dstats.rx_errors++;
|
||||
bus->sdcnt.rx_toolong++;
|
||||
brcmf_sdbrcm_rxfail(bus, false, false);
|
||||
@ -1105,26 +1105,26 @@ static int brcmf_sdio_hdparser(struct brcmf_sdio *bus, u8 *header,
|
||||
return -EPROTO;
|
||||
}
|
||||
if (type == BRCMF_SDIO_FT_SUPER && rd->channel != SDPCM_GLOM_CHANNEL) {
|
||||
brcmf_dbg(ERROR, "Wrong channel for superframe\n");
|
||||
brcmf_err("Wrong channel for superframe\n");
|
||||
rd->len = 0;
|
||||
return -EINVAL;
|
||||
}
|
||||
if (type == BRCMF_SDIO_FT_SUB && rd->channel != SDPCM_DATA_CHANNEL &&
|
||||
rd->channel != SDPCM_EVENT_CHANNEL) {
|
||||
brcmf_dbg(ERROR, "Wrong channel for subframe\n");
|
||||
brcmf_err("Wrong channel for subframe\n");
|
||||
rd->len = 0;
|
||||
return -EINVAL;
|
||||
}
|
||||
rd->dat_offset = SDPCM_DOFFSET_VALUE(&header[SDPCM_FRAMETAG_LEN]);
|
||||
if (rd->dat_offset < SDPCM_HDRLEN || rd->dat_offset > rd->len) {
|
||||
brcmf_dbg(ERROR, "seq %d: bad data offset\n", rx_seq);
|
||||
brcmf_err("seq %d: bad data offset\n", rx_seq);
|
||||
bus->sdcnt.rx_badhdr++;
|
||||
brcmf_sdbrcm_rxfail(bus, false, false);
|
||||
rd->len = 0;
|
||||
return -ENXIO;
|
||||
}
|
||||
if (rd->seq_num != rx_seq) {
|
||||
brcmf_dbg(ERROR, "seq %d: sequence number error, expect %d\n",
|
||||
brcmf_err("seq %d: sequence number error, expect %d\n",
|
||||
rx_seq, rd->seq_num);
|
||||
bus->sdcnt.rx_badseq++;
|
||||
rd->seq_num = rx_seq;
|
||||
@ -1136,7 +1136,7 @@ static int brcmf_sdio_hdparser(struct brcmf_sdio *bus, u8 *header,
|
||||
if (rd->len_nxtfrm << 4 > MAX_RX_DATASZ) {
|
||||
/* only warm for NON glom packet */
|
||||
if (rd->channel != SDPCM_GLOM_CHANNEL)
|
||||
brcmf_dbg(ERROR, "seq %d: next length error\n", rx_seq);
|
||||
brcmf_err("seq %d: next length error\n", rx_seq);
|
||||
rd->len_nxtfrm = 0;
|
||||
}
|
||||
fc = SDPCM_FCMASK_VALUE(&header[SDPCM_FRAMETAG_LEN]);
|
||||
@ -1150,7 +1150,7 @@ static int brcmf_sdio_hdparser(struct brcmf_sdio *bus, u8 *header,
|
||||
}
|
||||
tx_seq_max = SDPCM_WINDOW_VALUE(&header[SDPCM_FRAMETAG_LEN]);
|
||||
if ((u8)(tx_seq_max - bus->tx_seq) > 0x40) {
|
||||
brcmf_dbg(ERROR, "seq %d: max tx seq number error\n", rx_seq);
|
||||
brcmf_err("seq %d: max tx seq number error\n", rx_seq);
|
||||
tx_seq_max = bus->tx_seq + 2;
|
||||
}
|
||||
bus->tx_max = tx_seq_max;
|
||||
@ -1186,7 +1186,7 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_sdio *bus, u8 rxseq)
|
||||
dlen = (u16) (bus->glomd->len);
|
||||
dptr = bus->glomd->data;
|
||||
if (!dlen || (dlen & 1)) {
|
||||
brcmf_dbg(ERROR, "bad glomd len(%d), ignore descriptor\n",
|
||||
brcmf_err("bad glomd len(%d), ignore descriptor\n",
|
||||
dlen);
|
||||
dlen = 0;
|
||||
}
|
||||
@ -1198,13 +1198,13 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_sdio *bus, u8 rxseq)
|
||||
dptr += sizeof(u16);
|
||||
if ((sublen < SDPCM_HDRLEN) ||
|
||||
((num == 0) && (sublen < (2 * SDPCM_HDRLEN)))) {
|
||||
brcmf_dbg(ERROR, "descriptor len %d bad: %d\n",
|
||||
brcmf_err("descriptor len %d bad: %d\n",
|
||||
num, sublen);
|
||||
pnext = NULL;
|
||||
break;
|
||||
}
|
||||
if (sublen % BRCMF_SDALIGN) {
|
||||
brcmf_dbg(ERROR, "sublen %d not multiple of %d\n",
|
||||
brcmf_err("sublen %d not multiple of %d\n",
|
||||
sublen, BRCMF_SDALIGN);
|
||||
usechain = false;
|
||||
}
|
||||
@ -1221,7 +1221,7 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_sdio *bus, u8 rxseq)
|
||||
/* Allocate/chain packet for next subframe */
|
||||
pnext = brcmu_pkt_buf_get_skb(sublen + BRCMF_SDALIGN);
|
||||
if (pnext == NULL) {
|
||||
brcmf_dbg(ERROR, "bcm_pkt_buf_get_skb failed, num %d len %d\n",
|
||||
brcmf_err("bcm_pkt_buf_get_skb failed, num %d len %d\n",
|
||||
num, sublen);
|
||||
break;
|
||||
}
|
||||
@ -1284,13 +1284,13 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_sdio *bus, u8 rxseq)
|
||||
bus->dataptr, dlen);
|
||||
sublen = (u16) brcmf_sdbrcm_glom_from_buf(bus, dlen);
|
||||
if (sublen != dlen) {
|
||||
brcmf_dbg(ERROR, "FAILED TO COPY, dlen %d sublen %d\n",
|
||||
brcmf_err("FAILED TO COPY, dlen %d sublen %d\n",
|
||||
dlen, sublen);
|
||||
errcode = -1;
|
||||
}
|
||||
pnext = NULL;
|
||||
} else {
|
||||
brcmf_dbg(ERROR, "COULDN'T ALLOC %d-BYTE GLOM, FORCE FAILURE\n",
|
||||
brcmf_err("COULDN'T ALLOC %d-BYTE GLOM, FORCE FAILURE\n",
|
||||
dlen);
|
||||
errcode = -1;
|
||||
}
|
||||
@ -1299,7 +1299,7 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_sdio *bus, u8 rxseq)
|
||||
|
||||
/* On failure, kill the superframe, allow a couple retries */
|
||||
if (errcode < 0) {
|
||||
brcmf_dbg(ERROR, "glom read of %d bytes failed: %d\n",
|
||||
brcmf_err("glom read of %d bytes failed: %d\n",
|
||||
dlen, errcode);
|
||||
bus->sdiodev->bus_if->dstats.rx_errors++;
|
||||
|
||||
@ -1390,7 +1390,7 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_sdio *bus, u8 rxseq)
|
||||
continue;
|
||||
} else if (brcmf_proto_hdrpull(bus->sdiodev->dev,
|
||||
&ifidx, pfirst) != 0) {
|
||||
brcmf_dbg(ERROR, "rx protocol error\n");
|
||||
brcmf_err("rx protocol error\n");
|
||||
bus->sdiodev->bus_if->dstats.rx_errors++;
|
||||
skb_unlink(pfirst, &bus->glom);
|
||||
brcmu_pkt_buf_free_skb(pfirst);
|
||||
@ -1456,7 +1456,7 @@ brcmf_sdbrcm_read_control(struct brcmf_sdio *bus, u8 *hdr, uint len, uint doff)
|
||||
if (bus->rxblen)
|
||||
buf = vzalloc(bus->rxblen);
|
||||
if (!buf) {
|
||||
brcmf_dbg(ERROR, "no memory for control frame\n");
|
||||
brcmf_err("no memory for control frame\n");
|
||||
goto done;
|
||||
}
|
||||
rbuf = bus->rxbuf;
|
||||
@ -1486,7 +1486,7 @@ brcmf_sdbrcm_read_control(struct brcmf_sdio *bus, u8 *hdr, uint len, uint doff)
|
||||
|
||||
/* Drop if the read is too big or it exceeds our maximum */
|
||||
if ((rdlen + BRCMF_FIRSTREAD) > bus->sdiodev->bus_if->maxctl) {
|
||||
brcmf_dbg(ERROR, "%d-byte control read exceeds %d-byte buffer\n",
|
||||
brcmf_err("%d-byte control read exceeds %d-byte buffer\n",
|
||||
rdlen, bus->sdiodev->bus_if->maxctl);
|
||||
bus->sdiodev->bus_if->dstats.rx_errors++;
|
||||
brcmf_sdbrcm_rxfail(bus, false, false);
|
||||
@ -1494,7 +1494,7 @@ brcmf_sdbrcm_read_control(struct brcmf_sdio *bus, u8 *hdr, uint len, uint doff)
|
||||
}
|
||||
|
||||
if ((len - doff) > bus->sdiodev->bus_if->maxctl) {
|
||||
brcmf_dbg(ERROR, "%d-byte ctl frame (%d-byte ctl data) exceeds %d-byte limit\n",
|
||||
brcmf_err("%d-byte ctl frame (%d-byte ctl data) exceeds %d-byte limit\n",
|
||||
len, len - doff, bus->sdiodev->bus_if->maxctl);
|
||||
bus->sdiodev->bus_if->dstats.rx_errors++;
|
||||
bus->sdcnt.rx_toolong++;
|
||||
@ -1511,7 +1511,7 @@ brcmf_sdbrcm_read_control(struct brcmf_sdio *bus, u8 *hdr, uint len, uint doff)
|
||||
|
||||
/* Control frame failures need retransmission */
|
||||
if (sdret < 0) {
|
||||
brcmf_dbg(ERROR, "read %d control bytes failed: %d\n",
|
||||
brcmf_err("read %d control bytes failed: %d\n",
|
||||
rdlen, sdret);
|
||||
bus->sdcnt.rxc_errors++;
|
||||
brcmf_sdbrcm_rxfail(bus, true, true);
|
||||
@ -1527,7 +1527,7 @@ gotpkt:
|
||||
/* Point to valid data and indicate its length */
|
||||
spin_lock_bh(&bus->rxctl_lock);
|
||||
if (bus->rxctl) {
|
||||
brcmf_dbg(ERROR, "last control frame is being processed.\n");
|
||||
brcmf_err("last control frame is being processed.\n");
|
||||
spin_unlock_bh(&bus->rxctl_lock);
|
||||
vfree(buf);
|
||||
goto done;
|
||||
@ -1599,7 +1599,7 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes)
|
||||
BRCMF_FIRSTREAD);
|
||||
bus->sdcnt.f2rxhdrs++;
|
||||
if (sdret < 0) {
|
||||
brcmf_dbg(ERROR, "RXHEADER FAILED: %d\n",
|
||||
brcmf_err("RXHEADER FAILED: %d\n",
|
||||
sdret);
|
||||
bus->sdcnt.rx_hdrfail++;
|
||||
brcmf_sdbrcm_rxfail(bus, true, true);
|
||||
@ -1643,7 +1643,7 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes)
|
||||
BRCMF_SDALIGN);
|
||||
if (!pkt) {
|
||||
/* Give up on data, request rtx of events */
|
||||
brcmf_dbg(ERROR, "brcmu_pkt_buf_get_skb failed\n");
|
||||
brcmf_err("brcmu_pkt_buf_get_skb failed\n");
|
||||
bus->sdiodev->bus_if->dstats.rx_dropped++;
|
||||
brcmf_sdbrcm_rxfail(bus, false,
|
||||
RETRYCHAN(rd->channel));
|
||||
@ -1659,7 +1659,7 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes)
|
||||
sdio_release_host(bus->sdiodev->func[1]);
|
||||
|
||||
if (sdret < 0) {
|
||||
brcmf_dbg(ERROR, "read %d bytes from channel %d failed: %d\n",
|
||||
brcmf_err("read %d bytes from channel %d failed: %d\n",
|
||||
rd->len, rd->channel, sdret);
|
||||
brcmu_pkt_buf_free_skb(pkt);
|
||||
bus->sdiodev->bus_if->dstats.rx_errors++;
|
||||
@ -1685,7 +1685,7 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes)
|
||||
}
|
||||
bus->sdcnt.rx_readahead_cnt++;
|
||||
if (rd->len != roundup(rd_new.len, 16)) {
|
||||
brcmf_dbg(ERROR, "frame length mismatch:read %d, should be %d\n",
|
||||
brcmf_err("frame length mismatch:read %d, should be %d\n",
|
||||
rd->len,
|
||||
roundup(rd_new.len, 16) >> 4);
|
||||
rd->len = 0;
|
||||
@ -1706,7 +1706,7 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes)
|
||||
"RxHdr:\n");
|
||||
|
||||
if (rd_new.channel == SDPCM_CONTROL_CHANNEL) {
|
||||
brcmf_dbg(ERROR, "readahead on control packet %d?\n",
|
||||
brcmf_err("readahead on control packet %d?\n",
|
||||
rd_new.seq_num);
|
||||
/* Force retry w/normal header read */
|
||||
rd->len = 0;
|
||||
@ -1733,7 +1733,7 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes)
|
||||
skb_pull(pkt, SDPCM_HDRLEN);
|
||||
bus->glomd = pkt;
|
||||
} else {
|
||||
brcmf_dbg(ERROR, "%s: glom superframe w/o "
|
||||
brcmf_err("%s: glom superframe w/o "
|
||||
"descriptor!\n", __func__);
|
||||
sdio_claim_host(bus->sdiodev->func[1]);
|
||||
brcmf_sdbrcm_rxfail(bus, false, false);
|
||||
@ -1762,7 +1762,7 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes)
|
||||
continue;
|
||||
} else if (brcmf_proto_hdrpull(bus->sdiodev->dev, &ifidx,
|
||||
pkt) != 0) {
|
||||
brcmf_dbg(ERROR, "rx protocol error\n");
|
||||
brcmf_err("rx protocol error\n");
|
||||
brcmu_pkt_buf_free_skb(pkt);
|
||||
bus->sdiodev->bus_if->dstats.rx_errors++;
|
||||
continue;
|
||||
@ -1818,7 +1818,7 @@ static int brcmf_sdbrcm_txpkt(struct brcmf_sdio *bus, struct sk_buff *pkt,
|
||||
bus->sdiodev->bus_if->tx_realloc++;
|
||||
new = brcmu_pkt_buf_get_skb(pkt->len + BRCMF_SDALIGN);
|
||||
if (!new) {
|
||||
brcmf_dbg(ERROR, "couldn't allocate new %d-byte packet\n",
|
||||
brcmf_err("couldn't allocate new %d-byte packet\n",
|
||||
pkt->len + BRCMF_SDALIGN);
|
||||
ret = -ENOMEM;
|
||||
goto done;
|
||||
@ -2024,7 +2024,7 @@ static void brcmf_sdbrcm_bus_stop(struct device *dev)
|
||||
(saveclk | SBSDIO_FORCE_HT), &err);
|
||||
}
|
||||
if (err)
|
||||
brcmf_dbg(ERROR, "Failed to force clock for F2: err %d\n", err);
|
||||
brcmf_err("Failed to force clock for F2: err %d\n", err);
|
||||
|
||||
/* Turn off the bus (F2), free any pending packets */
|
||||
brcmf_dbg(INTR, "disable SDIO interrupts\n");
|
||||
@ -2150,7 +2150,7 @@ static void brcmf_sdbrcm_dpc(struct brcmf_sdio *bus)
|
||||
devctl = brcmf_sdio_regrb(bus->sdiodev,
|
||||
SBSDIO_DEVICE_CTL, &err);
|
||||
if (err) {
|
||||
brcmf_dbg(ERROR, "error reading DEVCTL: %d\n", err);
|
||||
brcmf_err("error reading DEVCTL: %d\n", err);
|
||||
bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN;
|
||||
}
|
||||
#endif /* DEBUG */
|
||||
@ -2159,7 +2159,7 @@ static void brcmf_sdbrcm_dpc(struct brcmf_sdio *bus)
|
||||
clkctl = brcmf_sdio_regrb(bus->sdiodev,
|
||||
SBSDIO_FUNC1_CHIPCLKCSR, &err);
|
||||
if (err) {
|
||||
brcmf_dbg(ERROR, "error reading CSR: %d\n",
|
||||
brcmf_err("error reading CSR: %d\n",
|
||||
err);
|
||||
bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN;
|
||||
}
|
||||
@ -2171,7 +2171,7 @@ static void brcmf_sdbrcm_dpc(struct brcmf_sdio *bus)
|
||||
devctl = brcmf_sdio_regrb(bus->sdiodev,
|
||||
SBSDIO_DEVICE_CTL, &err);
|
||||
if (err) {
|
||||
brcmf_dbg(ERROR, "error reading DEVCTL: %d\n",
|
||||
brcmf_err("error reading DEVCTL: %d\n",
|
||||
err);
|
||||
bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN;
|
||||
}
|
||||
@ -2179,7 +2179,7 @@ static void brcmf_sdbrcm_dpc(struct brcmf_sdio *bus)
|
||||
brcmf_sdio_regwb(bus->sdiodev, SBSDIO_DEVICE_CTL,
|
||||
devctl, &err);
|
||||
if (err) {
|
||||
brcmf_dbg(ERROR, "error writing DEVCTL: %d\n",
|
||||
brcmf_err("error writing DEVCTL: %d\n",
|
||||
err);
|
||||
bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN;
|
||||
}
|
||||
@ -2226,17 +2226,17 @@ static void brcmf_sdbrcm_dpc(struct brcmf_sdio *bus)
|
||||
|
||||
/* Generally don't ask for these, can get CRC errors... */
|
||||
if (intstatus & I_WR_OOSYNC) {
|
||||
brcmf_dbg(ERROR, "Dongle reports WR_OOSYNC\n");
|
||||
brcmf_err("Dongle reports WR_OOSYNC\n");
|
||||
intstatus &= ~I_WR_OOSYNC;
|
||||
}
|
||||
|
||||
if (intstatus & I_RD_OOSYNC) {
|
||||
brcmf_dbg(ERROR, "Dongle reports RD_OOSYNC\n");
|
||||
brcmf_err("Dongle reports RD_OOSYNC\n");
|
||||
intstatus &= ~I_RD_OOSYNC;
|
||||
}
|
||||
|
||||
if (intstatus & I_SBINT) {
|
||||
brcmf_dbg(ERROR, "Dongle reports SBINT\n");
|
||||
brcmf_err("Dongle reports SBINT\n");
|
||||
intstatus &= ~I_SBINT;
|
||||
}
|
||||
|
||||
@ -2319,7 +2319,7 @@ static void brcmf_sdbrcm_dpc(struct brcmf_sdio *bus)
|
||||
}
|
||||
|
||||
if ((bus->sdiodev->bus_if->state == BRCMF_BUS_DOWN) || (err != 0)) {
|
||||
brcmf_dbg(ERROR, "failed backplane access over SDIO, halting operation\n");
|
||||
brcmf_err("failed backplane access over SDIO, halting operation\n");
|
||||
bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN;
|
||||
atomic_set(&bus->intstatus, 0);
|
||||
} else if (atomic_read(&bus->intstatus) ||
|
||||
@ -2370,7 +2370,7 @@ static int brcmf_sdbrcm_bus_txdata(struct device *dev, struct sk_buff *pkt)
|
||||
skb_pull(pkt, SDPCM_HDRLEN);
|
||||
brcmf_txcomplete(bus->sdiodev->dev, pkt, false);
|
||||
brcmu_pkt_buf_free_skb(pkt);
|
||||
brcmf_dbg(ERROR, "out of bus->txq !!!\n");
|
||||
brcmf_err("out of bus->txq !!!\n");
|
||||
ret = -ENOSR;
|
||||
} else {
|
||||
ret = 0;
|
||||
@ -2420,7 +2420,7 @@ brcmf_sdbrcm_membytes(struct brcmf_sdio *bus, bool write, u32 address, u8 *data,
|
||||
/* Set the backplane window to include the start address */
|
||||
bcmerror = brcmf_sdcard_set_sbaddr_window(bus->sdiodev, address);
|
||||
if (bcmerror) {
|
||||
brcmf_dbg(ERROR, "window change failed\n");
|
||||
brcmf_err("window change failed\n");
|
||||
goto xfer_done;
|
||||
}
|
||||
|
||||
@ -2432,7 +2432,7 @@ brcmf_sdbrcm_membytes(struct brcmf_sdio *bus, bool write, u32 address, u8 *data,
|
||||
bcmerror = brcmf_sdcard_rwdata(bus->sdiodev, write,
|
||||
sdaddr, data, dsize);
|
||||
if (bcmerror) {
|
||||
brcmf_dbg(ERROR, "membytes transfer failed\n");
|
||||
brcmf_err("membytes transfer failed\n");
|
||||
break;
|
||||
}
|
||||
|
||||
@ -2444,7 +2444,7 @@ brcmf_sdbrcm_membytes(struct brcmf_sdio *bus, bool write, u32 address, u8 *data,
|
||||
bcmerror = brcmf_sdcard_set_sbaddr_window(bus->sdiodev,
|
||||
address);
|
||||
if (bcmerror) {
|
||||
brcmf_dbg(ERROR, "window change failed\n");
|
||||
brcmf_err("window change failed\n");
|
||||
break;
|
||||
}
|
||||
sdaddr = 0;
|
||||
@ -2455,7 +2455,7 @@ brcmf_sdbrcm_membytes(struct brcmf_sdio *bus, bool write, u32 address, u8 *data,
|
||||
xfer_done:
|
||||
/* Return the window to backplane enumeration space for core access */
|
||||
if (brcmf_sdcard_set_sbaddr_window(bus->sdiodev, bus->sdiodev->sbwad))
|
||||
brcmf_dbg(ERROR, "FAILED to set window back to 0x%x\n",
|
||||
brcmf_err("FAILED to set window back to 0x%x\n",
|
||||
bus->sdiodev->sbwad);
|
||||
|
||||
sdio_release_host(bus->sdiodev->func[1]);
|
||||
@ -2739,7 +2739,7 @@ static int brcmf_sdio_readshared(struct brcmf_sdio *bus,
|
||||
* NVRAM length at the end of memory should have been overwritten.
|
||||
*/
|
||||
if (!brcmf_sdio_valid_shared_address(addr)) {
|
||||
brcmf_dbg(ERROR, "invalid sdpcm_shared address 0x%08X\n",
|
||||
brcmf_err("invalid sdpcm_shared address 0x%08X\n",
|
||||
addr);
|
||||
return -EINVAL;
|
||||
}
|
||||
@ -2762,8 +2762,7 @@ static int brcmf_sdio_readshared(struct brcmf_sdio *bus,
|
||||
sh->msgtrace_addr = le32_to_cpu(sh_le.msgtrace_addr);
|
||||
|
||||
if ((sh->flags & SDPCM_SHARED_VERSION_MASK) != SDPCM_SHARED_VERSION) {
|
||||
brcmf_dbg(ERROR,
|
||||
"sdpcm_shared version mismatch: dhd %d dongle %d\n",
|
||||
brcmf_err("sdpcm_shared version mismatch: dhd %d dongle %d\n",
|
||||
SDPCM_SHARED_VERSION,
|
||||
sh->flags & SDPCM_SHARED_VERSION_MASK);
|
||||
return -EPROTO;
|
||||
@ -2938,10 +2937,10 @@ static int brcmf_sdbrcm_checkdied(struct brcmf_sdio *bus)
|
||||
if ((sh.flags & SDPCM_SHARED_ASSERT_BUILT) == 0)
|
||||
brcmf_dbg(INFO, "firmware not built with -assert\n");
|
||||
else if (sh.flags & SDPCM_SHARED_ASSERT)
|
||||
brcmf_dbg(ERROR, "assertion in dongle\n");
|
||||
brcmf_err("assertion in dongle\n");
|
||||
|
||||
if (sh.flags & SDPCM_SHARED_TRAP)
|
||||
brcmf_dbg(ERROR, "firmware trap in dongle\n");
|
||||
brcmf_err("firmware trap in dongle\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -3047,7 +3046,7 @@ brcmf_sdbrcm_bus_rxctl(struct device *dev, unsigned char *msg, uint msglen)
|
||||
brcmf_dbg(CTL, "resumed on rxctl frame, got %d expected %d\n",
|
||||
rxlen, msglen);
|
||||
} else if (timeleft == 0) {
|
||||
brcmf_dbg(ERROR, "resumed on timeout\n");
|
||||
brcmf_err("resumed on timeout\n");
|
||||
brcmf_sdbrcm_checkdied(bus);
|
||||
} else if (pending) {
|
||||
brcmf_dbg(CTL, "cancelled\n");
|
||||
@ -3098,14 +3097,14 @@ static int brcmf_sdbrcm_write_vars(struct brcmf_sdio *bus)
|
||||
bcmerror = brcmf_sdbrcm_membytes(bus, false, varaddr,
|
||||
nvram_ularray, bus->varsz);
|
||||
if (bcmerror) {
|
||||
brcmf_dbg(ERROR, "error %d on reading %d nvram bytes at 0x%08x\n",
|
||||
brcmf_err("error %d on reading %d nvram bytes at 0x%08x\n",
|
||||
bcmerror, bus->varsz, varaddr);
|
||||
}
|
||||
/* Compare the org NVRAM with the one read from RAM */
|
||||
if (memcmp(bus->vars, nvram_ularray, bus->varsz))
|
||||
brcmf_dbg(ERROR, "Downloaded NVRAM image is corrupted\n");
|
||||
brcmf_err("Downloaded NVRAM image is corrupted\n");
|
||||
else
|
||||
brcmf_dbg(ERROR, "Download/Upload/Compare of NVRAM ok\n");
|
||||
brcmf_err("Download/Upload/Compare of NVRAM ok\n");
|
||||
|
||||
kfree(nvram_ularray);
|
||||
#endif /* DEBUG */
|
||||
@ -3163,14 +3162,14 @@ static int brcmf_sdbrcm_download_state(struct brcmf_sdio *bus, bool enter)
|
||||
}
|
||||
} else {
|
||||
if (!ci->iscoreup(bus->sdiodev, ci, BCMA_CORE_INTERNAL_MEM)) {
|
||||
brcmf_dbg(ERROR, "SOCRAM core is down after reset?\n");
|
||||
brcmf_err("SOCRAM core is down after reset?\n");
|
||||
bcmerror = -EBADE;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
bcmerror = brcmf_sdbrcm_write_vars(bus);
|
||||
if (bcmerror) {
|
||||
brcmf_dbg(ERROR, "no vars written to RAM\n");
|
||||
brcmf_err("no vars written to RAM\n");
|
||||
bcmerror = 0;
|
||||
}
|
||||
|
||||
@ -3210,7 +3209,7 @@ static int brcmf_sdbrcm_download_code_file(struct brcmf_sdio *bus)
|
||||
ret = request_firmware(&bus->firmware, BRCMF_SDIO_FW_NAME,
|
||||
&bus->sdiodev->func[2]->dev);
|
||||
if (ret) {
|
||||
brcmf_dbg(ERROR, "Fail to request firmware %d\n", ret);
|
||||
brcmf_err("Fail to request firmware %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
bus->fw_ptr = 0;
|
||||
@ -3229,7 +3228,7 @@ static int brcmf_sdbrcm_download_code_file(struct brcmf_sdio *bus)
|
||||
brcmf_sdbrcm_get_image((char *)memptr, MEMBLOCK, bus))) {
|
||||
ret = brcmf_sdbrcm_membytes(bus, true, offset, memptr, len);
|
||||
if (ret) {
|
||||
brcmf_dbg(ERROR, "error %d on writing %d membytes at 0x%08x\n",
|
||||
brcmf_err("error %d on writing %d membytes at 0x%08x\n",
|
||||
ret, MEMBLOCK, offset);
|
||||
goto err;
|
||||
}
|
||||
@ -3329,7 +3328,7 @@ static int brcmf_sdbrcm_download_nvram(struct brcmf_sdio *bus)
|
||||
ret = request_firmware(&bus->firmware, BRCMF_SDIO_NV_NAME,
|
||||
&bus->sdiodev->func[2]->dev);
|
||||
if (ret) {
|
||||
brcmf_dbg(ERROR, "Fail to request nvram %d\n", ret);
|
||||
brcmf_err("Fail to request nvram %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -3346,23 +3345,23 @@ static int _brcmf_sdbrcm_download_firmware(struct brcmf_sdio *bus)
|
||||
|
||||
/* Keep arm in reset */
|
||||
if (brcmf_sdbrcm_download_state(bus, true)) {
|
||||
brcmf_dbg(ERROR, "error placing ARM core in reset\n");
|
||||
brcmf_err("error placing ARM core in reset\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* External image takes precedence if specified */
|
||||
if (brcmf_sdbrcm_download_code_file(bus)) {
|
||||
brcmf_dbg(ERROR, "dongle image file download failed\n");
|
||||
brcmf_err("dongle image file download failed\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* External nvram takes precedence if specified */
|
||||
if (brcmf_sdbrcm_download_nvram(bus))
|
||||
brcmf_dbg(ERROR, "dongle nvram file download failed\n");
|
||||
brcmf_err("dongle nvram file download failed\n");
|
||||
|
||||
/* Take arm out of reset */
|
||||
if (brcmf_sdbrcm_download_state(bus, false)) {
|
||||
brcmf_dbg(ERROR, "error getting out of ARM core reset\n");
|
||||
brcmf_err("error getting out of ARM core reset\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
@ -3430,7 +3429,7 @@ static int brcmf_sdbrcm_bus_init(struct device *dev)
|
||||
(saveclk | SBSDIO_FORCE_HT), &err);
|
||||
}
|
||||
if (err) {
|
||||
brcmf_dbg(ERROR, "Failed to force clock for F2: err %d\n", err);
|
||||
brcmf_err("Failed to force clock for F2: err %d\n", err);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@ -3476,7 +3475,7 @@ static int brcmf_sdbrcm_bus_init(struct device *dev)
|
||||
if (ret == 0) {
|
||||
ret = brcmf_sdio_intr_register(bus->sdiodev);
|
||||
if (ret != 0)
|
||||
brcmf_dbg(ERROR, "intr register failed:%d\n", ret);
|
||||
brcmf_err("intr register failed:%d\n", ret);
|
||||
}
|
||||
|
||||
/* If we didn't come up, turn off backplane clock */
|
||||
@ -3496,12 +3495,12 @@ void brcmf_sdbrcm_isr(void *arg)
|
||||
brcmf_dbg(TRACE, "Enter\n");
|
||||
|
||||
if (!bus) {
|
||||
brcmf_dbg(ERROR, "bus is null pointer, exiting\n");
|
||||
brcmf_err("bus is null pointer, exiting\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (bus->sdiodev->bus_if->state == BRCMF_BUS_DOWN) {
|
||||
brcmf_dbg(ERROR, "bus is down. we have nothing to do\n");
|
||||
brcmf_err("bus is down. we have nothing to do\n");
|
||||
return;
|
||||
}
|
||||
/* Count the interrupt call */
|
||||
@ -3510,13 +3509,13 @@ void brcmf_sdbrcm_isr(void *arg)
|
||||
atomic_set(&bus->ipend, 1);
|
||||
else
|
||||
if (brcmf_sdio_intr_rstatus(bus)) {
|
||||
brcmf_dbg(ERROR, "failed backplane access\n");
|
||||
brcmf_err("failed backplane access\n");
|
||||
bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN;
|
||||
}
|
||||
|
||||
/* Disable additional interrupts (is this needed now)? */
|
||||
if (!bus->intr)
|
||||
brcmf_dbg(ERROR, "isr w/o interrupt configured!\n");
|
||||
brcmf_err("isr w/o interrupt configured!\n");
|
||||
|
||||
brcmf_sdbrcm_adddpctsk(bus);
|
||||
queue_work(bus->brcmf_wq, &bus->datawork);
|
||||
@ -3718,18 +3717,18 @@ brcmf_sdbrcm_probe_attach(struct brcmf_sdio *bus, u32 regsva)
|
||||
SBSDIO_FUNC1_CHIPCLKCSR, &err);
|
||||
|
||||
if (err || ((clkctl & ~SBSDIO_AVBITS) != BRCMF_INIT_CLKCTL1)) {
|
||||
brcmf_dbg(ERROR, "ChipClkCSR access: err %d wrote 0x%02x read 0x%02x\n",
|
||||
brcmf_err("ChipClkCSR access: err %d wrote 0x%02x read 0x%02x\n",
|
||||
err, BRCMF_INIT_CLKCTL1, clkctl);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (brcmf_sdio_chip_attach(bus->sdiodev, &bus->ci, regsva)) {
|
||||
brcmf_dbg(ERROR, "brcmf_sdio_chip_attach failed!\n");
|
||||
brcmf_err("brcmf_sdio_chip_attach failed!\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (!brcmf_sdbrcm_chipmatch((u16) bus->ci->chip)) {
|
||||
brcmf_dbg(ERROR, "unsupported chip: 0x%04x\n", bus->ci->chip);
|
||||
brcmf_err("unsupported chip: 0x%04x\n", bus->ci->chip);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@ -3739,7 +3738,7 @@ brcmf_sdbrcm_probe_attach(struct brcmf_sdio *bus, u32 regsva)
|
||||
/* Get info on the SOCRAM cores... */
|
||||
bus->ramsize = bus->ci->ramsize;
|
||||
if (!(bus->ramsize)) {
|
||||
brcmf_dbg(ERROR, "failed to find SOCRAM memory!\n");
|
||||
brcmf_err("failed to find SOCRAM memory!\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@ -3883,6 +3882,14 @@ static void brcmf_sdbrcm_release(struct brcmf_sdio *bus)
|
||||
brcmf_dbg(TRACE, "Disconnected\n");
|
||||
}
|
||||
|
||||
static struct brcmf_bus_ops brcmf_sdio_bus_ops = {
|
||||
.stop = brcmf_sdbrcm_bus_stop,
|
||||
.init = brcmf_sdbrcm_bus_init,
|
||||
.txdata = brcmf_sdbrcm_bus_txdata,
|
||||
.txctl = brcmf_sdbrcm_bus_txctl,
|
||||
.rxctl = brcmf_sdbrcm_bus_rxctl,
|
||||
};
|
||||
|
||||
void *brcmf_sdbrcm_probe(u32 regsva, struct brcmf_sdio_dev *sdiodev)
|
||||
{
|
||||
int ret;
|
||||
@ -3913,13 +3920,13 @@ void *brcmf_sdbrcm_probe(u32 regsva, struct brcmf_sdio_dev *sdiodev)
|
||||
INIT_WORK(&bus->datawork, brcmf_sdio_dataworker);
|
||||
bus->brcmf_wq = create_singlethread_workqueue("brcmf_wq");
|
||||
if (bus->brcmf_wq == NULL) {
|
||||
brcmf_dbg(ERROR, "insufficient memory to create txworkqueue\n");
|
||||
brcmf_err("insufficient memory to create txworkqueue\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* attempt to attach to the dongle */
|
||||
if (!(brcmf_sdbrcm_probe_attach(bus, regsva))) {
|
||||
brcmf_dbg(ERROR, "brcmf_sdbrcm_probe_attach failed\n");
|
||||
brcmf_err("brcmf_sdbrcm_probe_attach failed\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@ -3946,26 +3953,24 @@ void *brcmf_sdbrcm_probe(u32 regsva, struct brcmf_sdio_dev *sdiodev)
|
||||
spin_lock_init(&bus->dpc_tl_lock);
|
||||
|
||||
/* Assign bus interface call back */
|
||||
bus->sdiodev->bus_if->brcmf_bus_stop = brcmf_sdbrcm_bus_stop;
|
||||
bus->sdiodev->bus_if->brcmf_bus_init = brcmf_sdbrcm_bus_init;
|
||||
bus->sdiodev->bus_if->brcmf_bus_txdata = brcmf_sdbrcm_bus_txdata;
|
||||
bus->sdiodev->bus_if->brcmf_bus_txctl = brcmf_sdbrcm_bus_txctl;
|
||||
bus->sdiodev->bus_if->brcmf_bus_rxctl = brcmf_sdbrcm_bus_rxctl;
|
||||
bus->sdiodev->bus_if->dev = bus->sdiodev->dev;
|
||||
bus->sdiodev->bus_if->ops = &brcmf_sdio_bus_ops;
|
||||
|
||||
/* Attach to the brcmf/OS/network interface */
|
||||
ret = brcmf_attach(SDPCM_RESERVE, bus->sdiodev->dev);
|
||||
if (ret != 0) {
|
||||
brcmf_dbg(ERROR, "brcmf_attach failed\n");
|
||||
brcmf_err("brcmf_attach failed\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* Allocate buffers */
|
||||
if (!(brcmf_sdbrcm_probe_malloc(bus))) {
|
||||
brcmf_dbg(ERROR, "brcmf_sdbrcm_probe_malloc failed\n");
|
||||
brcmf_err("brcmf_sdbrcm_probe_malloc failed\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (!(brcmf_sdbrcm_probe_init(bus))) {
|
||||
brcmf_dbg(ERROR, "brcmf_sdbrcm_probe_init failed\n");
|
||||
brcmf_err("brcmf_sdbrcm_probe_init failed\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@ -3995,7 +4000,7 @@ void *brcmf_sdbrcm_probe(u32 regsva, struct brcmf_sdio_dev *sdiodev)
|
||||
/* if firmware path present try to download and bring up bus */
|
||||
ret = brcmf_bus_start(bus->sdiodev->dev);
|
||||
if (ret != 0) {
|
||||
brcmf_dbg(ERROR, "dongle is not responding\n");
|
||||
brcmf_err("dongle is not responding\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -95,76 +95,14 @@ struct brcmf_fweh_event_name {
|
||||
};
|
||||
|
||||
#ifdef DEBUG
|
||||
#define BRCMF_ENUM_DEF(id, val) \
|
||||
{ val, #id },
|
||||
|
||||
/* array for mapping code to event name */
|
||||
static struct brcmf_fweh_event_name fweh_event_names[] = {
|
||||
{ BRCMF_E_SET_SSID, "SET_SSID" },
|
||||
{ BRCMF_E_JOIN, "JOIN" },
|
||||
{ BRCMF_E_START, "START" },
|
||||
{ BRCMF_E_AUTH, "AUTH" },
|
||||
{ BRCMF_E_AUTH_IND, "AUTH_IND" },
|
||||
{ BRCMF_E_DEAUTH, "DEAUTH" },
|
||||
{ BRCMF_E_DEAUTH_IND, "DEAUTH_IND" },
|
||||
{ BRCMF_E_ASSOC, "ASSOC" },
|
||||
{ BRCMF_E_ASSOC_IND, "ASSOC_IND" },
|
||||
{ BRCMF_E_REASSOC, "REASSOC" },
|
||||
{ BRCMF_E_REASSOC_IND, "REASSOC_IND" },
|
||||
{ BRCMF_E_DISASSOC, "DISASSOC" },
|
||||
{ BRCMF_E_DISASSOC_IND, "DISASSOC_IND" },
|
||||
{ BRCMF_E_QUIET_START, "START_QUIET" },
|
||||
{ BRCMF_E_QUIET_END, "END_QUIET" },
|
||||
{ BRCMF_E_BEACON_RX, "BEACON_RX" },
|
||||
{ BRCMF_E_LINK, "LINK" },
|
||||
{ BRCMF_E_MIC_ERROR, "MIC_ERROR" },
|
||||
{ BRCMF_E_NDIS_LINK, "NDIS_LINK" },
|
||||
{ BRCMF_E_ROAM, "ROAM" },
|
||||
{ BRCMF_E_TXFAIL, "TXFAIL" },
|
||||
{ BRCMF_E_PMKID_CACHE, "PMKID_CACHE" },
|
||||
{ BRCMF_E_RETROGRADE_TSF, "RETROGRADE_TSF" },
|
||||
{ BRCMF_E_PRUNE, "PRUNE" },
|
||||
{ BRCMF_E_AUTOAUTH, "AUTOAUTH" },
|
||||
{ BRCMF_E_EAPOL_MSG, "EAPOL_MSG" },
|
||||
{ BRCMF_E_SCAN_COMPLETE, "SCAN_COMPLETE" },
|
||||
{ BRCMF_E_ADDTS_IND, "ADDTS_IND" },
|
||||
{ BRCMF_E_DELTS_IND, "DELTS_IND" },
|
||||
{ BRCMF_E_BCNSENT_IND, "BCNSENT_IND" },
|
||||
{ BRCMF_E_BCNRX_MSG, "BCNRX_MSG" },
|
||||
{ BRCMF_E_BCNLOST_MSG, "BCNLOST_MSG" },
|
||||
{ BRCMF_E_ROAM_PREP, "ROAM_PREP" },
|
||||
{ BRCMF_E_PFN_NET_FOUND, "PNO_NET_FOUND" },
|
||||
{ BRCMF_E_PFN_NET_LOST, "PNO_NET_LOST" },
|
||||
{ BRCMF_E_RESET_COMPLETE, "RESET_COMPLETE" },
|
||||
{ BRCMF_E_JOIN_START, "JOIN_START" },
|
||||
{ BRCMF_E_ROAM_START, "ROAM_START" },
|
||||
{ BRCMF_E_ASSOC_START, "ASSOC_START" },
|
||||
{ BRCMF_E_IBSS_ASSOC, "IBSS_ASSOC" },
|
||||
{ BRCMF_E_RADIO, "RADIO" },
|
||||
{ BRCMF_E_PSM_WATCHDOG, "PSM_WATCHDOG" },
|
||||
{ BRCMF_E_PROBREQ_MSG, "PROBREQ_MSG" },
|
||||
{ BRCMF_E_SCAN_CONFIRM_IND, "SCAN_CONFIRM_IND" },
|
||||
{ BRCMF_E_PSK_SUP, "PSK_SUP" },
|
||||
{ BRCMF_E_COUNTRY_CODE_CHANGED, "COUNTRY_CODE_CHANGED" },
|
||||
{ BRCMF_E_EXCEEDED_MEDIUM_TIME, "EXCEEDED_MEDIUM_TIME" },
|
||||
{ BRCMF_E_ICV_ERROR, "ICV_ERROR" },
|
||||
{ BRCMF_E_UNICAST_DECODE_ERROR, "UNICAST_DECODE_ERROR" },
|
||||
{ BRCMF_E_MULTICAST_DECODE_ERROR, "MULTICAST_DECODE_ERROR" },
|
||||
{ BRCMF_E_TRACE, "TRACE" },
|
||||
{ BRCMF_E_IF, "IF" },
|
||||
{ BRCMF_E_RSSI, "RSSI" },
|
||||
{ BRCMF_E_PFN_SCAN_COMPLETE, "PFN_SCAN_COMPLETE" },
|
||||
{ BRCMF_E_EXTLOG_MSG, "EXTLOG_MSG" },
|
||||
{ BRCMF_E_ACTION_FRAME, "ACTION_FRAME" },
|
||||
{ BRCMF_E_ACTION_FRAME_COMPLETE, "ACTION_FRAME_COMPLETE" },
|
||||
{ BRCMF_E_PRE_ASSOC_IND, "PRE_ASSOC_IND" },
|
||||
{ BRCMF_E_PRE_REASSOC_IND, "PRE_REASSOC_IND" },
|
||||
{ BRCMF_E_CHANNEL_ADOPTED, "CHANNEL_ADOPTED" },
|
||||
{ BRCMF_E_AP_STARTED, "AP_STARTED" },
|
||||
{ BRCMF_E_DFS_AP_STOP, "DFS_AP_STOP" },
|
||||
{ BRCMF_E_DFS_AP_RESUME, "DFS_AP_RESUME" },
|
||||
{ BRCMF_E_ESCAN_RESULT, "ESCAN_RESULT" },
|
||||
{ BRCMF_E_ACTION_FRAME_OFF_CHAN_COMPLETE, "ACTION_FRM_OFF_CHAN_CMPLT" },
|
||||
{ BRCMF_E_DCS_REQUEST, "DCS_REQUEST" },
|
||||
{ BRCMF_E_FIFO_CREDIT_MAP, "FIFO_CREDIT_MAP"}
|
||||
BRCMF_FWEH_EVENT_ENUM_DEFLIST
|
||||
};
|
||||
#undef BRCMF_ENUM_DEF
|
||||
|
||||
/**
|
||||
* brcmf_fweh_event_name() - returns name for given event code.
|
||||
@ -219,9 +157,9 @@ static int brcmf_fweh_call_event_handler(struct brcmf_if *ifp,
|
||||
if (ifp->ndev && fweh->evt_handler[code])
|
||||
err = fweh->evt_handler[code](ifp, emsg, data);
|
||||
else
|
||||
brcmf_dbg(ERROR, "unhandled event %d ignored\n", code);
|
||||
brcmf_err("unhandled event %d ignored\n", code);
|
||||
} else {
|
||||
brcmf_dbg(ERROR, "no interface object\n");
|
||||
brcmf_err("no interface object\n");
|
||||
}
|
||||
return err;
|
||||
}
|
||||
@ -246,7 +184,7 @@ static void brcmf_fweh_handle_if_event(struct brcmf_pub *drvr,
|
||||
ifevent->bssidx, ifevent->flags);
|
||||
|
||||
if (ifevent->ifidx >= BRCMF_MAX_IFS) {
|
||||
brcmf_dbg(ERROR, "invalid interface index: %u\n",
|
||||
brcmf_err("invalid interface index: %u\n",
|
||||
ifevent->ifidx);
|
||||
return;
|
||||
}
|
||||
@ -348,7 +286,7 @@ static void brcmf_fweh_event_worker(struct work_struct *work)
|
||||
err = brcmf_fweh_call_event_handler(ifp, event->code, &emsg,
|
||||
event->data);
|
||||
if (err) {
|
||||
brcmf_dbg(ERROR, "event handler failed (%d)\n",
|
||||
brcmf_err("event handler failed (%d)\n",
|
||||
event->code);
|
||||
err = 0;
|
||||
}
|
||||
@ -405,7 +343,7 @@ int brcmf_fweh_register(struct brcmf_pub *drvr, enum brcmf_fweh_event_code code,
|
||||
brcmf_fweh_handler_t handler)
|
||||
{
|
||||
if (drvr->fweh.evt_handler[code]) {
|
||||
brcmf_dbg(ERROR, "event code %d already registered\n", code);
|
||||
brcmf_err("event code %d already registered\n", code);
|
||||
return -ENOSPC;
|
||||
}
|
||||
drvr->fweh.evt_handler[code] = handler;
|
||||
@ -453,7 +391,7 @@ int brcmf_fweh_activate_events(struct brcmf_if *ifp)
|
||||
err = brcmf_fil_iovar_data_set(ifp, "event_msgs",
|
||||
eventmask, BRCMF_EVENTING_MASK_LEN);
|
||||
if (err)
|
||||
brcmf_dbg(ERROR, "Set event_msgs error (%d)\n", err);
|
||||
brcmf_err("Set event_msgs error (%d)\n", err);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
@ -29,77 +29,85 @@ struct brcmf_if;
|
||||
struct brcmf_cfg80211_info;
|
||||
struct brcmf_event;
|
||||
|
||||
/* list of firmware events */
|
||||
#define BRCMF_FWEH_EVENT_ENUM_DEFLIST \
|
||||
BRCMF_ENUM_DEF(SET_SSID, 0) \
|
||||
BRCMF_ENUM_DEF(JOIN, 1) \
|
||||
BRCMF_ENUM_DEF(START, 2) \
|
||||
BRCMF_ENUM_DEF(AUTH, 3) \
|
||||
BRCMF_ENUM_DEF(AUTH_IND, 4) \
|
||||
BRCMF_ENUM_DEF(DEAUTH, 5) \
|
||||
BRCMF_ENUM_DEF(DEAUTH_IND, 6) \
|
||||
BRCMF_ENUM_DEF(ASSOC, 7) \
|
||||
BRCMF_ENUM_DEF(ASSOC_IND, 8) \
|
||||
BRCMF_ENUM_DEF(REASSOC, 9) \
|
||||
BRCMF_ENUM_DEF(REASSOC_IND, 10) \
|
||||
BRCMF_ENUM_DEF(DISASSOC, 11) \
|
||||
BRCMF_ENUM_DEF(DISASSOC_IND, 12) \
|
||||
BRCMF_ENUM_DEF(QUIET_START, 13) \
|
||||
BRCMF_ENUM_DEF(QUIET_END, 14) \
|
||||
BRCMF_ENUM_DEF(BEACON_RX, 15) \
|
||||
BRCMF_ENUM_DEF(LINK, 16) \
|
||||
BRCMF_ENUM_DEF(MIC_ERROR, 17) \
|
||||
BRCMF_ENUM_DEF(NDIS_LINK, 18) \
|
||||
BRCMF_ENUM_DEF(ROAM, 19) \
|
||||
BRCMF_ENUM_DEF(TXFAIL, 20) \
|
||||
BRCMF_ENUM_DEF(PMKID_CACHE, 21) \
|
||||
BRCMF_ENUM_DEF(RETROGRADE_TSF, 22) \
|
||||
BRCMF_ENUM_DEF(PRUNE, 23) \
|
||||
BRCMF_ENUM_DEF(AUTOAUTH, 24) \
|
||||
BRCMF_ENUM_DEF(EAPOL_MSG, 25) \
|
||||
BRCMF_ENUM_DEF(SCAN_COMPLETE, 26) \
|
||||
BRCMF_ENUM_DEF(ADDTS_IND, 27) \
|
||||
BRCMF_ENUM_DEF(DELTS_IND, 28) \
|
||||
BRCMF_ENUM_DEF(BCNSENT_IND, 29) \
|
||||
BRCMF_ENUM_DEF(BCNRX_MSG, 30) \
|
||||
BRCMF_ENUM_DEF(BCNLOST_MSG, 31) \
|
||||
BRCMF_ENUM_DEF(ROAM_PREP, 32) \
|
||||
BRCMF_ENUM_DEF(PFN_NET_FOUND, 33) \
|
||||
BRCMF_ENUM_DEF(PFN_NET_LOST, 34) \
|
||||
BRCMF_ENUM_DEF(RESET_COMPLETE, 35) \
|
||||
BRCMF_ENUM_DEF(JOIN_START, 36) \
|
||||
BRCMF_ENUM_DEF(ROAM_START, 37) \
|
||||
BRCMF_ENUM_DEF(ASSOC_START, 38) \
|
||||
BRCMF_ENUM_DEF(IBSS_ASSOC, 39) \
|
||||
BRCMF_ENUM_DEF(RADIO, 40) \
|
||||
BRCMF_ENUM_DEF(PSM_WATCHDOG, 41) \
|
||||
BRCMF_ENUM_DEF(PROBREQ_MSG, 44) \
|
||||
BRCMF_ENUM_DEF(SCAN_CONFIRM_IND, 45) \
|
||||
BRCMF_ENUM_DEF(PSK_SUP, 46) \
|
||||
BRCMF_ENUM_DEF(COUNTRY_CODE_CHANGED, 47) \
|
||||
BRCMF_ENUM_DEF(EXCEEDED_MEDIUM_TIME, 48) \
|
||||
BRCMF_ENUM_DEF(ICV_ERROR, 49) \
|
||||
BRCMF_ENUM_DEF(UNICAST_DECODE_ERROR, 50) \
|
||||
BRCMF_ENUM_DEF(MULTICAST_DECODE_ERROR, 51) \
|
||||
BRCMF_ENUM_DEF(TRACE, 52) \
|
||||
BRCMF_ENUM_DEF(IF, 54) \
|
||||
BRCMF_ENUM_DEF(RSSI, 56) \
|
||||
BRCMF_ENUM_DEF(PFN_SCAN_COMPLETE, 57) \
|
||||
BRCMF_ENUM_DEF(EXTLOG_MSG, 58) \
|
||||
BRCMF_ENUM_DEF(ACTION_FRAME, 59) \
|
||||
BRCMF_ENUM_DEF(ACTION_FRAME_COMPLETE, 60) \
|
||||
BRCMF_ENUM_DEF(PRE_ASSOC_IND, 61) \
|
||||
BRCMF_ENUM_DEF(PRE_REASSOC_IND, 62) \
|
||||
BRCMF_ENUM_DEF(CHANNEL_ADOPTED, 63) \
|
||||
BRCMF_ENUM_DEF(AP_STARTED, 64) \
|
||||
BRCMF_ENUM_DEF(DFS_AP_STOP, 65) \
|
||||
BRCMF_ENUM_DEF(DFS_AP_RESUME, 66) \
|
||||
BRCMF_ENUM_DEF(ESCAN_RESULT, 69) \
|
||||
BRCMF_ENUM_DEF(ACTION_FRAME_OFF_CHAN_COMPLETE, 70) \
|
||||
BRCMF_ENUM_DEF(DCS_REQUEST, 73) \
|
||||
BRCMF_ENUM_DEF(FIFO_CREDIT_MAP, 74)
|
||||
|
||||
#define BRCMF_ENUM_DEF(id, val) \
|
||||
BRCMF_E_##id = (val),
|
||||
|
||||
/* firmware event codes sent by the dongle */
|
||||
enum brcmf_fweh_event_code {
|
||||
BRCMF_E_SET_SSID = 0,
|
||||
BRCMF_E_JOIN = 1,
|
||||
BRCMF_E_START = 2,
|
||||
BRCMF_E_AUTH = 3,
|
||||
BRCMF_E_AUTH_IND = 4,
|
||||
BRCMF_E_DEAUTH = 5,
|
||||
BRCMF_E_DEAUTH_IND = 6,
|
||||
BRCMF_E_ASSOC = 7,
|
||||
BRCMF_E_ASSOC_IND = 8,
|
||||
BRCMF_E_REASSOC = 9,
|
||||
BRCMF_E_REASSOC_IND = 10,
|
||||
BRCMF_E_DISASSOC = 11,
|
||||
BRCMF_E_DISASSOC_IND = 12,
|
||||
BRCMF_E_QUIET_START = 13,
|
||||
BRCMF_E_QUIET_END = 14,
|
||||
BRCMF_E_BEACON_RX = 15,
|
||||
BRCMF_E_LINK = 16,
|
||||
BRCMF_E_MIC_ERROR = 17,
|
||||
BRCMF_E_NDIS_LINK = 18,
|
||||
BRCMF_E_ROAM = 19,
|
||||
BRCMF_E_TXFAIL = 20,
|
||||
BRCMF_E_PMKID_CACHE = 21,
|
||||
BRCMF_E_RETROGRADE_TSF = 22,
|
||||
BRCMF_E_PRUNE = 23,
|
||||
BRCMF_E_AUTOAUTH = 24,
|
||||
BRCMF_E_EAPOL_MSG = 25,
|
||||
BRCMF_E_SCAN_COMPLETE = 26,
|
||||
BRCMF_E_ADDTS_IND = 27,
|
||||
BRCMF_E_DELTS_IND = 28,
|
||||
BRCMF_E_BCNSENT_IND = 29,
|
||||
BRCMF_E_BCNRX_MSG = 30,
|
||||
BRCMF_E_BCNLOST_MSG = 31,
|
||||
BRCMF_E_ROAM_PREP = 32,
|
||||
BRCMF_E_PFN_NET_FOUND = 33,
|
||||
BRCMF_E_PFN_NET_LOST = 34,
|
||||
BRCMF_E_RESET_COMPLETE = 35,
|
||||
BRCMF_E_JOIN_START = 36,
|
||||
BRCMF_E_ROAM_START = 37,
|
||||
BRCMF_E_ASSOC_START = 38,
|
||||
BRCMF_E_IBSS_ASSOC = 39,
|
||||
BRCMF_E_RADIO = 40,
|
||||
BRCMF_E_PSM_WATCHDOG = 41,
|
||||
BRCMF_E_PROBREQ_MSG = 44,
|
||||
BRCMF_E_SCAN_CONFIRM_IND = 45,
|
||||
BRCMF_E_PSK_SUP = 46,
|
||||
BRCMF_E_COUNTRY_CODE_CHANGED = 47,
|
||||
BRCMF_E_EXCEEDED_MEDIUM_TIME = 48,
|
||||
BRCMF_E_ICV_ERROR = 49,
|
||||
BRCMF_E_UNICAST_DECODE_ERROR = 50,
|
||||
BRCMF_E_MULTICAST_DECODE_ERROR = 51,
|
||||
BRCMF_E_TRACE = 52,
|
||||
BRCMF_E_IF = 54,
|
||||
BRCMF_E_RSSI = 56,
|
||||
BRCMF_E_PFN_SCAN_COMPLETE = 57,
|
||||
BRCMF_E_EXTLOG_MSG = 58,
|
||||
BRCMF_E_ACTION_FRAME = 59,
|
||||
BRCMF_E_ACTION_FRAME_COMPLETE = 60,
|
||||
BRCMF_E_PRE_ASSOC_IND = 61,
|
||||
BRCMF_E_PRE_REASSOC_IND = 62,
|
||||
BRCMF_E_CHANNEL_ADOPTED = 63,
|
||||
BRCMF_E_AP_STARTED = 64,
|
||||
BRCMF_E_DFS_AP_STOP = 65,
|
||||
BRCMF_E_DFS_AP_RESUME = 66,
|
||||
BRCMF_E_ESCAN_RESULT = 69,
|
||||
BRCMF_E_ACTION_FRAME_OFF_CHAN_COMPLETE = 70,
|
||||
BRCMF_E_DCS_REQUEST = 73,
|
||||
BRCMF_E_FIFO_CREDIT_MAP = 74,
|
||||
BRCMF_FWEH_EVENT_ENUM_DEFLIST
|
||||
BRCMF_E_LAST
|
||||
};
|
||||
#undef BRCMF_ENUM_DEF
|
||||
|
||||
/* flags field values in struct brcmf_event_msg */
|
||||
#define BRCMF_EVENT_MSG_LINK 0x01
|
||||
|
@ -38,7 +38,7 @@ brcmf_fil_cmd_data(struct brcmf_if *ifp, u32 cmd, void *data, u32 len, bool set)
|
||||
s32 err;
|
||||
|
||||
if (drvr->bus_if->state != BRCMF_BUS_DATA) {
|
||||
brcmf_dbg(ERROR, "bus is down. we have nothing to do.\n");
|
||||
brcmf_err("bus is down. we have nothing to do.\n");
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ brcmf_fil_cmd_data(struct brcmf_if *ifp, u32 cmd, void *data, u32 len, bool set)
|
||||
if (err >= 0)
|
||||
err = 0;
|
||||
else
|
||||
brcmf_dbg(ERROR, "Failed err=%d\n", err);
|
||||
brcmf_err("Failed err=%d\n", err);
|
||||
|
||||
return err;
|
||||
}
|
||||
@ -161,7 +161,7 @@ brcmf_fil_iovar_data_set(struct brcmf_if *ifp, char *name, void *data,
|
||||
buflen, true);
|
||||
} else {
|
||||
err = -EPERM;
|
||||
brcmf_dbg(ERROR, "Creating iovar failed\n");
|
||||
brcmf_err("Creating iovar failed\n");
|
||||
}
|
||||
|
||||
mutex_unlock(&drvr->proto_block);
|
||||
@ -187,7 +187,7 @@ brcmf_fil_iovar_data_get(struct brcmf_if *ifp, char *name, void *data,
|
||||
memcpy(data, drvr->proto_buf, len);
|
||||
} else {
|
||||
err = -EPERM;
|
||||
brcmf_dbg(ERROR, "Creating iovar failed\n");
|
||||
brcmf_err("Creating iovar failed\n");
|
||||
}
|
||||
|
||||
brcmf_dbg(FIL, "name=%s, len=%d\n", name, len);
|
||||
@ -237,7 +237,7 @@ brcmf_create_bsscfg(s32 bssidx, char *name, char *data, u32 datalen, char *buf,
|
||||
iolen = prefixlen + namelen + sizeof(bssidx_le) + datalen;
|
||||
|
||||
if (buflen < iolen) {
|
||||
brcmf_dbg(ERROR, "buffer is too short\n");
|
||||
brcmf_err("buffer is too short\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -284,7 +284,7 @@ brcmf_fil_bsscfg_data_set(struct brcmf_if *ifp, char *name,
|
||||
buflen, true);
|
||||
} else {
|
||||
err = -EPERM;
|
||||
brcmf_dbg(ERROR, "Creating bsscfg failed\n");
|
||||
brcmf_err("Creating bsscfg failed\n");
|
||||
}
|
||||
|
||||
mutex_unlock(&drvr->proto_block);
|
||||
@ -310,7 +310,7 @@ brcmf_fil_bsscfg_data_get(struct brcmf_if *ifp, char *name,
|
||||
memcpy(data, drvr->proto_buf, len);
|
||||
} else {
|
||||
err = -EPERM;
|
||||
brcmf_dbg(ERROR, "Creating bsscfg failed\n");
|
||||
brcmf_err("Creating bsscfg failed\n");
|
||||
}
|
||||
brcmf_dbg(FIL, "bssidx=%d, name=%s, len=%d\n", ifp->bssidx, name, len);
|
||||
brcmf_dbg_hex_dump(BRCMF_FIL_ON(), data,
|
||||
|
@ -186,7 +186,7 @@ brcmf_sdio_sb_coredisable(struct brcmf_sdio_dev *sdiodev,
|
||||
CORE_SB(base, sbtmstatehigh),
|
||||
NULL);
|
||||
if (regdata & SSB_TMSHIGH_BUSY)
|
||||
brcmf_dbg(ERROR, "core state still busy\n");
|
||||
brcmf_err("core state still busy\n");
|
||||
|
||||
regdata = brcmf_sdio_regrl(sdiodev, CORE_SB(base, sbidlow),
|
||||
NULL);
|
||||
@ -438,7 +438,7 @@ static int brcmf_sdio_chip_recognition(struct brcmf_sdio_dev *sdiodev,
|
||||
ci->ramsize = 0x80000;
|
||||
break;
|
||||
default:
|
||||
brcmf_dbg(ERROR, "chipid 0x%x is not supported\n", ci->chip);
|
||||
brcmf_err("chipid 0x%x is not supported\n", ci->chip);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
@ -456,7 +456,7 @@ static int brcmf_sdio_chip_recognition(struct brcmf_sdio_dev *sdiodev,
|
||||
ci->resetcore = brcmf_sdio_ai_resetcore;
|
||||
break;
|
||||
default:
|
||||
brcmf_dbg(ERROR, "socitype %u not supported\n", ci->socitype);
|
||||
brcmf_err("socitype %u not supported\n", ci->socitype);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
@ -473,7 +473,7 @@ brcmf_sdio_chip_buscoreprep(struct brcmf_sdio_dev *sdiodev)
|
||||
clkset = SBSDIO_FORCE_HW_CLKREQ_OFF | SBSDIO_ALP_AVAIL_REQ;
|
||||
brcmf_sdio_regwb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, clkset, &err);
|
||||
if (err) {
|
||||
brcmf_dbg(ERROR, "error writing for HT off\n");
|
||||
brcmf_err("error writing for HT off\n");
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -483,7 +483,7 @@ brcmf_sdio_chip_buscoreprep(struct brcmf_sdio_dev *sdiodev)
|
||||
SBSDIO_FUNC1_CHIPCLKCSR, NULL);
|
||||
|
||||
if ((clkval & ~SBSDIO_AVBITS) != clkset) {
|
||||
brcmf_dbg(ERROR, "ChipClkCSR access: wrote 0x%02x read 0x%02x\n",
|
||||
brcmf_err("ChipClkCSR access: wrote 0x%02x read 0x%02x\n",
|
||||
clkset, clkval);
|
||||
return -EACCES;
|
||||
}
|
||||
@ -493,7 +493,7 @@ brcmf_sdio_chip_buscoreprep(struct brcmf_sdio_dev *sdiodev)
|
||||
!SBSDIO_ALPAV(clkval)),
|
||||
PMU_MAX_TRANSITION_DLY);
|
||||
if (!SBSDIO_ALPAV(clkval)) {
|
||||
brcmf_dbg(ERROR, "timeout on ALPAV wait, clkval 0x%02x\n",
|
||||
brcmf_err("timeout on ALPAV wait, clkval 0x%02x\n",
|
||||
clkval);
|
||||
return -EBUSY;
|
||||
}
|
||||
@ -618,7 +618,7 @@ brcmf_sdio_chip_drivestrengthinit(struct brcmf_sdio_dev *sdiodev,
|
||||
str_shift = 11;
|
||||
break;
|
||||
default:
|
||||
brcmf_dbg(ERROR, "No SDIO Drive strength init done for chip %s rev %d pmurev %d\n",
|
||||
brcmf_err("No SDIO Drive strength init done for chip %s rev %d pmurev %d\n",
|
||||
brcmf_sdio_chip_name(ci->chip, chn, 8),
|
||||
ci->chiprev, ci->pmurev);
|
||||
break;
|
||||
|
@ -216,7 +216,7 @@ brcmf_usb_send_ctl(struct brcmf_usbdev_info *devinfo, u8 *buf, int len)
|
||||
|
||||
ret = usb_submit_urb(devinfo->ctl_urb, GFP_ATOMIC);
|
||||
if (ret < 0)
|
||||
brcmf_dbg(ERROR, "usb_submit_urb failed %d\n", ret);
|
||||
brcmf_err("usb_submit_urb failed %d\n", ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -250,7 +250,7 @@ brcmf_usb_recv_ctl(struct brcmf_usbdev_info *devinfo, u8 *buf, int len)
|
||||
|
||||
ret = usb_submit_urb(devinfo->ctl_urb, GFP_ATOMIC);
|
||||
if (ret < 0)
|
||||
brcmf_dbg(ERROR, "usb_submit_urb failed %d\n", ret);
|
||||
brcmf_err("usb_submit_urb failed %d\n", ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -271,14 +271,14 @@ static int brcmf_usb_tx_ctlpkt(struct device *dev, u8 *buf, u32 len)
|
||||
devinfo->ctl_completed = false;
|
||||
err = brcmf_usb_send_ctl(devinfo, buf, len);
|
||||
if (err) {
|
||||
brcmf_dbg(ERROR, "fail %d bytes: %d\n", err, len);
|
||||
brcmf_err("fail %d bytes: %d\n", err, len);
|
||||
clear_bit(0, &devinfo->ctl_op);
|
||||
return err;
|
||||
}
|
||||
timeout = brcmf_usb_ioctl_resp_wait(devinfo);
|
||||
clear_bit(0, &devinfo->ctl_op);
|
||||
if (!timeout) {
|
||||
brcmf_dbg(ERROR, "Txctl wait timed out\n");
|
||||
brcmf_err("Txctl wait timed out\n");
|
||||
err = -EIO;
|
||||
}
|
||||
return err;
|
||||
@ -300,7 +300,7 @@ static int brcmf_usb_rx_ctlpkt(struct device *dev, u8 *buf, u32 len)
|
||||
devinfo->ctl_completed = false;
|
||||
err = brcmf_usb_recv_ctl(devinfo, buf, len);
|
||||
if (err) {
|
||||
brcmf_dbg(ERROR, "fail %d bytes: %d\n", err, len);
|
||||
brcmf_err("fail %d bytes: %d\n", err, len);
|
||||
clear_bit(0, &devinfo->ctl_op);
|
||||
return err;
|
||||
}
|
||||
@ -308,7 +308,7 @@ static int brcmf_usb_rx_ctlpkt(struct device *dev, u8 *buf, u32 len)
|
||||
err = devinfo->ctl_urb_status;
|
||||
clear_bit(0, &devinfo->ctl_op);
|
||||
if (!timeout) {
|
||||
brcmf_dbg(ERROR, "rxctl wait timed out\n");
|
||||
brcmf_err("rxctl wait timed out\n");
|
||||
err = -EIO;
|
||||
}
|
||||
if (!err)
|
||||
@ -356,7 +356,7 @@ brcmf_usbdev_qinit(struct list_head *q, int qsize)
|
||||
|
||||
reqs = kzalloc(sizeof(struct brcmf_usbreq) * qsize, GFP_ATOMIC);
|
||||
if (reqs == NULL) {
|
||||
brcmf_dbg(ERROR, "fail to allocate memory!\n");
|
||||
brcmf_err("fail to allocate memory!\n");
|
||||
return NULL;
|
||||
}
|
||||
req = reqs;
|
||||
@ -372,7 +372,7 @@ brcmf_usbdev_qinit(struct list_head *q, int qsize)
|
||||
}
|
||||
return reqs;
|
||||
fail:
|
||||
brcmf_dbg(ERROR, "fail!\n");
|
||||
brcmf_err("fail!\n");
|
||||
while (!list_empty(q)) {
|
||||
req = list_entry(q->next, struct brcmf_usbreq, list);
|
||||
if (req && req->urb)
|
||||
@ -389,7 +389,7 @@ static void brcmf_usb_free_q(struct list_head *q, bool pending)
|
||||
int i = 0;
|
||||
list_for_each_entry_safe(req, next, q, list) {
|
||||
if (!req->urb) {
|
||||
brcmf_dbg(ERROR, "bad req\n");
|
||||
brcmf_err("bad req\n");
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
@ -462,7 +462,7 @@ static void brcmf_usb_rx_complete(struct urb *urb)
|
||||
if (devinfo->bus_pub.state == BRCMFMAC_USB_STATE_UP) {
|
||||
skb_put(skb, urb->actual_length);
|
||||
if (brcmf_proto_hdrpull(devinfo->dev, &ifidx, skb) != 0) {
|
||||
brcmf_dbg(ERROR, "rx protocol error\n");
|
||||
brcmf_err("rx protocol error\n");
|
||||
brcmu_pkt_buf_free_skb(skb);
|
||||
devinfo->bus_pub.bus->dstats.rx_errors++;
|
||||
} else
|
||||
@ -513,7 +513,7 @@ static void brcmf_usb_rx_fill_all(struct brcmf_usbdev_info *devinfo)
|
||||
struct brcmf_usbreq *req;
|
||||
|
||||
if (devinfo->bus_pub.state != BRCMFMAC_USB_STATE_UP) {
|
||||
brcmf_dbg(ERROR, "bus is not up=%d\n", devinfo->bus_pub.state);
|
||||
brcmf_err("bus is not up=%d\n", devinfo->bus_pub.state);
|
||||
return;
|
||||
}
|
||||
while ((req = brcmf_usb_deq(devinfo, &devinfo->rx_freeq, NULL)) != NULL)
|
||||
@ -569,14 +569,14 @@ brcmf_usb_intr_complete(struct urb *urb)
|
||||
}
|
||||
|
||||
if (devinfo->bus_pub.state == BRCMFMAC_USB_STATE_DOWN) {
|
||||
brcmf_dbg(ERROR, "intr cb when DBUS down, ignoring\n");
|
||||
brcmf_err("intr cb when DBUS down, ignoring\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (devinfo->bus_pub.state == BRCMFMAC_USB_STATE_UP) {
|
||||
err = usb_submit_urb(devinfo->intr_urb, GFP_ATOMIC);
|
||||
if (err)
|
||||
brcmf_dbg(ERROR, "usb_submit_urb, err=%d\n", err);
|
||||
brcmf_err("usb_submit_urb, err=%d\n", err);
|
||||
}
|
||||
}
|
||||
|
||||
@ -594,7 +594,7 @@ static int brcmf_usb_tx(struct device *dev, struct sk_buff *skb)
|
||||
&devinfo->tx_freecount);
|
||||
if (!req) {
|
||||
brcmu_pkt_buf_free_skb(skb);
|
||||
brcmf_dbg(ERROR, "no req to send\n");
|
||||
brcmf_err("no req to send\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
@ -606,7 +606,7 @@ static int brcmf_usb_tx(struct device *dev, struct sk_buff *skb)
|
||||
brcmf_usb_enq(devinfo, &devinfo->tx_postq, req, NULL);
|
||||
ret = usb_submit_urb(req->urb, GFP_ATOMIC);
|
||||
if (ret) {
|
||||
brcmf_dbg(ERROR, "brcmf_usb_tx usb_submit_urb FAILED\n");
|
||||
brcmf_err("brcmf_usb_tx usb_submit_urb FAILED\n");
|
||||
brcmf_usb_del_fromq(devinfo, req);
|
||||
brcmu_pkt_buf_free_skb(req->skb);
|
||||
req->skb = NULL;
|
||||
@ -648,7 +648,7 @@ static int brcmf_usb_up(struct device *dev)
|
||||
|
||||
ret = usb_submit_urb(devinfo->intr_urb, GFP_ATOMIC);
|
||||
if (ret) {
|
||||
brcmf_dbg(ERROR, "USB_SUBMIT_URB failed with status %d\n",
|
||||
brcmf_err("USB_SUBMIT_URB failed with status %d\n",
|
||||
ret);
|
||||
return -EINVAL;
|
||||
}
|
||||
@ -745,7 +745,7 @@ static bool brcmf_usb_dl_cmd(struct brcmf_usbdev_info *devinfo, u8 cmd,
|
||||
devinfo->ctl_completed = false;
|
||||
ret = usb_submit_urb(devinfo->ctl_urb, GFP_ATOMIC);
|
||||
if (ret < 0) {
|
||||
brcmf_dbg(ERROR, "usb_submit_urb failed %d\n", ret);
|
||||
brcmf_err("usb_submit_urb failed %d\n", ret);
|
||||
kfree(tmpbuf);
|
||||
return false;
|
||||
}
|
||||
@ -815,7 +815,7 @@ brcmf_usb_resetcfg(struct brcmf_usbdev_info *devinfo)
|
||||
brcmf_usb_dl_cmd(devinfo, DL_RESETCFG, &id, sizeof(id));
|
||||
return 0;
|
||||
} else {
|
||||
brcmf_dbg(ERROR, "Cannot talk to Dongle. Firmware is not UP, %d ms\n",
|
||||
brcmf_err("Cannot talk to Dongle. Firmware is not UP, %d ms\n",
|
||||
BRCMF_USB_RESET_GETVER_SPINWAIT * loop_cnt);
|
||||
return -EINVAL;
|
||||
}
|
||||
@ -840,7 +840,7 @@ brcmf_usb_dl_send_bulk(struct brcmf_usbdev_info *devinfo, void *buffer, int len)
|
||||
devinfo->ctl_completed = false;
|
||||
ret = usb_submit_urb(devinfo->bulk_urb, GFP_ATOMIC);
|
||||
if (ret) {
|
||||
brcmf_dbg(ERROR, "usb_submit_urb failed %d\n", ret);
|
||||
brcmf_err("usb_submit_urb failed %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
ret = brcmf_usb_ioctl_resp_wait(devinfo);
|
||||
@ -873,7 +873,7 @@ brcmf_usb_dl_writeimage(struct brcmf_usbdev_info *devinfo, u8 *fw, int fwlen)
|
||||
|
||||
/* 2) Check we are in the Waiting state */
|
||||
if (rdlstate != DL_WAITING) {
|
||||
brcmf_dbg(ERROR, "Failed to DL_START\n");
|
||||
brcmf_err("Failed to DL_START\n");
|
||||
err = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
@ -902,7 +902,7 @@ brcmf_usb_dl_writeimage(struct brcmf_usbdev_info *devinfo, u8 *fw, int fwlen)
|
||||
memcpy(bulkchunk, dlpos, sendlen);
|
||||
if (brcmf_usb_dl_send_bulk(devinfo, bulkchunk,
|
||||
sendlen)) {
|
||||
brcmf_dbg(ERROR, "send_bulk failed\n");
|
||||
brcmf_err("send_bulk failed\n");
|
||||
err = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
@ -912,7 +912,7 @@ brcmf_usb_dl_writeimage(struct brcmf_usbdev_info *devinfo, u8 *fw, int fwlen)
|
||||
}
|
||||
if (!brcmf_usb_dl_cmd(devinfo, DL_GETSTATE, &state,
|
||||
sizeof(struct rdl_state_le))) {
|
||||
brcmf_dbg(ERROR, "DL_GETSTATE Failed xxxx\n");
|
||||
brcmf_err("DL_GETSTATE Failed xxxx\n");
|
||||
err = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
@ -922,7 +922,7 @@ brcmf_usb_dl_writeimage(struct brcmf_usbdev_info *devinfo, u8 *fw, int fwlen)
|
||||
|
||||
/* restart if an error is reported */
|
||||
if (rdlstate == DL_BAD_HDR || rdlstate == DL_BAD_CRC) {
|
||||
brcmf_dbg(ERROR, "Bad Hdr or Bad CRC state %d\n",
|
||||
brcmf_err("Bad Hdr or Bad CRC state %d\n",
|
||||
rdlstate);
|
||||
err = -EINVAL;
|
||||
goto fail;
|
||||
@ -981,7 +981,7 @@ static int brcmf_usb_dlrun(struct brcmf_usbdev_info *devinfo)
|
||||
return -ENODEV;
|
||||
/* The Dongle may go for re-enumeration. */
|
||||
} else {
|
||||
brcmf_dbg(ERROR, "Dongle not runnable\n");
|
||||
brcmf_err("Dongle not runnable\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
brcmf_dbg(USB, "Exit\n");
|
||||
@ -1019,13 +1019,13 @@ brcmf_usb_fw_download(struct brcmf_usbdev_info *devinfo)
|
||||
chiprev = devinfo->bus_pub.chiprev;
|
||||
|
||||
if (!brcmf_usb_chip_support(devid, chiprev)) {
|
||||
brcmf_dbg(ERROR, "unsupported chip %d rev %d\n",
|
||||
brcmf_err("unsupported chip %d rev %d\n",
|
||||
devid, chiprev);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!devinfo->image) {
|
||||
brcmf_dbg(ERROR, "No firmware!\n");
|
||||
brcmf_err("No firmware!\n");
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
@ -1124,11 +1124,11 @@ static int brcmf_usb_get_fw(struct brcmf_usbdev_info *devinfo)
|
||||
/* fw image not yet loaded. Load it now and add to list */
|
||||
err = request_firmware(&fw, fwname, devinfo->dev);
|
||||
if (!fw) {
|
||||
brcmf_dbg(ERROR, "fail to request firmware %s\n", fwname);
|
||||
brcmf_err("fail to request firmware %s\n", fwname);
|
||||
return err;
|
||||
}
|
||||
if (check_file(fw->data) < 0) {
|
||||
brcmf_dbg(ERROR, "invalid firmware %s\n", fwname);
|
||||
brcmf_err("invalid firmware %s\n", fwname);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@ -1196,17 +1196,17 @@ struct brcmf_usbdev *brcmf_usb_attach(struct brcmf_usbdev_info *devinfo,
|
||||
|
||||
devinfo->intr_urb = usb_alloc_urb(0, GFP_ATOMIC);
|
||||
if (!devinfo->intr_urb) {
|
||||
brcmf_dbg(ERROR, "usb_alloc_urb (intr) failed\n");
|
||||
brcmf_err("usb_alloc_urb (intr) failed\n");
|
||||
goto error;
|
||||
}
|
||||
devinfo->ctl_urb = usb_alloc_urb(0, GFP_ATOMIC);
|
||||
if (!devinfo->ctl_urb) {
|
||||
brcmf_dbg(ERROR, "usb_alloc_urb (ctl) failed\n");
|
||||
brcmf_err("usb_alloc_urb (ctl) failed\n");
|
||||
goto error;
|
||||
}
|
||||
devinfo->bulk_urb = usb_alloc_urb(0, GFP_ATOMIC);
|
||||
if (!devinfo->bulk_urb) {
|
||||
brcmf_dbg(ERROR, "usb_alloc_urb (bulk) failed\n");
|
||||
brcmf_err("usb_alloc_urb (bulk) failed\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
@ -1223,11 +1223,19 @@ struct brcmf_usbdev *brcmf_usb_attach(struct brcmf_usbdev_info *devinfo,
|
||||
return &devinfo->bus_pub;
|
||||
|
||||
error:
|
||||
brcmf_dbg(ERROR, "failed!\n");
|
||||
brcmf_err("failed!\n");
|
||||
brcmf_usb_detach(devinfo);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static struct brcmf_bus_ops brcmf_usb_bus_ops = {
|
||||
.txdata = brcmf_usb_tx,
|
||||
.init = brcmf_usb_up,
|
||||
.stop = brcmf_usb_down,
|
||||
.txctl = brcmf_usb_tx_ctlpkt,
|
||||
.rxctl = brcmf_usb_rx_ctlpkt,
|
||||
};
|
||||
|
||||
static int brcmf_usb_probe_cb(struct brcmf_usbdev_info *devinfo)
|
||||
{
|
||||
struct brcmf_bus *bus = NULL;
|
||||
@ -1246,25 +1254,22 @@ static int brcmf_usb_probe_cb(struct brcmf_usbdev_info *devinfo)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
bus->dev = dev;
|
||||
bus_pub->bus = bus;
|
||||
bus->brcmf_bus_txdata = brcmf_usb_tx;
|
||||
bus->brcmf_bus_init = brcmf_usb_up;
|
||||
bus->brcmf_bus_stop = brcmf_usb_down;
|
||||
bus->brcmf_bus_txctl = brcmf_usb_tx_ctlpkt;
|
||||
bus->brcmf_bus_rxctl = brcmf_usb_rx_ctlpkt;
|
||||
bus->bus_priv.usb = bus_pub;
|
||||
dev_set_drvdata(dev, bus);
|
||||
bus->ops = &brcmf_usb_bus_ops;
|
||||
|
||||
/* Attach to the common driver interface */
|
||||
ret = brcmf_attach(0, dev);
|
||||
if (ret) {
|
||||
brcmf_dbg(ERROR, "brcmf_attach failed\n");
|
||||
brcmf_err("brcmf_attach failed\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
ret = brcmf_bus_start(dev);
|
||||
if (ret) {
|
||||
brcmf_dbg(ERROR, "dongle is not responding\n");
|
||||
brcmf_err("dongle is not responding\n");
|
||||
brcmf_detach(dev);
|
||||
goto fail;
|
||||
}
|
||||
@ -1339,7 +1344,7 @@ brcmf_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
|
||||
if (IFDESC(usb, CONTROL_IF).bInterfaceClass != USB_CLASS_VENDOR_SPEC ||
|
||||
IFDESC(usb, CONTROL_IF).bInterfaceSubClass != 2 ||
|
||||
IFDESC(usb, CONTROL_IF).bInterfaceProtocol != 0xff) {
|
||||
brcmf_dbg(ERROR, "invalid control interface: class %d, subclass %d, proto %d\n",
|
||||
brcmf_err("invalid control interface: class %d, subclass %d, proto %d\n",
|
||||
IFDESC(usb, CONTROL_IF).bInterfaceClass,
|
||||
IFDESC(usb, CONTROL_IF).bInterfaceSubClass,
|
||||
IFDESC(usb, CONTROL_IF).bInterfaceProtocol);
|
||||
@ -1351,7 +1356,7 @@ brcmf_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
|
||||
endpoint = &IFEPDESC(usb, CONTROL_IF, 0);
|
||||
if ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)
|
||||
!= USB_ENDPOINT_XFER_INT) {
|
||||
brcmf_dbg(ERROR, "invalid control endpoint %d\n",
|
||||
brcmf_err("invalid control endpoint %d\n",
|
||||
endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK);
|
||||
ret = -1;
|
||||
goto fail;
|
||||
@ -1370,7 +1375,7 @@ brcmf_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
|
||||
endpoint = &IFEPDESC(usb, BULK_IF, ep);
|
||||
if ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) !=
|
||||
USB_ENDPOINT_XFER_BULK) {
|
||||
brcmf_dbg(ERROR, "invalid data endpoint %d\n", ep);
|
||||
brcmf_err("invalid data endpoint %d\n", ep);
|
||||
ret = -1;
|
||||
goto fail;
|
||||
}
|
||||
@ -1413,7 +1418,7 @@ brcmf_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
brcmf_dbg(ERROR, "failed with errno %d\n", ret);
|
||||
brcmf_err("failed with errno %d\n", ret);
|
||||
kfree(devinfo);
|
||||
usb_set_intfdata(intf, NULL);
|
||||
return ret;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -17,73 +17,6 @@
|
||||
#ifndef _wl_cfg80211_h_
|
||||
#define _wl_cfg80211_h_
|
||||
|
||||
#define WL_DBG_NONE 0
|
||||
#define WL_DBG_CONN (1 << 5)
|
||||
#define WL_DBG_SCAN (1 << 4)
|
||||
#define WL_DBG_TRACE (1 << 3)
|
||||
#define WL_DBG_INFO (1 << 1)
|
||||
#define WL_DBG_ERR (1 << 0)
|
||||
#define WL_DBG_MASK ((WL_DBG_INFO | WL_DBG_ERR | WL_DBG_TRACE) | \
|
||||
(WL_DBG_SCAN) | (WL_DBG_CONN))
|
||||
|
||||
#define WL_ERR(fmt, ...) \
|
||||
do { \
|
||||
if (brcmf_dbg_level & WL_DBG_ERR) { \
|
||||
if (net_ratelimit()) { \
|
||||
pr_err("ERROR @%s : " fmt, \
|
||||
__func__, ##__VA_ARGS__); \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#if (defined DEBUG)
|
||||
#define WL_INFO(fmt, ...) \
|
||||
do { \
|
||||
if (brcmf_dbg_level & WL_DBG_INFO) { \
|
||||
if (net_ratelimit()) { \
|
||||
pr_err("INFO @%s : " fmt, \
|
||||
__func__, ##__VA_ARGS__); \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define WL_TRACE(fmt, ...) \
|
||||
do { \
|
||||
if (brcmf_dbg_level & WL_DBG_TRACE) { \
|
||||
if (net_ratelimit()) { \
|
||||
pr_err("TRACE @%s : " fmt, \
|
||||
__func__, ##__VA_ARGS__); \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define WL_SCAN(fmt, ...) \
|
||||
do { \
|
||||
if (brcmf_dbg_level & WL_DBG_SCAN) { \
|
||||
if (net_ratelimit()) { \
|
||||
pr_err("SCAN @%s : " fmt, \
|
||||
__func__, ##__VA_ARGS__); \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define WL_CONN(fmt, ...) \
|
||||
do { \
|
||||
if (brcmf_dbg_level & WL_DBG_CONN) { \
|
||||
if (net_ratelimit()) { \
|
||||
pr_err("CONN @%s : " fmt, \
|
||||
__func__, ##__VA_ARGS__); \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#else /* (defined DEBUG) */
|
||||
#define WL_INFO(fmt, args...)
|
||||
#define WL_TRACE(fmt, args...)
|
||||
#define WL_SCAN(fmt, args...)
|
||||
#define WL_CONN(fmt, args...)
|
||||
#endif /* (defined DEBUG) */
|
||||
|
||||
#define WL_NUM_SCAN_MAX 10
|
||||
#define WL_NUM_PMKIDS_MAX MAXPMKID
|
||||
#define WL_TLV_INFO_MAX 1024
|
||||
@ -450,7 +383,8 @@ brcmf_cfg80211_connect_info *cfg_to_conn(struct brcmf_cfg80211_info *cfg)
|
||||
return &cfg->conn_info;
|
||||
}
|
||||
|
||||
struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr);
|
||||
struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr,
|
||||
struct device *busdev);
|
||||
void brcmf_cfg80211_detach(struct brcmf_cfg80211_info *cfg);
|
||||
s32 brcmf_cfg80211_up(struct net_device *ndev);
|
||||
s32 brcmf_cfg80211_down(struct net_device *ndev);
|
||||
|
@ -721,7 +721,7 @@ void ai_epa_4313war(struct si_pub *sih)
|
||||
/* check if the device is removed */
|
||||
bool ai_deviceremoved(struct si_pub *sih)
|
||||
{
|
||||
u32 w;
|
||||
u32 w = 0;
|
||||
struct si_info *sii;
|
||||
|
||||
sii = container_of(sih, struct si_info, pub);
|
||||
|
@ -93,6 +93,7 @@ MODULE_FIRMWARE("brcm/bcm43xx_hdr-0.fw");
|
||||
|
||||
/* recognized BCMA Core IDs */
|
||||
static struct bcma_device_id brcms_coreid_table[] = {
|
||||
BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 17, BCMA_ANY_CLASS),
|
||||
BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 23, BCMA_ANY_CLASS),
|
||||
BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 24, BCMA_ANY_CLASS),
|
||||
BCMA_CORETABLE_END
|
||||
|
@ -717,7 +717,7 @@ static void brcms_c_ucode_bsinit(struct brcms_hardware *wlc_hw)
|
||||
brcms_c_write_mhf(wlc_hw, wlc_hw->band->mhfs);
|
||||
|
||||
/* do band-specific ucode IHR, SHM, and SCR inits */
|
||||
if (D11REV_IS(wlc_hw->corerev, 23)) {
|
||||
if (D11REV_IS(wlc_hw->corerev, 17) || D11REV_IS(wlc_hw->corerev, 23)) {
|
||||
if (BRCMS_ISNPHY(wlc_hw->band))
|
||||
brcms_c_write_inits(wlc_hw, ucode->d11n0bsinitvals16);
|
||||
else
|
||||
@ -2264,7 +2264,7 @@ static void brcms_ucode_download(struct brcms_hardware *wlc_hw)
|
||||
if (wlc_hw->ucode_loaded)
|
||||
return;
|
||||
|
||||
if (D11REV_IS(wlc_hw->corerev, 23)) {
|
||||
if (D11REV_IS(wlc_hw->corerev, 17) || D11REV_IS(wlc_hw->corerev, 23)) {
|
||||
if (BRCMS_ISNPHY(wlc_hw->band)) {
|
||||
brcms_ucode_write(wlc_hw, ucode->bcm43xx_16_mimo,
|
||||
ucode->bcm43xx_16_mimosz);
|
||||
@ -2920,7 +2920,7 @@ brcms_b_write_objmem(struct brcms_hardware *wlc_hw, uint offset, u16 v,
|
||||
if (offset & 2)
|
||||
objoff += 2;
|
||||
|
||||
bcma_write16(core, objoff, v);
|
||||
bcma_wflush16(core, objoff, v);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -3216,7 +3216,7 @@ static void brcms_b_coreinit(struct brcms_c_info *wlc)
|
||||
|
||||
sflags = bcma_aread32(core, BCMA_IOST);
|
||||
|
||||
if (D11REV_IS(wlc_hw->corerev, 23)) {
|
||||
if (D11REV_IS(wlc_hw->corerev, 17) || D11REV_IS(wlc_hw->corerev, 23)) {
|
||||
if (BRCMS_ISNPHY(wlc_hw->band))
|
||||
brcms_c_write_inits(wlc_hw, ucode->d11n0initvals16);
|
||||
else
|
||||
@ -4500,7 +4500,8 @@ static int brcms_b_attach(struct brcms_c_info *wlc, struct bcma_device *core,
|
||||
|
||||
/* check device id(srom, nvram etc.) to set bands */
|
||||
if (wlc_hw->deviceid == BCM43224_D11N_ID ||
|
||||
wlc_hw->deviceid == BCM43224_D11N_ID_VEN1)
|
||||
wlc_hw->deviceid == BCM43224_D11N_ID_VEN1 ||
|
||||
wlc_hw->deviceid == BCM43224_CHIP_ID)
|
||||
/* Dualband boards */
|
||||
wlc_hw->_nbands = 2;
|
||||
else
|
||||
@ -5653,7 +5654,7 @@ static bool brcms_c_chipmatch_pci(struct bcma_device *core)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (device == BCM43224_D11N_ID_VEN1)
|
||||
if (device == BCM43224_D11N_ID_VEN1 || device == BCM43224_CHIP_ID)
|
||||
return true;
|
||||
if ((device == BCM43224_D11N_ID) || (device == BCM43225_D11N2G_ID))
|
||||
return true;
|
||||
|
@ -833,14 +833,14 @@ static void iwl_find_disconn_antenna(struct iwl_priv *priv, u32* average_sig,
|
||||
* To be safe, simply mask out any chains that we know
|
||||
* are not on the device.
|
||||
*/
|
||||
active_chains &= priv->eeprom_data->valid_rx_ant;
|
||||
active_chains &= priv->nvm_data->valid_rx_ant;
|
||||
|
||||
num_tx_chains = 0;
|
||||
for (i = 0; i < NUM_RX_CHAINS; i++) {
|
||||
/* loops on all the bits of
|
||||
* priv->hw_setting.valid_tx_ant */
|
||||
u8 ant_msk = (1 << i);
|
||||
if (!(priv->eeprom_data->valid_tx_ant & ant_msk))
|
||||
if (!(priv->nvm_data->valid_tx_ant & ant_msk))
|
||||
continue;
|
||||
|
||||
num_tx_chains++;
|
||||
@ -854,7 +854,7 @@ static void iwl_find_disconn_antenna(struct iwl_priv *priv, u32* average_sig,
|
||||
* connect the first valid tx chain
|
||||
*/
|
||||
first_chain =
|
||||
find_first_chain(priv->eeprom_data->valid_tx_ant);
|
||||
find_first_chain(priv->nvm_data->valid_tx_ant);
|
||||
data->disconn_array[first_chain] = 0;
|
||||
active_chains |= BIT(first_chain);
|
||||
IWL_DEBUG_CALIB(priv,
|
||||
@ -864,13 +864,13 @@ static void iwl_find_disconn_antenna(struct iwl_priv *priv, u32* average_sig,
|
||||
}
|
||||
}
|
||||
|
||||
if (active_chains != priv->eeprom_data->valid_rx_ant &&
|
||||
if (active_chains != priv->nvm_data->valid_rx_ant &&
|
||||
active_chains != priv->chain_noise_data.active_chains)
|
||||
IWL_DEBUG_CALIB(priv,
|
||||
"Detected that not all antennas are connected! "
|
||||
"Connected: %#x, valid: %#x.\n",
|
||||
active_chains,
|
||||
priv->eeprom_data->valid_rx_ant);
|
||||
priv->nvm_data->valid_rx_ant);
|
||||
|
||||
/* Save for use within RXON, TX, SCAN commands, etc. */
|
||||
data->active_chains = active_chains;
|
||||
@ -1055,7 +1055,7 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv)
|
||||
priv->cfg->bt_params->advanced_bt_coexist) {
|
||||
/* Disable disconnected antenna algorithm for advanced
|
||||
bt coex, assuming valid antennas are connected */
|
||||
data->active_chains = priv->eeprom_data->valid_rx_ant;
|
||||
data->active_chains = priv->nvm_data->valid_rx_ant;
|
||||
for (i = 0; i < NUM_RX_CHAINS; i++)
|
||||
if (!(data->active_chains & (1<<i)))
|
||||
data->disconn_array[i] = 1;
|
||||
@ -1086,7 +1086,7 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv)
|
||||
|
||||
iwlagn_gain_computation(
|
||||
priv, average_noise,
|
||||
find_first_chain(priv->eeprom_data->valid_rx_ant));
|
||||
find_first_chain(priv->nvm_data->valid_rx_ant));
|
||||
|
||||
/* Some power changes may have been made during the calibration.
|
||||
* Update and commit the RXON
|
||||
|
@ -305,7 +305,7 @@ static ssize_t iwl_dbgfs_nvm_read(struct file *file,
|
||||
int pos = 0, ofs = 0, buf_size = 0;
|
||||
const u8 *ptr;
|
||||
char *buf;
|
||||
u16 eeprom_ver;
|
||||
u16 nvm_ver;
|
||||
size_t eeprom_len = priv->eeprom_blob_size;
|
||||
buf_size = 4 * eeprom_len + 256;
|
||||
|
||||
@ -321,9 +321,9 @@ static ssize_t iwl_dbgfs_nvm_read(struct file *file,
|
||||
if (!buf)
|
||||
return -ENOMEM;
|
||||
|
||||
eeprom_ver = priv->eeprom_data->eeprom_version;
|
||||
nvm_ver = priv->nvm_data->nvm_version;
|
||||
pos += scnprintf(buf + pos, buf_size - pos,
|
||||
"NVM version: 0x%x\n", eeprom_ver);
|
||||
"NVM version: 0x%x\n", nvm_ver);
|
||||
for (ofs = 0 ; ofs < eeprom_len ; ofs += 16) {
|
||||
pos += scnprintf(buf + pos, buf_size - pos, "0x%.4x ", ofs);
|
||||
hex_dump_to_buffer(ptr + ofs, 16 , 16, 2, buf + pos,
|
||||
@ -1333,17 +1333,17 @@ static ssize_t iwl_dbgfs_ucode_tx_stats_read(struct file *file,
|
||||
if (tx->tx_power.ant_a || tx->tx_power.ant_b || tx->tx_power.ant_c) {
|
||||
pos += scnprintf(buf + pos, bufsz - pos,
|
||||
"tx power: (1/2 dB step)\n");
|
||||
if ((priv->eeprom_data->valid_tx_ant & ANT_A) &&
|
||||
if ((priv->nvm_data->valid_tx_ant & ANT_A) &&
|
||||
tx->tx_power.ant_a)
|
||||
pos += scnprintf(buf + pos, bufsz - pos,
|
||||
fmt_hex, "antenna A:",
|
||||
tx->tx_power.ant_a);
|
||||
if ((priv->eeprom_data->valid_tx_ant & ANT_B) &&
|
||||
if ((priv->nvm_data->valid_tx_ant & ANT_B) &&
|
||||
tx->tx_power.ant_b)
|
||||
pos += scnprintf(buf + pos, bufsz - pos,
|
||||
fmt_hex, "antenna B:",
|
||||
tx->tx_power.ant_b);
|
||||
if ((priv->eeprom_data->valid_tx_ant & ANT_C) &&
|
||||
if ((priv->nvm_data->valid_tx_ant & ANT_C) &&
|
||||
tx->tx_power.ant_c)
|
||||
pos += scnprintf(buf + pos, bufsz - pos,
|
||||
fmt_hex, "antenna C:",
|
||||
|
@ -843,7 +843,7 @@ struct iwl_priv {
|
||||
void *wowlan_sram;
|
||||
#endif /* CONFIG_IWLWIFI_DEBUGFS */
|
||||
|
||||
struct iwl_eeprom_data *eeprom_data;
|
||||
struct iwl_nvm_data *nvm_data;
|
||||
/* eeprom blob for debugfs/testmode */
|
||||
u8 *eeprom_blob;
|
||||
size_t eeprom_blob_size;
|
||||
|
@ -305,8 +305,8 @@ static s32 iwl_temp_calib_to_offset(struct iwl_priv *priv)
|
||||
{
|
||||
u16 temperature, voltage;
|
||||
|
||||
temperature = le16_to_cpu(priv->eeprom_data->kelvin_temperature);
|
||||
voltage = le16_to_cpu(priv->eeprom_data->kelvin_voltage);
|
||||
temperature = le16_to_cpu(priv->nvm_data->kelvin_temperature);
|
||||
voltage = le16_to_cpu(priv->nvm_data->kelvin_voltage);
|
||||
|
||||
/* offset = temp - volt / coeff */
|
||||
return (s32)(temperature -
|
||||
@ -460,13 +460,13 @@ static void iwl6000_nic_config(struct iwl_priv *priv)
|
||||
break;
|
||||
case IWL_DEVICE_FAMILY_6050:
|
||||
/* Indicate calibration version to uCode. */
|
||||
if (priv->eeprom_data->calib_version >= 6)
|
||||
if (priv->nvm_data->calib_version >= 6)
|
||||
iwl_set_bit(priv->trans, CSR_GP_DRIVER_REG,
|
||||
CSR_GP_DRIVER_REG_BIT_CALIB_VERSION6);
|
||||
break;
|
||||
case IWL_DEVICE_FAMILY_6150:
|
||||
/* Indicate calibration version to uCode. */
|
||||
if (priv->eeprom_data->calib_version >= 6)
|
||||
if (priv->nvm_data->calib_version >= 6)
|
||||
iwl_set_bit(priv->trans, CSR_GP_DRIVER_REG,
|
||||
CSR_GP_DRIVER_REG_BIT_CALIB_VERSION6);
|
||||
iwl_set_bit(priv->trans, CSR_GP_DRIVER_REG,
|
||||
|
@ -59,7 +59,7 @@ int iwlagn_send_tx_power(struct iwl_priv *priv)
|
||||
/* half dBm need to multiply */
|
||||
tx_power_cmd.global_lmt = (s8)(2 * priv->tx_power_user_lmt);
|
||||
|
||||
if (tx_power_cmd.global_lmt > priv->eeprom_data->max_tx_pwr_half_dbm) {
|
||||
if (tx_power_cmd.global_lmt > priv->nvm_data->max_tx_pwr_half_dbm) {
|
||||
/*
|
||||
* For the newer devices which using enhanced/extend tx power
|
||||
* table in EEPROM, the format is in half dBm. driver need to
|
||||
@ -72,7 +72,7 @@ int iwlagn_send_tx_power(struct iwl_priv *priv)
|
||||
* half-dBm format), lower the tx power based on EEPROM
|
||||
*/
|
||||
tx_power_cmd.global_lmt =
|
||||
priv->eeprom_data->max_tx_pwr_half_dbm;
|
||||
priv->nvm_data->max_tx_pwr_half_dbm;
|
||||
}
|
||||
tx_power_cmd.flags = IWLAGN_TX_POWER_NO_CLOSED;
|
||||
tx_power_cmd.srv_chan_lmt = IWLAGN_TX_POWER_AUTO;
|
||||
@ -159,7 +159,7 @@ int iwlagn_txfifo_flush(struct iwl_priv *priv)
|
||||
IWL_PAN_SCD_MGMT_MSK |
|
||||
IWL_PAN_SCD_MULTICAST_MSK;
|
||||
|
||||
if (priv->eeprom_data->sku & EEPROM_SKU_CAP_11N_ENABLE)
|
||||
if (priv->nvm_data->sku_cap_11n_enable)
|
||||
flush_cmd.queue_control |= IWL_AGG_TX_QUEUE_MSK;
|
||||
|
||||
IWL_DEBUG_INFO(priv, "queue control: 0x%x\n",
|
||||
@ -825,7 +825,7 @@ void iwlagn_set_rxon_chain(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
|
||||
if (priv->chain_noise_data.active_chains)
|
||||
active_chains = priv->chain_noise_data.active_chains;
|
||||
else
|
||||
active_chains = priv->eeprom_data->valid_rx_ant;
|
||||
active_chains = priv->nvm_data->valid_rx_ant;
|
||||
|
||||
if (priv->cfg->bt_params &&
|
||||
priv->cfg->bt_params->advanced_bt_coexist &&
|
||||
|
@ -164,7 +164,7 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv,
|
||||
hw->max_tx_aggregation_subframes = LINK_QUAL_AGG_FRAME_LIMIT_DEF;
|
||||
*/
|
||||
|
||||
if (priv->eeprom_data->sku & EEPROM_SKU_CAP_11N_ENABLE)
|
||||
if (priv->nvm_data->sku_cap_11n_enable)
|
||||
hw->flags |= IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS |
|
||||
IEEE80211_HW_SUPPORTS_STATIC_SMPS;
|
||||
|
||||
@ -242,12 +242,12 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv,
|
||||
|
||||
hw->max_listen_interval = IWL_CONN_MAX_LISTEN_INTERVAL;
|
||||
|
||||
if (priv->eeprom_data->bands[IEEE80211_BAND_2GHZ].n_channels)
|
||||
if (priv->nvm_data->bands[IEEE80211_BAND_2GHZ].n_channels)
|
||||
priv->hw->wiphy->bands[IEEE80211_BAND_2GHZ] =
|
||||
&priv->eeprom_data->bands[IEEE80211_BAND_2GHZ];
|
||||
if (priv->eeprom_data->bands[IEEE80211_BAND_5GHZ].n_channels)
|
||||
&priv->nvm_data->bands[IEEE80211_BAND_2GHZ];
|
||||
if (priv->nvm_data->bands[IEEE80211_BAND_5GHZ].n_channels)
|
||||
priv->hw->wiphy->bands[IEEE80211_BAND_5GHZ] =
|
||||
&priv->eeprom_data->bands[IEEE80211_BAND_5GHZ];
|
||||
&priv->nvm_data->bands[IEEE80211_BAND_5GHZ];
|
||||
|
||||
hw->wiphy->hw_version = priv->trans->hw_id;
|
||||
|
||||
@ -654,7 +654,7 @@ static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,
|
||||
IWL_DEBUG_HT(priv, "A-MPDU action on addr %pM tid %d\n",
|
||||
sta->addr, tid);
|
||||
|
||||
if (!(priv->eeprom_data->sku & EEPROM_SKU_CAP_11N_ENABLE))
|
||||
if (!(priv->nvm_data->sku_cap_11n_enable))
|
||||
return -EACCES;
|
||||
|
||||
IWL_DEBUG_MAC80211(priv, "enter\n");
|
||||
|
@ -185,7 +185,7 @@ int iwlagn_send_beacon_cmd(struct iwl_priv *priv)
|
||||
rate = info->control.rates[0].idx;
|
||||
|
||||
priv->mgmt_tx_ant = iwl_toggle_tx_ant(priv, priv->mgmt_tx_ant,
|
||||
priv->eeprom_data->valid_tx_ant);
|
||||
priv->nvm_data->valid_tx_ant);
|
||||
rate_flags = iwl_ant_idx_to_flags(priv->mgmt_tx_ant);
|
||||
|
||||
/* In mac80211, rates for 5 GHz start at 0 */
|
||||
@ -776,7 +776,7 @@ int iwl_alive_start(struct iwl_priv *priv)
|
||||
ieee80211_wake_queues(priv->hw);
|
||||
|
||||
/* Configure Tx antenna selection based on H/W config */
|
||||
iwlagn_send_tx_ant_config(priv, priv->eeprom_data->valid_tx_ant);
|
||||
iwlagn_send_tx_ant_config(priv, priv->nvm_data->valid_tx_ant);
|
||||
|
||||
if (iwl_is_associated_ctx(ctx) && !priv->wowlan) {
|
||||
struct iwl_rxon_cmd *active_rxon =
|
||||
@ -1191,30 +1191,38 @@ static void iwl_option_config(struct iwl_priv *priv)
|
||||
|
||||
static int iwl_eeprom_init_hw_params(struct iwl_priv *priv)
|
||||
{
|
||||
if (priv->eeprom_data->sku & EEPROM_SKU_CAP_11N_ENABLE &&
|
||||
struct iwl_nvm_data *data = priv->nvm_data;
|
||||
char *debug_msg;
|
||||
|
||||
if (data->sku_cap_11n_enable &&
|
||||
!priv->cfg->ht_params) {
|
||||
IWL_ERR(priv, "Invalid 11n configuration\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!priv->eeprom_data->sku) {
|
||||
if (!data->sku_cap_11n_enable && !data->sku_cap_band_24GHz_enable &&
|
||||
!data->sku_cap_band_52GHz_enable) {
|
||||
IWL_ERR(priv, "Invalid device sku\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
IWL_DEBUG_INFO(priv, "Device SKU: 0x%X\n", priv->eeprom_data->sku);
|
||||
debug_msg = "Device SKU: 24GHz %s %s, 52GHz %s %s, 11.n %s %s\n";
|
||||
IWL_DEBUG_INFO(priv, debug_msg,
|
||||
data->sku_cap_band_24GHz_enable ? "" : "NOT", "enabled",
|
||||
data->sku_cap_band_52GHz_enable ? "" : "NOT", "enabled",
|
||||
data->sku_cap_11n_enable ? "" : "NOT", "enabled");
|
||||
|
||||
priv->hw_params.tx_chains_num =
|
||||
num_of_ant(priv->eeprom_data->valid_tx_ant);
|
||||
num_of_ant(data->valid_tx_ant);
|
||||
if (priv->cfg->rx_with_siso_diversity)
|
||||
priv->hw_params.rx_chains_num = 1;
|
||||
else
|
||||
priv->hw_params.rx_chains_num =
|
||||
num_of_ant(priv->eeprom_data->valid_rx_ant);
|
||||
num_of_ant(data->valid_rx_ant);
|
||||
|
||||
IWL_DEBUG_INFO(priv, "Valid Tx ant: 0x%X, Valid Rx ant: 0x%X\n",
|
||||
priv->eeprom_data->valid_tx_ant,
|
||||
priv->eeprom_data->valid_rx_ant);
|
||||
data->valid_tx_ant,
|
||||
data->valid_rx_ant);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -1374,24 +1382,24 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
|
||||
/* Reset chip to save power until we load uCode during "up". */
|
||||
iwl_trans_stop_hw(priv->trans, false);
|
||||
|
||||
priv->eeprom_data = iwl_parse_eeprom_data(priv->trans->dev, priv->cfg,
|
||||
priv->nvm_data = iwl_parse_eeprom_data(priv->trans->dev, priv->cfg,
|
||||
priv->eeprom_blob,
|
||||
priv->eeprom_blob_size);
|
||||
if (!priv->eeprom_data)
|
||||
if (!priv->nvm_data)
|
||||
goto out_free_eeprom_blob;
|
||||
|
||||
if (iwl_eeprom_check_version(priv->eeprom_data, priv->trans))
|
||||
if (iwl_nvm_check_version(priv->nvm_data, priv->trans))
|
||||
goto out_free_eeprom;
|
||||
|
||||
if (iwl_eeprom_init_hw_params(priv))
|
||||
goto out_free_eeprom;
|
||||
|
||||
/* extract MAC Address */
|
||||
memcpy(priv->addresses[0].addr, priv->eeprom_data->hw_addr, ETH_ALEN);
|
||||
memcpy(priv->addresses[0].addr, priv->nvm_data->hw_addr, ETH_ALEN);
|
||||
IWL_DEBUG_INFO(priv, "MAC address: %pM\n", priv->addresses[0].addr);
|
||||
priv->hw->wiphy->addresses = priv->addresses;
|
||||
priv->hw->wiphy->n_addresses = 1;
|
||||
num_mac = priv->eeprom_data->n_hw_addrs;
|
||||
num_mac = priv->nvm_data->n_hw_addrs;
|
||||
if (num_mac > 1) {
|
||||
memcpy(priv->addresses[1].addr, priv->addresses[0].addr,
|
||||
ETH_ALEN);
|
||||
@ -1404,7 +1412,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
|
||||
************************/
|
||||
iwl_set_hw_params(priv);
|
||||
|
||||
if (!(priv->eeprom_data->sku & EEPROM_SKU_CAP_IPAN_ENABLE)) {
|
||||
if (!(priv->nvm_data->sku_cap_ipan_enable)) {
|
||||
IWL_DEBUG_INFO(priv, "Your EEPROM disabled PAN");
|
||||
ucode_flags &= ~IWL_UCODE_TLV_FLAGS_PAN;
|
||||
/*
|
||||
@ -1486,7 +1494,7 @@ out_destroy_workqueue:
|
||||
out_free_eeprom_blob:
|
||||
kfree(priv->eeprom_blob);
|
||||
out_free_eeprom:
|
||||
iwl_free_eeprom_data(priv->eeprom_data);
|
||||
iwl_free_nvm_data(priv->nvm_data);
|
||||
out_free_hw:
|
||||
ieee80211_free_hw(priv->hw);
|
||||
out:
|
||||
@ -1506,7 +1514,7 @@ static void iwl_op_mode_dvm_stop(struct iwl_op_mode *op_mode)
|
||||
iwl_tt_exit(priv);
|
||||
|
||||
kfree(priv->eeprom_blob);
|
||||
iwl_free_eeprom_data(priv->eeprom_data);
|
||||
iwl_free_nvm_data(priv->nvm_data);
|
||||
|
||||
/*netif_stop_queue(dev); */
|
||||
flush_workqueue(priv->workqueue);
|
||||
@ -1980,7 +1988,6 @@ static void iwl_cmd_queue_full(struct iwl_op_mode *op_mode)
|
||||
static void iwl_nic_config(struct iwl_op_mode *op_mode)
|
||||
{
|
||||
struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode);
|
||||
u16 radio_cfg = priv->eeprom_data->radio_cfg;
|
||||
|
||||
/* SKU Control */
|
||||
iwl_set_bits_mask(priv->trans, CSR_HW_IF_CONFIG_REG,
|
||||
@ -1992,13 +1999,13 @@ static void iwl_nic_config(struct iwl_op_mode *op_mode)
|
||||
CSR_HW_IF_CONFIG_REG_POS_MAC_DASH));
|
||||
|
||||
/* write radio config values to register */
|
||||
if (EEPROM_RF_CFG_TYPE_MSK(radio_cfg) <= EEPROM_RF_CONFIG_TYPE_MAX) {
|
||||
if (priv->nvm_data->radio_cfg_type <= EEPROM_RF_CONFIG_TYPE_MAX) {
|
||||
u32 reg_val =
|
||||
EEPROM_RF_CFG_TYPE_MSK(radio_cfg) <<
|
||||
priv->nvm_data->radio_cfg_type <<
|
||||
CSR_HW_IF_CONFIG_REG_POS_PHY_TYPE |
|
||||
EEPROM_RF_CFG_STEP_MSK(radio_cfg) <<
|
||||
priv->nvm_data->radio_cfg_step <<
|
||||
CSR_HW_IF_CONFIG_REG_POS_PHY_STEP |
|
||||
EEPROM_RF_CFG_DASH_MSK(radio_cfg) <<
|
||||
priv->nvm_data->radio_cfg_dash <<
|
||||
CSR_HW_IF_CONFIG_REG_POS_PHY_DASH;
|
||||
|
||||
iwl_set_bits_mask(priv->trans, CSR_HW_IF_CONFIG_REG,
|
||||
@ -2007,9 +2014,9 @@ static void iwl_nic_config(struct iwl_op_mode *op_mode)
|
||||
CSR_HW_IF_CONFIG_REG_MSK_PHY_DASH, reg_val);
|
||||
|
||||
IWL_INFO(priv, "Radio type=0x%x-0x%x-0x%x\n",
|
||||
EEPROM_RF_CFG_TYPE_MSK(radio_cfg),
|
||||
EEPROM_RF_CFG_STEP_MSK(radio_cfg),
|
||||
EEPROM_RF_CFG_DASH_MSK(radio_cfg));
|
||||
priv->nvm_data->radio_cfg_type,
|
||||
priv->nvm_data->radio_cfg_step,
|
||||
priv->nvm_data->radio_cfg_dash);
|
||||
} else {
|
||||
WARN_ON(1);
|
||||
}
|
||||
|
@ -820,7 +820,7 @@ static u32 rs_get_lower_rate(struct iwl_lq_sta *lq_sta,
|
||||
|
||||
if (num_of_ant(tbl->ant_type) > 1)
|
||||
tbl->ant_type =
|
||||
first_antenna(priv->eeprom_data->valid_tx_ant);
|
||||
first_antenna(priv->nvm_data->valid_tx_ant);
|
||||
|
||||
tbl->is_ht40 = 0;
|
||||
tbl->is_SGI = 0;
|
||||
@ -1448,7 +1448,7 @@ static int rs_move_legacy_other(struct iwl_priv *priv,
|
||||
u32 sz = (sizeof(struct iwl_scale_tbl_info) -
|
||||
(sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT));
|
||||
u8 start_action;
|
||||
u8 valid_tx_ant = priv->eeprom_data->valid_tx_ant;
|
||||
u8 valid_tx_ant = priv->nvm_data->valid_tx_ant;
|
||||
u8 tx_chains_num = priv->hw_params.tx_chains_num;
|
||||
int ret = 0;
|
||||
u8 update_search_tbl_counter = 0;
|
||||
@ -1466,7 +1466,7 @@ static int rs_move_legacy_other(struct iwl_priv *priv,
|
||||
case IWL_BT_COEX_TRAFFIC_LOAD_CONTINUOUS:
|
||||
/* avoid antenna B and MIMO */
|
||||
valid_tx_ant =
|
||||
first_antenna(priv->eeprom_data->valid_tx_ant);
|
||||
first_antenna(priv->nvm_data->valid_tx_ant);
|
||||
if (tbl->action >= IWL_LEGACY_SWITCH_ANTENNA2 &&
|
||||
tbl->action != IWL_LEGACY_SWITCH_SISO)
|
||||
tbl->action = IWL_LEGACY_SWITCH_SISO;
|
||||
@ -1490,7 +1490,7 @@ static int rs_move_legacy_other(struct iwl_priv *priv,
|
||||
else if (tbl->action >= IWL_LEGACY_SWITCH_ANTENNA2)
|
||||
tbl->action = IWL_LEGACY_SWITCH_SISO;
|
||||
valid_tx_ant =
|
||||
first_antenna(priv->eeprom_data->valid_tx_ant);
|
||||
first_antenna(priv->nvm_data->valid_tx_ant);
|
||||
}
|
||||
|
||||
start_action = tbl->action;
|
||||
@ -1624,7 +1624,7 @@ static int rs_move_siso_to_other(struct iwl_priv *priv,
|
||||
u32 sz = (sizeof(struct iwl_scale_tbl_info) -
|
||||
(sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT));
|
||||
u8 start_action;
|
||||
u8 valid_tx_ant = priv->eeprom_data->valid_tx_ant;
|
||||
u8 valid_tx_ant = priv->nvm_data->valid_tx_ant;
|
||||
u8 tx_chains_num = priv->hw_params.tx_chains_num;
|
||||
u8 update_search_tbl_counter = 0;
|
||||
int ret;
|
||||
@ -1642,7 +1642,7 @@ static int rs_move_siso_to_other(struct iwl_priv *priv,
|
||||
case IWL_BT_COEX_TRAFFIC_LOAD_CONTINUOUS:
|
||||
/* avoid antenna B and MIMO */
|
||||
valid_tx_ant =
|
||||
first_antenna(priv->eeprom_data->valid_tx_ant);
|
||||
first_antenna(priv->nvm_data->valid_tx_ant);
|
||||
if (tbl->action != IWL_SISO_SWITCH_ANTENNA1)
|
||||
tbl->action = IWL_SISO_SWITCH_ANTENNA1;
|
||||
break;
|
||||
@ -1660,7 +1660,7 @@ static int rs_move_siso_to_other(struct iwl_priv *priv,
|
||||
/* configure as 1x1 if bt full concurrency */
|
||||
if (priv->bt_full_concurrent) {
|
||||
valid_tx_ant =
|
||||
first_antenna(priv->eeprom_data->valid_tx_ant);
|
||||
first_antenna(priv->nvm_data->valid_tx_ant);
|
||||
if (tbl->action >= IWL_LEGACY_SWITCH_ANTENNA2)
|
||||
tbl->action = IWL_SISO_SWITCH_ANTENNA1;
|
||||
}
|
||||
@ -1796,7 +1796,7 @@ static int rs_move_mimo2_to_other(struct iwl_priv *priv,
|
||||
u32 sz = (sizeof(struct iwl_scale_tbl_info) -
|
||||
(sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT));
|
||||
u8 start_action;
|
||||
u8 valid_tx_ant = priv->eeprom_data->valid_tx_ant;
|
||||
u8 valid_tx_ant = priv->nvm_data->valid_tx_ant;
|
||||
u8 tx_chains_num = priv->hw_params.tx_chains_num;
|
||||
u8 update_search_tbl_counter = 0;
|
||||
int ret;
|
||||
@ -1966,7 +1966,7 @@ static int rs_move_mimo3_to_other(struct iwl_priv *priv,
|
||||
u32 sz = (sizeof(struct iwl_scale_tbl_info) -
|
||||
(sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT));
|
||||
u8 start_action;
|
||||
u8 valid_tx_ant = priv->eeprom_data->valid_tx_ant;
|
||||
u8 valid_tx_ant = priv->nvm_data->valid_tx_ant;
|
||||
u8 tx_chains_num = priv->hw_params.tx_chains_num;
|
||||
int ret;
|
||||
u8 update_search_tbl_counter = 0;
|
||||
@ -2700,7 +2700,7 @@ static void rs_initialize_lq(struct iwl_priv *priv,
|
||||
|
||||
i = lq_sta->last_txrate_idx;
|
||||
|
||||
valid_tx_ant = priv->eeprom_data->valid_tx_ant;
|
||||
valid_tx_ant = priv->nvm_data->valid_tx_ant;
|
||||
|
||||
if (!lq_sta->search_better_tbl)
|
||||
active_tbl = lq_sta->active_tbl;
|
||||
@ -2894,15 +2894,15 @@ void iwl_rs_rate_init(struct iwl_priv *priv, struct ieee80211_sta *sta, u8 sta_i
|
||||
|
||||
/* These values will be overridden later */
|
||||
lq_sta->lq.general_params.single_stream_ant_msk =
|
||||
first_antenna(priv->eeprom_data->valid_tx_ant);
|
||||
first_antenna(priv->nvm_data->valid_tx_ant);
|
||||
lq_sta->lq.general_params.dual_stream_ant_msk =
|
||||
priv->eeprom_data->valid_tx_ant &
|
||||
~first_antenna(priv->eeprom_data->valid_tx_ant);
|
||||
priv->nvm_data->valid_tx_ant &
|
||||
~first_antenna(priv->nvm_data->valid_tx_ant);
|
||||
if (!lq_sta->lq.general_params.dual_stream_ant_msk) {
|
||||
lq_sta->lq.general_params.dual_stream_ant_msk = ANT_AB;
|
||||
} else if (num_of_ant(priv->eeprom_data->valid_tx_ant) == 2) {
|
||||
} else if (num_of_ant(priv->nvm_data->valid_tx_ant) == 2) {
|
||||
lq_sta->lq.general_params.dual_stream_ant_msk =
|
||||
priv->eeprom_data->valid_tx_ant;
|
||||
priv->nvm_data->valid_tx_ant;
|
||||
}
|
||||
|
||||
/* as default allow aggregation for all tids */
|
||||
@ -2948,7 +2948,7 @@ static void rs_fill_link_cmd(struct iwl_priv *priv,
|
||||
if (priv && priv->bt_full_concurrent) {
|
||||
/* 1x1 only */
|
||||
tbl_type.ant_type =
|
||||
first_antenna(priv->eeprom_data->valid_tx_ant);
|
||||
first_antenna(priv->nvm_data->valid_tx_ant);
|
||||
}
|
||||
|
||||
/* How many times should we repeat the initial rate? */
|
||||
@ -2980,7 +2980,7 @@ static void rs_fill_link_cmd(struct iwl_priv *priv,
|
||||
if (priv->bt_full_concurrent)
|
||||
valid_tx_ant = ANT_A;
|
||||
else
|
||||
valid_tx_ant = priv->eeprom_data->valid_tx_ant;
|
||||
valid_tx_ant = priv->nvm_data->valid_tx_ant;
|
||||
}
|
||||
|
||||
/* Fill rest of rate table */
|
||||
@ -3014,7 +3014,7 @@ static void rs_fill_link_cmd(struct iwl_priv *priv,
|
||||
if (priv && priv->bt_full_concurrent) {
|
||||
/* 1x1 only */
|
||||
tbl_type.ant_type =
|
||||
first_antenna(priv->eeprom_data->valid_tx_ant);
|
||||
first_antenna(priv->nvm_data->valid_tx_ant);
|
||||
}
|
||||
|
||||
/* Indicate to uCode which entries might be MIMO.
|
||||
@ -3101,7 +3101,7 @@ static void rs_dbgfs_set_mcs(struct iwl_lq_sta *lq_sta,
|
||||
u8 ant_sel_tx;
|
||||
|
||||
priv = lq_sta->drv;
|
||||
valid_tx_ant = priv->eeprom_data->valid_tx_ant;
|
||||
valid_tx_ant = priv->nvm_data->valid_tx_ant;
|
||||
if (lq_sta->dbg_fixed_rate) {
|
||||
ant_sel_tx =
|
||||
((lq_sta->dbg_fixed_rate & RATE_MCS_ANT_ABC_MSK)
|
||||
@ -3172,9 +3172,9 @@ static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file,
|
||||
desc += sprintf(buff+desc, "fixed rate 0x%X\n",
|
||||
lq_sta->dbg_fixed_rate);
|
||||
desc += sprintf(buff+desc, "valid_tx_ant %s%s%s\n",
|
||||
(priv->eeprom_data->valid_tx_ant & ANT_A) ? "ANT_A," : "",
|
||||
(priv->eeprom_data->valid_tx_ant & ANT_B) ? "ANT_B," : "",
|
||||
(priv->eeprom_data->valid_tx_ant & ANT_C) ? "ANT_C" : "");
|
||||
(priv->nvm_data->valid_tx_ant & ANT_A) ? "ANT_A," : "",
|
||||
(priv->nvm_data->valid_tx_ant & ANT_B) ? "ANT_B," : "",
|
||||
(priv->nvm_data->valid_tx_ant & ANT_C) ? "ANT_C" : "");
|
||||
desc += sprintf(buff+desc, "lq type %s\n",
|
||||
(is_legacy(tbl->lq_type)) ? "legacy" : "HT");
|
||||
if (is_Ht(tbl->lq_type)) {
|
||||
|
@ -420,10 +420,10 @@ static int iwl_set_tx_power(struct iwl_priv *priv, s8 tx_power, bool force)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (tx_power > DIV_ROUND_UP(priv->eeprom_data->max_tx_pwr_half_dbm, 2)) {
|
||||
if (tx_power > DIV_ROUND_UP(priv->nvm_data->max_tx_pwr_half_dbm, 2)) {
|
||||
IWL_WARN(priv,
|
||||
"Requested user TXPOWER %d above upper limit %d.\n",
|
||||
tx_power, priv->eeprom_data->max_tx_pwr_half_dbm);
|
||||
tx_power, priv->nvm_data->max_tx_pwr_half_dbm);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -660,12 +660,12 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
|
||||
u16 rx_chain = 0;
|
||||
enum ieee80211_band band;
|
||||
u8 n_probes = 0;
|
||||
u8 rx_ant = priv->eeprom_data->valid_rx_ant;
|
||||
u8 rx_ant = priv->nvm_data->valid_rx_ant;
|
||||
u8 rate;
|
||||
bool is_active = false;
|
||||
int chan_mod;
|
||||
u8 active_chains;
|
||||
u8 scan_tx_antennas = priv->eeprom_data->valid_tx_ant;
|
||||
u8 scan_tx_antennas = priv->nvm_data->valid_tx_ant;
|
||||
int ret;
|
||||
int scan_cmd_size = sizeof(struct iwl_scan_cmd) +
|
||||
MAX_SCAN_CHANNEL * sizeof(struct iwl_scan_channel) +
|
||||
@ -673,8 +673,9 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
|
||||
const u8 *ssid = NULL;
|
||||
u8 ssid_len = 0;
|
||||
|
||||
if (WARN_ON_ONCE(priv->scan_request &&
|
||||
priv->scan_request->n_channels > MAX_SCAN_CHANNEL))
|
||||
if (WARN_ON(priv->scan_type == IWL_SCAN_NORMAL &&
|
||||
(!priv->scan_request ||
|
||||
priv->scan_request->n_channels > MAX_SCAN_CHANNEL)))
|
||||
return -EINVAL;
|
||||
|
||||
lockdep_assert_held(&priv->mutex);
|
||||
@ -881,7 +882,7 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
|
||||
|
||||
/* MIMO is not used here, but value is required */
|
||||
rx_chain |=
|
||||
priv->eeprom_data->valid_rx_ant << RXON_RX_CHAIN_VALID_POS;
|
||||
priv->nvm_data->valid_rx_ant << RXON_RX_CHAIN_VALID_POS;
|
||||
rx_chain |= rx_ant << RXON_RX_CHAIN_FORCE_MIMO_SEL_POS;
|
||||
rx_chain |= rx_ant << RXON_RX_CHAIN_FORCE_SEL_POS;
|
||||
rx_chain |= 0x1 << RXON_RX_CHAIN_DRIVER_FORCE_POS;
|
||||
@ -998,7 +999,7 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
|
||||
|
||||
void iwl_init_scan_params(struct iwl_priv *priv)
|
||||
{
|
||||
u8 ant_idx = fls(priv->eeprom_data->valid_tx_ant) - 1;
|
||||
u8 ant_idx = fls(priv->nvm_data->valid_tx_ant) - 1;
|
||||
if (!priv->scan_tx_ant[IEEE80211_BAND_5GHZ])
|
||||
priv->scan_tx_ant[IEEE80211_BAND_5GHZ] = ant_idx;
|
||||
if (!priv->scan_tx_ant[IEEE80211_BAND_2GHZ])
|
||||
|
@ -634,23 +634,23 @@ static void iwl_sta_fill_lq(struct iwl_priv *priv, struct iwl_rxon_context *ctx,
|
||||
if (r >= IWL_FIRST_CCK_RATE && r <= IWL_LAST_CCK_RATE)
|
||||
rate_flags |= RATE_MCS_CCK_MSK;
|
||||
|
||||
rate_flags |= first_antenna(priv->eeprom_data->valid_tx_ant) <<
|
||||
rate_flags |= first_antenna(priv->nvm_data->valid_tx_ant) <<
|
||||
RATE_MCS_ANT_POS;
|
||||
rate_n_flags = iwl_hw_set_rate_n_flags(iwl_rates[r].plcp, rate_flags);
|
||||
for (i = 0; i < LINK_QUAL_MAX_RETRY_NUM; i++)
|
||||
link_cmd->rs_table[i].rate_n_flags = rate_n_flags;
|
||||
|
||||
link_cmd->general_params.single_stream_ant_msk =
|
||||
first_antenna(priv->eeprom_data->valid_tx_ant);
|
||||
first_antenna(priv->nvm_data->valid_tx_ant);
|
||||
|
||||
link_cmd->general_params.dual_stream_ant_msk =
|
||||
priv->eeprom_data->valid_tx_ant &
|
||||
~first_antenna(priv->eeprom_data->valid_tx_ant);
|
||||
priv->nvm_data->valid_tx_ant &
|
||||
~first_antenna(priv->nvm_data->valid_tx_ant);
|
||||
if (!link_cmd->general_params.dual_stream_ant_msk) {
|
||||
link_cmd->general_params.dual_stream_ant_msk = ANT_AB;
|
||||
} else if (num_of_ant(priv->eeprom_data->valid_tx_ant) == 2) {
|
||||
} else if (num_of_ant(priv->nvm_data->valid_tx_ant) == 2) {
|
||||
link_cmd->general_params.dual_stream_ant_msk =
|
||||
priv->eeprom_data->valid_tx_ant;
|
||||
priv->nvm_data->valid_tx_ant;
|
||||
}
|
||||
|
||||
link_cmd->agg_params.agg_dis_start_th =
|
||||
|
@ -188,7 +188,7 @@ static void iwlagn_tx_cmd_build_rate(struct iwl_priv *priv,
|
||||
if (info->control.rates[0].flags & IEEE80211_TX_RC_MCS ||
|
||||
(rate_idx < 0) || (rate_idx > IWL_RATE_COUNT_LEGACY))
|
||||
rate_idx = rate_lowest_index(
|
||||
&priv->eeprom_data->bands[info->band], sta);
|
||||
&priv->nvm_data->bands[info->band], sta);
|
||||
/* For 5 GHZ band, remap mac80211 rate indices into driver indices */
|
||||
if (info->band == IEEE80211_BAND_5GHZ)
|
||||
rate_idx += IWL_FIRST_OFDM_RATE;
|
||||
@ -207,11 +207,11 @@ static void iwlagn_tx_cmd_build_rate(struct iwl_priv *priv,
|
||||
priv->bt_full_concurrent) {
|
||||
/* operated as 1x1 in full concurrency mode */
|
||||
priv->mgmt_tx_ant = iwl_toggle_tx_ant(priv, priv->mgmt_tx_ant,
|
||||
first_antenna(priv->eeprom_data->valid_tx_ant));
|
||||
first_antenna(priv->nvm_data->valid_tx_ant));
|
||||
} else
|
||||
priv->mgmt_tx_ant = iwl_toggle_tx_ant(
|
||||
priv, priv->mgmt_tx_ant,
|
||||
priv->eeprom_data->valid_tx_ant);
|
||||
priv->nvm_data->valid_tx_ant);
|
||||
rate_flags |= iwl_ant_idx_to_flags(priv->mgmt_tx_ant);
|
||||
|
||||
/* Set the rate in the TX cmd */
|
||||
@ -305,7 +305,7 @@ int iwlagn_tx_skb(struct iwl_priv *priv,
|
||||
u8 hdr_len;
|
||||
u16 len, seq_number = 0;
|
||||
u8 sta_id, tid = IWL_MAX_TID_COUNT;
|
||||
bool is_agg = false;
|
||||
bool is_agg = false, is_data_qos = false;
|
||||
int txq_id;
|
||||
|
||||
if (info->control.vif)
|
||||
@ -378,9 +378,6 @@ int iwlagn_tx_skb(struct iwl_priv *priv,
|
||||
iwl_sta_modify_sleep_tx_count(priv, sta_id, 1);
|
||||
}
|
||||
|
||||
if (info->flags & IEEE80211_TX_CTL_AMPDU)
|
||||
is_agg = true;
|
||||
|
||||
dev_cmd = iwl_trans_alloc_tx_cmd(priv->trans);
|
||||
|
||||
if (unlikely(!dev_cmd))
|
||||
@ -442,6 +439,10 @@ int iwlagn_tx_skb(struct iwl_priv *priv,
|
||||
hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG);
|
||||
hdr->seq_ctrl |= cpu_to_le16(seq_number);
|
||||
seq_number += 0x10;
|
||||
|
||||
if (info->flags & IEEE80211_TX_CTL_AMPDU)
|
||||
is_agg = true;
|
||||
is_data_qos = true;
|
||||
}
|
||||
|
||||
/* Copy MAC header from skb into command buffer */
|
||||
@ -474,8 +475,7 @@ int iwlagn_tx_skb(struct iwl_priv *priv,
|
||||
if (iwl_trans_tx(priv->trans, skb, dev_cmd, txq_id))
|
||||
goto drop_unlock_sta;
|
||||
|
||||
if (ieee80211_is_data_qos(fc) && !ieee80211_is_qos_nullfunc(fc) &&
|
||||
!ieee80211_has_morefrags(fc))
|
||||
if (is_data_qos && !ieee80211_has_morefrags(fc))
|
||||
priv->tid_data[sta_id][tid].seq_number = seq_number;
|
||||
|
||||
spin_unlock(&priv->sta_lock);
|
||||
@ -1097,29 +1097,6 @@ static void iwl_check_abort_status(struct iwl_priv *priv,
|
||||
}
|
||||
}
|
||||
|
||||
static int iwl_reclaim(struct iwl_priv *priv, int sta_id, int tid,
|
||||
int txq_id, int ssn, struct sk_buff_head *skbs)
|
||||
{
|
||||
if (unlikely(txq_id >= IWLAGN_FIRST_AMPDU_QUEUE &&
|
||||
tid != IWL_TID_NON_QOS &&
|
||||
txq_id != priv->tid_data[sta_id][tid].agg.txq_id)) {
|
||||
/*
|
||||
* FIXME: this is a uCode bug which need to be addressed,
|
||||
* log the information and return for now.
|
||||
* Since it is can possibly happen very often and in order
|
||||
* not to fill the syslog, don't use IWL_ERR or IWL_WARN
|
||||
*/
|
||||
IWL_DEBUG_TX_QUEUES(priv,
|
||||
"Bad queue mapping txq_id=%d, agg_txq[sta:%d,tid:%d]=%d\n",
|
||||
txq_id, sta_id, tid,
|
||||
priv->tid_data[sta_id][tid].agg.txq_id);
|
||||
return 1;
|
||||
}
|
||||
|
||||
iwl_trans_reclaim(priv->trans, txq_id, ssn, skbs);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int iwlagn_rx_reply_tx(struct iwl_priv *priv, struct iwl_rx_cmd_buffer *rxb,
|
||||
struct iwl_device_cmd *cmd)
|
||||
{
|
||||
@ -1181,9 +1158,8 @@ int iwlagn_rx_reply_tx(struct iwl_priv *priv, struct iwl_rx_cmd_buffer *rxb,
|
||||
next_reclaimed);
|
||||
}
|
||||
|
||||
/*we can free until ssn % q.n_bd not inclusive */
|
||||
WARN_ON_ONCE(iwl_reclaim(priv, sta_id, tid,
|
||||
txq_id, ssn, &skbs));
|
||||
iwl_trans_reclaim(priv->trans, txq_id, ssn, &skbs);
|
||||
|
||||
iwlagn_check_ratid_empty(priv, sta_id, tid);
|
||||
freed = 0;
|
||||
|
||||
@ -1308,16 +1284,27 @@ int iwlagn_rx_reply_compressed_ba(struct iwl_priv *priv,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (unlikely(scd_flow != agg->txq_id)) {
|
||||
/*
|
||||
* FIXME: this is a uCode bug which need to be addressed,
|
||||
* log the information and return for now.
|
||||
* Since it is can possibly happen very often and in order
|
||||
* not to fill the syslog, don't use IWL_ERR or IWL_WARN
|
||||
*/
|
||||
IWL_DEBUG_TX_QUEUES(priv,
|
||||
"Bad queue mapping txq_id=%d, agg_txq[sta:%d,tid:%d]=%d\n",
|
||||
scd_flow, sta_id, tid, agg->txq_id);
|
||||
spin_unlock(&priv->sta_lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
__skb_queue_head_init(&reclaimed_skbs);
|
||||
|
||||
/* Release all TFDs before the SSN, i.e. all TFDs in front of
|
||||
* block-ack window (we assume that they've been successfully
|
||||
* transmitted ... if not, it's too late anyway). */
|
||||
if (iwl_reclaim(priv, sta_id, tid, scd_flow,
|
||||
ba_resp_scd_ssn, &reclaimed_skbs)) {
|
||||
spin_unlock(&priv->sta_lock);
|
||||
return 0;
|
||||
}
|
||||
iwl_trans_reclaim(priv->trans, scd_flow, ba_resp_scd_ssn,
|
||||
&reclaimed_skbs);
|
||||
|
||||
IWL_DEBUG_TX_REPLY(priv, "REPLY_COMPRESSED_BA [%d] Received from %pM, "
|
||||
"sta_id = %d\n",
|
||||
|
@ -61,7 +61,7 @@ iwl_get_ucode_image(struct iwl_priv *priv, enum iwl_ucode_type ucode_type)
|
||||
static int iwl_set_Xtal_calib(struct iwl_priv *priv)
|
||||
{
|
||||
struct iwl_calib_xtal_freq_cmd cmd;
|
||||
__le16 *xtal_calib = priv->eeprom_data->xtal_calib;
|
||||
__le16 *xtal_calib = priv->nvm_data->xtal_calib;
|
||||
|
||||
iwl_set_calib_hdr(&cmd.hdr, IWL_PHY_CALIBRATE_CRYSTAL_FRQ_CMD);
|
||||
cmd.cap_pin1 = le16_to_cpu(xtal_calib[0]);
|
||||
@ -75,7 +75,7 @@ static int iwl_set_temperature_offset_calib(struct iwl_priv *priv)
|
||||
|
||||
memset(&cmd, 0, sizeof(cmd));
|
||||
iwl_set_calib_hdr(&cmd.hdr, IWL_PHY_CALIBRATE_TEMP_OFFSET_CMD);
|
||||
cmd.radio_sensor_offset = priv->eeprom_data->raw_temperature;
|
||||
cmd.radio_sensor_offset = priv->nvm_data->raw_temperature;
|
||||
if (!(cmd.radio_sensor_offset))
|
||||
cmd.radio_sensor_offset = DEFAULT_RADIO_SENSOR_OFFSET;
|
||||
|
||||
@ -90,14 +90,14 @@ static int iwl_set_temperature_offset_calib_v2(struct iwl_priv *priv)
|
||||
|
||||
memset(&cmd, 0, sizeof(cmd));
|
||||
iwl_set_calib_hdr(&cmd.hdr, IWL_PHY_CALIBRATE_TEMP_OFFSET_CMD);
|
||||
cmd.radio_sensor_offset_high = priv->eeprom_data->kelvin_temperature;
|
||||
cmd.radio_sensor_offset_low = priv->eeprom_data->raw_temperature;
|
||||
cmd.radio_sensor_offset_high = priv->nvm_data->kelvin_temperature;
|
||||
cmd.radio_sensor_offset_low = priv->nvm_data->raw_temperature;
|
||||
if (!cmd.radio_sensor_offset_low) {
|
||||
IWL_DEBUG_CALIB(priv, "no info in EEPROM, use default\n");
|
||||
cmd.radio_sensor_offset_low = DEFAULT_RADIO_SENSOR_OFFSET;
|
||||
cmd.radio_sensor_offset_high = DEFAULT_RADIO_SENSOR_OFFSET;
|
||||
}
|
||||
cmd.burntVoltageRef = priv->eeprom_data->calib_voltage;
|
||||
cmd.burntVoltageRef = priv->nvm_data->calib_voltage;
|
||||
|
||||
IWL_DEBUG_CALIB(priv, "Radio sensor offset high: %d\n",
|
||||
le16_to_cpu(cmd.radio_sensor_offset_high));
|
||||
@ -257,7 +257,7 @@ static int iwl_alive_notify(struct iwl_priv *priv)
|
||||
iwl_trans_fw_alive(priv->trans, 0);
|
||||
|
||||
if (priv->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_PAN &&
|
||||
priv->eeprom_data->sku & EEPROM_SKU_CAP_IPAN_ENABLE) {
|
||||
priv->nvm_data->sku_cap_ipan_enable) {
|
||||
n_queues = ARRAY_SIZE(iwlagn_ipan_queue_to_tx_fifo);
|
||||
queue_to_txf = iwlagn_ipan_queue_to_tx_fifo;
|
||||
} else {
|
||||
|
@ -226,8 +226,8 @@ struct iwl_eeprom_params {
|
||||
* @max_data_size: The maximal length of the fw data section
|
||||
* @valid_tx_ant: valid transmit antenna
|
||||
* @valid_rx_ant: valid receive antenna
|
||||
* @eeprom_ver: EEPROM version
|
||||
* @eeprom_calib_ver: EEPROM calibration version
|
||||
* @nvm_ver: NVM version
|
||||
* @nvm_calib_ver: NVM calibration version
|
||||
* @lib: pointer to the lib ops
|
||||
* @base_params: pointer to basic parameters
|
||||
* @ht_params: point to ht patameters
|
||||
@ -257,8 +257,8 @@ struct iwl_cfg {
|
||||
const u32 max_inst_size;
|
||||
u8 valid_tx_ant;
|
||||
u8 valid_rx_ant;
|
||||
u16 eeprom_ver;
|
||||
u16 eeprom_calib_ver;
|
||||
u16 nvm_ver;
|
||||
u16 nvm_calib_ver;
|
||||
/* params not likely to change within a device family */
|
||||
const struct iwl_base_params *base_params;
|
||||
/* params likely to change within a device family */
|
||||
|
@ -133,6 +133,40 @@ TRACE_EVENT(iwlwifi_dev_iowrite32,
|
||||
__get_str(dev), __entry->offs, __entry->val)
|
||||
);
|
||||
|
||||
TRACE_EVENT(iwlwifi_dev_iowrite_prph32,
|
||||
TP_PROTO(const struct device *dev, u32 offs, u32 val),
|
||||
TP_ARGS(dev, offs, val),
|
||||
TP_STRUCT__entry(
|
||||
DEV_ENTRY
|
||||
__field(u32, offs)
|
||||
__field(u32, val)
|
||||
),
|
||||
TP_fast_assign(
|
||||
DEV_ASSIGN;
|
||||
__entry->offs = offs;
|
||||
__entry->val = val;
|
||||
),
|
||||
TP_printk("[%s] write PRPH[%#x] = %#x)",
|
||||
__get_str(dev), __entry->offs, __entry->val)
|
||||
);
|
||||
|
||||
TRACE_EVENT(iwlwifi_dev_ioread_prph32,
|
||||
TP_PROTO(const struct device *dev, u32 offs, u32 val),
|
||||
TP_ARGS(dev, offs, val),
|
||||
TP_STRUCT__entry(
|
||||
DEV_ENTRY
|
||||
__field(u32, offs)
|
||||
__field(u32, val)
|
||||
),
|
||||
TP_fast_assign(
|
||||
DEV_ASSIGN;
|
||||
__entry->offs = offs;
|
||||
__entry->val = val;
|
||||
),
|
||||
TP_printk("[%s] read PRPH[%#x] = %#x",
|
||||
__get_str(dev), __entry->offs, __entry->val)
|
||||
);
|
||||
|
||||
TRACE_EVENT(iwlwifi_dev_irq,
|
||||
TP_PROTO(const struct device *dev),
|
||||
TP_ARGS(dev),
|
||||
|
@ -1032,6 +1032,7 @@ struct iwl_drv *iwl_drv_start(struct iwl_trans *trans,
|
||||
|
||||
if (!drv->dbgfs_drv) {
|
||||
IWL_ERR(drv, "failed to create debugfs directory\n");
|
||||
ret = -ENOMEM;
|
||||
goto err_free_drv;
|
||||
}
|
||||
|
||||
@ -1040,12 +1041,12 @@ struct iwl_drv *iwl_drv_start(struct iwl_trans *trans,
|
||||
|
||||
if (!drv->trans->dbgfs_dir) {
|
||||
IWL_ERR(drv, "failed to create transport debugfs directory\n");
|
||||
ret = -ENOMEM;
|
||||
goto err_free_dbgfs;
|
||||
}
|
||||
#endif
|
||||
|
||||
ret = iwl_request_firmware(drv, true);
|
||||
|
||||
if (ret) {
|
||||
IWL_ERR(trans, "Couldn't request the fw\n");
|
||||
goto err_fw;
|
||||
@ -1060,9 +1061,8 @@ err_free_dbgfs:
|
||||
err_free_drv:
|
||||
#endif
|
||||
kfree(drv);
|
||||
drv = NULL;
|
||||
|
||||
return drv;
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
|
||||
void iwl_drv_stop(struct iwl_drv *drv)
|
||||
|
@ -116,6 +116,24 @@ struct iwl_eeprom_calib_hdr {
|
||||
#define EEPROM_KELVIN_TEMPERATURE ((2*0x12A) | EEPROM_CALIB_ALL)
|
||||
#define EEPROM_RAW_TEMPERATURE ((2*0x12B) | EEPROM_CALIB_ALL)
|
||||
|
||||
/* SKU Capabilities (actual values from EEPROM definition) */
|
||||
enum eeprom_sku_bits {
|
||||
EEPROM_SKU_CAP_BAND_24GHZ = BIT(4),
|
||||
EEPROM_SKU_CAP_BAND_52GHZ = BIT(5),
|
||||
EEPROM_SKU_CAP_11N_ENABLE = BIT(6),
|
||||
EEPROM_SKU_CAP_AMT_ENABLE = BIT(7),
|
||||
EEPROM_SKU_CAP_IPAN_ENABLE = BIT(8)
|
||||
};
|
||||
|
||||
/* radio config bits (actual values from EEPROM definition) */
|
||||
#define EEPROM_RF_CFG_TYPE_MSK(x) (x & 0x3) /* bits 0-1 */
|
||||
#define EEPROM_RF_CFG_STEP_MSK(x) ((x >> 2) & 0x3) /* bits 2-3 */
|
||||
#define EEPROM_RF_CFG_DASH_MSK(x) ((x >> 4) & 0x3) /* bits 4-5 */
|
||||
#define EEPROM_RF_CFG_PNUM_MSK(x) ((x >> 6) & 0x3) /* bits 6-7 */
|
||||
#define EEPROM_RF_CFG_TX_ANT_MSK(x) ((x >> 8) & 0xF) /* bits 8-11 */
|
||||
#define EEPROM_RF_CFG_RX_ANT_MSK(x) ((x >> 12) & 0xF) /* bits 12-15 */
|
||||
|
||||
|
||||
/*
|
||||
* EEPROM bands
|
||||
* These are the channel numbers from each band in the order
|
||||
@ -251,7 +269,7 @@ static const u8 *iwl_eeprom_query_addr(const u8 *eeprom, size_t eeprom_size,
|
||||
}
|
||||
|
||||
static int iwl_eeprom_read_calib(const u8 *eeprom, size_t eeprom_size,
|
||||
struct iwl_eeprom_data *data)
|
||||
struct iwl_nvm_data *data)
|
||||
{
|
||||
struct iwl_eeprom_calib_hdr *hdr;
|
||||
|
||||
@ -330,7 +348,7 @@ struct iwl_eeprom_enhanced_txpwr {
|
||||
s8 mimo3_max;
|
||||
} __packed;
|
||||
|
||||
static s8 iwl_get_max_txpwr_half_dbm(const struct iwl_eeprom_data *data,
|
||||
static s8 iwl_get_max_txpwr_half_dbm(const struct iwl_nvm_data *data,
|
||||
struct iwl_eeprom_enhanced_txpwr *txp)
|
||||
{
|
||||
s8 result = 0; /* (.5 dBm) */
|
||||
@ -364,7 +382,7 @@ static s8 iwl_get_max_txpwr_half_dbm(const struct iwl_eeprom_data *data,
|
||||
((txp->flags & IWL_EEPROM_ENH_TXP_FL_##x) ? # x " " : "")
|
||||
|
||||
static void
|
||||
iwl_eeprom_enh_txp_read_element(struct iwl_eeprom_data *data,
|
||||
iwl_eeprom_enh_txp_read_element(struct iwl_nvm_data *data,
|
||||
struct iwl_eeprom_enhanced_txpwr *txp,
|
||||
int n_channels, s8 max_txpower_avg)
|
||||
{
|
||||
@ -392,7 +410,7 @@ iwl_eeprom_enh_txp_read_element(struct iwl_eeprom_data *data,
|
||||
}
|
||||
|
||||
static void iwl_eeprom_enhanced_txpower(struct device *dev,
|
||||
struct iwl_eeprom_data *data,
|
||||
struct iwl_nvm_data *data,
|
||||
const u8 *eeprom, size_t eeprom_size,
|
||||
int n_channels)
|
||||
{
|
||||
@ -504,7 +522,7 @@ static void iwl_init_band_reference(const struct iwl_cfg *cfg,
|
||||
((eeprom_ch->flags & EEPROM_CHANNEL_##x) ? # x " " : "")
|
||||
|
||||
static void iwl_mod_ht40_chan_info(struct device *dev,
|
||||
struct iwl_eeprom_data *data, int n_channels,
|
||||
struct iwl_nvm_data *data, int n_channels,
|
||||
enum ieee80211_band band, u16 channel,
|
||||
const struct iwl_eeprom_channel *eeprom_ch,
|
||||
u8 clear_ht40_extension_channel)
|
||||
@ -547,7 +565,7 @@ static void iwl_mod_ht40_chan_info(struct device *dev,
|
||||
((eeprom_ch_info[ch_idx].flags & EEPROM_CHANNEL_##x) ? # x " " : "")
|
||||
|
||||
static int iwl_init_channel_map(struct device *dev, const struct iwl_cfg *cfg,
|
||||
struct iwl_eeprom_data *data,
|
||||
struct iwl_nvm_data *data,
|
||||
const u8 *eeprom, size_t eeprom_size)
|
||||
{
|
||||
int band, ch_idx;
|
||||
@ -685,7 +703,7 @@ static int iwl_init_channel_map(struct device *dev, const struct iwl_cfg *cfg,
|
||||
return n_channels;
|
||||
}
|
||||
|
||||
static int iwl_init_sband_channels(struct iwl_eeprom_data *data,
|
||||
static int iwl_init_sband_channels(struct iwl_nvm_data *data,
|
||||
struct ieee80211_supported_band *sband,
|
||||
int n_channels, enum ieee80211_band band)
|
||||
{
|
||||
@ -711,7 +729,7 @@ static int iwl_init_sband_channels(struct iwl_eeprom_data *data,
|
||||
#define MAX_BIT_RATE_20_MHZ 72 /* Mbps */
|
||||
|
||||
static void iwl_init_ht_hw_capab(const struct iwl_cfg *cfg,
|
||||
struct iwl_eeprom_data *data,
|
||||
struct iwl_nvm_data *data,
|
||||
struct ieee80211_sta_ht_cap *ht_info,
|
||||
enum ieee80211_band band)
|
||||
{
|
||||
@ -725,7 +743,7 @@ static void iwl_init_ht_hw_capab(const struct iwl_cfg *cfg,
|
||||
else
|
||||
rx_chains = hweight8(data->valid_rx_ant);
|
||||
|
||||
if (!(data->sku & EEPROM_SKU_CAP_11N_ENABLE) || !cfg->ht_params) {
|
||||
if (!(data->sku_cap_11n_enable) || !cfg->ht_params) {
|
||||
ht_info->ht_supported = false;
|
||||
return;
|
||||
}
|
||||
@ -773,7 +791,7 @@ static void iwl_init_ht_hw_capab(const struct iwl_cfg *cfg,
|
||||
}
|
||||
|
||||
static void iwl_init_sbands(struct device *dev, const struct iwl_cfg *cfg,
|
||||
struct iwl_eeprom_data *data,
|
||||
struct iwl_nvm_data *data,
|
||||
const u8 *eeprom, size_t eeprom_size)
|
||||
{
|
||||
int n_channels = iwl_init_channel_map(dev, cfg, data,
|
||||
@ -804,12 +822,13 @@ static void iwl_init_sbands(struct device *dev, const struct iwl_cfg *cfg,
|
||||
|
||||
/* EEPROM data functions */
|
||||
|
||||
struct iwl_eeprom_data *
|
||||
struct iwl_nvm_data *
|
||||
iwl_parse_eeprom_data(struct device *dev, const struct iwl_cfg *cfg,
|
||||
const u8 *eeprom, size_t eeprom_size)
|
||||
{
|
||||
struct iwl_eeprom_data *data;
|
||||
struct iwl_nvm_data *data;
|
||||
const void *tmp;
|
||||
u16 radio_cfg, sku;
|
||||
|
||||
if (WARN_ON(!cfg || !cfg->eeprom_params))
|
||||
return NULL;
|
||||
@ -849,18 +868,27 @@ iwl_parse_eeprom_data(struct device *dev, const struct iwl_cfg *cfg,
|
||||
data->kelvin_temperature = *(__le16 *)tmp;
|
||||
data->kelvin_voltage = *((__le16 *)tmp + 1);
|
||||
|
||||
data->radio_cfg = iwl_eeprom_query16(eeprom, eeprom_size,
|
||||
radio_cfg = iwl_eeprom_query16(eeprom, eeprom_size,
|
||||
EEPROM_RADIO_CONFIG);
|
||||
data->sku = iwl_eeprom_query16(eeprom, eeprom_size,
|
||||
EEPROM_SKU_CAP);
|
||||
data->radio_cfg_dash = EEPROM_RF_CFG_DASH_MSK(radio_cfg);
|
||||
data->radio_cfg_pnum = EEPROM_RF_CFG_PNUM_MSK(radio_cfg);
|
||||
data->radio_cfg_step = EEPROM_RF_CFG_STEP_MSK(radio_cfg);
|
||||
data->radio_cfg_type = EEPROM_RF_CFG_TYPE_MSK(radio_cfg);
|
||||
data->valid_rx_ant = EEPROM_RF_CFG_RX_ANT_MSK(radio_cfg);
|
||||
data->valid_tx_ant = EEPROM_RF_CFG_TX_ANT_MSK(radio_cfg);
|
||||
|
||||
sku = iwl_eeprom_query16(eeprom, eeprom_size,
|
||||
EEPROM_SKU_CAP);
|
||||
data->sku_cap_11n_enable = sku & EEPROM_SKU_CAP_11N_ENABLE;
|
||||
data->sku_cap_amt_enable = sku & EEPROM_SKU_CAP_AMT_ENABLE;
|
||||
data->sku_cap_band_24GHz_enable = sku & EEPROM_SKU_CAP_BAND_24GHZ;
|
||||
data->sku_cap_band_52GHz_enable = sku & EEPROM_SKU_CAP_BAND_52GHZ;
|
||||
data->sku_cap_ipan_enable = sku & EEPROM_SKU_CAP_IPAN_ENABLE;
|
||||
if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_ALL)
|
||||
data->sku &= ~EEPROM_SKU_CAP_11N_ENABLE;
|
||||
data->sku_cap_11n_enable = false;
|
||||
|
||||
data->eeprom_version = iwl_eeprom_query16(eeprom, eeprom_size,
|
||||
EEPROM_VERSION);
|
||||
|
||||
data->valid_tx_ant = EEPROM_RF_CFG_TX_ANT_MSK(data->radio_cfg);
|
||||
data->valid_rx_ant = EEPROM_RF_CFG_RX_ANT_MSK(data->radio_cfg);
|
||||
data->nvm_version = iwl_eeprom_query16(eeprom, eeprom_size,
|
||||
EEPROM_VERSION);
|
||||
|
||||
/* check overrides (some devices have wrong EEPROM) */
|
||||
if (cfg->valid_tx_ant)
|
||||
@ -884,20 +912,20 @@ iwl_parse_eeprom_data(struct device *dev, const struct iwl_cfg *cfg,
|
||||
EXPORT_SYMBOL_GPL(iwl_parse_eeprom_data);
|
||||
|
||||
/* helper functions */
|
||||
int iwl_eeprom_check_version(struct iwl_eeprom_data *data,
|
||||
int iwl_nvm_check_version(struct iwl_nvm_data *data,
|
||||
struct iwl_trans *trans)
|
||||
{
|
||||
if (data->eeprom_version >= trans->cfg->eeprom_ver ||
|
||||
data->calib_version >= trans->cfg->eeprom_calib_ver) {
|
||||
if (data->nvm_version >= trans->cfg->nvm_ver ||
|
||||
data->calib_version >= trans->cfg->nvm_calib_ver) {
|
||||
IWL_DEBUG_INFO(trans, "device EEPROM VER=0x%x, CALIB=0x%x\n",
|
||||
data->eeprom_version, data->calib_version);
|
||||
data->nvm_version, data->calib_version);
|
||||
return 0;
|
||||
}
|
||||
|
||||
IWL_ERR(trans,
|
||||
"Unsupported (too old) EEPROM VER=0x%x < 0x%x CALIB=0x%x < 0x%x\n",
|
||||
data->eeprom_version, trans->cfg->eeprom_ver,
|
||||
data->calib_version, trans->cfg->eeprom_calib_ver);
|
||||
data->nvm_version, trans->cfg->nvm_ver,
|
||||
data->calib_version, trans->cfg->nvm_calib_ver);
|
||||
return -EINVAL;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(iwl_eeprom_check_version);
|
||||
EXPORT_SYMBOL_GPL(iwl_nvm_check_version);
|
||||
|
@ -66,22 +66,7 @@
|
||||
#include <linux/if_ether.h>
|
||||
#include "iwl-trans.h"
|
||||
|
||||
/* SKU Capabilities (actual values from EEPROM definition) */
|
||||
#define EEPROM_SKU_CAP_BAND_24GHZ (1 << 4)
|
||||
#define EEPROM_SKU_CAP_BAND_52GHZ (1 << 5)
|
||||
#define EEPROM_SKU_CAP_11N_ENABLE (1 << 6)
|
||||
#define EEPROM_SKU_CAP_AMT_ENABLE (1 << 7)
|
||||
#define EEPROM_SKU_CAP_IPAN_ENABLE (1 << 8)
|
||||
|
||||
/* radio config bits (actual values from EEPROM definition) */
|
||||
#define EEPROM_RF_CFG_TYPE_MSK(x) (x & 0x3) /* bits 0-1 */
|
||||
#define EEPROM_RF_CFG_STEP_MSK(x) ((x >> 2) & 0x3) /* bits 2-3 */
|
||||
#define EEPROM_RF_CFG_DASH_MSK(x) ((x >> 4) & 0x3) /* bits 4-5 */
|
||||
#define EEPROM_RF_CFG_PNUM_MSK(x) ((x >> 6) & 0x3) /* bits 6-7 */
|
||||
#define EEPROM_RF_CFG_TX_ANT_MSK(x) ((x >> 8) & 0xF) /* bits 8-11 */
|
||||
#define EEPROM_RF_CFG_RX_ANT_MSK(x) ((x >> 12) & 0xF) /* bits 12-15 */
|
||||
|
||||
struct iwl_eeprom_data {
|
||||
struct iwl_nvm_data {
|
||||
int n_hw_addrs;
|
||||
u8 hw_addr[ETH_ALEN];
|
||||
|
||||
@ -93,13 +78,21 @@ struct iwl_eeprom_data {
|
||||
__le16 kelvin_voltage;
|
||||
__le16 xtal_calib[2];
|
||||
|
||||
u16 sku;
|
||||
u16 radio_cfg;
|
||||
u16 eeprom_version;
|
||||
s8 max_tx_pwr_half_dbm;
|
||||
bool sku_cap_band_24GHz_enable;
|
||||
bool sku_cap_band_52GHz_enable;
|
||||
bool sku_cap_11n_enable;
|
||||
bool sku_cap_amt_enable;
|
||||
bool sku_cap_ipan_enable;
|
||||
|
||||
u8 radio_cfg_type;
|
||||
u8 radio_cfg_step;
|
||||
u8 radio_cfg_dash;
|
||||
u8 radio_cfg_pnum;
|
||||
u8 valid_tx_ant, valid_rx_ant;
|
||||
|
||||
u16 nvm_version;
|
||||
s8 max_tx_pwr_half_dbm;
|
||||
|
||||
struct ieee80211_supported_band bands[IEEE80211_NUM_BANDS];
|
||||
struct ieee80211_channel channels[];
|
||||
};
|
||||
@ -115,22 +108,22 @@ struct iwl_eeprom_data {
|
||||
* This function parses all EEPROM values we need and then
|
||||
* returns a (newly allocated) struct containing all the
|
||||
* relevant values for driver use. The struct must be freed
|
||||
* later with iwl_free_eeprom_data().
|
||||
* later with iwl_free_nvm_data().
|
||||
*/
|
||||
struct iwl_eeprom_data *
|
||||
struct iwl_nvm_data *
|
||||
iwl_parse_eeprom_data(struct device *dev, const struct iwl_cfg *cfg,
|
||||
const u8 *eeprom, size_t eeprom_size);
|
||||
|
||||
/**
|
||||
* iwl_free_eeprom_data - free EEPROM data
|
||||
* iwl_free_nvm_data - free NVM data
|
||||
* @data: the data to free
|
||||
*/
|
||||
static inline void iwl_free_eeprom_data(struct iwl_eeprom_data *data)
|
||||
static inline void iwl_free_nvm_data(struct iwl_nvm_data *data)
|
||||
{
|
||||
kfree(data);
|
||||
}
|
||||
|
||||
int iwl_eeprom_check_version(struct iwl_eeprom_data *data,
|
||||
struct iwl_trans *trans);
|
||||
int iwl_nvm_check_version(struct iwl_nvm_data *data,
|
||||
struct iwl_trans *trans);
|
||||
|
||||
#endif /* __iwl_eeprom_parse_h__ */
|
||||
|
@ -214,84 +214,84 @@ int iwl_poll_direct_bit(struct iwl_trans *trans, u32 addr, u32 mask,
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(iwl_poll_direct_bit);
|
||||
|
||||
static inline u32 __iwl_read_prph(struct iwl_trans *trans, u32 reg)
|
||||
static inline u32 __iwl_read_prph(struct iwl_trans *trans, u32 ofs)
|
||||
{
|
||||
iwl_write32(trans, HBUS_TARG_PRPH_RADDR, reg | (3 << 24));
|
||||
return iwl_read32(trans, HBUS_TARG_PRPH_RDAT);
|
||||
u32 val = iwl_trans_read_prph(trans, ofs);
|
||||
trace_iwlwifi_dev_ioread_prph32(trans->dev, ofs, val);
|
||||
return val;
|
||||
}
|
||||
|
||||
static inline void __iwl_write_prph(struct iwl_trans *trans, u32 addr, u32 val)
|
||||
static inline void __iwl_write_prph(struct iwl_trans *trans, u32 ofs, u32 val)
|
||||
{
|
||||
iwl_write32(trans, HBUS_TARG_PRPH_WADDR,
|
||||
((addr & 0x0000FFFF) | (3 << 24)));
|
||||
iwl_write32(trans, HBUS_TARG_PRPH_WDAT, val);
|
||||
trace_iwlwifi_dev_iowrite_prph32(trans->dev, ofs, val);
|
||||
iwl_trans_write_prph(trans, ofs, val);
|
||||
}
|
||||
|
||||
u32 iwl_read_prph(struct iwl_trans *trans, u32 reg)
|
||||
u32 iwl_read_prph(struct iwl_trans *trans, u32 ofs)
|
||||
{
|
||||
unsigned long flags;
|
||||
u32 val;
|
||||
|
||||
spin_lock_irqsave(&trans->reg_lock, flags);
|
||||
iwl_grab_nic_access(trans);
|
||||
val = __iwl_read_prph(trans, reg);
|
||||
val = __iwl_read_prph(trans, ofs);
|
||||
iwl_release_nic_access(trans);
|
||||
spin_unlock_irqrestore(&trans->reg_lock, flags);
|
||||
return val;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(iwl_read_prph);
|
||||
|
||||
void iwl_write_prph(struct iwl_trans *trans, u32 addr, u32 val)
|
||||
void iwl_write_prph(struct iwl_trans *trans, u32 ofs, u32 val)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&trans->reg_lock, flags);
|
||||
if (likely(iwl_grab_nic_access(trans))) {
|
||||
__iwl_write_prph(trans, addr, val);
|
||||
__iwl_write_prph(trans, ofs, val);
|
||||
iwl_release_nic_access(trans);
|
||||
}
|
||||
spin_unlock_irqrestore(&trans->reg_lock, flags);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(iwl_write_prph);
|
||||
|
||||
void iwl_set_bits_prph(struct iwl_trans *trans, u32 reg, u32 mask)
|
||||
void iwl_set_bits_prph(struct iwl_trans *trans, u32 ofs, u32 mask)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&trans->reg_lock, flags);
|
||||
if (likely(iwl_grab_nic_access(trans))) {
|
||||
__iwl_write_prph(trans, reg,
|
||||
__iwl_read_prph(trans, reg) | mask);
|
||||
__iwl_write_prph(trans, ofs,
|
||||
__iwl_read_prph(trans, ofs) | mask);
|
||||
iwl_release_nic_access(trans);
|
||||
}
|
||||
spin_unlock_irqrestore(&trans->reg_lock, flags);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(iwl_set_bits_prph);
|
||||
|
||||
void iwl_set_bits_mask_prph(struct iwl_trans *trans, u32 reg,
|
||||
void iwl_set_bits_mask_prph(struct iwl_trans *trans, u32 ofs,
|
||||
u32 bits, u32 mask)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&trans->reg_lock, flags);
|
||||
if (likely(iwl_grab_nic_access(trans))) {
|
||||
__iwl_write_prph(trans, reg,
|
||||
(__iwl_read_prph(trans, reg) & mask) | bits);
|
||||
__iwl_write_prph(trans, ofs,
|
||||
(__iwl_read_prph(trans, ofs) & mask) | bits);
|
||||
iwl_release_nic_access(trans);
|
||||
}
|
||||
spin_unlock_irqrestore(&trans->reg_lock, flags);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(iwl_set_bits_mask_prph);
|
||||
|
||||
void iwl_clear_bits_prph(struct iwl_trans *trans, u32 reg, u32 mask)
|
||||
void iwl_clear_bits_prph(struct iwl_trans *trans, u32 ofs, u32 mask)
|
||||
{
|
||||
unsigned long flags;
|
||||
u32 val;
|
||||
|
||||
spin_lock_irqsave(&trans->reg_lock, flags);
|
||||
if (likely(iwl_grab_nic_access(trans))) {
|
||||
val = __iwl_read_prph(trans, reg);
|
||||
__iwl_write_prph(trans, reg, (val & ~mask));
|
||||
val = __iwl_read_prph(trans, ofs);
|
||||
__iwl_write_prph(trans, ofs, (val & ~mask));
|
||||
iwl_release_nic_access(trans);
|
||||
}
|
||||
spin_unlock_irqrestore(&trans->reg_lock, flags);
|
||||
|
@ -69,12 +69,12 @@ u32 iwl_read_direct32(struct iwl_trans *trans, u32 reg);
|
||||
void iwl_write_direct32(struct iwl_trans *trans, u32 reg, u32 value);
|
||||
|
||||
|
||||
u32 iwl_read_prph(struct iwl_trans *trans, u32 reg);
|
||||
void iwl_write_prph(struct iwl_trans *trans, u32 addr, u32 val);
|
||||
void iwl_set_bits_prph(struct iwl_trans *trans, u32 reg, u32 mask);
|
||||
void iwl_set_bits_mask_prph(struct iwl_trans *trans, u32 reg,
|
||||
u32 iwl_read_prph(struct iwl_trans *trans, u32 ofs);
|
||||
void iwl_write_prph(struct iwl_trans *trans, u32 ofs, u32 val);
|
||||
void iwl_set_bits_prph(struct iwl_trans *trans, u32 ofs, u32 mask);
|
||||
void iwl_set_bits_mask_prph(struct iwl_trans *trans, u32 ofs,
|
||||
u32 bits, u32 mask);
|
||||
void iwl_clear_bits_prph(struct iwl_trans *trans, u32 reg, u32 mask);
|
||||
void iwl_clear_bits_prph(struct iwl_trans *trans, u32 ofs, u32 mask);
|
||||
|
||||
void _iwl_read_targ_mem_dwords(struct iwl_trans *trans, u32 addr,
|
||||
void *buf, int dwords);
|
||||
|
@ -385,6 +385,8 @@ struct iwl_trans;
|
||||
* @write8: write a u8 to a register at offset ofs from the BAR
|
||||
* @write32: write a u32 to a register at offset ofs from the BAR
|
||||
* @read32: read a u32 register at offset ofs from the BAR
|
||||
* @read_prph: read a DWORD from a periphery register
|
||||
* @write_prph: write a DWORD to a periphery register
|
||||
* @configure: configure parameters required by the transport layer from
|
||||
* the op_mode. May be called several times before start_fw, can't be
|
||||
* called after that.
|
||||
@ -420,6 +422,8 @@ struct iwl_trans_ops {
|
||||
void (*write8)(struct iwl_trans *trans, u32 ofs, u8 val);
|
||||
void (*write32)(struct iwl_trans *trans, u32 ofs, u32 val);
|
||||
u32 (*read32)(struct iwl_trans *trans, u32 ofs);
|
||||
u32 (*read_prph)(struct iwl_trans *trans, u32 ofs);
|
||||
void (*write_prph)(struct iwl_trans *trans, u32 ofs, u32 val);
|
||||
void (*configure)(struct iwl_trans *trans,
|
||||
const struct iwl_trans_config *trans_cfg);
|
||||
void (*set_pmi)(struct iwl_trans *trans, bool state);
|
||||
@ -489,10 +493,6 @@ struct iwl_trans {
|
||||
static inline void iwl_trans_configure(struct iwl_trans *trans,
|
||||
const struct iwl_trans_config *trans_cfg)
|
||||
{
|
||||
/*
|
||||
* only set the op_mode for the moment. Later on, this function will do
|
||||
* more
|
||||
*/
|
||||
trans->op_mode = trans_cfg->op_mode;
|
||||
|
||||
trans->ops->configure(trans, trans_cfg);
|
||||
@ -512,6 +512,9 @@ static inline void iwl_trans_stop_hw(struct iwl_trans *trans,
|
||||
|
||||
trans->ops->stop_hw(trans, op_mode_leaving);
|
||||
|
||||
if (op_mode_leaving)
|
||||
trans->op_mode = NULL;
|
||||
|
||||
trans->state = IWL_TRANS_NO_FW;
|
||||
}
|
||||
|
||||
@ -665,6 +668,17 @@ static inline u32 iwl_trans_read32(struct iwl_trans *trans, u32 ofs)
|
||||
return trans->ops->read32(trans, ofs);
|
||||
}
|
||||
|
||||
static inline u32 iwl_trans_read_prph(struct iwl_trans *trans, u32 ofs)
|
||||
{
|
||||
return trans->ops->read_prph(trans, ofs);
|
||||
}
|
||||
|
||||
static inline void iwl_trans_write_prph(struct iwl_trans *trans, u32 ofs,
|
||||
u32 val)
|
||||
{
|
||||
return trans->ops->write_prph(trans, ofs, val);
|
||||
}
|
||||
|
||||
static inline void iwl_trans_set_pmi(struct iwl_trans *trans, bool state)
|
||||
{
|
||||
trans->ops->set_pmi(trans, state);
|
||||
|
@ -94,8 +94,8 @@ static const struct iwl_eeprom_params iwl1000_eeprom_params = {
|
||||
.device_family = IWL_DEVICE_FAMILY_1000, \
|
||||
.max_inst_size = IWLAGN_RTC_INST_SIZE, \
|
||||
.max_data_size = IWLAGN_RTC_DATA_SIZE, \
|
||||
.eeprom_ver = EEPROM_1000_EEPROM_VERSION, \
|
||||
.eeprom_calib_ver = EEPROM_1000_TX_POWER_VERSION, \
|
||||
.nvm_ver = EEPROM_1000_EEPROM_VERSION, \
|
||||
.nvm_calib_ver = EEPROM_1000_TX_POWER_VERSION, \
|
||||
.base_params = &iwl1000_base_params, \
|
||||
.eeprom_params = &iwl1000_eeprom_params, \
|
||||
.led_mode = IWL_LED_BLINK
|
||||
@ -119,8 +119,8 @@ const struct iwl_cfg iwl1000_bg_cfg = {
|
||||
.device_family = IWL_DEVICE_FAMILY_100, \
|
||||
.max_inst_size = IWLAGN_RTC_INST_SIZE, \
|
||||
.max_data_size = IWLAGN_RTC_DATA_SIZE, \
|
||||
.eeprom_ver = EEPROM_1000_EEPROM_VERSION, \
|
||||
.eeprom_calib_ver = EEPROM_1000_TX_POWER_VERSION, \
|
||||
.nvm_ver = EEPROM_1000_EEPROM_VERSION, \
|
||||
.nvm_calib_ver = EEPROM_1000_TX_POWER_VERSION, \
|
||||
.base_params = &iwl1000_base_params, \
|
||||
.eeprom_params = &iwl1000_eeprom_params, \
|
||||
.led_mode = IWL_LED_RF_STATE, \
|
||||
|
@ -138,8 +138,8 @@ static const struct iwl_eeprom_params iwl20x0_eeprom_params = {
|
||||
.device_family = IWL_DEVICE_FAMILY_2000, \
|
||||
.max_inst_size = IWL60_RTC_INST_SIZE, \
|
||||
.max_data_size = IWL60_RTC_DATA_SIZE, \
|
||||
.eeprom_ver = EEPROM_2000_EEPROM_VERSION, \
|
||||
.eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
|
||||
.nvm_ver = EEPROM_2000_EEPROM_VERSION, \
|
||||
.nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
|
||||
.base_params = &iwl2000_base_params, \
|
||||
.eeprom_params = &iwl20x0_eeprom_params, \
|
||||
.need_temp_offset_calib = true, \
|
||||
@ -166,8 +166,8 @@ const struct iwl_cfg iwl2000_2bgn_d_cfg = {
|
||||
.device_family = IWL_DEVICE_FAMILY_2030, \
|
||||
.max_inst_size = IWL60_RTC_INST_SIZE, \
|
||||
.max_data_size = IWL60_RTC_DATA_SIZE, \
|
||||
.eeprom_ver = EEPROM_2000_EEPROM_VERSION, \
|
||||
.eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
|
||||
.nvm_ver = EEPROM_2000_EEPROM_VERSION, \
|
||||
.nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
|
||||
.base_params = &iwl2030_base_params, \
|
||||
.bt_params = &iwl2030_bt_params, \
|
||||
.eeprom_params = &iwl20x0_eeprom_params, \
|
||||
@ -190,8 +190,8 @@ const struct iwl_cfg iwl2030_2bgn_cfg = {
|
||||
.device_family = IWL_DEVICE_FAMILY_105, \
|
||||
.max_inst_size = IWL60_RTC_INST_SIZE, \
|
||||
.max_data_size = IWL60_RTC_DATA_SIZE, \
|
||||
.eeprom_ver = EEPROM_2000_EEPROM_VERSION, \
|
||||
.eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
|
||||
.nvm_ver = EEPROM_2000_EEPROM_VERSION, \
|
||||
.nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
|
||||
.base_params = &iwl2000_base_params, \
|
||||
.eeprom_params = &iwl20x0_eeprom_params, \
|
||||
.need_temp_offset_calib = true, \
|
||||
@ -220,8 +220,8 @@ const struct iwl_cfg iwl105_bgn_d_cfg = {
|
||||
.device_family = IWL_DEVICE_FAMILY_135, \
|
||||
.max_inst_size = IWL60_RTC_INST_SIZE, \
|
||||
.max_data_size = IWL60_RTC_DATA_SIZE, \
|
||||
.eeprom_ver = EEPROM_2000_EEPROM_VERSION, \
|
||||
.eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
|
||||
.nvm_ver = EEPROM_2000_EEPROM_VERSION, \
|
||||
.nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
|
||||
.base_params = &iwl2030_base_params, \
|
||||
.bt_params = &iwl2030_bt_params, \
|
||||
.eeprom_params = &iwl20x0_eeprom_params, \
|
||||
|
@ -92,8 +92,8 @@ static const struct iwl_eeprom_params iwl5000_eeprom_params = {
|
||||
.device_family = IWL_DEVICE_FAMILY_5000, \
|
||||
.max_inst_size = IWLAGN_RTC_INST_SIZE, \
|
||||
.max_data_size = IWLAGN_RTC_DATA_SIZE, \
|
||||
.eeprom_ver = EEPROM_5000_EEPROM_VERSION, \
|
||||
.eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, \
|
||||
.nvm_ver = EEPROM_5000_EEPROM_VERSION, \
|
||||
.nvm_calib_ver = EEPROM_5000_TX_POWER_VERSION, \
|
||||
.base_params = &iwl5000_base_params, \
|
||||
.eeprom_params = &iwl5000_eeprom_params, \
|
||||
.led_mode = IWL_LED_BLINK
|
||||
@ -139,8 +139,8 @@ const struct iwl_cfg iwl5350_agn_cfg = {
|
||||
.device_family = IWL_DEVICE_FAMILY_5000,
|
||||
.max_inst_size = IWLAGN_RTC_INST_SIZE,
|
||||
.max_data_size = IWLAGN_RTC_DATA_SIZE,
|
||||
.eeprom_ver = EEPROM_5050_EEPROM_VERSION,
|
||||
.eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,
|
||||
.nvm_ver = EEPROM_5050_EEPROM_VERSION,
|
||||
.nvm_calib_ver = EEPROM_5050_TX_POWER_VERSION,
|
||||
.base_params = &iwl5000_base_params,
|
||||
.eeprom_params = &iwl5000_eeprom_params,
|
||||
.ht_params = &iwl5000_ht_params,
|
||||
@ -156,8 +156,8 @@ const struct iwl_cfg iwl5350_agn_cfg = {
|
||||
.device_family = IWL_DEVICE_FAMILY_5150, \
|
||||
.max_inst_size = IWLAGN_RTC_INST_SIZE, \
|
||||
.max_data_size = IWLAGN_RTC_DATA_SIZE, \
|
||||
.eeprom_ver = EEPROM_5050_EEPROM_VERSION, \
|
||||
.eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION, \
|
||||
.nvm_ver = EEPROM_5050_EEPROM_VERSION, \
|
||||
.nvm_calib_ver = EEPROM_5050_TX_POWER_VERSION, \
|
||||
.base_params = &iwl5000_base_params, \
|
||||
.eeprom_params = &iwl5000_eeprom_params, \
|
||||
.no_xtal_calib = true, \
|
||||
|
@ -160,8 +160,8 @@ static const struct iwl_eeprom_params iwl6000_eeprom_params = {
|
||||
.device_family = IWL_DEVICE_FAMILY_6005, \
|
||||
.max_inst_size = IWL60_RTC_INST_SIZE, \
|
||||
.max_data_size = IWL60_RTC_DATA_SIZE, \
|
||||
.eeprom_ver = EEPROM_6005_EEPROM_VERSION, \
|
||||
.eeprom_calib_ver = EEPROM_6005_TX_POWER_VERSION, \
|
||||
.nvm_ver = EEPROM_6005_EEPROM_VERSION, \
|
||||
.nvm_calib_ver = EEPROM_6005_TX_POWER_VERSION, \
|
||||
.base_params = &iwl6000_g2_base_params, \
|
||||
.eeprom_params = &iwl6000_eeprom_params, \
|
||||
.need_temp_offset_calib = true, \
|
||||
@ -215,8 +215,8 @@ const struct iwl_cfg iwl6005_2agn_mow2_cfg = {
|
||||
.device_family = IWL_DEVICE_FAMILY_6030, \
|
||||
.max_inst_size = IWL60_RTC_INST_SIZE, \
|
||||
.max_data_size = IWL60_RTC_DATA_SIZE, \
|
||||
.eeprom_ver = EEPROM_6030_EEPROM_VERSION, \
|
||||
.eeprom_calib_ver = EEPROM_6030_TX_POWER_VERSION, \
|
||||
.nvm_ver = EEPROM_6030_EEPROM_VERSION, \
|
||||
.nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION, \
|
||||
.base_params = &iwl6000_g2_base_params, \
|
||||
.bt_params = &iwl6000_bt_params, \
|
||||
.eeprom_params = &iwl6000_eeprom_params, \
|
||||
@ -254,8 +254,8 @@ const struct iwl_cfg iwl6030_2bg_cfg = {
|
||||
.device_family = IWL_DEVICE_FAMILY_6030, \
|
||||
.max_inst_size = IWL60_RTC_INST_SIZE, \
|
||||
.max_data_size = IWL60_RTC_DATA_SIZE, \
|
||||
.eeprom_ver = EEPROM_6030_EEPROM_VERSION, \
|
||||
.eeprom_calib_ver = EEPROM_6030_TX_POWER_VERSION, \
|
||||
.nvm_ver = EEPROM_6030_EEPROM_VERSION, \
|
||||
.nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION, \
|
||||
.base_params = &iwl6000_g2_base_params, \
|
||||
.bt_params = &iwl6000_bt_params, \
|
||||
.eeprom_params = &iwl6000_eeprom_params, \
|
||||
@ -306,8 +306,8 @@ const struct iwl_cfg iwl130_bg_cfg = {
|
||||
.max_data_size = IWL60_RTC_DATA_SIZE, \
|
||||
.valid_tx_ant = ANT_BC, /* .cfg overwrite */ \
|
||||
.valid_rx_ant = ANT_BC, /* .cfg overwrite */ \
|
||||
.eeprom_ver = EEPROM_6000_EEPROM_VERSION, \
|
||||
.eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION, \
|
||||
.nvm_ver = EEPROM_6000_EEPROM_VERSION, \
|
||||
.nvm_calib_ver = EEPROM_6000_TX_POWER_VERSION, \
|
||||
.base_params = &iwl6000_base_params, \
|
||||
.eeprom_params = &iwl6000_eeprom_params, \
|
||||
.led_mode = IWL_LED_BLINK
|
||||
@ -337,8 +337,8 @@ const struct iwl_cfg iwl6000i_2bg_cfg = {
|
||||
.max_data_size = IWL60_RTC_DATA_SIZE, \
|
||||
.valid_tx_ant = ANT_AB, /* .cfg overwrite */ \
|
||||
.valid_rx_ant = ANT_AB, /* .cfg overwrite */ \
|
||||
.eeprom_ver = EEPROM_6050_EEPROM_VERSION, \
|
||||
.eeprom_calib_ver = EEPROM_6050_TX_POWER_VERSION, \
|
||||
.nvm_ver = EEPROM_6050_EEPROM_VERSION, \
|
||||
.nvm_calib_ver = EEPROM_6050_TX_POWER_VERSION, \
|
||||
.base_params = &iwl6050_base_params, \
|
||||
.eeprom_params = &iwl6000_eeprom_params, \
|
||||
.led_mode = IWL_LED_BLINK, \
|
||||
@ -362,8 +362,8 @@ const struct iwl_cfg iwl6050_2abg_cfg = {
|
||||
.device_family = IWL_DEVICE_FAMILY_6150, \
|
||||
.max_inst_size = IWL60_RTC_INST_SIZE, \
|
||||
.max_data_size = IWL60_RTC_DATA_SIZE, \
|
||||
.eeprom_ver = EEPROM_6150_EEPROM_VERSION, \
|
||||
.eeprom_calib_ver = EEPROM_6150_TX_POWER_VERSION, \
|
||||
.nvm_ver = EEPROM_6150_EEPROM_VERSION, \
|
||||
.nvm_calib_ver = EEPROM_6150_TX_POWER_VERSION, \
|
||||
.base_params = &iwl6050_base_params, \
|
||||
.eeprom_params = &iwl6000_eeprom_params, \
|
||||
.led_mode = IWL_LED_BLINK, \
|
||||
@ -389,8 +389,8 @@ const struct iwl_cfg iwl6000_3agn_cfg = {
|
||||
.device_family = IWL_DEVICE_FAMILY_6000,
|
||||
.max_inst_size = IWL60_RTC_INST_SIZE,
|
||||
.max_data_size = IWL60_RTC_DATA_SIZE,
|
||||
.eeprom_ver = EEPROM_6000_EEPROM_VERSION,
|
||||
.eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
|
||||
.nvm_ver = EEPROM_6000_EEPROM_VERSION,
|
||||
.nvm_calib_ver = EEPROM_6000_TX_POWER_VERSION,
|
||||
.base_params = &iwl6000_base_params,
|
||||
.eeprom_params = &iwl6000_eeprom_params,
|
||||
.ht_params = &iwl6000_ht_params,
|
||||
|
@ -267,6 +267,7 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
const struct iwl_cfg *cfg = (struct iwl_cfg *)(ent->driver_data);
|
||||
struct iwl_trans *iwl_trans;
|
||||
struct iwl_trans_pcie *trans_pcie;
|
||||
int ret;
|
||||
|
||||
iwl_trans = iwl_trans_pcie_alloc(pdev, ent, cfg);
|
||||
if (iwl_trans == NULL)
|
||||
@ -276,11 +277,15 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
|
||||
trans_pcie = IWL_TRANS_GET_PCIE_TRANS(iwl_trans);
|
||||
trans_pcie->drv = iwl_drv_start(iwl_trans, cfg);
|
||||
if (!trans_pcie->drv)
|
||||
|
||||
if (IS_ERR_OR_NULL(trans_pcie->drv)) {
|
||||
ret = PTR_ERR(trans_pcie->drv);
|
||||
goto out_free_trans;
|
||||
}
|
||||
|
||||
/* register transport layer debugfs here */
|
||||
if (iwl_trans_dbgfs_register(iwl_trans, iwl_trans->dbgfs_dir))
|
||||
ret = iwl_trans_dbgfs_register(iwl_trans, iwl_trans->dbgfs_dir);
|
||||
if (ret)
|
||||
goto out_free_drv;
|
||||
|
||||
return 0;
|
||||
@ -290,7 +295,7 @@ out_free_drv:
|
||||
out_free_trans:
|
||||
iwl_trans_pcie_free(iwl_trans);
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
return -EFAULT;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void iwl_pci_remove(struct pci_dev *pdev)
|
||||
|
@ -717,7 +717,7 @@ static void iwl_pcie_rx_handle(struct iwl_trans *trans)
|
||||
|
||||
/* uCode's read index (stored in shared DRAM) indicates the last Rx
|
||||
* buffer that the driver may process (last buffer filled by ucode). */
|
||||
r = le16_to_cpu(rxq->rb_stts->closed_rb_num) & 0x0FFF;
|
||||
r = le16_to_cpu(ACCESS_ONCE(rxq->rb_stts->closed_rb_num)) & 0x0FFF;
|
||||
i = rxq->read;
|
||||
|
||||
/* Rx interrupt, but nothing sent from uCode */
|
||||
@ -1122,12 +1122,20 @@ static irqreturn_t iwl_pcie_isr(int irq, void *data)
|
||||
* back-to-back ISRs and sporadic interrupts from our NIC.
|
||||
* If we have something to service, the tasklet will re-enable ints.
|
||||
* If we *don't* have something, we'll re-enable before leaving here. */
|
||||
inta_mask = iwl_read32(trans, CSR_INT_MASK); /* just for debug */
|
||||
inta_mask = iwl_read32(trans, CSR_INT_MASK);
|
||||
iwl_write32(trans, CSR_INT_MASK, 0x00000000);
|
||||
|
||||
/* Discover which interrupts are active/pending */
|
||||
inta = iwl_read32(trans, CSR_INT);
|
||||
|
||||
if (inta & (~inta_mask)) {
|
||||
IWL_DEBUG_ISR(trans,
|
||||
"We got a masked interrupt (0x%08x)...Ack and ignore\n",
|
||||
inta & (~inta_mask));
|
||||
iwl_write32(trans, CSR_INT, inta & (~inta_mask));
|
||||
inta &= inta_mask;
|
||||
}
|
||||
|
||||
/* Ignore interrupt if there's nothing in NIC to service.
|
||||
* This may be due to IRQ shared with another device,
|
||||
* or due to sporadic interrupts thrown from our NIC. */
|
||||
@ -1209,7 +1217,7 @@ irqreturn_t iwl_pcie_isr_ict(int irq, void *data)
|
||||
* If we have something to service, the tasklet will re-enable ints.
|
||||
* If we *don't* have something, we'll re-enable before leaving here.
|
||||
*/
|
||||
inta_mask = iwl_read32(trans, CSR_INT_MASK); /* just for debug */
|
||||
inta_mask = iwl_read32(trans, CSR_INT_MASK);
|
||||
iwl_write32(trans, CSR_INT_MASK, 0x00000000);
|
||||
|
||||
/* Ignore interrupt if there's nothing in NIC to service.
|
||||
|
@ -633,6 +633,8 @@ static void iwl_trans_pcie_stop_hw(struct iwl_trans *trans,
|
||||
iwl_disable_interrupts(trans);
|
||||
spin_unlock_irqrestore(&trans_pcie->irq_lock, flags);
|
||||
|
||||
iwl_pcie_disable_ict(trans);
|
||||
|
||||
if (!op_mode_leaving) {
|
||||
/*
|
||||
* Even if we stop the HW, we still want the RF kill
|
||||
@ -666,6 +668,20 @@ static u32 iwl_trans_pcie_read32(struct iwl_trans *trans, u32 ofs)
|
||||
return readl(IWL_TRANS_GET_PCIE_TRANS(trans)->hw_base + ofs);
|
||||
}
|
||||
|
||||
static u32 iwl_trans_pcie_read_prph(struct iwl_trans *trans, u32 reg)
|
||||
{
|
||||
iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_RADDR, reg | (3 << 24));
|
||||
return iwl_trans_pcie_read32(trans, HBUS_TARG_PRPH_RDAT);
|
||||
}
|
||||
|
||||
static void iwl_trans_pcie_write_prph(struct iwl_trans *trans, u32 addr,
|
||||
u32 val)
|
||||
{
|
||||
iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_WADDR,
|
||||
((addr & 0x0000FFFF) | (3 << 24)));
|
||||
iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_WDAT, val);
|
||||
}
|
||||
|
||||
static void iwl_trans_pcie_configure(struct iwl_trans *trans,
|
||||
const struct iwl_trans_config *trans_cfg)
|
||||
{
|
||||
@ -1221,6 +1237,8 @@ static const struct iwl_trans_ops trans_ops_pcie = {
|
||||
.write8 = iwl_trans_pcie_write8,
|
||||
.write32 = iwl_trans_pcie_write32,
|
||||
.read32 = iwl_trans_pcie_read32,
|
||||
.read_prph = iwl_trans_pcie_read_prph,
|
||||
.write_prph = iwl_trans_pcie_write_prph,
|
||||
.configure = iwl_trans_pcie_configure,
|
||||
.set_pmi = iwl_trans_pcie_set_pmi,
|
||||
};
|
||||
|
@ -2223,7 +2223,7 @@ static int __init init_mac80211_hwsim(void)
|
||||
IEEE80211_VHT_CAP_RXSTBC_2 |
|
||||
IEEE80211_VHT_CAP_RXSTBC_3 |
|
||||
IEEE80211_VHT_CAP_RXSTBC_4 |
|
||||
IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT;
|
||||
IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK;
|
||||
sband->vht_cap.vht_mcs.rx_mcs_map =
|
||||
cpu_to_le16(IEEE80211_VHT_MCS_SUPPORT_0_8 << 0 |
|
||||
IEEE80211_VHT_MCS_SUPPORT_0_8 << 2 |
|
||||
|
@ -5090,7 +5090,8 @@ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
|
||||
IEEE80211_HW_SUPPORTS_PS |
|
||||
IEEE80211_HW_PS_NULLFUNC_STACK |
|
||||
IEEE80211_HW_AMPDU_AGGREGATION |
|
||||
IEEE80211_HW_REPORTS_TX_ACK_STATUS;
|
||||
IEEE80211_HW_REPORTS_TX_ACK_STATUS |
|
||||
IEEE80211_HW_TEARDOWN_AGGR_ON_BAR_FAIL;
|
||||
|
||||
/*
|
||||
* Don't set IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING for USB devices
|
||||
|
@ -1170,6 +1170,7 @@ static struct usb_device_id rt2800usb_device_table[] = {
|
||||
{ USB_DEVICE(0x2001, 0x3c19) },
|
||||
{ USB_DEVICE(0x2001, 0x3c1c) },
|
||||
{ USB_DEVICE(0x2001, 0x3c1d) },
|
||||
{ USB_DEVICE(0x2001, 0x3c1e) },
|
||||
/* LG innotek */
|
||||
{ USB_DEVICE(0x043e, 0x7a22) },
|
||||
/* Panasonic */
|
||||
|
@ -392,10 +392,9 @@ void rt2x00lib_txdone(struct queue_entry *entry,
|
||||
tx_info->flags |= IEEE80211_TX_STAT_AMPDU;
|
||||
tx_info->status.ampdu_len = 1;
|
||||
tx_info->status.ampdu_ack_len = success ? 1 : 0;
|
||||
/*
|
||||
* TODO: Need to tear down BA session here
|
||||
* if not successful.
|
||||
*/
|
||||
|
||||
if (!success)
|
||||
tx_info->flags |= IEEE80211_TX_STAT_AMPDU_NO_BACK;
|
||||
}
|
||||
|
||||
if (rate_flags & IEEE80211_TX_RC_USE_RTS_CTS) {
|
||||
|
@ -1126,8 +1126,7 @@ static u32 ssb_tmslow_reject_bitmask(struct ssb_device *dev)
|
||||
case SSB_IDLOW_SSBREV_27: /* same here */
|
||||
return SSB_TMSLOW_REJECT; /* this is a guess */
|
||||
default:
|
||||
printk(KERN_INFO "ssb: Backplane Revision 0x%.8X\n", rev);
|
||||
WARN_ON(1);
|
||||
WARN(1, KERN_INFO "ssb: Backplane Revision 0x%.8X\n", rev);
|
||||
}
|
||||
return (SSB_TMSLOW_REJECT | SSB_TMSLOW_REJECT_23);
|
||||
}
|
||||
|
@ -22,6 +22,8 @@
|
||||
#define ATH9K_PLAT_EEP_MAX_WORDS 2048
|
||||
|
||||
struct ath9k_platform_data {
|
||||
const char *eeprom_name;
|
||||
|
||||
u16 eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS];
|
||||
u8 *macaddr;
|
||||
|
||||
|
@ -1251,32 +1251,34 @@ struct ieee80211_vht_operation {
|
||||
#define IEEE80211_VHT_MCS_NOT_SUPPORTED 3
|
||||
|
||||
/* 802.11ac VHT Capabilities */
|
||||
#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895 0x00000000
|
||||
#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991 0x00000001
|
||||
#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 0x00000002
|
||||
#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ 0x00000004
|
||||
#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ 0x00000008
|
||||
#define IEEE80211_VHT_CAP_RXLDPC 0x00000010
|
||||
#define IEEE80211_VHT_CAP_SHORT_GI_80 0x00000020
|
||||
#define IEEE80211_VHT_CAP_SHORT_GI_160 0x00000040
|
||||
#define IEEE80211_VHT_CAP_TXSTBC 0x00000080
|
||||
#define IEEE80211_VHT_CAP_RXSTBC_1 0x00000100
|
||||
#define IEEE80211_VHT_CAP_RXSTBC_2 0x00000200
|
||||
#define IEEE80211_VHT_CAP_RXSTBC_3 0x00000300
|
||||
#define IEEE80211_VHT_CAP_RXSTBC_4 0x00000400
|
||||
#define IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE 0x00000800
|
||||
#define IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE 0x00001000
|
||||
#define IEEE80211_VHT_CAP_BEAMFORMER_ANTENNAS_MAX 0x00006000
|
||||
#define IEEE80211_VHT_CAP_SOUNDING_DIMENTION_MAX 0x00030000
|
||||
#define IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE 0x00080000
|
||||
#define IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE 0x00100000
|
||||
#define IEEE80211_VHT_CAP_VHT_TXOP_PS 0x00200000
|
||||
#define IEEE80211_VHT_CAP_HTC_VHT 0x00400000
|
||||
#define IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT 0x00800000
|
||||
#define IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_UNSOL_MFB 0x08000000
|
||||
#define IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB 0x0c000000
|
||||
#define IEEE80211_VHT_CAP_RX_ANTENNA_PATTERN 0x10000000
|
||||
#define IEEE80211_VHT_CAP_TX_ANTENNA_PATTERN 0x20000000
|
||||
#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895 0x00000000
|
||||
#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991 0x00000001
|
||||
#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 0x00000002
|
||||
#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ 0x00000004
|
||||
#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ 0x00000008
|
||||
#define IEEE80211_VHT_CAP_RXLDPC 0x00000010
|
||||
#define IEEE80211_VHT_CAP_SHORT_GI_80 0x00000020
|
||||
#define IEEE80211_VHT_CAP_SHORT_GI_160 0x00000040
|
||||
#define IEEE80211_VHT_CAP_TXSTBC 0x00000080
|
||||
#define IEEE80211_VHT_CAP_RXSTBC_1 0x00000100
|
||||
#define IEEE80211_VHT_CAP_RXSTBC_2 0x00000200
|
||||
#define IEEE80211_VHT_CAP_RXSTBC_3 0x00000300
|
||||
#define IEEE80211_VHT_CAP_RXSTBC_4 0x00000400
|
||||
#define IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE 0x00000800
|
||||
#define IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE 0x00001000
|
||||
#define IEEE80211_VHT_CAP_BEAMFORMER_ANTENNAS_MAX 0x00006000
|
||||
#define IEEE80211_VHT_CAP_SOUNDING_DIMENTION_MAX 0x00030000
|
||||
#define IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE 0x00080000
|
||||
#define IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE 0x00100000
|
||||
#define IEEE80211_VHT_CAP_VHT_TXOP_PS 0x00200000
|
||||
#define IEEE80211_VHT_CAP_HTC_VHT 0x00400000
|
||||
#define IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT 23
|
||||
#define IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK \
|
||||
(7 << IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT)
|
||||
#define IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_UNSOL_MFB 0x08000000
|
||||
#define IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB 0x0c000000
|
||||
#define IEEE80211_VHT_CAP_RX_ANTENNA_PATTERN 0x10000000
|
||||
#define IEEE80211_VHT_CAP_TX_ANTENNA_PATTERN 0x20000000
|
||||
|
||||
/* Authentication algorithms */
|
||||
#define WLAN_AUTH_OPEN 0
|
||||
|
@ -1369,6 +1369,10 @@ struct ieee80211_tx_control {
|
||||
* @IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF: Use the P2P Device address for any
|
||||
* P2P Interface. This will be honoured even if more than one interface
|
||||
* is supported.
|
||||
*
|
||||
* @IEEE80211_HW_TEARDOWN_AGGR_ON_BAR_FAIL: On this hardware TX BA session
|
||||
* should be tear down once BAR frame will not be acked.
|
||||
*
|
||||
*/
|
||||
enum ieee80211_hw_flags {
|
||||
IEEE80211_HW_HAS_RATE_CONTROL = 1<<0,
|
||||
@ -1397,6 +1401,7 @@ enum ieee80211_hw_flags {
|
||||
IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23,
|
||||
IEEE80211_HW_SCAN_WHILE_IDLE = 1<<24,
|
||||
IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF = 1<<25,
|
||||
IEEE80211_HW_TEARDOWN_AGGR_ON_BAR_FAIL = 1<<26,
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -445,7 +445,7 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid,
|
||||
|
||||
trace_api_start_tx_ba_session(pubsta, tid);
|
||||
|
||||
if (WARN_ON(!local->ops->ampdu_action))
|
||||
if (WARN_ON_ONCE(!local->ops->ampdu_action))
|
||||
return -EINVAL;
|
||||
|
||||
if ((tid >= IEEE80211_NUM_TIDS) ||
|
||||
|
@ -199,6 +199,22 @@ static ssize_t key_icverrors_read(struct file *file, char __user *userbuf,
|
||||
}
|
||||
KEY_OPS(icverrors);
|
||||
|
||||
static ssize_t key_mic_failures_read(struct file *file, char __user *userbuf,
|
||||
size_t count, loff_t *ppos)
|
||||
{
|
||||
struct ieee80211_key *key = file->private_data;
|
||||
char buf[20];
|
||||
int len;
|
||||
|
||||
if (key->conf.cipher != WLAN_CIPHER_SUITE_TKIP)
|
||||
return -EINVAL;
|
||||
|
||||
len = scnprintf(buf, sizeof(buf), "%u\n", key->u.tkip.mic_failures);
|
||||
|
||||
return simple_read_from_buffer(userbuf, count, ppos, buf, len);
|
||||
}
|
||||
KEY_OPS(mic_failures);
|
||||
|
||||
static ssize_t key_key_read(struct file *file, char __user *userbuf,
|
||||
size_t count, loff_t *ppos)
|
||||
{
|
||||
@ -260,6 +276,7 @@ void ieee80211_debugfs_key_add(struct ieee80211_key *key)
|
||||
DEBUGFS_ADD(rx_spec);
|
||||
DEBUGFS_ADD(replays);
|
||||
DEBUGFS_ADD(icverrors);
|
||||
DEBUGFS_ADD(mic_failures);
|
||||
DEBUGFS_ADD(key);
|
||||
DEBUGFS_ADD(ifindex);
|
||||
};
|
||||
|
@ -201,6 +201,20 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
|
||||
bss_change |= BSS_CHANGED_BASIC_RATES;
|
||||
bss_change |= BSS_CHANGED_HT;
|
||||
bss_change |= BSS_CHANGED_IBSS;
|
||||
|
||||
/*
|
||||
* In 5 GHz/802.11a, we can always use short slot time.
|
||||
* (IEEE 802.11-2012 18.3.8.7)
|
||||
*
|
||||
* In 2.4GHz, we must always use long slots in IBSS for compatibility
|
||||
* reasons.
|
||||
* (IEEE 802.11-2012 19.4.5)
|
||||
*
|
||||
* HT follows these specifications (IEEE 802.11-2012 20.3.18)
|
||||
*/
|
||||
sdata->vif.bss_conf.use_short_slot = chan->band == IEEE80211_BAND_5GHZ;
|
||||
bss_change |= BSS_CHANGED_ERP_SLOT;
|
||||
|
||||
sdata->vif.bss_conf.ibss_joined = true;
|
||||
sdata->vif.bss_conf.ibss_creator = creator;
|
||||
ieee80211_bss_info_change_notify(sdata, bss_change);
|
||||
|
@ -862,7 +862,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
|
||||
rcu_assign_pointer(local->p2p_sdata, NULL);
|
||||
/* fall through */
|
||||
default:
|
||||
flush_work(&sdata->work);
|
||||
cancel_work_sync(&sdata->work);
|
||||
/*
|
||||
* When we get here, the interface is marked down.
|
||||
* Call rcu_barrier() to wait both for the RX path
|
||||
|
@ -81,6 +81,9 @@ struct ieee80211_key {
|
||||
|
||||
/* last received RSC */
|
||||
struct tkip_ctx rx[IEEE80211_NUM_TIDS];
|
||||
|
||||
/* number of mic failures */
|
||||
u32 mic_failures;
|
||||
} tkip;
|
||||
struct {
|
||||
atomic64_t tx_pn;
|
||||
|
@ -2360,9 +2360,9 @@ ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
|
||||
|
||||
return RX_MGMT_CFG80211_RX_ASSOC;
|
||||
}
|
||||
|
||||
static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
|
||||
struct ieee80211_mgmt *mgmt,
|
||||
size_t len,
|
||||
struct ieee80211_mgmt *mgmt, size_t len,
|
||||
struct ieee80211_rx_status *rx_status,
|
||||
struct ieee802_11_elems *elems,
|
||||
bool beacon)
|
||||
|
@ -154,6 +154,7 @@ minstrel_tx_status(void *priv, struct ieee80211_supported_band *sband,
|
||||
struct ieee80211_sta *sta, void *priv_sta,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
struct minstrel_priv *mp = priv;
|
||||
struct minstrel_sta_info *mi = priv_sta;
|
||||
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
|
||||
struct ieee80211_tx_rate *ar = info->status.rates;
|
||||
@ -181,6 +182,10 @@ minstrel_tx_status(void *priv, struct ieee80211_supported_band *sband,
|
||||
|
||||
if (mi->sample_deferred > 0)
|
||||
mi->sample_deferred--;
|
||||
|
||||
if (time_after(jiffies, mi->stats_update +
|
||||
(mp->update_interval * HZ) / 1000))
|
||||
minstrel_update_stats(mp, mi);
|
||||
}
|
||||
|
||||
|
||||
@ -235,10 +240,6 @@ minstrel_get_rate(void *priv, struct ieee80211_sta *sta,
|
||||
|
||||
mrr = mp->has_mrr && !txrc->rts && !txrc->bss_conf->use_cts_prot;
|
||||
|
||||
if (time_after(jiffies, mi->stats_update + (mp->update_interval *
|
||||
HZ) / 1000))
|
||||
minstrel_update_stats(mp, mi);
|
||||
|
||||
ndx = mi->max_tp_rate;
|
||||
|
||||
if (mrr)
|
||||
|
@ -378,9 +378,6 @@ ieee80211_rx_monitor(struct ieee80211_local *local, struct sk_buff *origskb,
|
||||
* the SKB because it has a bad FCS/PLCP checksum.
|
||||
*/
|
||||
|
||||
/* room for the radiotap header based on driver features */
|
||||
needed_headroom = ieee80211_rx_radiotap_space(local, status);
|
||||
|
||||
if (local->hw.flags & IEEE80211_HW_RX_INCLUDES_FCS)
|
||||
present_fcs_len = FCS_LEN;
|
||||
|
||||
@ -399,6 +396,9 @@ ieee80211_rx_monitor(struct ieee80211_local *local, struct sk_buff *origskb,
|
||||
return remove_monitor_info(local, origskb);
|
||||
}
|
||||
|
||||
/* room for the radiotap header based on driver features */
|
||||
needed_headroom = ieee80211_rx_radiotap_space(local, status);
|
||||
|
||||
if (should_drop_frame(origskb, present_fcs_len)) {
|
||||
/* only need to expand headroom if necessary */
|
||||
skb = origskb;
|
||||
@ -2333,7 +2333,8 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
|
||||
if (len < IEEE80211_MIN_ACTION_SIZE)
|
||||
return RX_DROP_UNUSABLE;
|
||||
|
||||
if (!rx->sta && mgmt->u.action.category != WLAN_CATEGORY_PUBLIC)
|
||||
if (!rx->sta && mgmt->u.action.category != WLAN_CATEGORY_PUBLIC &&
|
||||
mgmt->u.action.category != WLAN_CATEGORY_SELF_PROTECTED)
|
||||
return RX_DROP_UNUSABLE;
|
||||
|
||||
if (!(status->rx_flags & IEEE80211_RX_RA_MATCH))
|
||||
|
@ -118,7 +118,7 @@ ieee80211_bss_info_update(struct ieee80211_local *local,
|
||||
struct ieee80211_tim_ie *tim_ie = elems->tim;
|
||||
bss->dtim_period = tim_ie->dtim_period;
|
||||
if (!elems->parse_error)
|
||||
bss->valid_data |= IEEE80211_BSS_VALID_DTIM;
|
||||
bss->valid_data |= IEEE80211_BSS_VALID_DTIM;
|
||||
}
|
||||
|
||||
/* If the beacon had no TIM IE, or it was invalid, use 1 */
|
||||
|
@ -502,7 +502,11 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
|
||||
IEEE80211_BAR_CTRL_TID_INFO_MASK) >>
|
||||
IEEE80211_BAR_CTRL_TID_INFO_SHIFT;
|
||||
|
||||
ieee80211_set_bar_pending(sta, tid, ssn);
|
||||
if (local->hw.flags &
|
||||
IEEE80211_HW_TEARDOWN_AGGR_ON_BAR_FAIL)
|
||||
ieee80211_stop_tx_ba_session(&sta->sta, tid);
|
||||
else
|
||||
ieee80211_set_bar_pending(sta, tid, ssn);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,7 @@ ieee80211_rx_h_michael_mic_verify(struct ieee80211_rx_data *rx)
|
||||
*/
|
||||
if (status->flag & (RX_FLAG_MMIC_STRIPPED | RX_FLAG_IV_STRIPPED)) {
|
||||
if (status->flag & RX_FLAG_MMIC_ERROR)
|
||||
goto mic_fail;
|
||||
goto mic_fail_no_key;
|
||||
|
||||
if (!(status->flag & RX_FLAG_IV_STRIPPED) && rx->key &&
|
||||
rx->key->conf.cipher == WLAN_CIPHER_SUITE_TKIP)
|
||||
@ -161,6 +161,9 @@ update_iv:
|
||||
return RX_CONTINUE;
|
||||
|
||||
mic_fail:
|
||||
rx->key->u.tkip.mic_failures++;
|
||||
|
||||
mic_fail_no_key:
|
||||
/*
|
||||
* In some cases the key can be unset - e.g. a multicast packet, in
|
||||
* a driver that supports HW encryption. Send up the key idx only if
|
||||
|
@ -265,6 +265,9 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy,
|
||||
|
||||
/* TODO: missing regulatory check on 80/160 bandwidth */
|
||||
|
||||
if (width > 20)
|
||||
prohibited_flags |= IEEE80211_CHAN_NO_OFDM;
|
||||
|
||||
if (!cfg80211_secondary_chans_ok(wiphy, chandef->center_freq1,
|
||||
width, prohibited_flags))
|
||||
return false;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user