aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlegacy
diff options
context:
space:
mode:
authorStanislaw Gruszka <sgruszka@redhat.com>2012-02-13 05:23:15 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-02-22 14:51:13 -0500
commit527901d0aeb233a479123b7e5f542fbc911ccf6d (patch)
tree4f9cd6088f02bbd4c1bba4a30a016c1ba3debb06 /drivers/net/wireless/iwlegacy
parent93b7654ec563a929a62da70324e834eeb18a2778 (diff)
iwlegacy: remove temp_ops
Remove unneeded structure and cleanup temperature calibration routines a bit. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlegacy')
-rw-r--r--drivers/net/wireless/iwlegacy/4965-mac.c26
-rw-r--r--drivers/net/wireless/iwlegacy/4965.c5
-rw-r--r--drivers/net/wireless/iwlegacy/4965.h1
-rw-r--r--drivers/net/wireless/iwlegacy/common.h8
4 files changed, 15 insertions, 25 deletions
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index 36f85f289a25..e113dc5b1c2e 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -1343,12 +1343,11 @@ il4965_accumulative_stats(struct il_priv *il, __le32 * stats)
1343} 1343}
1344#endif 1344#endif
1345 1345
1346#define REG_RECALIB_PERIOD (60)
1347
1348void 1346void
1349il4965_hdl_stats(struct il_priv *il, struct il_rx_buf *rxb) 1347il4965_hdl_stats(struct il_priv *il, struct il_rx_buf *rxb)
1350{ 1348{
1351 int change; 1349 const int recalib_seconds = 60;
1350 bool change;
1352 struct il_rx_pkt *pkt = rxb_addr(rxb); 1351 struct il_rx_pkt *pkt = rxb_addr(rxb);
1353 1352
1354 D_RX("Statistics notification received (%d vs %d).\n", 1353 D_RX("Statistics notification received (%d vs %d).\n",
@@ -1369,20 +1368,21 @@ il4965_hdl_stats(struct il_priv *il, struct il_rx_buf *rxb)
1369 1368
1370 set_bit(S_STATS, &il->status); 1369 set_bit(S_STATS, &il->status);
1371 1370
1372 /* Reschedule the stats timer to occur in 1371 /*
1373 * REG_RECALIB_PERIOD seconds to ensure we get a 1372 * Reschedule the stats timer to occur in recalib_seconds to ensure
1374 * thermal update even if the uCode doesn't give 1373 * we get a thermal update even if the uCode doesn't give us one
1375 * us one */ 1374 */
1376 mod_timer(&il->stats_periodic, 1375 mod_timer(&il->stats_periodic,
1377 jiffies + msecs_to_jiffies(REG_RECALIB_PERIOD * 1000)); 1376 jiffies + msecs_to_jiffies(recalib_seconds * 1000));
1378 1377
1379 if (unlikely(!test_bit(S_SCANNING, &il->status)) && 1378 if (unlikely(!test_bit(S_SCANNING, &il->status)) &&
1380 (pkt->hdr.cmd == N_STATS)) { 1379 (pkt->hdr.cmd == N_STATS)) {
1381 il4965_rx_calc_noise(il); 1380 il4965_rx_calc_noise(il);
1382 queue_work(il->workqueue, &il->run_time_calib_work); 1381 queue_work(il->workqueue, &il->run_time_calib_work);
1383 } 1382 }
1384 if (il->ops->lib->temp_ops.temperature && change) 1383
1385 il->ops->lib->temp_ops.temperature(il); 1384 if (change)
1385 il4965_temperature_calib(il);
1386} 1386}
1387 1387
1388void 1388void
@@ -4028,9 +4028,9 @@ il4965_hdl_alive(struct il_priv *il, struct il_rx_buf *rxb)
4028 * This callback is provided in order to send a stats request. 4028 * This callback is provided in order to send a stats request.
4029 * 4029 *
4030 * This timer function is continually reset to execute within 4030 * This timer function is continually reset to execute within
4031 * REG_RECALIB_PERIOD seconds since the last N_STATS 4031 * 60 seconds since the last N_STATS was received. We need to
4032 * was received. We need to ensure we receive the stats in order 4032 * ensure we receive the stats in order to update the temperature
4033 * to update the temperature used for calibrating the TXPOWER. 4033 * used for calibrating the TXPOWER.
4034 */ 4034 */
4035static void 4035static void
4036il4965_bg_stats_periodic(unsigned long data) 4036il4965_bg_stats_periodic(unsigned long data)
diff --git a/drivers/net/wireless/iwlegacy/4965.c b/drivers/net/wireless/iwlegacy/4965.c
index 34fa3db82292..3a30aacf5d0c 100644
--- a/drivers/net/wireless/iwlegacy/4965.c
+++ b/drivers/net/wireless/iwlegacy/4965.c
@@ -1678,7 +1678,7 @@ il4965_is_temp_calib_needed(struct il_priv *il)
1678 return 1; 1678 return 1;
1679} 1679}
1680 1680
1681static void 1681void
1682il4965_temperature_calib(struct il_priv *il) 1682il4965_temperature_calib(struct il_priv *il)
1683{ 1683{
1684 s32 temp; 1684 s32 temp;
@@ -1910,9 +1910,6 @@ static struct il_lib_ops il4965_lib = {
1910 }, 1910 },
1911 .send_tx_power = il4965_send_tx_power, 1911 .send_tx_power = il4965_send_tx_power,
1912 .update_chain_flags = il4965_update_chain_flags, 1912 .update_chain_flags = il4965_update_chain_flags,
1913 .temp_ops = {
1914 .temperature = il4965_temperature_calib,
1915 },
1916}; 1913};
1917 1914
1918static const struct il_legacy_ops il4965_legacy_ops = { 1915static const struct il_legacy_ops il4965_legacy_ops = {
diff --git a/drivers/net/wireless/iwlegacy/4965.h b/drivers/net/wireless/iwlegacy/4965.h
index b3fcb8f30fe9..7c6b9b925c94 100644
--- a/drivers/net/wireless/iwlegacy/4965.h
+++ b/drivers/net/wireless/iwlegacy/4965.h
@@ -266,6 +266,7 @@ il4965_hw_valid_rtc_data_addr(u32 addr)
266 ((t) < IL_TX_POWER_TEMPERATURE_MIN || \ 266 ((t) < IL_TX_POWER_TEMPERATURE_MIN || \
267 (t) > IL_TX_POWER_TEMPERATURE_MAX) 267 (t) > IL_TX_POWER_TEMPERATURE_MAX)
268 268
269extern void il4965_temperature_calib(struct il_priv *il);
269/********************* END TEMPERATURE ***************************************/ 270/********************* END TEMPERATURE ***************************************/
270 271
271/********************* START TXPOWER *****************************************/ 272/********************* START TXPOWER *****************************************/
diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h
index cd8f27d18b1c..6f42f56388e7 100644
--- a/drivers/net/wireless/iwlegacy/common.h
+++ b/drivers/net/wireless/iwlegacy/common.h
@@ -1588,10 +1588,6 @@ struct il_debugfs_ops {
1588}; 1588};
1589#endif 1589#endif
1590 1590
1591struct il_temp_ops {
1592 void (*temperature) (struct il_priv *il);
1593};
1594
1595struct il_lib_ops { 1591struct il_lib_ops {
1596 /* Handling TX */ 1592 /* Handling TX */
1597 void (*txq_update_byte_cnt_tbl) (struct il_priv *il, 1593 void (*txq_update_byte_cnt_tbl) (struct il_priv *il,
@@ -1622,10 +1618,6 @@ struct il_lib_ops {
1622 1618
1623 /* eeprom operations */ 1619 /* eeprom operations */
1624 struct il_eeprom_ops eeprom_ops; 1620 struct il_eeprom_ops eeprom_ops;
1625
1626 /* temperature */
1627 struct il_temp_ops temp_ops;
1628
1629}; 1621};
1630 1622
1631struct il_led_ops { 1623struct il_led_ops {