diff options
author | Don Fry <donald.h.fry@intel.com> | 2011-11-30 19:12:59 -0500 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2011-12-08 18:55:15 -0500 |
commit | ae6130fc9b5e9957aaf26355b80e0a5ef7f8f537 (patch) | |
tree | 7ad2fc6b5b9fc6b5e895bd8f15897f85e96bf21a | |
parent | ab36eab24e7847d6d92872c55b46554c8ac4c4b3 (diff) |
iwlwifi: move device_pointers from iwl_priv to iwl_shared
Move the low level ucode device_pointers structure to iwl_shared.
Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-rx.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-dev.h | 5 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-mac80211.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-shared.h | 12 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-ucode.c | 10 |
7 files changed, 21 insertions, 18 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rx.c b/drivers/net/wireless/iwlwifi/iwl-agn-rx.c index 90c55ea4cc39..9001c23f27bb 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rx.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rx.c | |||
@@ -1165,7 +1165,7 @@ int iwl_rx_dispatch(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb, | |||
1165 | pkt->hdr.cmd); | 1165 | pkt->hdr.cmd); |
1166 | w->triggered = true; | 1166 | w->triggered = true; |
1167 | if (w->fn) | 1167 | if (w->fn) |
1168 | w->fn(priv, pkt, w->fn_data); | 1168 | w->fn(trans(priv), pkt, w->fn_data); |
1169 | } | 1169 | } |
1170 | spin_unlock(&priv->shrd->notif_wait_lock); | 1170 | spin_unlock(&priv->shrd->notif_wait_lock); |
1171 | 1171 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 6b99448d4548..02927faa6178 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -366,7 +366,7 @@ static void iwl_continuous_event_trace(struct iwl_priv *priv) | |||
366 | u32 num_wraps; /* # times uCode wrapped to top of log */ | 366 | u32 num_wraps; /* # times uCode wrapped to top of log */ |
367 | u32 next_entry; /* index of next entry to be written by uCode */ | 367 | u32 next_entry; /* index of next entry to be written by uCode */ |
368 | 368 | ||
369 | base = priv->device_pointers.error_event_table; | 369 | base = priv->shrd->device_pointers.error_event_table; |
370 | if (iwlagn_hw_valid_rtc_data_addr(base)) { | 370 | if (iwlagn_hw_valid_rtc_data_addr(base)) { |
371 | capacity = iwl_read_targ_mem(bus(priv), base); | 371 | capacity = iwl_read_targ_mem(bus(priv), base); |
372 | num_wraps = iwl_read_targ_mem(bus(priv), | 372 | num_wraps = iwl_read_targ_mem(bus(priv), |
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index 68f9dc5e9248..aa225be8dee8 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
@@ -865,11 +865,6 @@ struct iwl_priv { | |||
865 | 865 | ||
866 | __le16 switch_channel; | 866 | __le16 switch_channel; |
867 | 867 | ||
868 | struct { | ||
869 | u32 error_event_table; | ||
870 | u32 log_event_table; | ||
871 | } device_pointers; | ||
872 | |||
873 | u16 active_rate; | 868 | u16 active_rate; |
874 | 869 | ||
875 | u8 start_calib; | 870 | u8 start_calib; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-mac80211.c b/drivers/net/wireless/iwlwifi/iwl-mac80211.c index 2dd536c9e192..b3886d20c272 100644 --- a/drivers/net/wireless/iwlwifi/iwl-mac80211.c +++ b/drivers/net/wireless/iwlwifi/iwl-mac80211.c | |||
@@ -427,7 +427,7 @@ static int iwlagn_mac_resume(struct ieee80211_hw *hw) | |||
427 | iwl_write32(bus(priv), CSR_UCODE_DRV_GP1_CLR, | 427 | iwl_write32(bus(priv), CSR_UCODE_DRV_GP1_CLR, |
428 | CSR_UCODE_DRV_GP1_BIT_D3_CFG_COMPLETE); | 428 | CSR_UCODE_DRV_GP1_BIT_D3_CFG_COMPLETE); |
429 | 429 | ||
430 | base = priv->device_pointers.error_event_table; | 430 | base = priv->shrd->device_pointers.error_event_table; |
431 | if (iwlagn_hw_valid_rtc_data_addr(base)) { | 431 | if (iwlagn_hw_valid_rtc_data_addr(base)) { |
432 | spin_lock_irqsave(&bus(priv)->reg_lock, flags); | 432 | spin_lock_irqsave(&bus(priv)->reg_lock, flags); |
433 | ret = iwl_grab_nic_access_silent(bus(priv)); | 433 | ret = iwl_grab_nic_access_silent(bus(priv)); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-shared.h b/drivers/net/wireless/iwlwifi/iwl-shared.h index 53cddd32fb74..29a7284aa3ef 100644 --- a/drivers/net/wireless/iwlwifi/iwl-shared.h +++ b/drivers/net/wireless/iwlwifi/iwl-shared.h | |||
@@ -97,6 +97,7 @@ | |||
97 | struct iwl_cfg; | 97 | struct iwl_cfg; |
98 | struct iwl_bus; | 98 | struct iwl_bus; |
99 | struct iwl_priv; | 99 | struct iwl_priv; |
100 | struct iwl_trans; | ||
100 | struct iwl_sensitivity_ranges; | 101 | struct iwl_sensitivity_ranges; |
101 | struct iwl_trans_ops; | 102 | struct iwl_trans_ops; |
102 | 103 | ||
@@ -294,7 +295,7 @@ enum iwl_ucode_type { | |||
294 | struct iwl_notification_wait { | 295 | struct iwl_notification_wait { |
295 | struct list_head list; | 296 | struct list_head list; |
296 | 297 | ||
297 | void (*fn)(struct iwl_priv *priv, struct iwl_rx_packet *pkt, | 298 | void (*fn)(struct iwl_trans *trans, struct iwl_rx_packet *pkt, |
298 | void *data); | 299 | void *data); |
299 | void *fn_data; | 300 | void *fn_data; |
300 | 301 | ||
@@ -323,6 +324,7 @@ struct iwl_notification_wait { | |||
323 | * @notif_waits: things waiting for notification | 324 | * @notif_waits: things waiting for notification |
324 | * @notif_wait_lock: lock protecting notification | 325 | * @notif_wait_lock: lock protecting notification |
325 | * @notif_waitq: head of notification wait queue | 326 | * @notif_waitq: head of notification wait queue |
327 | * @device_pointers: pointers to ucode event tables | ||
326 | */ | 328 | */ |
327 | struct iwl_shared { | 329 | struct iwl_shared { |
328 | #ifdef CONFIG_IWLWIFI_DEBUG | 330 | #ifdef CONFIG_IWLWIFI_DEBUG |
@@ -361,6 +363,12 @@ struct iwl_shared { | |||
361 | struct list_head notif_waits; | 363 | struct list_head notif_waits; |
362 | spinlock_t notif_wait_lock; | 364 | spinlock_t notif_wait_lock; |
363 | wait_queue_head_t notif_waitq; | 365 | wait_queue_head_t notif_waitq; |
366 | |||
367 | struct { | ||
368 | u32 error_event_table; | ||
369 | u32 log_event_table; | ||
370 | } device_pointers; | ||
371 | |||
364 | }; | 372 | }; |
365 | 373 | ||
366 | /*Whatever _m is (iwl_trans, iwl_priv, iwl_bus, these macros will work */ | 374 | /*Whatever _m is (iwl_trans, iwl_priv, iwl_bus, these macros will work */ |
@@ -510,7 +518,7 @@ void __acquires(wait_entry) | |||
510 | iwl_init_notification_wait(struct iwl_shared *shrd, | 518 | iwl_init_notification_wait(struct iwl_shared *shrd, |
511 | struct iwl_notification_wait *wait_entry, | 519 | struct iwl_notification_wait *wait_entry, |
512 | u8 cmd, | 520 | u8 cmd, |
513 | void (*fn)(struct iwl_priv *priv, | 521 | void (*fn)(struct iwl_trans *trans, |
514 | struct iwl_rx_packet *pkt, | 522 | struct iwl_rx_packet *pkt, |
515 | void *data), | 523 | void *data), |
516 | void *fn_data); | 524 | void *fn_data); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c index a0d43d6636f3..2ee00e0f39d3 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c +++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c | |||
@@ -594,7 +594,7 @@ static void iwl_dump_nic_error_log(struct iwl_trans *trans) | |||
594 | struct iwl_trans_pcie *trans_pcie = | 594 | struct iwl_trans_pcie *trans_pcie = |
595 | IWL_TRANS_GET_PCIE_TRANS(trans); | 595 | IWL_TRANS_GET_PCIE_TRANS(trans); |
596 | 596 | ||
597 | base = priv->device_pointers.error_event_table; | 597 | base = trans->shrd->device_pointers.error_event_table; |
598 | if (trans->shrd->ucode_type == IWL_UCODE_INIT) { | 598 | if (trans->shrd->ucode_type == IWL_UCODE_INIT) { |
599 | if (!base) | 599 | if (!base) |
600 | base = priv->init_errlog_ptr; | 600 | base = priv->init_errlog_ptr; |
@@ -724,7 +724,7 @@ static int iwl_print_event_log(struct iwl_trans *trans, u32 start_idx, | |||
724 | if (num_events == 0) | 724 | if (num_events == 0) |
725 | return pos; | 725 | return pos; |
726 | 726 | ||
727 | base = priv->device_pointers.log_event_table; | 727 | base = trans->shrd->device_pointers.log_event_table; |
728 | if (trans->shrd->ucode_type == IWL_UCODE_INIT) { | 728 | if (trans->shrd->ucode_type == IWL_UCODE_INIT) { |
729 | if (!base) | 729 | if (!base) |
730 | base = priv->init_evtlog_ptr; | 730 | base = priv->init_evtlog_ptr; |
@@ -838,7 +838,7 @@ int iwl_dump_nic_event_log(struct iwl_trans *trans, bool full_log, | |||
838 | size_t bufsz = 0; | 838 | size_t bufsz = 0; |
839 | struct iwl_priv *priv = priv(trans); | 839 | struct iwl_priv *priv = priv(trans); |
840 | 840 | ||
841 | base = priv->device_pointers.log_event_table; | 841 | base = trans->shrd->device_pointers.log_event_table; |
842 | if (trans->shrd->ucode_type == IWL_UCODE_INIT) { | 842 | if (trans->shrd->ucode_type == IWL_UCODE_INIT) { |
843 | logsize = priv->init_evtlog_size; | 843 | logsize = priv->init_evtlog_size; |
844 | if (!base) | 844 | if (!base) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-ucode.c b/drivers/net/wireless/iwlwifi/iwl-ucode.c index f56066964d88..256f647763aa 100644 --- a/drivers/net/wireless/iwlwifi/iwl-ucode.c +++ b/drivers/net/wireless/iwlwifi/iwl-ucode.c | |||
@@ -550,7 +550,7 @@ struct iwlagn_alive_data { | |||
550 | u8 subtype; | 550 | u8 subtype; |
551 | }; | 551 | }; |
552 | 552 | ||
553 | static void iwl_alive_fn(struct iwl_priv *priv, | 553 | static void iwl_alive_fn(struct iwl_trans *trans, |
554 | struct iwl_rx_packet *pkt, | 554 | struct iwl_rx_packet *pkt, |
555 | void *data) | 555 | void *data) |
556 | { | 556 | { |
@@ -559,14 +559,14 @@ static void iwl_alive_fn(struct iwl_priv *priv, | |||
559 | 559 | ||
560 | palive = &pkt->u.alive_frame; | 560 | palive = &pkt->u.alive_frame; |
561 | 561 | ||
562 | IWL_DEBUG_FW(priv, "Alive ucode status 0x%08X revision " | 562 | IWL_DEBUG_FW(trans, "Alive ucode status 0x%08X revision " |
563 | "0x%01X 0x%01X\n", | 563 | "0x%01X 0x%01X\n", |
564 | palive->is_valid, palive->ver_type, | 564 | palive->is_valid, palive->ver_type, |
565 | palive->ver_subtype); | 565 | palive->ver_subtype); |
566 | 566 | ||
567 | priv->device_pointers.error_event_table = | 567 | trans->shrd->device_pointers.error_event_table = |
568 | le32_to_cpu(palive->error_event_table_ptr); | 568 | le32_to_cpu(palive->error_event_table_ptr); |
569 | priv->device_pointers.log_event_table = | 569 | trans->shrd->device_pointers.log_event_table = |
570 | le32_to_cpu(palive->log_event_table_ptr); | 570 | le32_to_cpu(palive->log_event_table_ptr); |
571 | 571 | ||
572 | alive_data->subtype = palive->ver_subtype; | 572 | alive_data->subtype = palive->ver_subtype; |
@@ -577,7 +577,7 @@ static void iwl_alive_fn(struct iwl_priv *priv, | |||
577 | void iwl_init_notification_wait(struct iwl_shared *shrd, | 577 | void iwl_init_notification_wait(struct iwl_shared *shrd, |
578 | struct iwl_notification_wait *wait_entry, | 578 | struct iwl_notification_wait *wait_entry, |
579 | u8 cmd, | 579 | u8 cmd, |
580 | void (*fn)(struct iwl_priv *priv, | 580 | void (*fn)(struct iwl_trans *trans, |
581 | struct iwl_rx_packet *pkt, | 581 | struct iwl_rx_packet *pkt, |
582 | void *data), | 582 | void *data), |
583 | void *fn_data) | 583 | void *fn_data) |