diff options
Diffstat (limited to 'drivers/net/wireless/bcm43xx/bcm43xx_ilt.c')
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx_ilt.c | 42 |
1 files changed, 6 insertions, 36 deletions
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_ilt.c b/drivers/net/wireless/bcm43xx/bcm43xx_ilt.c index 22587e0e1a05..865ed5c33613 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_ilt.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_ilt.c | |||
@@ -312,20 +312,22 @@ const u16 bcm43xx_ilt_sigmasqr2[BCM43xx_ILT_SIGMASQR_SIZE] = { | |||
312 | 312 | ||
313 | /**** Helper functions to access the device Internal Lookup Tables ****/ | 313 | /**** Helper functions to access the device Internal Lookup Tables ****/ |
314 | 314 | ||
315 | void bcm43xx_ilt_write16(struct bcm43xx_private *bcm, u16 offset, u16 val) | 315 | void bcm43xx_ilt_write(struct bcm43xx_private *bcm, u16 offset, u16 val) |
316 | { | 316 | { |
317 | if ( bcm->current_core->phy->type == BCM43xx_PHYTYPE_A ) { | 317 | if (bcm->current_core->phy->type == BCM43xx_PHYTYPE_A) { |
318 | bcm43xx_phy_write(bcm, BCM43xx_PHY_ILT_A_CTRL, offset); | 318 | bcm43xx_phy_write(bcm, BCM43xx_PHY_ILT_A_CTRL, offset); |
319 | mmiowb(); | ||
319 | bcm43xx_phy_write(bcm, BCM43xx_PHY_ILT_A_DATA1, val); | 320 | bcm43xx_phy_write(bcm, BCM43xx_PHY_ILT_A_DATA1, val); |
320 | } else { | 321 | } else { |
321 | bcm43xx_phy_write(bcm, BCM43xx_PHY_ILT_G_CTRL, offset); | 322 | bcm43xx_phy_write(bcm, BCM43xx_PHY_ILT_G_CTRL, offset); |
323 | mmiowb(); | ||
322 | bcm43xx_phy_write(bcm, BCM43xx_PHY_ILT_G_DATA1, val); | 324 | bcm43xx_phy_write(bcm, BCM43xx_PHY_ILT_G_DATA1, val); |
323 | } | 325 | } |
324 | } | 326 | } |
325 | 327 | ||
326 | u16 bcm43xx_ilt_read16(struct bcm43xx_private *bcm, u16 offset) | 328 | u16 bcm43xx_ilt_read(struct bcm43xx_private *bcm, u16 offset) |
327 | { | 329 | { |
328 | if ( bcm->current_core->phy->type == BCM43xx_PHYTYPE_A ) { | 330 | if (bcm->current_core->phy->type == BCM43xx_PHYTYPE_A) { |
329 | bcm43xx_phy_write(bcm, BCM43xx_PHY_ILT_A_CTRL, offset); | 331 | bcm43xx_phy_write(bcm, BCM43xx_PHY_ILT_A_CTRL, offset); |
330 | return bcm43xx_phy_read(bcm, BCM43xx_PHY_ILT_A_DATA1); | 332 | return bcm43xx_phy_read(bcm, BCM43xx_PHY_ILT_A_DATA1); |
331 | } else { | 333 | } else { |
@@ -333,35 +335,3 @@ u16 bcm43xx_ilt_read16(struct bcm43xx_private *bcm, u16 offset) | |||
333 | return bcm43xx_phy_read(bcm, BCM43xx_PHY_ILT_G_DATA1); | 335 | return bcm43xx_phy_read(bcm, BCM43xx_PHY_ILT_G_DATA1); |
334 | } | 336 | } |
335 | } | 337 | } |
336 | |||
337 | void bcm43xx_ilt_write32(struct bcm43xx_private *bcm, u16 offset, u32 val) | ||
338 | { | ||
339 | if ( bcm->current_core->phy->type == BCM43xx_PHYTYPE_A ) { | ||
340 | bcm43xx_phy_write(bcm, BCM43xx_PHY_ILT_A_CTRL, offset); | ||
341 | bcm43xx_phy_write(bcm, BCM43xx_PHY_ILT_A_DATA2, (u16)(val >> 16)); | ||
342 | bcm43xx_phy_write(bcm, BCM43xx_PHY_ILT_A_DATA1, (u16)(val & 0x0000FFFF)); | ||
343 | } else { | ||
344 | bcm43xx_phy_write(bcm, BCM43xx_PHY_ILT_G_CTRL, offset); | ||
345 | bcm43xx_phy_write(bcm, BCM43xx_PHY_ILT_G_DATA2, (u16)(val >> 16)); | ||
346 | bcm43xx_phy_write(bcm, BCM43xx_PHY_ILT_G_DATA1, (u16)(val & 0x0000FFFF)); | ||
347 | } | ||
348 | } | ||
349 | |||
350 | u32 bcm43xx_ilt_read32(struct bcm43xx_private *bcm, u16 offset) | ||
351 | { | ||
352 | u32 ret; | ||
353 | |||
354 | if ( bcm->current_core->phy->type == BCM43xx_PHYTYPE_A ) { | ||
355 | bcm43xx_phy_write(bcm, BCM43xx_PHY_ILT_A_CTRL, offset); | ||
356 | ret = bcm43xx_phy_read(bcm, BCM43xx_PHY_ILT_A_DATA2); | ||
357 | ret <<= 16; | ||
358 | ret |= bcm43xx_phy_read(bcm, BCM43xx_PHY_ILT_A_DATA1); | ||
359 | } else { | ||
360 | bcm43xx_phy_write(bcm, BCM43xx_PHY_ILT_G_CTRL, offset); | ||
361 | ret = bcm43xx_phy_read(bcm, BCM43xx_PHY_ILT_G_DATA2); | ||
362 | ret <<= 16; | ||
363 | ret |= bcm43xx_phy_read(bcm, BCM43xx_PHY_ILT_G_DATA1); | ||
364 | } | ||
365 | |||
366 | return ret; | ||
367 | } | ||