-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 134408 b: refs/heads/master c: 6c1bb92 h: refs/heads/master v: v3
- Loading branch information
Michael Buesch
authored and
John W. Linville
committed
Feb 9, 2009
1 parent
428bf55
commit bc56694
Showing
6 changed files
with
229 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 3302e44dcdb8aff99769921af12b916a914b6317 | ||
refs/heads/master: 6c1bb9276c492c803611e63fa6fab8276c02ee70 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/* | ||
Broadcom B43 wireless driver | ||
IEEE 802.11g LP-PHY and radio device data tables | ||
Copyright (c) 2009 Michael Buesch <mb@bu3sch.de> | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 2 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program; see the file COPYING. If not, write to | ||
the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, | ||
Boston, MA 02110-1301, USA. | ||
*/ | ||
|
||
#include "b43.h" | ||
#include "tables_lpphy.h" | ||
#include "phy_common.h" | ||
#include "phy_lp.h" | ||
|
||
|
||
u32 b43_lptab_read(struct b43_wldev *dev, u32 offset) | ||
{ | ||
u32 type, value; | ||
|
||
type = offset & B43_LPTAB_TYPEMASK; | ||
offset &= ~B43_LPTAB_TYPEMASK; | ||
B43_WARN_ON(offset > 0xFFFF); | ||
|
||
switch (type) { | ||
case B43_LPTAB_8BIT: | ||
b43_phy_write(dev, B43_LPPHY_TABLE_ADDR, offset); | ||
value = b43_phy_read(dev, B43_LPPHY_TABLEDATALO) & 0xFF; | ||
break; | ||
case B43_LPTAB_16BIT: | ||
b43_phy_write(dev, B43_LPPHY_TABLE_ADDR, offset); | ||
value = b43_phy_read(dev, B43_LPPHY_TABLEDATALO); | ||
break; | ||
case B43_LPTAB_32BIT: | ||
b43_phy_write(dev, B43_LPPHY_TABLE_ADDR, offset); | ||
value = b43_phy_read(dev, B43_LPPHY_TABLEDATAHI); | ||
value <<= 16; | ||
value |= b43_phy_read(dev, B43_LPPHY_TABLEDATALO); | ||
break; | ||
default: | ||
B43_WARN_ON(1); | ||
value = 0; | ||
} | ||
|
||
return value; | ||
} | ||
|
||
void b43_lptab_write(struct b43_wldev *dev, u32 offset, u32 value) | ||
{ | ||
u32 type; | ||
|
||
type = offset & B43_LPTAB_TYPEMASK; | ||
offset &= ~B43_LPTAB_TYPEMASK; | ||
B43_WARN_ON(offset > 0xFFFF); | ||
|
||
switch (type) { | ||
case B43_LPTAB_8BIT: | ||
B43_WARN_ON(value & ~0xFF); | ||
b43_phy_write(dev, B43_LPPHY_TABLE_ADDR, offset); | ||
b43_phy_write(dev, B43_LPPHY_TABLEDATALO, value); | ||
break; | ||
case B43_LPTAB_16BIT: | ||
B43_WARN_ON(value & ~0xFFFF); | ||
b43_phy_write(dev, B43_LPPHY_TABLE_ADDR, offset); | ||
b43_phy_write(dev, B43_LPPHY_TABLEDATALO, value); | ||
break; | ||
case B43_LPTAB_32BIT: | ||
b43_phy_write(dev, B43_LPPHY_TABLE_ADDR, offset); | ||
b43_phy_write(dev, B43_LPPHY_TABLEDATAHI, value >> 16); | ||
b43_phy_write(dev, B43_LPPHY_TABLEDATALO, value); | ||
break; | ||
default: | ||
B43_WARN_ON(1); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#ifndef B43_TABLES_LPPHY_H_ | ||
#define B43_TABLES_LPPHY_H_ | ||
|
||
|
||
#define B43_LPTAB_TYPEMASK 0xF0000000 | ||
#define B43_LPTAB_8BIT 0x10000000 | ||
#define B43_LPTAB_16BIT 0x20000000 | ||
#define B43_LPTAB_32BIT 0x30000000 | ||
#define B43_LPTAB8(table, offset) (((table) << 10) | (offset) | B43_LPTAB_8BIT) | ||
#define B43_LPTAB16(table, offset) (((table) << 10) | (offset) | B43_LPTAB_16BIT) | ||
#define B43_LPTAB32(table, offset) (((table) << 10) | (offset) | B43_LPTAB_32BIT) | ||
|
||
/* Table definitions */ | ||
#define B43_LPTAB_TXPWR_R2PLUS B43_LPTAB32(0x07, 0) /* TX power lookup table (rev >= 2) */ | ||
#define B43_LPTAB_TXPWR_R0_1 B43_LPTAB32(0xA0, 0) /* TX power lookup table (rev < 2) */ | ||
|
||
u32 b43_lptab_read(struct b43_wldev *dev, u32 offset); | ||
void b43_lptab_write(struct b43_wldev *dev, u32 offset, u32 value); | ||
|
||
|
||
#endif /* B43_TABLES_LPPHY_H_ */ |