diff options
author | Joerg Albert <jal2@gmx.de> | 2009-09-15 16:20:22 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-10-07 16:39:38 -0400 |
commit | 90f2908d3263e5c84c8408ce382a669b528b10e3 (patch) | |
tree | b0746abff202b7bb17ca8f900abf3f3e4d41d9af | |
parent | 9554b34ad5817f424253aab265d0e2a54207f810 (diff) |
ar9170: fixed coding style, moved define
This patch fixes some coding style issues and moves MAX_RATE_POWER into hw.h
Signed-off-by: Joerg Albert <jal2@gmx.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath/ar9170/hw.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ar9170/phy.c | 28 |
2 files changed, 17 insertions, 13 deletions
diff --git a/drivers/net/wireless/ath/ar9170/hw.h b/drivers/net/wireless/ath/ar9170/hw.h index 6cbfb2f83391..88113148331c 100644 --- a/drivers/net/wireless/ath/ar9170/hw.h +++ b/drivers/net/wireless/ath/ar9170/hw.h | |||
@@ -311,6 +311,8 @@ struct ar9170_tx_control { | |||
311 | 311 | ||
312 | #define AR9170_TX_PHY_SHORT_GI 0x80000000 | 312 | #define AR9170_TX_PHY_SHORT_GI 0x80000000 |
313 | 313 | ||
314 | #define AR5416_MAX_RATE_POWER 63 | ||
315 | |||
314 | struct ar9170_rx_head { | 316 | struct ar9170_rx_head { |
315 | u8 plcp[12]; | 317 | u8 plcp[12]; |
316 | } __packed; | 318 | } __packed; |
diff --git a/drivers/net/wireless/ath/ar9170/phy.c b/drivers/net/wireless/ath/ar9170/phy.c index dbd488da18b1..07625a97851c 100644 --- a/drivers/net/wireless/ath/ar9170/phy.c +++ b/drivers/net/wireless/ath/ar9170/phy.c | |||
@@ -1239,9 +1239,6 @@ static u8 ar9170_get_max_edge_power(struct ar9170 *ar, | |||
1239 | struct ar9170_calctl_edges edges[], | 1239 | struct ar9170_calctl_edges edges[], |
1240 | u32 freq) | 1240 | u32 freq) |
1241 | { | 1241 | { |
1242 | /* TODO: move somewhere else */ | ||
1243 | #define AR5416_MAX_RATE_POWER 63 | ||
1244 | |||
1245 | int i; | 1242 | int i; |
1246 | u8 rc = AR5416_MAX_RATE_POWER; | 1243 | u8 rc = AR5416_MAX_RATE_POWER; |
1247 | u8 f; | 1244 | u8 f; |
@@ -1259,10 +1256,11 @@ static u8 ar9170_get_max_edge_power(struct ar9170 *ar, | |||
1259 | break; | 1256 | break; |
1260 | } | 1257 | } |
1261 | if (i > 0 && f < edges[i].channel) { | 1258 | if (i > 0 && f < edges[i].channel) { |
1262 | if (f > edges[i-1].channel && | 1259 | if (f > edges[i - 1].channel && |
1263 | edges[i-1].power_flags & AR9170_CALCTL_EDGE_FLAGS) { | 1260 | edges[i - 1].power_flags & |
1261 | AR9170_CALCTL_EDGE_FLAGS) { | ||
1264 | /* lower channel has the inband flag set */ | 1262 | /* lower channel has the inband flag set */ |
1265 | rc = edges[i-1].power_flags & | 1263 | rc = edges[i - 1].power_flags & |
1266 | ~AR9170_CALCTL_EDGE_FLAGS; | 1264 | ~AR9170_CALCTL_EDGE_FLAGS; |
1267 | } | 1265 | } |
1268 | break; | 1266 | break; |
@@ -1270,10 +1268,10 @@ static u8 ar9170_get_max_edge_power(struct ar9170 *ar, | |||
1270 | } | 1268 | } |
1271 | 1269 | ||
1272 | if (i == AR5416_NUM_BAND_EDGES) { | 1270 | if (i == AR5416_NUM_BAND_EDGES) { |
1273 | if (f > edges[i-1].channel && | 1271 | if (f > edges[i - 1].channel && |
1274 | edges[i-1].power_flags & AR9170_CALCTL_EDGE_FLAGS) { | 1272 | edges[i - 1].power_flags & AR9170_CALCTL_EDGE_FLAGS) { |
1275 | /* lower channel has the inband flag set */ | 1273 | /* lower channel has the inband flag set */ |
1276 | rc = edges[i-1].power_flags & | 1274 | rc = edges[i - 1].power_flags & |
1277 | ~AR9170_CALCTL_EDGE_FLAGS; | 1275 | ~AR9170_CALCTL_EDGE_FLAGS; |
1278 | } | 1276 | } |
1279 | } | 1277 | } |
@@ -1295,7 +1293,8 @@ static void ar9170_calc_ctl(struct ar9170 *ar, u32 freq, enum ar9170_bw bw) | |||
1295 | int pwr_cal_len; | 1293 | int pwr_cal_len; |
1296 | } *modes; | 1294 | } *modes; |
1297 | 1295 | ||
1298 | /* order is relevant in the mode_list_*: we fall back to the | 1296 | /* |
1297 | * order is relevant in the mode_list_*: we fall back to the | ||
1299 | * lower indices if any mode is missed in the EEPROM. | 1298 | * lower indices if any mode is missed in the EEPROM. |
1300 | */ | 1299 | */ |
1301 | struct ctl_modes mode_list_2ghz[] = { | 1300 | struct ctl_modes mode_list_2ghz[] = { |
@@ -1313,7 +1312,8 @@ static void ar9170_calc_ctl(struct ar9170 *ar, u32 freq, enum ar9170_bw bw) | |||
1313 | 1312 | ||
1314 | #define EDGES(c, n) (ar->eeprom.ctl_data[c].control_edges[n]) | 1313 | #define EDGES(c, n) (ar->eeprom.ctl_data[c].control_edges[n]) |
1315 | 1314 | ||
1316 | /* TODO: investigate the differences between OTUS' | 1315 | /* |
1316 | * TODO: investigate the differences between OTUS' | ||
1317 | * hpreg.c::zfHpGetRegulatoryDomain() and | 1317 | * hpreg.c::zfHpGetRegulatoryDomain() and |
1318 | * ath/regd.c::ath_regd_get_band_ctl() - | 1318 | * ath/regd.c::ath_regd_get_band_ctl() - |
1319 | * e.g. for FCC3_WORLD the OTUS procedure | 1319 | * e.g. for FCC3_WORLD the OTUS procedure |
@@ -1360,13 +1360,15 @@ static void ar9170_calc_ctl(struct ar9170 *ar, u32 freq, enum ar9170_bw bw) | |||
1360 | ar9170_get_max_edge_power(ar, EDGES(ctl_idx, 1), | 1360 | ar9170_get_max_edge_power(ar, EDGES(ctl_idx, 1), |
1361 | freq+f_off); | 1361 | freq+f_off); |
1362 | 1362 | ||
1363 | /* TODO: check if the regulatory max. power is | 1363 | /* |
1364 | * TODO: check if the regulatory max. power is | ||
1364 | * controlled by cfg80211 for DFS | 1365 | * controlled by cfg80211 for DFS |
1365 | * (hpmain applies it to max_power itself for DFS freq) | 1366 | * (hpmain applies it to max_power itself for DFS freq) |
1366 | */ | 1367 | */ |
1367 | 1368 | ||
1368 | } else { | 1369 | } else { |
1369 | /* Workaround in otus driver, hpmain.c, line 3906: | 1370 | /* |
1371 | * Workaround in otus driver, hpmain.c, line 3906: | ||
1370 | * if no data for 5GHT20 are found, take the | 1372 | * if no data for 5GHT20 are found, take the |
1371 | * legacy 5G value. | 1373 | * legacy 5G value. |
1372 | * We extend this here to fallback from any other *HT or | 1374 | * We extend this here to fallback from any other *HT or |