diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2010-02-04 07:08:08 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-02-08 16:50:56 -0500 |
commit | 5f6393ecf5cc7d064ba9172e0a2e1c64bcaaaf2f (patch) | |
tree | 818b958088881d7d541c65987d73e0cccd9c4787 /drivers | |
parent | 9442e5b58edb4a108ec5aae420a6fff3a63acab0 (diff) |
b43: N-PHY: load generated samples
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/b43/phy_n.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c index 74642d43e1ff..074b34c3b383 100644 --- a/drivers/net/wireless/b43/phy_n.c +++ b/drivers/net/wireless/b43/phy_n.c | |||
@@ -1017,6 +1017,33 @@ static void b43_nphy_workarounds(struct b43_wldev *dev) | |||
1017 | b43_nphy_stay_in_carrier_search(dev, 0); | 1017 | b43_nphy_stay_in_carrier_search(dev, 0); |
1018 | } | 1018 | } |
1019 | 1019 | ||
1020 | /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/LoadSampleTable */ | ||
1021 | static int b43_nphy_load_samples(struct b43_wldev *dev, | ||
1022 | struct b43_c32 *samples, u16 len) { | ||
1023 | struct b43_phy_n *nphy = dev->phy.n; | ||
1024 | u16 i; | ||
1025 | u32 *data; | ||
1026 | |||
1027 | data = kzalloc(len * sizeof(u32), GFP_KERNEL); | ||
1028 | if (!data) { | ||
1029 | b43err(dev->wl, "allocation for samples loading failed\n"); | ||
1030 | return -ENOMEM; | ||
1031 | } | ||
1032 | if (nphy->hang_avoid) | ||
1033 | b43_nphy_stay_in_carrier_search(dev, 1); | ||
1034 | |||
1035 | for (i = 0; i < len; i++) { | ||
1036 | data[i] = (samples[i].i & 0x3FF << 10); | ||
1037 | data[i] |= samples[i].q & 0x3FF; | ||
1038 | } | ||
1039 | b43_ntab_write_bulk(dev, B43_NTAB32(17, 0), len, data); | ||
1040 | |||
1041 | kfree(data); | ||
1042 | if (nphy->hang_avoid) | ||
1043 | b43_nphy_stay_in_carrier_search(dev, 0); | ||
1044 | return 0; | ||
1045 | } | ||
1046 | |||
1020 | /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/GenLoadSamples */ | 1047 | /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/GenLoadSamples */ |
1021 | static u16 b43_nphy_gen_load_samples(struct b43_wldev *dev, u32 freq, u16 max, | 1048 | static u16 b43_nphy_gen_load_samples(struct b43_wldev *dev, u32 freq, u16 max, |
1022 | bool test) | 1049 | bool test) |
@@ -1052,9 +1079,9 @@ static u16 b43_nphy_gen_load_samples(struct b43_wldev *dev, u32 freq, u16 max, | |||
1052 | samples[i].i = CORDIC_CONVERT(samples[i].i * max); | 1079 | samples[i].i = CORDIC_CONVERT(samples[i].i * max); |
1053 | } | 1080 | } |
1054 | 1081 | ||
1055 | /* TODO: Call N PHY Load Sample Table with buffer, len as arguments */ | 1082 | i = b43_nphy_load_samples(dev, samples, len); |
1056 | kfree(samples); | 1083 | kfree(samples); |
1057 | return len; | 1084 | return (i < 0) ? 0 : len; |
1058 | } | 1085 | } |
1059 | 1086 | ||
1060 | /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/RunSamples */ | 1087 | /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/RunSamples */ |