From 82cf9d7ec238ca597318132e816600ac7f311285 Mon Sep 17 00:00:00 2001 From: Kalle Valo Date: Wed, 10 Aug 2011 09:49:12 +0300 Subject: [PATCH] --- yaml --- r: 265490 b: refs/heads/master c: ad226ec22b92d7f0f834015149b1d1118e017f16 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/bcma/driver_pci.c | 2 +- trunk/drivers/net/wireless/ath/ath6kl/htc.c | 61 ++-- trunk/drivers/net/wireless/ath/ath6kl/htc.h | 45 +-- .../drivers/net/wireless/ath/ath6kl/htc_hif.c | 4 +- trunk/drivers/net/wireless/ath/ath6kl/init.c | 16 +- trunk/drivers/net/wireless/ath/ath6kl/main.c | 4 +- trunk/drivers/net/wireless/ath/ath6kl/txrx.c | 14 +- .../wireless/ath/ath9k/ar9003_2p2_initvals.h | 190 ++++++------ .../net/wireless/ath/ath9k/ar9003_eeprom.c | 130 +------- .../net/wireless/ath/ath9k/ar9003_mac.c | 15 +- .../net/wireless/ath/ath9k/ar9003_phy.c | 4 +- trunk/drivers/net/wireless/ath/ath9k/ath9k.h | 4 + trunk/drivers/net/wireless/ath/ath9k/beacon.c | 18 +- trunk/drivers/net/wireless/ath/ath9k/debug.c | 60 ---- trunk/drivers/net/wireless/ath/ath9k/eeprom.h | 2 - .../net/wireless/ath/ath9k/eeprom_4k.c | 112 ------- .../net/wireless/ath/ath9k/eeprom_9287.c | 106 ------- .../net/wireless/ath/ath9k/eeprom_def.c | 131 --------- trunk/drivers/net/wireless/ath/ath9k/gpio.c | 2 - trunk/drivers/net/wireless/ath/ath9k/hw.h | 7 - trunk/drivers/net/wireless/ath/ath9k/init.c | 1 - trunk/drivers/net/wireless/ath/ath9k/mac.c | 16 +- trunk/drivers/net/wireless/ath/ath9k/main.c | 8 +- trunk/drivers/net/wireless/ath/ath9k/rc.h | 6 + trunk/drivers/net/wireless/ath/ath9k/recv.c | 1 + trunk/drivers/net/wireless/ath/ath9k/xmit.c | 6 +- trunk/drivers/net/wireless/b43/Kconfig | 6 +- trunk/drivers/net/wireless/b43/main.c | 1 - trunk/drivers/net/wireless/libertas/cfg.c | 39 +-- trunk/drivers/net/wireless/libertas/cfg.h | 1 - trunk/drivers/net/wireless/libertas/cmd.c | 6 +- trunk/drivers/net/wireless/libertas/decl.h | 4 - trunk/drivers/net/wireless/libertas/dev.h | 16 +- trunk/drivers/net/wireless/libertas/if_sdio.c | 277 +++++++----------- trunk/drivers/net/wireless/libertas/if_spi.c | 4 + trunk/drivers/net/wireless/libertas/if_usb.c | 2 +- trunk/drivers/net/wireless/libertas/main.c | 168 ++++------- trunk/drivers/net/wireless/libertas/mesh.c | 9 +- trunk/drivers/net/wireless/mwifiex/main.c | 4 - trunk/drivers/net/wireless/rt2x00/rt2400pci.c | 39 ++- trunk/drivers/net/wireless/rt2x00/rt2500pci.c | 39 ++- trunk/drivers/net/wireless/rt2x00/rt2800pci.c | 46 +-- trunk/drivers/net/wireless/rt2x00/rt2x00dev.c | 1 + trunk/drivers/net/wireless/rt2x00/rt61pci.c | 34 ++- trunk/drivers/net/wireless/rtlwifi/pci.c | 37 ++- trunk/drivers/net/wireless/rtlwifi/pci.h | 26 ++ trunk/include/linux/ssb/ssb_regs.h | 40 --- trunk/include/net/lib80211.h | 3 + trunk/net/mac80211/rc80211_minstrel_ht.c | 8 +- trunk/net/mac80211/tx.c | 20 -- trunk/net/wireless/lib80211.c | 15 +- trunk/net/wireless/reg.c | 14 +- 53 files changed, 575 insertions(+), 1251 deletions(-) diff --git a/[refs] b/[refs] index b2ce05a4b2dc..169d63859e02 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 392e741939ddb7dd7adf7e4ec414b2140fb3a15b +refs/heads/master: ad226ec22b92d7f0f834015149b1d1118e017f16 diff --git a/trunk/drivers/bcma/driver_pci.c b/trunk/drivers/bcma/driver_pci.c index 81f3d0a4b856..405537662392 100644 --- a/trunk/drivers/bcma/driver_pci.c +++ b/trunk/drivers/bcma/driver_pci.c @@ -173,7 +173,7 @@ static bool bcma_core_pci_is_in_hostmode(struct bcma_drv_pci *pc) return false; #ifdef CONFIG_SSB_DRIVER_PCICORE - if (bus->sprom.boardflags_lo & SSB_BFL_NOPCI) + if (bus->sprom.boardflags_lo & SSB_PCICORE_BFL_NOPCI) return false; #endif /* CONFIG_SSB_DRIVER_PCICORE */ diff --git a/trunk/drivers/net/wireless/ath/ath6kl/htc.c b/trunk/drivers/net/wireless/ath/ath6kl/htc.c index 5580e22c19f4..a8dc5c3ea567 100644 --- a/trunk/drivers/net/wireless/ath/ath6kl/htc.c +++ b/trunk/drivers/net/wireless/ath/ath6kl/htc.c @@ -689,9 +689,9 @@ static int htc_setup_tx_complete(struct htc_target *target) return status; } -void htc_set_credit_dist(struct htc_target *target, - struct htc_credit_state_info *cred_dist_cntxt, - u16 srvc_pri_order[], int list_len) +void ath6kl_htc_set_credit_dist(struct htc_target *target, + struct htc_credit_state_info *cred_dist_cntxt, + u16 srvc_pri_order[], int list_len) { struct htc_endpoint *endpoint; int i, ep; @@ -717,7 +717,7 @@ void htc_set_credit_dist(struct htc_target *target, } } -int htc_tx(struct htc_target *target, struct htc_packet *packet) +int ath6kl_htc_tx(struct htc_target *target, struct htc_packet *packet) { struct htc_endpoint *endpoint; struct list_head queue; @@ -745,8 +745,8 @@ int htc_tx(struct htc_target *target, struct htc_packet *packet) } /* flush endpoint TX queue */ -void htc_flush_txep(struct htc_target *target, - enum htc_endpoint_id eid, u16 tag) +void ath6kl_htc_flush_txep(struct htc_target *target, + enum htc_endpoint_id eid, u16 tag) { struct htc_packet *packet, *tmp_pkt; struct list_head discard_q, container; @@ -785,7 +785,7 @@ void htc_flush_txep(struct htc_target *target, } -static void htc_flush_txep_all(struct htc_target *target) +static void ath6kl_htc_flush_txep_all(struct htc_target *target) { struct htc_endpoint *endpoint; int i; @@ -797,12 +797,12 @@ static void htc_flush_txep_all(struct htc_target *target) if (endpoint->svc_id == 0) /* not in use.. */ continue; - htc_flush_txep(target, i, HTC_TX_PACKET_TAG_ALL); + ath6kl_htc_flush_txep(target, i, HTC_TX_PACKET_TAG_ALL); } } -void htc_indicate_activity_change(struct htc_target *target, - enum htc_endpoint_id eid, bool active) +void ath6kl_htc_indicate_activity_change(struct htc_target *target, + enum htc_endpoint_id eid, bool active) { struct htc_endpoint *endpoint = &target->endpoint[eid]; bool dist = false; @@ -869,7 +869,7 @@ static int htc_add_rxbuf(struct htc_target *target, struct htc_packet *packet) INIT_LIST_HEAD(&queue); list_add_tail(&packet->list, &queue); - return htc_add_rxbuf_multiple(target, &queue); + return ath6kl_htc_add_rxbuf_multiple(target, &queue); } static void htc_reclaim_rxbuf(struct htc_target *target, @@ -1721,8 +1721,8 @@ static int htc_fetch_rxpkts(struct htc_target *target, return status; } -int htc_rxmsg_pending_handler(struct htc_target *target, u32 msg_look_ahead[], - int *num_pkts) +int ath6kl_htc_rxmsg_pending_handler(struct htc_target *target, + u32 msg_look_ahead[], int *num_pkts) { struct htc_packet *packets, *tmp_pkt; struct htc_endpoint *endpoint; @@ -1904,8 +1904,8 @@ static struct htc_packet *htc_wait_for_ctrl_msg(struct htc_target *target) return NULL; } -int htc_add_rxbuf_multiple(struct htc_target *target, - struct list_head *pkt_queue) +int ath6kl_htc_add_rxbuf_multiple(struct htc_target *target, + struct list_head *pkt_queue) { struct htc_endpoint *endpoint; struct htc_packet *first_pkt; @@ -1966,7 +1966,7 @@ int htc_add_rxbuf_multiple(struct htc_target *target, return status; } -void htc_flush_rx_buf(struct htc_target *target) +void ath6kl_htc_flush_rx_buf(struct htc_target *target) { struct htc_endpoint *endpoint; struct htc_packet *packet, *tmp_pkt; @@ -1994,9 +1994,9 @@ void htc_flush_rx_buf(struct htc_target *target) } } -int htc_conn_service(struct htc_target *target, - struct htc_service_connect_req *conn_req, - struct htc_service_connect_resp *conn_resp) +int ath6kl_htc_conn_service(struct htc_target *target, + struct htc_service_connect_req *conn_req, + struct htc_service_connect_resp *conn_resp) { struct htc_packet *rx_pkt = NULL; struct htc_packet *tx_pkt = NULL; @@ -2154,7 +2154,8 @@ static void reset_ep_state(struct htc_target *target) INIT_LIST_HEAD(&target->cred_dist_list); } -int htc_get_rxbuf_num(struct htc_target *target, enum htc_endpoint_id endpoint) +int ath6kl_htc_get_rxbuf_num(struct htc_target *target, + enum htc_endpoint_id endpoint) { int num; @@ -2212,7 +2213,7 @@ static void htc_setup_msg_bndl(struct htc_target *target) } } -int htc_wait_target(struct htc_target *target) +int ath6kl_htc_wait_target(struct htc_target *target) { struct htc_packet *packet = NULL; struct htc_ready_ext_msg *rdy_msg; @@ -2275,7 +2276,7 @@ int htc_wait_target(struct htc_target *target) connect.svc_id = HTC_CTRL_RSVD_SVC; /* connect fake service */ - status = htc_conn_service((void *)target, &connect, &resp); + status = ath6kl_htc_conn_service((void *)target, &connect, &resp); if (status) ath6kl_hif_cleanup_scatter(target->dev->ar); @@ -2293,7 +2294,7 @@ int htc_wait_target(struct htc_target *target) * Start HTC, enable interrupts and let the target know * host has finished setup. */ -int htc_start(struct htc_target *target) +int ath6kl_htc_start(struct htc_target *target) { struct htc_packet *packet; int status; @@ -2327,13 +2328,13 @@ int htc_start(struct htc_target *target) status = ath6kldev_unmask_intrs(target->dev); if (status) - htc_stop(target); + ath6kl_htc_stop(target); return status; } /* htc_stop: stop interrupt reception, and flush all queued buffers */ -void htc_stop(struct htc_target *target) +void ath6kl_htc_stop(struct htc_target *target) { spin_lock_bh(&target->htc_lock); target->htc_flags |= HTC_OP_STATE_STOPPING; @@ -2346,14 +2347,14 @@ void htc_stop(struct htc_target *target) */ ath6kldev_mask_intrs(target->dev); - htc_flush_txep_all(target); + ath6kl_htc_flush_txep_all(target); - htc_flush_rx_buf(target); + ath6kl_htc_flush_rx_buf(target); reset_ep_state(target); } -void *htc_create(struct ath6kl *ar) +void *ath6kl_htc_create(struct ath6kl *ar) { struct htc_target *target = NULL; struct htc_packet *packet; @@ -2422,7 +2423,7 @@ void *htc_create(struct ath6kl *ar) fail_create_htc: if (i != NUM_CONTROL_BUFFERS || status) { if (target) { - htc_cleanup(target); + ath6kl_htc_cleanup(target); target = NULL; } } @@ -2431,7 +2432,7 @@ void *htc_create(struct ath6kl *ar) } /* cleanup the HTC instance */ -void htc_cleanup(struct htc_target *target) +void ath6kl_htc_cleanup(struct htc_target *target) { struct htc_packet *packet, *tmp_packet; diff --git a/trunk/drivers/net/wireless/ath/ath6kl/htc.h b/trunk/drivers/net/wireless/ath/ath6kl/htc.h index d844d36e40cf..8ce0c2c07ded 100644 --- a/trunk/drivers/net/wireless/ath/ath6kl/htc.h +++ b/trunk/drivers/net/wireless/ath/ath6kl/htc.h @@ -540,27 +540,30 @@ struct htc_target { int chk_irq_status_cnt; }; -void *htc_create(struct ath6kl *ar); -void htc_set_credit_dist(struct htc_target *target, - struct htc_credit_state_info *cred_info, - u16 svc_pri_order[], int len); -int htc_wait_target(struct htc_target *target); -int htc_start(struct htc_target *target); -int htc_conn_service(struct htc_target *target, - struct htc_service_connect_req *req, - struct htc_service_connect_resp *resp); -int htc_tx(struct htc_target *target, struct htc_packet *packet); -void htc_stop(struct htc_target *target); -void htc_cleanup(struct htc_target *target); -void htc_flush_txep(struct htc_target *target, - enum htc_endpoint_id endpoint, u16 tag); -void htc_flush_rx_buf(struct htc_target *target); -void htc_indicate_activity_change(struct htc_target *target, - enum htc_endpoint_id endpoint, bool active); -int htc_get_rxbuf_num(struct htc_target *target, enum htc_endpoint_id endpoint); -int htc_add_rxbuf_multiple(struct htc_target *target, struct list_head *pktq); -int htc_rxmsg_pending_handler(struct htc_target *target, u32 msg_look_ahead[], - int *n_pkts); +void *ath6kl_htc_create(struct ath6kl *ar); +void ath6kl_htc_set_credit_dist(struct htc_target *target, + struct htc_credit_state_info *cred_info, + u16 svc_pri_order[], int len); +int ath6kl_htc_wait_target(struct htc_target *target); +int ath6kl_htc_start(struct htc_target *target); +int ath6kl_htc_conn_service(struct htc_target *target, + struct htc_service_connect_req *req, + struct htc_service_connect_resp *resp); +int ath6kl_htc_tx(struct htc_target *target, struct htc_packet *packet); +void ath6kl_htc_stop(struct htc_target *target); +void ath6kl_htc_cleanup(struct htc_target *target); +void ath6kl_htc_flush_txep(struct htc_target *target, + enum htc_endpoint_id endpoint, u16 tag); +void ath6kl_htc_flush_rx_buf(struct htc_target *target); +void ath6kl_htc_indicate_activity_change(struct htc_target *target, + enum htc_endpoint_id endpoint, + bool active); +int ath6kl_htc_get_rxbuf_num(struct htc_target *target, + enum htc_endpoint_id endpoint); +int ath6kl_htc_add_rxbuf_multiple(struct htc_target *target, + struct list_head *pktq); +int ath6kl_htc_rxmsg_pending_handler(struct htc_target *target, + u32 msg_look_ahead[], int *n_pkts); static inline void set_htc_pkt_info(struct htc_packet *packet, void *context, u8 *buf, unsigned int len, diff --git a/trunk/drivers/net/wireless/ath/ath6kl/htc_hif.c b/trunk/drivers/net/wireless/ath/ath6kl/htc_hif.c index 5d397b5c5efb..86b1cc7409c2 100644 --- a/trunk/drivers/net/wireless/ath/ath6kl/htc_hif.c +++ b/trunk/drivers/net/wireless/ath/ath6kl/htc_hif.c @@ -416,8 +416,8 @@ static int proc_pending_irqs(struct ath6kl_device *dev, bool *done) * improve performance by reducing context switching when * we rapidly pull packets. */ - status = htc_rxmsg_pending_handler(dev->htc_cnxt, - &lk_ahd, &fetched); + status = ath6kl_htc_rxmsg_pending_handler(dev->htc_cnxt, + &lk_ahd, &fetched); if (status) goto out; diff --git a/trunk/drivers/net/wireless/ath/ath6kl/init.c b/trunk/drivers/net/wireless/ath/ath6kl/init.c index 99ff2f94b6ce..9d10322eac41 100644 --- a/trunk/drivers/net/wireless/ath/ath6kl/init.c +++ b/trunk/drivers/net/wireless/ath/ath6kl/init.c @@ -160,7 +160,7 @@ static int ath6kl_connectservice(struct ath6kl *ar, memset(&response, 0, sizeof(response)); - status = htc_conn_service(ar->htc_target, con_req, &response); + status = ath6kl_htc_conn_service(ar->htc_target, con_req, &response); if (status) { ath6kl_err("failed to connect to %s service status:%d\n", desc, status); @@ -1069,7 +1069,7 @@ static int ath6kl_init(struct net_device *dev) * driver layer has to init BMI in order to set the host block * size. */ - if (htc_wait_target(ar->htc_target)) { + if (ath6kl_htc_wait_target(ar->htc_target)) { status = -EIO; goto err_node_cleanup; } @@ -1098,7 +1098,7 @@ static int ath6kl_init(struct net_device *dev) ath6kl_cookie_init(ar); /* start HTC */ - status = htc_start(ar->htc_target); + status = ath6kl_htc_start(ar->htc_target); if (status) { ath6kl_cookie_cleanup(ar); @@ -1138,9 +1138,9 @@ static int ath6kl_init(struct net_device *dev) goto ath6kl_init_done; err_htc_stop: - htc_stop(ar->htc_target); + ath6kl_htc_stop(ar->htc_target); err_rxbuf_cleanup: - htc_flush_rx_buf(ar->htc_target); + ath6kl_htc_flush_rx_buf(ar->htc_target); ath6kl_cleanup_amsdu_rxbufs(ar); err_cleanup_scatter: ath6kl_hif_cleanup_scatter(ar); @@ -1179,7 +1179,7 @@ int ath6kl_core_init(struct ath6kl *ar) if (ret) goto err_bmi_cleanup; - ar->htc_target = htc_create(ar); + ar->htc_target = ath6kl_htc_create(ar); if (!ar->htc_target) { ret = -ENOMEM; @@ -1217,7 +1217,7 @@ int ath6kl_core_init(struct ath6kl *ar) return ret; err_htc_cleanup: - htc_cleanup(ar->htc_target); + ath6kl_htc_cleanup(ar->htc_target); err_bmi_cleanup: ath6kl_bmi_cleanup(ar); err_wq: @@ -1275,7 +1275,7 @@ void ath6kl_destroy(struct net_device *dev, unsigned int unregister) destroy_workqueue(ar->ath6kl_wq); if (ar->htc_target) - htc_cleanup(ar->htc_target); + ath6kl_htc_cleanup(ar->htc_target); aggr_module_destroy(ar->aggr_cntxt); diff --git a/trunk/drivers/net/wireless/ath/ath6kl/main.c b/trunk/drivers/net/wireless/ath/ath6kl/main.c index 284e3e96ff3e..c336eae0cf48 100644 --- a/trunk/drivers/net/wireless/ath/ath6kl/main.c +++ b/trunk/drivers/net/wireless/ath/ath6kl/main.c @@ -375,7 +375,7 @@ void ath6kl_stop_endpoint(struct net_device *dev, bool keep_profile, if (ar->htc_target) { ath6kl_dbg(ATH6KL_DBG_TRC, "%s: shut down htc\n", __func__); - htc_stop(ar->htc_target); + ath6kl_htc_stop(ar->htc_target); } /* @@ -568,7 +568,7 @@ int ath6k_setup_credit_dist(void *htc_handle, servicepriority[4] = WMI_DATA_BK_SVC; /* lowest */ /* set priority list */ - htc_set_credit_dist(htc_handle, cred_info, servicepriority, 5); + ath6kl_htc_set_credit_dist(htc_handle, cred_info, servicepriority, 5); return 0; } diff --git a/trunk/drivers/net/wireless/ath/ath6kl/txrx.c b/trunk/drivers/net/wireless/ath/ath6kl/txrx.c index 0cab1c1b6fd1..167bdb9cf68d 100644 --- a/trunk/drivers/net/wireless/ath/ath6kl/txrx.c +++ b/trunk/drivers/net/wireless/ath/ath6kl/txrx.c @@ -221,7 +221,7 @@ int ath6kl_control_tx(void *devt, struct sk_buff *skb, * This interface is asynchronous, if there is an error, cleanup * will happen in the TX completion callback. */ - htc_tx(ar->htc_target, &cookie->htc_pkt); + ath6kl_htc_tx(ar->htc_target, &cookie->htc_pkt); return 0; @@ -331,7 +331,7 @@ int ath6kl_data_tx(struct sk_buff *skb, struct net_device *dev) * HTC interface is asynchronous, if this fails, cleanup will * happen in the ath6kl_tx_complete callback. */ - htc_tx(ar->htc_target, &cookie->htc_pkt); + ath6kl_htc_tx(ar->htc_target, &cookie->htc_pkt); return 0; @@ -403,7 +403,7 @@ void ath6kl_indicate_tx_activity(void *devt, u8 traffic_class, bool active) notify_htc: /* notify HTC, this may cause credit distribution changes */ - htc_indicate_activity_change(ar->htc_target, eid, active); + ath6kl_htc_indicate_activity_change(ar->htc_target, eid, active); } enum htc_send_full_action ath6kl_tx_queue_full(struct htc_target *target, @@ -611,8 +611,8 @@ void ath6kl_tx_data_cleanup(struct ath6kl *ar) /* flush all the data (non-control) streams */ for (i = 0; i < WMM_NUM_AC; i++) - htc_flush_txep(ar->htc_target, ar->ac2ep_map[i], - ATH6KL_DATA_PKT_TAG); + ath6kl_htc_flush_txep(ar->htc_target, ar->ac2ep_map[i], + ATH6KL_DATA_PKT_TAG); } /* Rx functions */ @@ -672,7 +672,7 @@ void ath6kl_rx_refill(struct htc_target *target, enum htc_endpoint_id endpoint) struct list_head queue; n_buf_refill = ATH6KL_MAX_RX_BUFFERS - - htc_get_rxbuf_num(ar->htc_target, endpoint); + ath6kl_htc_get_rxbuf_num(ar->htc_target, endpoint); if (n_buf_refill <= 0) return; @@ -695,7 +695,7 @@ void ath6kl_rx_refill(struct htc_target *target, enum htc_endpoint_id endpoint) } if (!list_empty(&queue)) - htc_add_rxbuf_multiple(ar->htc_target, &queue); + ath6kl_htc_add_rxbuf_multiple(ar->htc_target, &queue); } void ath6kl_refill_amsdu_rxbufs(struct ath6kl *ar, int count) diff --git a/trunk/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h b/trunk/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h index a0aadaddd071..2339728a7306 100644 --- a/trunk/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h +++ b/trunk/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h @@ -835,108 +835,108 @@ static const u32 ar9300_2p2_baseband_core[][2] = { static const u32 ar9300Modes_high_power_tx_gain_table_2p2[][5] = { /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ - {0x0000a2dc, 0x00033800, 0x00033800, 0x03aaa352, 0x03aaa352}, - {0x0000a2e0, 0x0003c000, 0x0003c000, 0x03ccc584, 0x03ccc584}, - {0x0000a2e4, 0x03fc0000, 0x03fc0000, 0x03f0f800, 0x03f0f800}, + {0x0000a2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352}, + {0x0000a2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584}, + {0x0000a2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800}, {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000}, - {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9}, - {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, - {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002}, - {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004}, - {0x0000a50c, 0x10000023, 0x10000023, 0x0b000200, 0x0b000200}, - {0x0000a510, 0x16000220, 0x16000220, 0x0f000202, 0x0f000202}, - {0x0000a514, 0x1c000223, 0x1c000223, 0x12000400, 0x12000400}, - {0x0000a518, 0x21002220, 0x21002220, 0x16000402, 0x16000402}, - {0x0000a51c, 0x27002223, 0x27002223, 0x19000404, 0x19000404}, - {0x0000a520, 0x2b022220, 0x2b022220, 0x1c000603, 0x1c000603}, - {0x0000a524, 0x2f022222, 0x2f022222, 0x21000a02, 0x21000a02}, - {0x0000a528, 0x34022225, 0x34022225, 0x25000a04, 0x25000a04}, - {0x0000a52c, 0x3a02222a, 0x3a02222a, 0x28000a20, 0x28000a20}, - {0x0000a530, 0x3e02222c, 0x3e02222c, 0x2c000e20, 0x2c000e20}, - {0x0000a534, 0x4202242a, 0x4202242a, 0x30000e22, 0x30000e22}, - {0x0000a538, 0x4702244a, 0x4702244a, 0x34000e24, 0x34000e24}, - {0x0000a53c, 0x4b02244c, 0x4b02244c, 0x38001640, 0x38001640}, - {0x0000a540, 0x4e02246c, 0x4e02246c, 0x3c001660, 0x3c001660}, - {0x0000a544, 0x52022470, 0x52022470, 0x3f001861, 0x3f001861}, - {0x0000a548, 0x55022490, 0x55022490, 0x43001a81, 0x43001a81}, - {0x0000a54c, 0x59022492, 0x59022492, 0x47001a83, 0x47001a83}, - {0x0000a550, 0x5d022692, 0x5d022692, 0x4a001c84, 0x4a001c84}, - {0x0000a554, 0x61022892, 0x61022892, 0x4e001ce3, 0x4e001ce3}, - {0x0000a558, 0x65024890, 0x65024890, 0x52001ce5, 0x52001ce5}, - {0x0000a55c, 0x69024892, 0x69024892, 0x56001ce9, 0x56001ce9}, - {0x0000a560, 0x6e024c92, 0x6e024c92, 0x5a001ceb, 0x5a001ceb}, - {0x0000a564, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec}, - {0x0000a568, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec}, - {0x0000a56c, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec}, - {0x0000a570, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec}, - {0x0000a574, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec}, - {0x0000a578, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec}, - {0x0000a57c, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec}, - {0x0000a580, 0x00800000, 0x00800000, 0x00800000, 0x00800000}, - {0x0000a584, 0x06800003, 0x06800003, 0x04800002, 0x04800002}, - {0x0000a588, 0x0a800020, 0x0a800020, 0x08800004, 0x08800004}, - {0x0000a58c, 0x10800023, 0x10800023, 0x0b800200, 0x0b800200}, - {0x0000a590, 0x16800220, 0x16800220, 0x0f800202, 0x0f800202}, - {0x0000a594, 0x1c800223, 0x1c800223, 0x12800400, 0x12800400}, - {0x0000a598, 0x21802220, 0x21802220, 0x16800402, 0x16800402}, - {0x0000a59c, 0x27802223, 0x27802223, 0x19800404, 0x19800404}, - {0x0000a5a0, 0x2b822220, 0x2b822220, 0x1c800603, 0x1c800603}, - {0x0000a5a4, 0x2f822222, 0x2f822222, 0x21800a02, 0x21800a02}, - {0x0000a5a8, 0x34822225, 0x34822225, 0x25800a04, 0x25800a04}, - {0x0000a5ac, 0x3a82222a, 0x3a82222a, 0x28800a20, 0x28800a20}, - {0x0000a5b0, 0x3e82222c, 0x3e82222c, 0x2c800e20, 0x2c800e20}, - {0x0000a5b4, 0x4282242a, 0x4282242a, 0x30800e22, 0x30800e22}, - {0x0000a5b8, 0x4782244a, 0x4782244a, 0x34800e24, 0x34800e24}, - {0x0000a5bc, 0x4b82244c, 0x4b82244c, 0x38801640, 0x38801640}, - {0x0000a5c0, 0x4e82246c, 0x4e82246c, 0x3c801660, 0x3c801660}, - {0x0000a5c4, 0x52822470, 0x52822470, 0x3f801861, 0x3f801861}, - {0x0000a5c8, 0x55822490, 0x55822490, 0x43801a81, 0x43801a81}, - {0x0000a5cc, 0x59822492, 0x59822492, 0x47801a83, 0x47801a83}, - {0x0000a5d0, 0x5d822692, 0x5d822692, 0x4a801c84, 0x4a801c84}, - {0x0000a5d4, 0x61822892, 0x61822892, 0x4e801ce3, 0x4e801ce3}, - {0x0000a5d8, 0x65824890, 0x65824890, 0x52801ce5, 0x52801ce5}, - {0x0000a5dc, 0x69824892, 0x69824892, 0x56801ce9, 0x56801ce9}, - {0x0000a5e0, 0x6e824c92, 0x6e824c92, 0x5a801ceb, 0x5a801ceb}, - {0x0000a5e4, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec}, - {0x0000a5e8, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec}, - {0x0000a5ec, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec}, - {0x0000a5f0, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec}, - {0x0000a5f4, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec}, - {0x0000a5f8, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec}, - {0x0000a5fc, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec}, + {0x0000a410, 0x000050d8, 0x000050d8, 0x000050d9, 0x000050d9}, + {0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000}, + {0x0000a504, 0x04002222, 0x04002222, 0x04000002, 0x04000002}, + {0x0000a508, 0x09002421, 0x09002421, 0x08000004, 0x08000004}, + {0x0000a50c, 0x0d002621, 0x0d002621, 0x0b000200, 0x0b000200}, + {0x0000a510, 0x13004620, 0x13004620, 0x0f000202, 0x0f000202}, + {0x0000a514, 0x19004a20, 0x19004a20, 0x11000400, 0x11000400}, + {0x0000a518, 0x1d004e20, 0x1d004e20, 0x15000402, 0x15000402}, + {0x0000a51c, 0x21005420, 0x21005420, 0x19000404, 0x19000404}, + {0x0000a520, 0x26005e20, 0x26005e20, 0x1b000603, 0x1b000603}, + {0x0000a524, 0x2b005e40, 0x2b005e40, 0x1f000a02, 0x1f000a02}, + {0x0000a528, 0x2f005e42, 0x2f005e42, 0x23000a04, 0x23000a04}, + {0x0000a52c, 0x33005e44, 0x33005e44, 0x26000a20, 0x26000a20}, + {0x0000a530, 0x38005e65, 0x38005e65, 0x2a000e20, 0x2a000e20}, + {0x0000a534, 0x3c005e69, 0x3c005e69, 0x2e000e22, 0x2e000e22}, + {0x0000a538, 0x40005e6b, 0x40005e6b, 0x31000e24, 0x31000e24}, + {0x0000a53c, 0x44005e6d, 0x44005e6d, 0x34001640, 0x34001640}, + {0x0000a540, 0x49005e72, 0x49005e72, 0x38001660, 0x38001660}, + {0x0000a544, 0x4e005eb2, 0x4e005eb2, 0x3b001861, 0x3b001861}, + {0x0000a548, 0x53005f12, 0x53005f12, 0x3e001a81, 0x3e001a81}, + {0x0000a54c, 0x59025eb2, 0x59025eb2, 0x42001a83, 0x42001a83}, + {0x0000a550, 0x5e025f12, 0x5e025f12, 0x44001c84, 0x44001c84}, + {0x0000a554, 0x61027f12, 0x61027f12, 0x48001ce3, 0x48001ce3}, + {0x0000a558, 0x6702bf12, 0x6702bf12, 0x4c001ce5, 0x4c001ce5}, + {0x0000a55c, 0x6b02bf14, 0x6b02bf14, 0x50001ce9, 0x50001ce9}, + {0x0000a560, 0x6f02bf16, 0x6f02bf16, 0x54001ceb, 0x54001ceb}, + {0x0000a564, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec}, + {0x0000a568, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec}, + {0x0000a56c, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec}, + {0x0000a570, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec}, + {0x0000a574, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec}, + {0x0000a578, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec}, + {0x0000a57c, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec}, + {0x0000a580, 0x00802220, 0x00802220, 0x00800000, 0x00800000}, + {0x0000a584, 0x04802222, 0x04802222, 0x04800002, 0x04800002}, + {0x0000a588, 0x09802421, 0x09802421, 0x08800004, 0x08800004}, + {0x0000a58c, 0x0d802621, 0x0d802621, 0x0b800200, 0x0b800200}, + {0x0000a590, 0x13804620, 0x13804620, 0x0f800202, 0x0f800202}, + {0x0000a594, 0x19804a20, 0x19804a20, 0x11800400, 0x11800400}, + {0x0000a598, 0x1d804e20, 0x1d804e20, 0x15800402, 0x15800402}, + {0x0000a59c, 0x21805420, 0x21805420, 0x19800404, 0x19800404}, + {0x0000a5a0, 0x26805e20, 0x26805e20, 0x1b800603, 0x1b800603}, + {0x0000a5a4, 0x2b805e40, 0x2b805e40, 0x1f800a02, 0x1f800a02}, + {0x0000a5a8, 0x2f805e42, 0x2f805e42, 0x23800a04, 0x23800a04}, + {0x0000a5ac, 0x33805e44, 0x33805e44, 0x26800a20, 0x26800a20}, + {0x0000a5b0, 0x38805e65, 0x38805e65, 0x2a800e20, 0x2a800e20}, + {0x0000a5b4, 0x3c805e69, 0x3c805e69, 0x2e800e22, 0x2e800e22}, + {0x0000a5b8, 0x40805e6b, 0x40805e6b, 0x31800e24, 0x31800e24}, + {0x0000a5bc, 0x44805e6d, 0x44805e6d, 0x34801640, 0x34801640}, + {0x0000a5c0, 0x49805e72, 0x49805e72, 0x38801660, 0x38801660}, + {0x0000a5c4, 0x4e805eb2, 0x4e805eb2, 0x3b801861, 0x3b801861}, + {0x0000a5c8, 0x53805f12, 0x53805f12, 0x3e801a81, 0x3e801a81}, + {0x0000a5cc, 0x59825eb2, 0x59825eb2, 0x42801a83, 0x42801a83}, + {0x0000a5d0, 0x5e825f12, 0x5e825f12, 0x44801c84, 0x44801c84}, + {0x0000a5d4, 0x61827f12, 0x61827f12, 0x48801ce3, 0x48801ce3}, + {0x0000a5d8, 0x6782bf12, 0x6782bf12, 0x4c801ce5, 0x4c801ce5}, + {0x0000a5dc, 0x6b82bf14, 0x6b82bf14, 0x50801ce9, 0x50801ce9}, + {0x0000a5e0, 0x6f82bf16, 0x6f82bf16, 0x54801ceb, 0x54801ceb}, + {0x0000a5e4, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec}, + {0x0000a5e8, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec}, + {0x0000a5ec, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec}, + {0x0000a5f0, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec}, + {0x0000a5f4, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec}, + {0x0000a5f8, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec}, + {0x0000a5fc, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec}, {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, - {0x0000a610, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, - {0x0000a614, 0x02004000, 0x02004000, 0x01404000, 0x01404000}, - {0x0000a618, 0x02004801, 0x02004801, 0x01404501, 0x01404501}, - {0x0000a61c, 0x02808a02, 0x02808a02, 0x02008501, 0x02008501}, - {0x0000a620, 0x0380ce03, 0x0380ce03, 0x0280ca03, 0x0280ca03}, - {0x0000a624, 0x04411104, 0x04411104, 0x03010c04, 0x03010c04}, - {0x0000a628, 0x04411104, 0x04411104, 0x04014c04, 0x04014c04}, - {0x0000a62c, 0x04411104, 0x04411104, 0x04015005, 0x04015005}, - {0x0000a630, 0x04411104, 0x04411104, 0x04015005, 0x04015005}, - {0x0000a634, 0x04411104, 0x04411104, 0x04015005, 0x04015005}, - {0x0000a638, 0x04411104, 0x04411104, 0x04015005, 0x04015005}, - {0x0000a63c, 0x04411104, 0x04411104, 0x04015005, 0x04015005}, - {0x0000b2dc, 0x00033800, 0x00033800, 0x03aaa352, 0x03aaa352}, - {0x0000b2e0, 0x0003c000, 0x0003c000, 0x03ccc584, 0x03ccc584}, - {0x0000b2e4, 0x03fc0000, 0x03fc0000, 0x03f0f800, 0x03f0f800}, + {0x0000a610, 0x00804000, 0x00804000, 0x00000000, 0x00000000}, + {0x0000a614, 0x00804201, 0x00804201, 0x01404000, 0x01404000}, + {0x0000a618, 0x0280c802, 0x0280c802, 0x01404501, 0x01404501}, + {0x0000a61c, 0x0280ca03, 0x0280ca03, 0x02008501, 0x02008501}, + {0x0000a620, 0x04c15104, 0x04c15104, 0x0280ca03, 0x0280ca03}, + {0x0000a624, 0x04c15305, 0x04c15305, 0x03010c04, 0x03010c04}, + {0x0000a628, 0x04c15305, 0x04c15305, 0x04014c04, 0x04014c04}, + {0x0000a62c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005}, + {0x0000a630, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005}, + {0x0000a634, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005}, + {0x0000a638, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005}, + {0x0000a63c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005}, + {0x0000b2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352}, + {0x0000b2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584}, + {0x0000b2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800}, {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000}, - {0x0000c2dc, 0x00033800, 0x00033800, 0x03aaa352, 0x03aaa352}, - {0x0000c2e0, 0x0003c000, 0x0003c000, 0x03ccc584, 0x03ccc584}, - {0x0000c2e4, 0x03fc0000, 0x03fc0000, 0x03f0f800, 0x03f0f800}, + {0x0000c2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352}, + {0x0000c2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584}, + {0x0000c2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800}, {0x0000c2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000}, - {0x00016044, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4}, - {0x00016048, 0x66480001, 0x66480001, 0x66480001, 0x66480001}, - {0x00016068, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c}, - {0x00016444, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4}, - {0x00016448, 0x66480001, 0x66480001, 0x66480001, 0x66480001}, - {0x00016468, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c}, - {0x00016844, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4}, - {0x00016848, 0x66480001, 0x66480001, 0x66480001, 0x66480001}, - {0x00016868, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c}, + {0x00016044, 0x056db2e6, 0x056db2e6, 0x056db2e6, 0x056db2e6}, + {0x00016048, 0xae480001, 0xae480001, 0xae480001, 0xae480001}, + {0x00016068, 0x6eb6db6c, 0x6eb6db6c, 0x6eb6db6c, 0x6eb6db6c}, + {0x00016444, 0x056db2e6, 0x056db2e6, 0x056db2e6, 0x056db2e6}, + {0x00016448, 0xae480001, 0xae480001, 0xae480001, 0xae480001}, + {0x00016468, 0x6eb6db6c, 0x6eb6db6c, 0x6eb6db6c, 0x6eb6db6c}, + {0x00016844, 0x056db2e6, 0x056db2e6, 0x056db2e6, 0x056db2e6}, + {0x00016848, 0xae480001, 0xae480001, 0xae480001, 0xae480001}, + {0x00016868, 0x6eb6db6c, 0x6eb6db6c, 0x6eb6db6c, 0x6eb6db6c}, }; static const u32 ar9300Modes_high_ob_db_tx_gain_table_2p2[][5] = { diff --git a/trunk/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/trunk/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c index 908463915b99..184abb6658e4 100644 --- a/trunk/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +++ b/trunk/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c @@ -3418,133 +3418,6 @@ static bool ath9k_hw_ar9300_fill_eeprom(struct ath_hw *ah) return true; } -#if defined(CONFIG_ATH9K_DEBUGFS) || defined(CONFIG_ATH9K_HTC_DEBUGFS) -static u32 ar9003_dump_modal_eeprom(char *buf, u32 len, u32 size, - struct ar9300_modal_eep_header *modal_hdr) -{ - PR_EEP("Chain0 Ant. Control", le16_to_cpu(modal_hdr->antCtrlChain[0])); - PR_EEP("Chain1 Ant. Control", le16_to_cpu(modal_hdr->antCtrlChain[1])); - PR_EEP("Chain2 Ant. Control", le16_to_cpu(modal_hdr->antCtrlChain[2])); - PR_EEP("Ant. Common Control", le32_to_cpu(modal_hdr->antCtrlCommon)); - PR_EEP("Ant. Common Control2", le32_to_cpu(modal_hdr->antCtrlCommon2)); - PR_EEP("Ant. Gain", modal_hdr->antennaGain); - PR_EEP("Switch Settle", modal_hdr->switchSettling); - PR_EEP("Chain0 xatten1DB", modal_hdr->xatten1DB[0]); - PR_EEP("Chain1 xatten1DB", modal_hdr->xatten1DB[1]); - PR_EEP("Chain2 xatten1DB", modal_hdr->xatten1DB[2]); - PR_EEP("Chain0 xatten1Margin", modal_hdr->xatten1Margin[0]); - PR_EEP("Chain1 xatten1Margin", modal_hdr->xatten1Margin[1]); - PR_EEP("Chain2 xatten1Margin", modal_hdr->xatten1Margin[2]); - PR_EEP("Temp Slope", modal_hdr->tempSlope); - PR_EEP("Volt Slope", modal_hdr->voltSlope); - PR_EEP("spur Channels0", modal_hdr->spurChans[0]); - PR_EEP("spur Channels1", modal_hdr->spurChans[1]); - PR_EEP("spur Channels2", modal_hdr->spurChans[2]); - PR_EEP("spur Channels3", modal_hdr->spurChans[3]); - PR_EEP("spur Channels4", modal_hdr->spurChans[4]); - PR_EEP("Chain0 NF Threshold", modal_hdr->noiseFloorThreshCh[0]); - PR_EEP("Chain1 NF Threshold", modal_hdr->noiseFloorThreshCh[1]); - PR_EEP("Chain2 NF Threshold", modal_hdr->noiseFloorThreshCh[2]); - PR_EEP("xPA Bias Level", modal_hdr->xpaBiasLvl); - PR_EEP("txFrameToDataStart", modal_hdr->txFrameToDataStart); - PR_EEP("txFrameToPaOn", modal_hdr->txFrameToPaOn); - PR_EEP("txFrameToXpaOn", modal_hdr->txFrameToXpaOn); - PR_EEP("txClip", modal_hdr->txClip); - PR_EEP("ADC Desired size", modal_hdr->adcDesiredSize); - PR_EEP("Chain0 ob", modal_hdr->ob[0]); - PR_EEP("Chain1 ob", modal_hdr->ob[1]); - PR_EEP("Chain2 ob", modal_hdr->ob[2]); - - PR_EEP("Chain0 db_stage2", modal_hdr->db_stage2[0]); - PR_EEP("Chain1 db_stage2", modal_hdr->db_stage2[1]); - PR_EEP("Chain2 db_stage2", modal_hdr->db_stage2[2]); - PR_EEP("Chain0 db_stage3", modal_hdr->db_stage3[0]); - PR_EEP("Chain1 db_stage3", modal_hdr->db_stage3[1]); - PR_EEP("Chain2 db_stage3", modal_hdr->db_stage3[2]); - PR_EEP("Chain0 db_stage4", modal_hdr->db_stage4[0]); - PR_EEP("Chain1 db_stage4", modal_hdr->db_stage4[1]); - PR_EEP("Chain2 db_stage4", modal_hdr->db_stage4[2]); - - return len; -} - -static u32 ath9k_hw_ar9003_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr, - u8 *buf, u32 len, u32 size) -{ - struct ar9300_eeprom *eep = &ah->eeprom.ar9300_eep; - struct ar9300_base_eep_hdr *pBase; - - if (!dump_base_hdr) { - len += snprintf(buf + len, size - len, - "%20s :\n", "2GHz modal Header"); - len += ar9003_dump_modal_eeprom(buf, len, size, - &eep->modalHeader2G); - len += snprintf(buf + len, size - len, - "%20s :\n", "5GHz modal Header"); - len += ar9003_dump_modal_eeprom(buf, len, size, - &eep->modalHeader5G); - goto out; - } - - pBase = &eep->baseEepHeader; - - PR_EEP("EEPROM Version", ah->eeprom.ar9300_eep.eepromVersion); - PR_EEP("RegDomain1", le16_to_cpu(pBase->regDmn[0])); - PR_EEP("RegDomain2", le16_to_cpu(pBase->regDmn[1])); - PR_EEP("TX Mask", (pBase->txrxMask >> 4)); - PR_EEP("RX Mask", (pBase->txrxMask & 0x0f)); - PR_EEP("Allow 5GHz", !!(pBase->opCapFlags.opFlags & - AR5416_OPFLAGS_11A)); - PR_EEP("Allow 2GHz", !!(pBase->opCapFlags.opFlags & - AR5416_OPFLAGS_11G)); - PR_EEP("Disable 2GHz HT20", !!(pBase->opCapFlags.opFlags & - AR5416_OPFLAGS_N_2G_HT20)); - PR_EEP("Disable 2GHz HT40", !!(pBase->opCapFlags.opFlags & - AR5416_OPFLAGS_N_2G_HT40)); - PR_EEP("Disable 5Ghz HT20", !!(pBase->opCapFlags.opFlags & - AR5416_OPFLAGS_N_5G_HT20)); - PR_EEP("Disable 5Ghz HT40", !!(pBase->opCapFlags.opFlags & - AR5416_OPFLAGS_N_5G_HT40)); - PR_EEP("Big Endian", !!(pBase->opCapFlags.eepMisc & 0x01)); - PR_EEP("RF Silent", pBase->rfSilent); - PR_EEP("BT option", pBase->blueToothOptions); - PR_EEP("Device Cap", pBase->deviceCap); - PR_EEP("Device Type", pBase->deviceType); - PR_EEP("Power Table Offset", pBase->pwrTableOffset); - PR_EEP("Tuning Caps1", pBase->params_for_tuning_caps[0]); - PR_EEP("Tuning Caps2", pBase->params_for_tuning_caps[1]); - PR_EEP("Enable Tx Temp Comp", !!(pBase->featureEnable & BIT(0))); - PR_EEP("Enable Tx Volt Comp", !!(pBase->featureEnable & BIT(1))); - PR_EEP("Enable fast clock", !!(pBase->featureEnable & BIT(2))); - PR_EEP("Enable doubling", !!(pBase->featureEnable & BIT(3))); - PR_EEP("Internal regulator", !!(pBase->featureEnable & BIT(4))); - PR_EEP("Enable Paprd", !!(pBase->featureEnable & BIT(5))); - PR_EEP("Driver Strength", !!(pBase->miscConfiguration & BIT(0))); - PR_EEP("Chain mask Reduce", (pBase->miscConfiguration >> 0x3) & 0x1); - PR_EEP("Write enable Gpio", pBase->eepromWriteEnableGpio); - PR_EEP("WLAN Disable Gpio", pBase->wlanDisableGpio); - PR_EEP("WLAN LED Gpio", pBase->wlanLedGpio); - PR_EEP("Rx Band Select Gpio", pBase->rxBandSelectGpio); - PR_EEP("Tx Gain", pBase->txrxgain >> 4); - PR_EEP("Rx Gain", pBase->txrxgain & 0xf); - PR_EEP("SW Reg", le32_to_cpu(pBase->swreg)); - - len += snprintf(buf + len, size - len, "%20s : %pM\n", "MacAddress", - ah->eeprom.ar9300_eep.macAddr); -out: - if (len > size) - len = size; - - return len; -} -#else -static u32 ath9k_hw_ar9003_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr, - u8 *buf, u32 len, u32 size) -{ - return 0; -} -#endif - /* XXX: review hardware docs */ static int ath9k_hw_ar9300_get_eeprom_ver(struct ath_hw *ah) { @@ -4188,7 +4061,7 @@ static int ar9003_hw_tx_power_regwrite(struct ath_hw *ah, u8 * pPwrArray) /* Write the power for duplicated frames - HT40 */ /* dup40_cck (LSB), dup40_ofdm, ext20_cck, ext20_ofdm (MSB) */ - REG_WRITE(ah, AR_PHY_POWER_TX_RATE(8), + REG_WRITE(ah, 0xa3e0, POW_SM(pPwrArray[ALL_TARGET_LEGACY_6_24], 24) | POW_SM(pPwrArray[ALL_TARGET_LEGACY_1L_5L], 16) | POW_SM(pPwrArray[ALL_TARGET_LEGACY_6_24], 8) | @@ -5124,7 +4997,6 @@ const struct eeprom_ops eep_ar9300_ops = { .check_eeprom = ath9k_hw_ar9300_check_eeprom, .get_eeprom = ath9k_hw_ar9300_get_eeprom, .fill_eeprom = ath9k_hw_ar9300_fill_eeprom, - .dump_eeprom = ath9k_hw_ar9003_dump_eeprom, .get_eeprom_ver = ath9k_hw_ar9300_get_eeprom_ver, .get_eeprom_rev = ath9k_hw_ar9300_get_eeprom_rev, .set_board_values = ath9k_hw_ar9300_set_board_values, diff --git a/trunk/drivers/net/wireless/ath/ath9k/ar9003_mac.c b/trunk/drivers/net/wireless/ath/ath9k/ar9003_mac.c index 1aadc4757e67..8ff0b88a29b9 100644 --- a/trunk/drivers/net/wireless/ath/ath9k/ar9003_mac.c +++ b/trunk/drivers/net/wireless/ath/ath9k/ar9003_mac.c @@ -531,18 +531,17 @@ int ath9k_hw_process_rxdesc_edma(struct ath_hw *ah, struct ath_rx_status *rxs, /* TODO: byte swap on big endian for ar9300_10 */ - if (!rxs) { - if ((rxsp->status11 & AR_RxDone) == 0) - return -EINPROGRESS; + if ((rxsp->status11 & AR_RxDone) == 0) + return -EINPROGRESS; - if (MS(rxsp->ds_info, AR_DescId) != 0x168c) - return -EINVAL; + if (MS(rxsp->ds_info, AR_DescId) != 0x168c) + return -EINVAL; - if ((rxsp->ds_info & (AR_TxRxDesc | AR_CtrlStat)) != 0) - return -EINPROGRESS; + if ((rxsp->ds_info & (AR_TxRxDesc | AR_CtrlStat)) != 0) + return -EINPROGRESS; + if (!rxs) return 0; - } rxs->rs_status = 0; rxs->rs_flags = 0; diff --git a/trunk/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/trunk/drivers/net/wireless/ath/ath9k/ar9003_phy.c index a0aaa6855486..1baca8e4715d 100644 --- a/trunk/drivers/net/wireless/ath/ath9k/ar9003_phy.c +++ b/trunk/drivers/net/wireless/ath/ath9k/ar9003_phy.c @@ -370,7 +370,7 @@ static void ar9003_hw_spur_ofdm_work(struct ath_hw *ah, else spur_subchannel_sd = 0; - spur_freq_sd = (freq_offset << 9) / 11; + spur_freq_sd = ((freq_offset + 10) << 9) / 11; } else { if (REG_READ_FIELD(ah, AR_PHY_GEN_CTRL, @@ -379,7 +379,7 @@ static void ar9003_hw_spur_ofdm_work(struct ath_hw *ah, else spur_subchannel_sd = 1; - spur_freq_sd = (freq_offset << 9) / 11; + spur_freq_sd = ((freq_offset - 10) << 9) / 11; } diff --git a/trunk/drivers/net/wireless/ath/ath9k/ath9k.h b/trunk/drivers/net/wireless/ath/ath9k/ath9k.h index c03949eb37c8..930e29b9e2ca 100644 --- a/trunk/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/trunk/drivers/net/wireless/ath/ath9k/ath9k.h @@ -217,6 +217,7 @@ struct ath_buf_state { u8 bf_type; u8 bfs_paprd; unsigned long bfs_paprd_timestamp; + enum ath9k_internal_frame_type bfs_ftype; }; struct ath_buf { @@ -272,6 +273,8 @@ struct ath_node { struct ath_tx_control { struct ath_txq *txq; struct ath_node *an; + int if_id; + enum ath9k_internal_frame_type frame_type; u8 paprd; }; @@ -567,6 +570,7 @@ struct ath_ant_comb { #define PS_WAIT_FOR_PSPOLL_DATA BIT(2) #define PS_WAIT_FOR_TX_ACK BIT(3) #define PS_BEACON_SYNC BIT(4) +#define PS_TSFOOR_SYNC BIT(5) struct ath_rate_table; diff --git a/trunk/drivers/net/wireless/ath/ath9k/beacon.c b/trunk/drivers/net/wireless/ath/ath9k/beacon.c index 086c9c816bf7..0d13ff74a68b 100644 --- a/trunk/drivers/net/wireless/ath/ath9k/beacon.c +++ b/trunk/drivers/net/wireless/ath/ath9k/beacon.c @@ -522,7 +522,6 @@ static void ath_beacon_config_ap(struct ath_softc *sc, ath9k_beacon_init(sc, nexttbtt, intval); sc->beacon.bmisscnt = 0; ath9k_hw_set_interrupts(ah, ah->imask); - ath9k_hw_enable_interrupts(ah); } /* @@ -649,8 +648,12 @@ static void ath_beacon_config_sta(struct ath_softc *sc, ath9k_hw_set_sta_beacon_timers(ah, &bs); ah->imask |= ATH9K_INT_BMISS; - ath9k_hw_set_interrupts(ah, ah->imask); - ath9k_hw_enable_interrupts(ah); + /* + * If the beacon config is called beacause of TSFOOR, + * Interrupts will be enabled back at the end of ath9k_tasklet + */ + if (!(sc->ps_flags & PS_TSFOOR_SYNC)) + ath9k_hw_set_interrupts(ah, ah->imask); } static void ath_beacon_config_adhoc(struct ath_softc *sc, @@ -684,9 +687,12 @@ static void ath_beacon_config_adhoc(struct ath_softc *sc, ath9k_hw_disable_interrupts(ah); ath9k_beacon_init(sc, nexttbtt, intval); sc->beacon.bmisscnt = 0; - - ath9k_hw_set_interrupts(ah, ah->imask); - ath9k_hw_enable_interrupts(ah); + /* + * If the beacon config is called beacause of TSFOOR, + * Interrupts will be enabled back at the end of ath9k_tasklet + */ + if (!(sc->ps_flags & PS_TSFOOR_SYNC)) + ath9k_hw_set_interrupts(ah, ah->imask); } static bool ath9k_allow_beacon_config(struct ath_softc *sc, diff --git a/trunk/drivers/net/wireless/ath/ath9k/debug.c b/trunk/drivers/net/wireless/ath/ath9k/debug.c index 9bec3b89fb68..d1eb89611ff7 100644 --- a/trunk/drivers/net/wireless/ath/ath9k/debug.c +++ b/trunk/drivers/net/wireless/ath/ath9k/debug.c @@ -1163,62 +1163,6 @@ static const struct file_operations fops_regdump = { .llseek = default_llseek,/* read accesses f_pos */ }; -static ssize_t read_file_base_eeprom(struct file *file, char __user *user_buf, - size_t count, loff_t *ppos) -{ - struct ath_softc *sc = file->private_data; - struct ath_hw *ah = sc->sc_ah; - u32 len = 0, size = 1500; - ssize_t retval = 0; - char *buf; - - buf = kzalloc(size, GFP_KERNEL); - if (!buf) - return -ENOMEM; - - len = ah->eep_ops->dump_eeprom(ah, true, buf, len, size); - - retval = simple_read_from_buffer(user_buf, count, ppos, buf, len); - kfree(buf); - - return retval; -} - -static const struct file_operations fops_base_eeprom = { - .read = read_file_base_eeprom, - .open = ath9k_debugfs_open, - .owner = THIS_MODULE, - .llseek = default_llseek, -}; - -static ssize_t read_file_modal_eeprom(struct file *file, char __user *user_buf, - size_t count, loff_t *ppos) -{ - struct ath_softc *sc = file->private_data; - struct ath_hw *ah = sc->sc_ah; - u32 len = 0, size = 6000; - char *buf; - size_t retval; - - buf = kzalloc(size, GFP_KERNEL); - if (buf == NULL) - return -ENOMEM; - - len = ah->eep_ops->dump_eeprom(ah, false, buf, len, size); - - retval = simple_read_from_buffer(user_buf, count, ppos, buf, len); - kfree(buf); - - return retval; -} - -static const struct file_operations fops_modal_eeprom = { - .read = read_file_modal_eeprom, - .open = ath9k_debugfs_open, - .owner = THIS_MODULE, - .llseek = default_llseek, -}; - int ath9k_init_debug(struct ath_hw *ah) { struct ath_common *common = ath9k_hw_common(ah); @@ -1262,10 +1206,6 @@ int ath9k_init_debug(struct ath_hw *ah) &ah->config.cwm_ignore_extcca); debugfs_create_file("regdump", S_IRUSR, sc->debug.debugfs_phy, sc, &fops_regdump); - debugfs_create_file("base_eeprom", S_IRUSR, sc->debug.debugfs_phy, sc, - &fops_base_eeprom); - debugfs_create_file("modal_eeprom", S_IRUSR, sc->debug.debugfs_phy, sc, - &fops_modal_eeprom); debugfs_create_u32("gpio_mask", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, &sc->sc_ah->gpio_mask); diff --git a/trunk/drivers/net/wireless/ath/ath9k/eeprom.h b/trunk/drivers/net/wireless/ath/ath9k/eeprom.h index a3c7d0c247a3..de99c0da52e4 100644 --- a/trunk/drivers/net/wireless/ath/ath9k/eeprom.h +++ b/trunk/drivers/net/wireless/ath/ath9k/eeprom.h @@ -649,8 +649,6 @@ struct eeprom_ops { int (*check_eeprom)(struct ath_hw *hw); u32 (*get_eeprom)(struct ath_hw *hw, enum eeprom_param param); bool (*fill_eeprom)(struct ath_hw *hw); - u32 (*dump_eeprom)(struct ath_hw *hw, bool dump_base_hdr, u8 *buf, - u32 len, u32 size); int (*get_eeprom_ver)(struct ath_hw *hw); int (*get_eeprom_rev)(struct ath_hw *hw); void (*set_board_values)(struct ath_hw *hw, struct ath9k_channel *chan); diff --git a/trunk/drivers/net/wireless/ath/ath9k/eeprom_4k.c b/trunk/drivers/net/wireless/ath/ath9k/eeprom_4k.c index 1c6ce0442e2f..abf40d3ed344 100644 --- a/trunk/drivers/net/wireless/ath/ath9k/eeprom_4k.c +++ b/trunk/drivers/net/wireless/ath/ath9k/eeprom_4k.c @@ -72,117 +72,6 @@ static bool ath9k_hw_4k_fill_eeprom(struct ath_hw *ah) return __ath9k_hw_4k_fill_eeprom(ah); } -#if defined(CONFIG_ATH9K_DEBUGFS) || defined(CONFIG_ATH9K_HTC_DEBUGFS) -static u32 ath9k_dump_4k_modal_eeprom(char *buf, u32 len, u32 size, - struct modal_eep_4k_header *modal_hdr) -{ - PR_EEP("Chain0 Ant. Control", modal_hdr->antCtrlChain[0]); - PR_EEP("Ant. Common Control", modal_hdr->antCtrlCommon); - PR_EEP("Chain0 Ant. Gain", modal_hdr->antennaGainCh[0]); - PR_EEP("Switch Settle", modal_hdr->switchSettling); - PR_EEP("Chain0 TxRxAtten", modal_hdr->txRxAttenCh[0]); - PR_EEP("Chain0 RxTxMargin", modal_hdr->rxTxMarginCh[0]); - PR_EEP("ADC Desired size", modal_hdr->adcDesiredSize); - PR_EEP("PGA Desired size", modal_hdr->pgaDesiredSize); - PR_EEP("Chain0 xlna Gain", modal_hdr->xlnaGainCh[0]); - PR_EEP("txEndToXpaOff", modal_hdr->txEndToXpaOff); - PR_EEP("txEndToRxOn", modal_hdr->txEndToRxOn); - PR_EEP("txFrameToXpaOn", modal_hdr->txFrameToXpaOn); - PR_EEP("CCA Threshold)", modal_hdr->thresh62); - PR_EEP("Chain0 NF Threshold", modal_hdr->noiseFloorThreshCh[0]); - PR_EEP("xpdGain", modal_hdr->xpdGain); - PR_EEP("External PD", modal_hdr->xpd); - PR_EEP("Chain0 I Coefficient", modal_hdr->iqCalICh[0]); - PR_EEP("Chain0 Q Coefficient", modal_hdr->iqCalQCh[0]); - PR_EEP("pdGainOverlap", modal_hdr->pdGainOverlap); - PR_EEP("O/D Bias Version", modal_hdr->version); - PR_EEP("CCK OutputBias", modal_hdr->ob_0); - PR_EEP("BPSK OutputBias", modal_hdr->ob_1); - PR_EEP("QPSK OutputBias", modal_hdr->ob_2); - PR_EEP("16QAM OutputBias", modal_hdr->ob_3); - PR_EEP("64QAM OutputBias", modal_hdr->ob_4); - PR_EEP("CCK Driver1_Bias", modal_hdr->db1_0); - PR_EEP("BPSK Driver1_Bias", modal_hdr->db1_1); - PR_EEP("QPSK Driver1_Bias", modal_hdr->db1_2); - PR_EEP("16QAM Driver1_Bias", modal_hdr->db1_3); - PR_EEP("64QAM Driver1_Bias", modal_hdr->db1_4); - PR_EEP("CCK Driver2_Bias", modal_hdr->db2_0); - PR_EEP("BPSK Driver2_Bias", modal_hdr->db2_1); - PR_EEP("QPSK Driver2_Bias", modal_hdr->db2_2); - PR_EEP("16QAM Driver2_Bias", modal_hdr->db2_3); - PR_EEP("64QAM Driver2_Bias", modal_hdr->db2_4); - PR_EEP("xPA Bias Level", modal_hdr->xpaBiasLvl); - PR_EEP("txFrameToDataStart", modal_hdr->txFrameToDataStart); - PR_EEP("txFrameToPaOn", modal_hdr->txFrameToPaOn); - PR_EEP("HT40 Power Inc.", modal_hdr->ht40PowerIncForPdadc); - PR_EEP("Chain0 bswAtten", modal_hdr->bswAtten[0]); - PR_EEP("Chain0 bswMargin", modal_hdr->bswMargin[0]); - PR_EEP("HT40 Switch Settle", modal_hdr->swSettleHt40); - PR_EEP("Chain0 xatten2Db", modal_hdr->xatten2Db[0]); - PR_EEP("Chain0 xatten2Margin", modal_hdr->xatten2Margin[0]); - PR_EEP("Ant. Diversity ctl1", modal_hdr->antdiv_ctl1); - PR_EEP("Ant. Diversity ctl2", modal_hdr->antdiv_ctl2); - PR_EEP("TX Diversity", modal_hdr->tx_diversity); - - return len; -} - -static u32 ath9k_hw_4k_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr, - u8 *buf, u32 len, u32 size) -{ - struct ar5416_eeprom_4k *eep = &ah->eeprom.map4k; - struct base_eep_header_4k *pBase = &eep->baseEepHeader; - - if (!dump_base_hdr) { - len += snprintf(buf + len, size - len, - "%20s :\n", "2GHz modal Header"); - len += ath9k_dump_4k_modal_eeprom(buf, len, size, - &eep->modalHeader); - goto out; - } - - PR_EEP("Major Version", pBase->version >> 12); - PR_EEP("Minor Version", pBase->version & 0xFFF); - PR_EEP("Checksum", pBase->checksum); - PR_EEP("Length", pBase->length); - PR_EEP("RegDomain1", pBase->regDmn[0]); - PR_EEP("RegDomain2", pBase->regDmn[1]); - PR_EEP("TX Mask", pBase->txMask); - PR_EEP("RX Mask", pBase->rxMask); - PR_EEP("Allow 5GHz", !!(pBase->opCapFlags & AR5416_OPFLAGS_11A)); - PR_EEP("Allow 2GHz", !!(pBase->opCapFlags & AR5416_OPFLAGS_11G)); - PR_EEP("Disable 2GHz HT20", !!(pBase->opCapFlags & - AR5416_OPFLAGS_N_2G_HT20)); - PR_EEP("Disable 2GHz HT40", !!(pBase->opCapFlags & - AR5416_OPFLAGS_N_2G_HT40)); - PR_EEP("Disable 5Ghz HT20", !!(pBase->opCapFlags & - AR5416_OPFLAGS_N_5G_HT20)); - PR_EEP("Disable 5Ghz HT40", !!(pBase->opCapFlags & - AR5416_OPFLAGS_N_5G_HT40)); - PR_EEP("Big Endian", !!(pBase->eepMisc & 0x01)); - PR_EEP("Cal Bin Major Ver", (pBase->binBuildNumber >> 24) & 0xFF); - PR_EEP("Cal Bin Minor Ver", (pBase->binBuildNumber >> 16) & 0xFF); - PR_EEP("Cal Bin Build", (pBase->binBuildNumber >> 8) & 0xFF); - PR_EEP("TX Gain type", pBase->txGainType); - - len += snprintf(buf + len, size - len, "%20s : %pM\n", "MacAddress", - pBase->macAddr); - -out: - if (len > size) - len = size; - - return len; -} -#else -static u32 ath9k_hw_4k_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr, - u8 *buf, u32 len, u32 size) -{ - return 0; -} -#endif - - #undef SIZE_EEPROM_4K static int ath9k_hw_4k_check_eeprom(struct ath_hw *ah) @@ -1160,7 +1049,6 @@ const struct eeprom_ops eep_4k_ops = { .check_eeprom = ath9k_hw_4k_check_eeprom, .get_eeprom = ath9k_hw_4k_get_eeprom, .fill_eeprom = ath9k_hw_4k_fill_eeprom, - .dump_eeprom = ath9k_hw_4k_dump_eeprom, .get_eeprom_ver = ath9k_hw_4k_get_eeprom_ver, .get_eeprom_rev = ath9k_hw_4k_get_eeprom_rev, .set_board_values = ath9k_hw_4k_set_board_values, diff --git a/trunk/drivers/net/wireless/ath/ath9k/eeprom_9287.c b/trunk/drivers/net/wireless/ath/ath9k/eeprom_9287.c index 21f180db2381..604312cfe8cb 100644 --- a/trunk/drivers/net/wireless/ath/ath9k/eeprom_9287.c +++ b/trunk/drivers/net/wireless/ath/ath9k/eeprom_9287.c @@ -76,111 +76,6 @@ static bool ath9k_hw_ar9287_fill_eeprom(struct ath_hw *ah) return __ath9k_hw_ar9287_fill_eeprom(ah); } -#if defined(CONFIG_ATH9K_DEBUGFS) || defined(CONFIG_ATH9K_HTC_DEBUGFS) -static u32 ar9287_dump_modal_eeprom(char *buf, u32 len, u32 size, - struct modal_eep_ar9287_header *modal_hdr) -{ - PR_EEP("Chain0 Ant. Control", modal_hdr->antCtrlChain[0]); - PR_EEP("Chain1 Ant. Control", modal_hdr->antCtrlChain[1]); - PR_EEP("Ant. Common Control", modal_hdr->antCtrlCommon); - PR_EEP("Chain0 Ant. Gain", modal_hdr->antennaGainCh[0]); - PR_EEP("Chain1 Ant. Gain", modal_hdr->antennaGainCh[1]); - PR_EEP("Switch Settle", modal_hdr->switchSettling); - PR_EEP("Chain0 TxRxAtten", modal_hdr->txRxAttenCh[0]); - PR_EEP("Chain1 TxRxAtten", modal_hdr->txRxAttenCh[1]); - PR_EEP("Chain0 RxTxMargin", modal_hdr->rxTxMarginCh[0]); - PR_EEP("Chain1 RxTxMargin", modal_hdr->rxTxMarginCh[1]); - PR_EEP("ADC Desired size", modal_hdr->adcDesiredSize); - PR_EEP("txEndToXpaOff", modal_hdr->txEndToXpaOff); - PR_EEP("txEndToRxOn", modal_hdr->txEndToRxOn); - PR_EEP("txFrameToXpaOn", modal_hdr->txFrameToXpaOn); - PR_EEP("CCA Threshold)", modal_hdr->thresh62); - PR_EEP("Chain0 NF Threshold", modal_hdr->noiseFloorThreshCh[0]); - PR_EEP("Chain1 NF Threshold", modal_hdr->noiseFloorThreshCh[1]); - PR_EEP("xpdGain", modal_hdr->xpdGain); - PR_EEP("External PD", modal_hdr->xpd); - PR_EEP("Chain0 I Coefficient", modal_hdr->iqCalICh[0]); - PR_EEP("Chain1 I Coefficient", modal_hdr->iqCalICh[1]); - PR_EEP("Chain0 Q Coefficient", modal_hdr->iqCalQCh[0]); - PR_EEP("Chain1 Q Coefficient", modal_hdr->iqCalQCh[1]); - PR_EEP("pdGainOverlap", modal_hdr->pdGainOverlap); - PR_EEP("xPA Bias Level", modal_hdr->xpaBiasLvl); - PR_EEP("txFrameToDataStart", modal_hdr->txFrameToDataStart); - PR_EEP("txFrameToPaOn", modal_hdr->txFrameToPaOn); - PR_EEP("HT40 Power Inc.", modal_hdr->ht40PowerIncForPdadc); - PR_EEP("Chain0 bswAtten", modal_hdr->bswAtten[0]); - PR_EEP("Chain1 bswAtten", modal_hdr->bswAtten[1]); - PR_EEP("Chain0 bswMargin", modal_hdr->bswMargin[0]); - PR_EEP("Chain1 bswMargin", modal_hdr->bswMargin[1]); - PR_EEP("HT40 Switch Settle", modal_hdr->swSettleHt40); - PR_EEP("AR92x7 Version", modal_hdr->version); - PR_EEP("DriverBias1", modal_hdr->db1); - PR_EEP("DriverBias2", modal_hdr->db1); - PR_EEP("CCK OutputBias", modal_hdr->ob_cck); - PR_EEP("PSK OutputBias", modal_hdr->ob_psk); - PR_EEP("QAM OutputBias", modal_hdr->ob_qam); - PR_EEP("PAL_OFF OutputBias", modal_hdr->ob_pal_off); - - return len; -} - -static u32 ath9k_hw_ar9287_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr, - u8 *buf, u32 len, u32 size) -{ - struct ar9287_eeprom *eep = &ah->eeprom.map9287; - struct base_eep_ar9287_header *pBase = &eep->baseEepHeader; - - if (!dump_base_hdr) { - len += snprintf(buf + len, size - len, - "%20s :\n", "2GHz modal Header"); - len += ar9287_dump_modal_eeprom(buf, len, size, - &eep->modalHeader); - goto out; - } - - PR_EEP("Major Version", pBase->version >> 12); - PR_EEP("Minor Version", pBase->version & 0xFFF); - PR_EEP("Checksum", pBase->checksum); - PR_EEP("Length", pBase->length); - PR_EEP("RegDomain1", pBase->regDmn[0]); - PR_EEP("RegDomain2", pBase->regDmn[1]); - PR_EEP("TX Mask", pBase->txMask); - PR_EEP("RX Mask", pBase->rxMask); - PR_EEP("Allow 5GHz", !!(pBase->opCapFlags & AR5416_OPFLAGS_11A)); - PR_EEP("Allow 2GHz", !!(pBase->opCapFlags & AR5416_OPFLAGS_11G)); - PR_EEP("Disable 2GHz HT20", !!(pBase->opCapFlags & - AR5416_OPFLAGS_N_2G_HT20)); - PR_EEP("Disable 2GHz HT40", !!(pBase->opCapFlags & - AR5416_OPFLAGS_N_2G_HT40)); - PR_EEP("Disable 5Ghz HT20", !!(pBase->opCapFlags & - AR5416_OPFLAGS_N_5G_HT20)); - PR_EEP("Disable 5Ghz HT40", !!(pBase->opCapFlags & - AR5416_OPFLAGS_N_5G_HT40)); - PR_EEP("Big Endian", !!(pBase->eepMisc & 0x01)); - PR_EEP("Cal Bin Major Ver", (pBase->binBuildNumber >> 24) & 0xFF); - PR_EEP("Cal Bin Minor Ver", (pBase->binBuildNumber >> 16) & 0xFF); - PR_EEP("Cal Bin Build", (pBase->binBuildNumber >> 8) & 0xFF); - PR_EEP("Power Table Offset", pBase->pwrTableOffset); - PR_EEP("OpenLoop Power Ctrl", pBase->openLoopPwrCntl); - - len += snprintf(buf + len, size - len, "%20s : %pM\n", "MacAddress", - pBase->macAddr); - -out: - if (len > size) - len = size; - - return len; -} -#else -static u32 ath9k_hw_ar9287_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr, - u8 *buf, u32 len, u32 size) -{ - return 0; -} -#endif - - static int ath9k_hw_ar9287_check_eeprom(struct ath_hw *ah) { u32 sum = 0, el, integer; @@ -1096,7 +991,6 @@ const struct eeprom_ops eep_ar9287_ops = { .check_eeprom = ath9k_hw_ar9287_check_eeprom, .get_eeprom = ath9k_hw_ar9287_get_eeprom, .fill_eeprom = ath9k_hw_ar9287_fill_eeprom, - .dump_eeprom = ath9k_hw_ar9287_dump_eeprom, .get_eeprom_ver = ath9k_hw_ar9287_get_eeprom_ver, .get_eeprom_rev = ath9k_hw_ar9287_get_eeprom_rev, .set_board_values = ath9k_hw_ar9287_set_board_values, diff --git a/trunk/drivers/net/wireless/ath/ath9k/eeprom_def.c b/trunk/drivers/net/wireless/ath/ath9k/eeprom_def.c index e7e84be8beed..85057e074bfc 100644 --- a/trunk/drivers/net/wireless/ath/ath9k/eeprom_def.c +++ b/trunk/drivers/net/wireless/ath/ath9k/eeprom_def.c @@ -133,136 +133,6 @@ static bool ath9k_hw_def_fill_eeprom(struct ath_hw *ah) #undef SIZE_EEPROM_DEF -#if defined(CONFIG_ATH9K_DEBUGFS) || defined(CONFIG_ATH9K_HTC_DEBUGFS) -static u32 ath9k_def_dump_modal_eeprom(char *buf, u32 len, u32 size, - struct modal_eep_header *modal_hdr) -{ - PR_EEP("Chain0 Ant. Control", modal_hdr->antCtrlChain[0]); - PR_EEP("Chain1 Ant. Control", modal_hdr->antCtrlChain[1]); - PR_EEP("Chain2 Ant. Control", modal_hdr->antCtrlChain[2]); - PR_EEP("Ant. Common Control", modal_hdr->antCtrlCommon); - PR_EEP("Chain0 Ant. Gain", modal_hdr->antennaGainCh[0]); - PR_EEP("Chain1 Ant. Gain", modal_hdr->antennaGainCh[1]); - PR_EEP("Chain2 Ant. Gain", modal_hdr->antennaGainCh[2]); - PR_EEP("Switch Settle", modal_hdr->switchSettling); - PR_EEP("Chain0 TxRxAtten", modal_hdr->txRxAttenCh[0]); - PR_EEP("Chain1 TxRxAtten", modal_hdr->txRxAttenCh[1]); - PR_EEP("Chain2 TxRxAtten", modal_hdr->txRxAttenCh[2]); - PR_EEP("Chain0 RxTxMargin", modal_hdr->rxTxMarginCh[0]); - PR_EEP("Chain1 RxTxMargin", modal_hdr->rxTxMarginCh[1]); - PR_EEP("Chain2 RxTxMargin", modal_hdr->rxTxMarginCh[2]); - PR_EEP("ADC Desired size", modal_hdr->adcDesiredSize); - PR_EEP("PGA Desired size", modal_hdr->pgaDesiredSize); - PR_EEP("Chain0 xlna Gain", modal_hdr->xlnaGainCh[0]); - PR_EEP("Chain1 xlna Gain", modal_hdr->xlnaGainCh[1]); - PR_EEP("Chain2 xlna Gain", modal_hdr->xlnaGainCh[2]); - PR_EEP("txEndToXpaOff", modal_hdr->txEndToXpaOff); - PR_EEP("txEndToRxOn", modal_hdr->txEndToRxOn); - PR_EEP("txFrameToXpaOn", modal_hdr->txFrameToXpaOn); - PR_EEP("CCA Threshold)", modal_hdr->thresh62); - PR_EEP("Chain0 NF Threshold", modal_hdr->noiseFloorThreshCh[0]); - PR_EEP("Chain1 NF Threshold", modal_hdr->noiseFloorThreshCh[1]); - PR_EEP("Chain2 NF Threshold", modal_hdr->noiseFloorThreshCh[2]); - PR_EEP("xpdGain", modal_hdr->xpdGain); - PR_EEP("External PD", modal_hdr->xpd); - PR_EEP("Chain0 I Coefficient", modal_hdr->iqCalICh[0]); - PR_EEP("Chain1 I Coefficient", modal_hdr->iqCalICh[1]); - PR_EEP("Chain2 I Coefficient", modal_hdr->iqCalICh[2]); - PR_EEP("Chain0 Q Coefficient", modal_hdr->iqCalQCh[0]); - PR_EEP("Chain1 Q Coefficient", modal_hdr->iqCalQCh[1]); - PR_EEP("Chain2 Q Coefficient", modal_hdr->iqCalQCh[2]); - PR_EEP("pdGainOverlap", modal_hdr->pdGainOverlap); - PR_EEP("Chain0 OutputBias", modal_hdr->ob); - PR_EEP("Chain0 DriverBias", modal_hdr->db); - PR_EEP("xPA Bias Level", modal_hdr->xpaBiasLvl); - PR_EEP("2chain pwr decrease", modal_hdr->pwrDecreaseFor2Chain); - PR_EEP("3chain pwr decrease", modal_hdr->pwrDecreaseFor3Chain); - PR_EEP("txFrameToDataStart", modal_hdr->txFrameToDataStart); - PR_EEP("txFrameToPaOn", modal_hdr->txFrameToPaOn); - PR_EEP("HT40 Power Inc.", modal_hdr->ht40PowerIncForPdadc); - PR_EEP("Chain0 bswAtten", modal_hdr->bswAtten[0]); - PR_EEP("Chain1 bswAtten", modal_hdr->bswAtten[1]); - PR_EEP("Chain2 bswAtten", modal_hdr->bswAtten[2]); - PR_EEP("Chain0 bswMargin", modal_hdr->bswMargin[0]); - PR_EEP("Chain1 bswMargin", modal_hdr->bswMargin[1]); - PR_EEP("Chain2 bswMargin", modal_hdr->bswMargin[2]); - PR_EEP("HT40 Switch Settle", modal_hdr->swSettleHt40); - PR_EEP("Chain0 xatten2Db", modal_hdr->xatten2Db[0]); - PR_EEP("Chain1 xatten2Db", modal_hdr->xatten2Db[1]); - PR_EEP("Chain2 xatten2Db", modal_hdr->xatten2Db[2]); - PR_EEP("Chain0 xatten2Margin", modal_hdr->xatten2Margin[0]); - PR_EEP("Chain1 xatten2Margin", modal_hdr->xatten2Margin[1]); - PR_EEP("Chain2 xatten2Margin", modal_hdr->xatten2Margin[2]); - PR_EEP("Chain1 OutputBias", modal_hdr->ob_ch1); - PR_EEP("Chain1 DriverBias", modal_hdr->db_ch1); - PR_EEP("LNA Control", modal_hdr->lna_ctl); - PR_EEP("XPA Bias Freq0", modal_hdr->xpaBiasLvlFreq[0]); - PR_EEP("XPA Bias Freq1", modal_hdr->xpaBiasLvlFreq[1]); - PR_EEP("XPA Bias Freq2", modal_hdr->xpaBiasLvlFreq[2]); - - return len; -} - -static u32 ath9k_hw_def_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr, - u8 *buf, u32 len, u32 size) -{ - struct ar5416_eeprom_def *eep = &ah->eeprom.def; - struct base_eep_header *pBase = &eep->baseEepHeader; - - if (!dump_base_hdr) { - len += snprintf(buf + len, size - len, - "%20s :\n", "2GHz modal Header"); - len += ath9k_def_dump_modal_eeprom(buf, len, size, - &eep->modalHeader[0]); - len += snprintf(buf + len, size - len, - "%20s :\n", "5GHz modal Header"); - len += ath9k_def_dump_modal_eeprom(buf, len, size, - &eep->modalHeader[1]); - goto out; - } - - PR_EEP("Major Version", pBase->version >> 12); - PR_EEP("Minor Version", pBase->version & 0xFFF); - PR_EEP("Checksum", pBase->checksum); - PR_EEP("Length", pBase->length); - PR_EEP("RegDomain1", pBase->regDmn[0]); - PR_EEP("RegDomain2", pBase->regDmn[1]); - PR_EEP("TX Mask", pBase->txMask); - PR_EEP("RX Mask", pBase->rxMask); - PR_EEP("Allow 5GHz", !!(pBase->opCapFlags & AR5416_OPFLAGS_11A)); - PR_EEP("Allow 2GHz", !!(pBase->opCapFlags & AR5416_OPFLAGS_11G)); - PR_EEP("Disable 2GHz HT20", !!(pBase->opCapFlags & - AR5416_OPFLAGS_N_2G_HT20)); - PR_EEP("Disable 2GHz HT40", !!(pBase->opCapFlags & - AR5416_OPFLAGS_N_2G_HT40)); - PR_EEP("Disable 5Ghz HT20", !!(pBase->opCapFlags & - AR5416_OPFLAGS_N_5G_HT20)); - PR_EEP("Disable 5Ghz HT40", !!(pBase->opCapFlags & - AR5416_OPFLAGS_N_5G_HT40)); - PR_EEP("Big Endian", !!(pBase->eepMisc & 0x01)); - PR_EEP("Cal Bin Major Ver", (pBase->binBuildNumber >> 24) & 0xFF); - PR_EEP("Cal Bin Minor Ver", (pBase->binBuildNumber >> 16) & 0xFF); - PR_EEP("Cal Bin Build", (pBase->binBuildNumber >> 8) & 0xFF); - PR_EEP("OpenLoop Power Ctrl", pBase->openLoopPwrCntl); - - len += snprintf(buf + len, size - len, "%20s : %pM\n", "MacAddress", - pBase->macAddr); - -out: - if (len > size) - len = size; - - return len; -} -#else -static u32 ath9k_hw_def_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr, - u8 *buf, u32 len, u32 size) -{ - return 0; -} -#endif - - static int ath9k_hw_def_check_eeprom(struct ath_hw *ah) { struct ar5416_eeprom_def *eep = @@ -1451,7 +1321,6 @@ const struct eeprom_ops eep_def_ops = { .check_eeprom = ath9k_hw_def_check_eeprom, .get_eeprom = ath9k_hw_def_get_eeprom, .fill_eeprom = ath9k_hw_def_fill_eeprom, - .dump_eeprom = ath9k_hw_def_dump_eeprom, .get_eeprom_ver = ath9k_hw_def_get_eeprom_ver, .get_eeprom_rev = ath9k_hw_def_get_eeprom_rev, .set_board_values = ath9k_hw_def_set_board_values, diff --git a/trunk/drivers/net/wireless/ath/ath9k/gpio.c b/trunk/drivers/net/wireless/ath/ath9k/gpio.c index 5113dd80c99f..bc713fc28191 100644 --- a/trunk/drivers/net/wireless/ath/ath9k/gpio.c +++ b/trunk/drivers/net/wireless/ath/ath9k/gpio.c @@ -149,7 +149,6 @@ static void ath9k_gen_timer_start(struct ath_hw *ah, ath9k_hw_disable_interrupts(ah); ah->imask |= ATH9K_INT_GENTIMER; ath9k_hw_set_interrupts(ah, ah->imask); - ath9k_hw_enable_interrupts(ah); } } @@ -164,7 +163,6 @@ static void ath9k_gen_timer_stop(struct ath_hw *ah, struct ath_gen_timer *timer) ath9k_hw_disable_interrupts(ah); ah->imask &= ~ATH9K_INT_GENTIMER; ath9k_hw_set_interrupts(ah, ah->imask); - ath9k_hw_enable_interrupts(ah); } } diff --git a/trunk/drivers/net/wireless/ath/ath9k/hw.h b/trunk/drivers/net/wireless/ath/ath9k/hw.h index 4fbcced2828c..eb49dc19debe 100644 --- a/trunk/drivers/net/wireless/ath/ath9k/hw.h +++ b/trunk/drivers/net/wireless/ath/ath9k/hw.h @@ -93,12 +93,6 @@ (_ah)->reg_ops.write_flush((_ah)); \ } while (0) -#define PR_EEP(_s, _val) \ - do { \ - len += snprintf(buf + len, size - len, "%20s : %10d\n", \ - _s, (_val)); \ - } while (0) - #define SM(_v, _f) (((_v) << _f##_S) & _f) #define MS(_v, _f) (((_v) & _f) >> _f##_S) #define REG_RMW_FIELD(_a, _r, _f, _v) \ @@ -709,7 +703,6 @@ struct ath_hw { u32 txdesc_interrupt_mask; u32 txeol_interrupt_mask; u32 txurn_interrupt_mask; - atomic_t intr_ref_cnt; bool chip_fullsleep; u32 atim_window; diff --git a/trunk/drivers/net/wireless/ath/ath9k/init.c b/trunk/drivers/net/wireless/ath/ath9k/init.c index db38a58e752d..d99f188dfcfc 100644 --- a/trunk/drivers/net/wireless/ath/ath9k/init.c +++ b/trunk/drivers/net/wireless/ath/ath9k/init.c @@ -566,7 +566,6 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc, ah->reg_ops.read = ath9k_ioread32; ah->reg_ops.write = ath9k_iowrite32; ah->reg_ops.rmw = ath9k_reg_rmw; - atomic_set(&ah->intr_ref_cnt, -1); sc->sc_ah = ah; if (!pdata) { diff --git a/trunk/drivers/net/wireless/ath/ath9k/mac.c b/trunk/drivers/net/wireless/ath/ath9k/mac.c index 0f90e1521ffe..b6b523a897e5 100644 --- a/trunk/drivers/net/wireless/ath/ath9k/mac.c +++ b/trunk/drivers/net/wireless/ath/ath9k/mac.c @@ -800,11 +800,6 @@ void ath9k_hw_disable_interrupts(struct ath_hw *ah) { struct ath_common *common = ath9k_hw_common(ah); - if (!(ah->imask & ATH9K_INT_GLOBAL)) - atomic_set(&ah->intr_ref_cnt, -1); - else - atomic_dec(&ah->intr_ref_cnt); - ath_dbg(common, ATH_DBG_INTERRUPT, "disable IER\n"); REG_WRITE(ah, AR_IER, AR_IER_DISABLE); (void) REG_READ(ah, AR_IER); @@ -826,13 +821,6 @@ void ath9k_hw_enable_interrupts(struct ath_hw *ah) if (!(ah->imask & ATH9K_INT_GLOBAL)) return; - if (!atomic_inc_and_test(&ah->intr_ref_cnt)) { - ath_dbg(common, ATH_DBG_INTERRUPT, - "Do not enable IER ref count %d\n", - atomic_read(&ah->intr_ref_cnt)); - return; - } - if (AR_SREV_9340(ah)) sync_default &= ~AR_INTR_SYNC_HOST1_FATAL; @@ -864,6 +852,7 @@ void ath9k_hw_set_interrupts(struct ath_hw *ah, enum ath9k_int ints) ath_dbg(common, ATH_DBG_INTERRUPT, "0x%x => 0x%x\n", omask, ints); + /* TODO: global int Ref count */ mask = ints & ATH9K_INT_COMMON; mask2 = 0; @@ -940,6 +929,9 @@ void ath9k_hw_set_interrupts(struct ath_hw *ah, enum ath9k_int ints) REG_CLR_BIT(ah, AR_IMR_S5, AR_IMR_S5_TIM_TIMER); } + if (ints & ATH9K_INT_GLOBAL) + ath9k_hw_enable_interrupts(ah); + return; } EXPORT_SYMBOL(ath9k_hw_set_interrupts); diff --git a/trunk/drivers/net/wireless/ath/ath9k/main.c b/trunk/drivers/net/wireless/ath/ath9k/main.c index 1e7fe8c0e119..b602447b0a88 100644 --- a/trunk/drivers/net/wireless/ath/ath9k/main.c +++ b/trunk/drivers/net/wireless/ath/ath9k/main.c @@ -294,7 +294,6 @@ static int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw, ath9k_cmn_update_txpow(ah, sc->curtxpow, sc->config.txpowlimit, &sc->curtxpow); ath9k_hw_set_interrupts(ah, ah->imask); - ath9k_hw_enable_interrupts(ah); if (!(sc->sc_flags & (SC_OP_OFFCHANNEL))) { if (sc->sc_flags & SC_OP_BEACONS) @@ -707,7 +706,8 @@ void ath9k_tasklet(unsigned long data) */ ath_dbg(common, ATH_DBG_PS, "TSFOOR - Sync with next Beacon\n"); - sc->ps_flags |= PS_WAIT_FOR_BEACON | PS_BEACON_SYNC; + sc->ps_flags |= PS_WAIT_FOR_BEACON | PS_BEACON_SYNC | + PS_TSFOOR_SYNC; } if (ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) @@ -886,7 +886,6 @@ static void ath_radio_enable(struct ath_softc *sc, struct ieee80211_hw *hw) ath9k_ps_wakeup(sc); spin_lock_bh(&sc->sc_pcu_lock); - atomic_set(&ah->intr_ref_cnt, -1); ath9k_hw_configpcipowersave(ah, 0, 0); @@ -911,7 +910,6 @@ static void ath_radio_enable(struct ath_softc *sc, struct ieee80211_hw *hw) /* Re-Enable interrupts */ ath9k_hw_set_interrupts(ah, ah->imask); - ath9k_hw_enable_interrupts(ah); /* Enable LED */ ath9k_hw_cfg_output(ah, ah->led_pin, @@ -1018,7 +1016,6 @@ int ath_reset(struct ath_softc *sc, bool retry_tx) ath_set_beacon(sc); /* restart beacons */ ath9k_hw_set_interrupts(ah, ah->imask); - ath9k_hw_enable_interrupts(ah); if (retry_tx) { int i; @@ -1133,7 +1130,6 @@ static int ath9k_start(struct ieee80211_hw *hw) /* Disable BMISS interrupt when we're not associated */ ah->imask &= ~(ATH9K_INT_SWBA | ATH9K_INT_BMISS); ath9k_hw_set_interrupts(ah, ah->imask); - ath9k_hw_enable_interrupts(ah); ieee80211_wake_queues(hw); diff --git a/trunk/drivers/net/wireless/ath/ath9k/rc.h b/trunk/drivers/net/wireless/ath/ath9k/rc.h index b7a4bcd3eec7..c3d850207bee 100644 --- a/trunk/drivers/net/wireless/ath/ath9k/rc.h +++ b/trunk/drivers/net/wireless/ath/ath9k/rc.h @@ -221,6 +221,12 @@ struct ath_rate_priv { struct ath_rc_stats rcstats[RATE_TABLE_SIZE]; }; +enum ath9k_internal_frame_type { + ATH9K_IFT_NOT_INTERNAL, + ATH9K_IFT_PAUSE, + ATH9K_IFT_UNPAUSE +}; + #ifdef CONFIG_ATH9K_RATE_CONTROL int ath_rate_control_register(void); void ath_rate_control_unregister(void); diff --git a/trunk/drivers/net/wireless/ath/ath9k/recv.c b/trunk/drivers/net/wireless/ath/ath9k/recv.c index 5b4f05366f87..a551a942027b 100644 --- a/trunk/drivers/net/wireless/ath/ath9k/recv.c +++ b/trunk/drivers/net/wireless/ath/ath9k/recv.c @@ -601,6 +601,7 @@ static void ath_rx_ps_beacon(struct ath_softc *sc, struct sk_buff *skb) ath_dbg(common, ATH_DBG_PS, "Reconfigure Beacon timers based on timestamp from the AP\n"); ath_set_beacon(sc); + sc->ps_flags &= ~PS_TSFOOR_SYNC; } if (ath_beacon_dtim_pending_cab(skb)) { diff --git a/trunk/drivers/net/wireless/ath/ath9k/xmit.c b/trunk/drivers/net/wireless/ath/ath9k/xmit.c index e815e825e9cb..cc595712f518 100644 --- a/trunk/drivers/net/wireless/ath/ath9k/xmit.c +++ b/trunk/drivers/net/wireless/ath/ath9k/xmit.c @@ -1777,6 +1777,7 @@ static void ath_tx_start_dma(struct ath_softc *sc, struct ath_buf *bf, INIT_LIST_HEAD(&bf_head); list_add_tail(&bf->list, &bf_head); + bf->bf_state.bfs_ftype = txctl->frame_type; bf->bf_state.bfs_paprd = txctl->paprd; if (bf->bf_state.bfs_paprd) @@ -1875,7 +1876,7 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb, /*****************/ static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb, - int tx_flags, struct ath_txq *txq) + int tx_flags, int ftype, struct ath_txq *txq) { struct ieee80211_hw *hw = sc->hw; struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); @@ -1960,7 +1961,8 @@ static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf, complete(&sc->paprd_complete); } else { ath_debug_stat_tx(sc, bf, ts, txq); - ath_tx_complete(sc, skb, tx_flags, txq); + ath_tx_complete(sc, skb, tx_flags, + bf->bf_state.bfs_ftype, txq); } /* At this point, skb (bf->bf_mpdu) is consumed...make sure we don't * accidentally reference it later. diff --git a/trunk/drivers/net/wireless/b43/Kconfig b/trunk/drivers/net/wireless/b43/Kconfig index b81a2a1c2618..3cab843afb05 100644 --- a/trunk/drivers/net/wireless/b43/Kconfig +++ b/trunk/drivers/net/wireless/b43/Kconfig @@ -114,13 +114,13 @@ config B43_PHY_N affect other devices support and may provide support for basic needs. config B43_PHY_LP - bool "Support for low-power (LP-PHY) devices" - depends on B43 + bool "Support for low-power (LP-PHY) devices (EXPERIMENTAL)" + depends on B43 && EXPERIMENTAL default y ---help--- Support for the LP-PHY. The LP-PHY is a low-power PHY built into some notebooks - and embedded devices. It supports 802.11a/b/g + and embedded devices. It supports 802.11a/g (802.11a support is optional, and currently disabled). config B43_PHY_HT diff --git a/trunk/drivers/net/wireless/b43/main.c b/trunk/drivers/net/wireless/b43/main.c index d2661aaff50f..88443acf8cfe 100644 --- a/trunk/drivers/net/wireless/b43/main.c +++ b/trunk/drivers/net/wireless/b43/main.c @@ -114,7 +114,6 @@ MODULE_PARM_DESC(pio, "Use PIO accesses by default: 0=DMA, 1=PIO"); #ifdef CONFIG_B43_BCMA static const struct bcma_device_id b43_bcma_tbl[] = { - BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x11, BCMA_ANY_CLASS), BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x17, BCMA_ANY_CLASS), BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x18, BCMA_ANY_CLASS), BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x1D, BCMA_ANY_CLASS), diff --git a/trunk/drivers/net/wireless/libertas/cfg.c b/trunk/drivers/net/wireless/libertas/cfg.c index 85b3169c40d7..63009c7eb2f1 100644 --- a/trunk/drivers/net/wireless/libertas/cfg.c +++ b/trunk/drivers/net/wireless/libertas/cfg.c @@ -712,7 +712,7 @@ static void lbs_scan_worker(struct work_struct *work) if (priv->scan_channel < priv->scan_req->n_channels) { cancel_delayed_work(&priv->scan_work); - if (netif_running(priv->dev)) + if (!priv->stopping) queue_delayed_work(priv->work_thread, &priv->scan_work, msecs_to_jiffies(300)); } @@ -1409,23 +1409,31 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev, return ret; } -int lbs_disconnect(struct lbs_private *priv, u16 reason) +static int lbs_cfg_disconnect(struct wiphy *wiphy, struct net_device *dev, + u16 reason_code) { + struct lbs_private *priv = wiphy_priv(wiphy); struct cmd_ds_802_11_deauthenticate cmd; - int ret; + + if (dev == priv->mesh_dev) + return -EOPNOTSUPP; + + lbs_deb_enter_args(LBS_DEB_CFG80211, "reason_code %d", reason_code); + + /* store for lbs_cfg_ret_disconnect() */ + priv->disassoc_reason = reason_code; memset(&cmd, 0, sizeof(cmd)); cmd.hdr.size = cpu_to_le16(sizeof(cmd)); /* Mildly ugly to use a locally store my own BSSID ... */ memcpy(cmd.macaddr, &priv->assoc_bss, ETH_ALEN); - cmd.reasoncode = cpu_to_le16(reason); + cmd.reasoncode = cpu_to_le16(reason_code); - ret = lbs_cmd_with_response(priv, CMD_802_11_DEAUTHENTICATE, &cmd); - if (ret) - return ret; + if (lbs_cmd_with_response(priv, CMD_802_11_DEAUTHENTICATE, &cmd)) + return -EFAULT; cfg80211_disconnected(priv->dev, - reason, + priv->disassoc_reason, NULL, 0, GFP_KERNEL); priv->connect_status = LBS_DISCONNECTED; @@ -1433,21 +1441,6 @@ int lbs_disconnect(struct lbs_private *priv, u16 reason) return 0; } -static int lbs_cfg_disconnect(struct wiphy *wiphy, struct net_device *dev, - u16 reason_code) -{ - struct lbs_private *priv = wiphy_priv(wiphy); - - if (dev == priv->mesh_dev) - return -EOPNOTSUPP; - - lbs_deb_enter_args(LBS_DEB_CFG80211, "reason_code %d", reason_code); - - /* store for lbs_cfg_ret_disconnect() */ - priv->disassoc_reason = reason_code; - - return lbs_disconnect(priv, reason_code); -} static int lbs_cfg_set_default_key(struct wiphy *wiphy, struct net_device *netdev, diff --git a/trunk/drivers/net/wireless/libertas/cfg.h b/trunk/drivers/net/wireless/libertas/cfg.h index a02ee151710e..4f46bb744bee 100644 --- a/trunk/drivers/net/wireless/libertas/cfg.h +++ b/trunk/drivers/net/wireless/libertas/cfg.h @@ -17,6 +17,5 @@ void lbs_send_disconnect_notification(struct lbs_private *priv); void lbs_send_mic_failureevent(struct lbs_private *priv, u32 event); void lbs_scan_deinit(struct lbs_private *priv); -int lbs_disconnect(struct lbs_private *priv, u16 reason); #endif diff --git a/trunk/drivers/net/wireless/libertas/cmd.c b/trunk/drivers/net/wireless/libertas/cmd.c index e08ab1de3d9d..dbd24a4607ec 100644 --- a/trunk/drivers/net/wireless/libertas/cmd.c +++ b/trunk/drivers/net/wireless/libertas/cmd.c @@ -1088,7 +1088,7 @@ void __lbs_complete_command(struct lbs_private *priv, struct cmd_ctrl_node *cmd, if (!cmd->callback || cmd->callback == lbs_cmd_async_callback) __lbs_cleanup_and_insert_cmd(priv, cmd); priv->cur_cmd = NULL; - wake_up(&priv->waitq); + wake_up_interruptible(&priv->waitq); } void lbs_complete_command(struct lbs_private *priv, struct cmd_ctrl_node *cmd, @@ -1627,7 +1627,7 @@ struct cmd_ctrl_node *__lbs_cmd_async(struct lbs_private *priv, lbs_deb_host("PREP_CMD: cmdnode is NULL\n"); /* Wake up main thread to execute next command */ - wake_up(&priv->waitq); + wake_up_interruptible(&priv->waitq); cmdnode = ERR_PTR(-ENOBUFS); goto done; } @@ -1647,7 +1647,7 @@ struct cmd_ctrl_node *__lbs_cmd_async(struct lbs_private *priv, cmdnode->cmdwaitqwoken = 0; lbs_queue_cmd(priv, cmdnode); - wake_up(&priv->waitq); + wake_up_interruptible(&priv->waitq); done: lbs_deb_leave_args(LBS_DEB_HOST, "ret %p", cmdnode); diff --git a/trunk/drivers/net/wireless/libertas/decl.h b/trunk/drivers/net/wireless/libertas/decl.h index 9304e6fc421f..da0b05bb89fe 100644 --- a/trunk/drivers/net/wireless/libertas/decl.h +++ b/trunk/drivers/net/wireless/libertas/decl.h @@ -43,14 +43,10 @@ int lbs_start_card(struct lbs_private *priv); void lbs_stop_card(struct lbs_private *priv); void lbs_host_to_card_done(struct lbs_private *priv); -int lbs_start_iface(struct lbs_private *priv); -int lbs_stop_iface(struct lbs_private *priv); - int lbs_rtap_supported(struct lbs_private *priv); int lbs_set_mac_address(struct net_device *dev, void *addr); void lbs_set_multicast_list(struct net_device *dev); -void lbs_update_mcast(struct lbs_private *priv); int lbs_suspend(struct lbs_private *priv); int lbs_resume(struct lbs_private *priv); diff --git a/trunk/drivers/net/wireless/libertas/dev.h b/trunk/drivers/net/wireless/libertas/dev.h index 814838916b82..133ff1cac524 100644 --- a/trunk/drivers/net/wireless/libertas/dev.h +++ b/trunk/drivers/net/wireless/libertas/dev.h @@ -46,6 +46,7 @@ struct lbs_private { /* CFG80211 */ struct wireless_dev *wdev; bool wiphy_registered; + bool stopping; struct cfg80211_scan_request *scan_req; u8 assoc_bss[ETH_ALEN]; u8 disassoc_reason; @@ -95,14 +96,11 @@ struct lbs_private { /* Hardware access */ void *card; - bool iface_running; u8 fw_ready; u8 surpriseremoved; u8 setup_fw_on_resume; int (*hw_host_to_card) (struct lbs_private *priv, u8 type, u8 *payload, u16 nb); void (*reset_card) (struct lbs_private *priv); - int (*power_save) (struct lbs_private *priv); - int (*power_restore) (struct lbs_private *priv); int (*enter_deep_sleep) (struct lbs_private *priv); int (*exit_deep_sleep) (struct lbs_private *priv); int (*reset_deep_sleep_wakeup) (struct lbs_private *priv); @@ -184,16 +182,4 @@ struct lbs_private { extern struct cmd_confirm_sleep confirm_sleep; -/* Check if there is an interface active. */ -static inline int lbs_iface_active(struct lbs_private *priv) -{ - int r; - - r = netif_running(priv->dev); - if (priv->mesh_dev); - r |= netif_running(priv->dev); - - return r; -} - #endif diff --git a/trunk/drivers/net/wireless/libertas/if_sdio.c b/trunk/drivers/net/wireless/libertas/if_sdio.c index c962e21762dc..387786e1b394 100644 --- a/trunk/drivers/net/wireless/libertas/if_sdio.c +++ b/trunk/drivers/net/wireless/libertas/if_sdio.c @@ -39,7 +39,6 @@ #include #include #include -#include #include "host.h" #include "decl.h" @@ -48,8 +47,6 @@ #include "cmd.h" #include "if_sdio.h" -static void if_sdio_interrupt(struct sdio_func *func); - /* The if_sdio_remove() callback function is called when * user removes this module from kernel space or ejects * the card from the slot. The driver handles these 2 cases @@ -760,136 +757,6 @@ static int if_sdio_prog_firmware(struct if_sdio_card *card) return ret; } -/********************************************************************/ -/* Power management */ -/********************************************************************/ - -static int if_sdio_power_on(struct if_sdio_card *card) -{ - struct sdio_func *func = card->func; - struct lbs_private *priv = card->priv; - struct mmc_host *host = func->card->host; - int ret; - - sdio_claim_host(func); - - ret = sdio_enable_func(func); - if (ret) - goto release; - - /* For 1-bit transfers to the 8686 model, we need to enable the - * interrupt flag in the CCCR register. Set the MMC_QUIRK_LENIENT_FN0 - * bit to allow access to non-vendor registers. */ - if ((card->model == MODEL_8686) && - (host->caps & MMC_CAP_SDIO_IRQ) && - (host->ios.bus_width == MMC_BUS_WIDTH_1)) { - u8 reg; - - func->card->quirks |= MMC_QUIRK_LENIENT_FN0; - reg = sdio_f0_readb(func, SDIO_CCCR_IF, &ret); - if (ret) - goto disable; - - reg |= SDIO_BUS_ECSI; - sdio_f0_writeb(func, reg, SDIO_CCCR_IF, &ret); - if (ret) - goto disable; - } - - card->ioport = sdio_readb(func, IF_SDIO_IOPORT, &ret); - if (ret) - goto disable; - - card->ioport |= sdio_readb(func, IF_SDIO_IOPORT + 1, &ret) << 8; - if (ret) - goto disable; - - card->ioport |= sdio_readb(func, IF_SDIO_IOPORT + 2, &ret) << 16; - if (ret) - goto disable; - - sdio_release_host(func); - ret = if_sdio_prog_firmware(card); - sdio_claim_host(func); - if (ret) - goto disable; - - /* - * Get rx_unit if the chip is SD8688 or newer. - * SD8385 & SD8686 do not have rx_unit. - */ - if ((card->model != MODEL_8385) - && (card->model != MODEL_8686)) - card->rx_unit = if_sdio_read_rx_unit(card); - else - card->rx_unit = 0; - - /* - * Set up the interrupt handler late. - * - * If we set it up earlier, the (buggy) hardware generates a spurious - * interrupt, even before the interrupt has been enabled, with - * CCCR_INTx = 0. - * - * We register the interrupt handler late so that we can handle any - * spurious interrupts, and also to avoid generation of that known - * spurious interrupt in the first place. - */ - ret = sdio_claim_irq(func, if_sdio_interrupt); - if (ret) - goto disable; - - /* - * Enable interrupts now that everything is set up - */ - sdio_writeb(func, 0x0f, IF_SDIO_H_INT_MASK, &ret); - if (ret) - goto release_irq; - - sdio_release_host(func); - - /* - * FUNC_INIT is required for SD8688 WLAN/BT multiple functions - */ - if (card->model == MODEL_8688) { - struct cmd_header cmd; - - memset(&cmd, 0, sizeof(cmd)); - - lbs_deb_sdio("send function INIT command\n"); - if (__lbs_cmd(priv, CMD_FUNC_INIT, &cmd, sizeof(cmd), - lbs_cmd_copyback, (unsigned long) &cmd)) - netdev_alert(priv->dev, "CMD_FUNC_INIT cmd failed\n"); - } - - priv->fw_ready = 1; - - return 0; - -release_irq: - sdio_release_irq(func); -disable: - sdio_disable_func(func); -release: - sdio_release_host(func); - return ret; -} - -static int if_sdio_power_off(struct if_sdio_card *card) -{ - struct sdio_func *func = card->func; - struct lbs_private *priv = card->priv; - - priv->fw_ready = 0; - - sdio_claim_host(func); - sdio_release_irq(func); - sdio_disable_func(func); - sdio_release_host(func); - return 0; -} - - /*******************************************************************/ /* Libertas callbacks */ /*******************************************************************/ @@ -1056,32 +923,6 @@ static void if_sdio_reset_card(struct lbs_private *priv) schedule_work(&card_reset_work); } -static int if_sdio_power_save(struct lbs_private *priv) -{ - struct if_sdio_card *card = priv->card; - int ret; - - flush_workqueue(card->workqueue); - - ret = if_sdio_power_off(card); - - /* Let runtime PM know the card is powered off */ - pm_runtime_put_sync(&card->func->dev); - - return ret; -} - -static int if_sdio_power_restore(struct lbs_private *priv) -{ - struct if_sdio_card *card = priv->card; - - /* Make sure the card will not be powered off by runtime PM */ - pm_runtime_get_sync(&card->func->dev); - - return if_sdio_power_on(card); -} - - /*******************************************************************/ /* SDIO callbacks */ /*******************************************************************/ @@ -1135,6 +976,7 @@ static int if_sdio_probe(struct sdio_func *func, int ret, i; unsigned int model; struct if_sdio_packet *packet; + struct mmc_host *host = func->card->host; lbs_deb_enter(LBS_DEB_SDIO); @@ -1191,6 +1033,45 @@ static int if_sdio_probe(struct sdio_func *func, goto free; } + sdio_claim_host(func); + + ret = sdio_enable_func(func); + if (ret) + goto release; + + /* For 1-bit transfers to the 8686 model, we need to enable the + * interrupt flag in the CCCR register. Set the MMC_QUIRK_LENIENT_FN0 + * bit to allow access to non-vendor registers. */ + if ((card->model == MODEL_8686) && + (host->caps & MMC_CAP_SDIO_IRQ) && + (host->ios.bus_width == MMC_BUS_WIDTH_1)) { + u8 reg; + + func->card->quirks |= MMC_QUIRK_LENIENT_FN0; + reg = sdio_f0_readb(func, SDIO_CCCR_IF, &ret); + if (ret) + goto release_int; + + reg |= SDIO_BUS_ECSI; + sdio_f0_writeb(func, reg, SDIO_CCCR_IF, &ret); + if (ret) + goto release_int; + } + + card->ioport = sdio_readb(func, IF_SDIO_IOPORT, &ret); + if (ret) + goto release_int; + + card->ioport |= sdio_readb(func, IF_SDIO_IOPORT + 1, &ret) << 8; + if (ret) + goto release_int; + + card->ioport |= sdio_readb(func, IF_SDIO_IOPORT + 2, &ret) << 16; + if (ret) + goto release_int; + + sdio_release_host(func); + sdio_set_drvdata(func, card); lbs_deb_sdio("class = 0x%X, vendor = 0x%X, " @@ -1198,11 +1079,14 @@ static int if_sdio_probe(struct sdio_func *func, func->class, func->vendor, func->device, model, (unsigned)card->ioport); + ret = if_sdio_prog_firmware(card); + if (ret) + goto reclaim; priv = lbs_add_card(card, &func->dev); if (!priv) { ret = -ENOMEM; - goto free; + goto reclaim; } card->priv = priv; @@ -1213,21 +1097,62 @@ static int if_sdio_probe(struct sdio_func *func, priv->exit_deep_sleep = if_sdio_exit_deep_sleep; priv->reset_deep_sleep_wakeup = if_sdio_reset_deep_sleep_wakeup; priv->reset_card = if_sdio_reset_card; - priv->power_save = if_sdio_power_save; - priv->power_restore = if_sdio_power_restore; - ret = if_sdio_power_on(card); + sdio_claim_host(func); + + /* + * Get rx_unit if the chip is SD8688 or newer. + * SD8385 & SD8686 do not have rx_unit. + */ + if ((card->model != MODEL_8385) + && (card->model != MODEL_8686)) + card->rx_unit = if_sdio_read_rx_unit(card); + else + card->rx_unit = 0; + + /* + * Set up the interrupt handler late. + * + * If we set it up earlier, the (buggy) hardware generates a spurious + * interrupt, even before the interrupt has been enabled, with + * CCCR_INTx = 0. + * + * We register the interrupt handler late so that we can handle any + * spurious interrupts, and also to avoid generation of that known + * spurious interrupt in the first place. + */ + ret = sdio_claim_irq(func, if_sdio_interrupt); + if (ret) + goto disable; + + /* + * Enable interrupts now that everything is set up + */ + sdio_writeb(func, 0x0f, IF_SDIO_H_INT_MASK, &ret); + sdio_release_host(func); if (ret) - goto err_activate_card; + goto reclaim; + + priv->fw_ready = 1; + + /* + * FUNC_INIT is required for SD8688 WLAN/BT multiple functions + */ + if (card->model == MODEL_8688) { + struct cmd_header cmd; + + memset(&cmd, 0, sizeof(cmd)); + + lbs_deb_sdio("send function INIT command\n"); + if (__lbs_cmd(priv, CMD_FUNC_INIT, &cmd, sizeof(cmd), + lbs_cmd_copyback, (unsigned long) &cmd)) + netdev_alert(priv->dev, "CMD_FUNC_INIT cmd failed\n"); + } ret = lbs_start_card(priv); - if_sdio_power_off(card); if (ret) goto err_activate_card; - /* Tell PM core that we don't need the card to be powered now */ - pm_runtime_put_noidle(&func->dev); - out: lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret); @@ -1236,6 +1161,14 @@ static int if_sdio_probe(struct sdio_func *func, err_activate_card: flush_workqueue(card->workqueue); lbs_remove_card(priv); +reclaim: + sdio_claim_host(func); +release_int: + sdio_release_irq(func); +disable: + sdio_disable_func(func); +release: + sdio_release_host(func); free: destroy_workqueue(card->workqueue); while (card->packets) { @@ -1262,9 +1195,6 @@ static void if_sdio_remove(struct sdio_func *func) card = sdio_get_drvdata(func); - /* Undo decrement done above in if_sdio_probe */ - pm_runtime_get_noresume(&func->dev); - if (user_rmmod && (card->model == MODEL_8688)) { /* * FUNC_SHUTDOWN is required for SD8688 WLAN/BT @@ -1289,6 +1219,11 @@ static void if_sdio_remove(struct sdio_func *func) flush_workqueue(card->workqueue); destroy_workqueue(card->workqueue); + sdio_claim_host(func); + sdio_release_irq(func); + sdio_disable_func(func); + sdio_release_host(func); + while (card->packets) { packet = card->packets; card->packets = card->packets->next; diff --git a/trunk/drivers/net/wireless/libertas/if_spi.c b/trunk/drivers/net/wireless/libertas/if_spi.c index 622ae6de0d8b..e0286cfbc91d 100644 --- a/trunk/drivers/net/wireless/libertas/if_spi.c +++ b/trunk/drivers/net/wireless/libertas/if_spi.c @@ -531,6 +531,10 @@ static int if_spi_prog_helper_firmware(struct if_spi_card *card, goto out; err = spu_write_u16(card, IF_SPI_CARD_INT_CAUSE_REG, IF_SPI_CIC_CMD_DOWNLOAD_OVER); + goto out; + + lbs_deb_spi("waiting for helper to boot...\n"); + out: if (err) pr_err("failed to load helper firmware (err=%d)\n", err); diff --git a/trunk/drivers/net/wireless/libertas/if_usb.c b/trunk/drivers/net/wireless/libertas/if_usb.c index 0c846f5a646a..ca6e0a411e9c 100644 --- a/trunk/drivers/net/wireless/libertas/if_usb.c +++ b/trunk/drivers/net/wireless/libertas/if_usb.c @@ -956,7 +956,7 @@ static int if_usb_prog_firmware(struct if_usb_card *cardp, priv->dnld_sent = DNLD_RES_RECEIVED; spin_unlock_irqrestore(&priv->driver_lock, flags); - wake_up(&priv->waitq); + wake_up_interruptible(&priv->waitq); return ret; } diff --git a/trunk/drivers/net/wireless/libertas/main.c b/trunk/drivers/net/wireless/libertas/main.c index d62d1fb4177f..ee28ae510935 100644 --- a/trunk/drivers/net/wireless/libertas/main.c +++ b/trunk/drivers/net/wireless/libertas/main.c @@ -99,37 +99,6 @@ u8 lbs_data_rate_to_fw_index(u32 rate) return 0; } -int lbs_start_iface(struct lbs_private *priv) -{ - struct cmd_ds_802_11_mac_address cmd; - int ret; - - if (priv->power_restore) { - ret = priv->power_restore(priv); - if (ret) - return ret; - } - - cmd.hdr.size = cpu_to_le16(sizeof(cmd)); - cmd.action = cpu_to_le16(CMD_ACT_SET); - memcpy(cmd.macadd, priv->current_addr, ETH_ALEN); - - ret = lbs_cmd_with_response(priv, CMD_802_11_MAC_ADDRESS, &cmd); - if (ret) { - lbs_deb_net("set MAC address failed\n"); - goto err; - } - - lbs_update_channel(priv); - - priv->iface_running = true; - return 0; - -err: - if (priv->power_save) - priv->power_save(priv); - return ret; -} /** * lbs_dev_open - open the ethX interface @@ -143,64 +112,23 @@ static int lbs_dev_open(struct net_device *dev) int ret = 0; lbs_deb_enter(LBS_DEB_NET); - if (!priv->iface_running) { - ret = lbs_start_iface(priv); - if (ret) - goto out; - } spin_lock_irq(&priv->driver_lock); + priv->stopping = false; - netif_carrier_off(dev); + if (priv->connect_status == LBS_CONNECTED) + netif_carrier_on(dev); + else + netif_carrier_off(dev); if (!priv->tx_pending_len) netif_wake_queue(dev); spin_unlock_irq(&priv->driver_lock); - -out: lbs_deb_leave_args(LBS_DEB_NET, "ret %d", ret); return ret; } -static bool lbs_command_queue_empty(struct lbs_private *priv) -{ - unsigned long flags; - bool ret; - spin_lock_irqsave(&priv->driver_lock, flags); - ret = priv->cur_cmd == NULL && list_empty(&priv->cmdpendingq); - spin_unlock_irqrestore(&priv->driver_lock, flags); - return ret; -} - -int lbs_stop_iface(struct lbs_private *priv) -{ - unsigned long flags; - int ret = 0; - - lbs_deb_enter(LBS_DEB_MAIN); - - spin_lock_irqsave(&priv->driver_lock, flags); - priv->iface_running = false; - kfree_skb(priv->currenttxskb); - priv->currenttxskb = NULL; - priv->tx_pending_len = 0; - spin_unlock_irqrestore(&priv->driver_lock, flags); - - cancel_work_sync(&priv->mcast_work); - - /* Disable command processing, and wait for all commands to complete */ - lbs_deb_main("waiting for commands to complete\n"); - wait_event(priv->waitq, lbs_command_queue_empty(priv)); - lbs_deb_main("all commands completed\n"); - - if (priv->power_save) - ret = priv->power_save(priv); - - lbs_deb_leave(LBS_DEB_MAIN); - return ret; -} - /** * lbs_eth_stop - close the ethX interface * @@ -213,25 +141,18 @@ static int lbs_eth_stop(struct net_device *dev) lbs_deb_enter(LBS_DEB_NET); - if (priv->connect_status == LBS_CONNECTED) - lbs_disconnect(priv, WLAN_REASON_DEAUTH_LEAVING); - spin_lock_irq(&priv->driver_lock); + priv->stopping = true; netif_stop_queue(dev); spin_unlock_irq(&priv->driver_lock); - lbs_update_mcast(priv); + schedule_work(&priv->mcast_work); cancel_delayed_work_sync(&priv->scan_work); if (priv->scan_req) { cfg80211_scan_done(priv->scan_req, false); priv->scan_req = NULL; } - netif_carrier_off(priv->dev); - - if (!lbs_iface_active(priv)) - lbs_stop_iface(priv); - lbs_deb_leave(LBS_DEB_NET); return 0; } @@ -249,7 +170,7 @@ void lbs_host_to_card_done(struct lbs_private *priv) /* Wake main thread if commands are pending */ if (!priv->cur_cmd || priv->tx_pending_len > 0) { if (!priv->wakeup_dev_required) - wake_up(&priv->waitq); + wake_up_interruptible(&priv->waitq); } spin_unlock_irqrestore(&priv->driver_lock, flags); @@ -262,24 +183,29 @@ int lbs_set_mac_address(struct net_device *dev, void *addr) int ret = 0; struct lbs_private *priv = dev->ml_priv; struct sockaddr *phwaddr = addr; + struct cmd_ds_802_11_mac_address cmd; lbs_deb_enter(LBS_DEB_NET); - /* - * Can only set MAC address when all interfaces are down, to be written - * to the hardware when one of them is brought up. - */ - if (lbs_iface_active(priv)) - return -EBUSY; - /* In case it was called from the mesh device */ dev = priv->dev; + cmd.hdr.size = cpu_to_le16(sizeof(cmd)); + cmd.action = cpu_to_le16(CMD_ACT_SET); + memcpy(cmd.macadd, phwaddr->sa_data, ETH_ALEN); + + ret = lbs_cmd_with_response(priv, CMD_802_11_MAC_ADDRESS, &cmd); + if (ret) { + lbs_deb_net("set MAC address failed\n"); + goto done; + } + memcpy(priv->current_addr, phwaddr->sa_data, ETH_ALEN); memcpy(dev->dev_addr, phwaddr->sa_data, ETH_ALEN); if (priv->mesh_dev) memcpy(priv->mesh_dev->dev_addr, phwaddr->sa_data, ETH_ALEN); +done: lbs_deb_leave_args(LBS_DEB_NET, "ret %d", ret); return ret; } @@ -333,18 +259,18 @@ static int lbs_add_mcast_addrs(struct cmd_ds_mac_multicast_adr *cmd, return i; } -void lbs_update_mcast(struct lbs_private *priv) +static void lbs_set_mcast_worker(struct work_struct *work) { + struct lbs_private *priv = container_of(work, struct lbs_private, mcast_work); struct cmd_ds_mac_multicast_adr mcast_cmd; - int dev_flags = 0; + int dev_flags; int nr_addrs; int old_mac_control = priv->mac_control; lbs_deb_enter(LBS_DEB_NET); - if (netif_running(priv->dev)) - dev_flags |= priv->dev->flags; - if (priv->mesh_dev && netif_running(priv->mesh_dev)) + dev_flags = priv->dev->flags; + if (priv->mesh_dev) dev_flags |= priv->mesh_dev->flags; if (dev_flags & IFF_PROMISC) { @@ -390,12 +316,6 @@ void lbs_update_mcast(struct lbs_private *priv) lbs_deb_leave(LBS_DEB_NET); } -static void lbs_set_mcast_worker(struct work_struct *work) -{ - struct lbs_private *priv = container_of(work, struct lbs_private, mcast_work); - lbs_update_mcast(priv); -} - void lbs_set_multicast_list(struct net_device *dev) { struct lbs_private *priv = dev->ml_priv; @@ -728,7 +648,7 @@ static void lbs_cmd_timeout_handler(unsigned long data) if (priv->dnld_sent == DNLD_CMD_SENT) priv->dnld_sent = DNLD_RES_RECEIVED; - wake_up(&priv->waitq); + wake_up_interruptible(&priv->waitq); out: spin_unlock_irqrestore(&priv->driver_lock, flags); lbs_deb_leave(LBS_DEB_CMD); @@ -970,6 +890,10 @@ void lbs_remove_card(struct lbs_private *priv) lbs_remove_mesh(priv); lbs_scan_deinit(priv); + dev = priv->dev; + + cancel_work_sync(&priv->mcast_work); + /* worker thread destruction blocks on the in-flight command which * should have been cleared already in lbs_stop_card(). */ @@ -1040,6 +964,8 @@ int lbs_start_card(struct lbs_private *priv) if (lbs_mesh_activated(priv)) lbs_start_mesh(priv); + lbs_update_channel(priv); + lbs_debugfs_init_one(priv, dev); netdev_info(dev, "Marvell WLAN 802.11 adapter\n"); @@ -1056,6 +982,8 @@ EXPORT_SYMBOL_GPL(lbs_start_card); void lbs_stop_card(struct lbs_private *priv) { struct net_device *dev; + struct cmd_ctrl_node *cmdnode; + unsigned long flags; lbs_deb_enter(LBS_DEB_MAIN); @@ -1068,6 +996,30 @@ void lbs_stop_card(struct lbs_private *priv) lbs_debugfs_remove_one(priv); lbs_deinit_mesh(priv); + + /* Delete the timeout of the currently processing command */ + del_timer_sync(&priv->command_timer); + del_timer_sync(&priv->auto_deepsleep_timer); + + /* Flush pending command nodes */ + spin_lock_irqsave(&priv->driver_lock, flags); + lbs_deb_main("clearing pending commands\n"); + list_for_each_entry(cmdnode, &priv->cmdpendingq, list) { + cmdnode->result = -ENOENT; + cmdnode->cmdwaitqwoken = 1; + wake_up(&cmdnode->cmdwait_q); + } + + /* Flush the command the card is currently processing */ + if (priv->cur_cmd) { + lbs_deb_main("clearing current command\n"); + priv->cur_cmd->result = -ENOENT; + priv->cur_cmd->cmdwaitqwoken = 1; + wake_up(&priv->cur_cmd->cmdwait_q); + } + lbs_deb_main("done clearing commands\n"); + spin_unlock_irqrestore(&priv->driver_lock, flags); + unregister_netdev(dev); out: @@ -1088,7 +1040,7 @@ void lbs_queue_event(struct lbs_private *priv, u32 event) kfifo_in(&priv->event_fifo, (unsigned char *) &event, sizeof(u32)); - wake_up(&priv->waitq); + wake_up_interruptible(&priv->waitq); spin_unlock_irqrestore(&priv->driver_lock, flags); lbs_deb_leave(LBS_DEB_THREAD); @@ -1106,7 +1058,7 @@ void lbs_notify_command_response(struct lbs_private *priv, u8 resp_idx) BUG_ON(resp_idx > 1); priv->resp_idx = resp_idx; - wake_up(&priv->waitq); + wake_up_interruptible(&priv->waitq); lbs_deb_leave(LBS_DEB_THREAD); } diff --git a/trunk/drivers/net/wireless/libertas/mesh.c b/trunk/drivers/net/wireless/libertas/mesh.c index 138699baf90e..2a635d279ffe 100644 --- a/trunk/drivers/net/wireless/libertas/mesh.c +++ b/trunk/drivers/net/wireless/libertas/mesh.c @@ -924,9 +924,7 @@ static int lbs_mesh_stop(struct net_device *dev) spin_unlock_irq(&priv->driver_lock); - lbs_update_mcast(priv); - if (!lbs_iface_active(priv)) - lbs_stop_iface(priv); + schedule_work(&priv->mcast_work); lbs_deb_leave(LBS_DEB_MESH); return 0; @@ -944,11 +942,6 @@ static int lbs_mesh_dev_open(struct net_device *dev) int ret = 0; lbs_deb_enter(LBS_DEB_NET); - if (!priv->iface_running) { - ret = lbs_start_iface(priv); - if (ret) - goto out; - } spin_lock_irq(&priv->driver_lock); diff --git a/trunk/drivers/net/wireless/mwifiex/main.c b/trunk/drivers/net/wireless/mwifiex/main.c index 53579ad83e5c..e5fc53dc6887 100644 --- a/trunk/drivers/net/wireless/mwifiex/main.c +++ b/trunk/drivers/net/wireless/mwifiex/main.c @@ -849,7 +849,6 @@ mwifiex_add_card(void *card, struct semaphore *sem, { int i; struct mwifiex_adapter *adapter; - char fmt[64]; if (down_interruptible(sem)) goto exit_sem_err; @@ -898,9 +897,6 @@ mwifiex_add_card(void *card, struct semaphore *sem, up(sem); - mwifiex_drv_get_driver_version(adapter, fmt, sizeof(fmt) - 1); - dev_notice(adapter->dev, "driver_version = %s\n", fmt); - return 0; err_add_intf: diff --git a/trunk/drivers/net/wireless/rt2x00/rt2400pci.c b/trunk/drivers/net/wireless/rt2x00/rt2400pci.c index daa32fc9398b..76bcc3547976 100644 --- a/trunk/drivers/net/wireless/rt2x00/rt2400pci.c +++ b/trunk/drivers/net/wireless/rt2x00/rt2400pci.c @@ -645,6 +645,11 @@ static void rt2400pci_start_queue(struct data_queue *queue) rt2x00pci_register_write(rt2x00dev, RXCSR0, reg); break; case QID_BEACON: + /* + * Allow the tbtt tasklet to be scheduled. + */ + tasklet_enable(&rt2x00dev->tbtt_tasklet); + rt2x00pci_register_read(rt2x00dev, CSR14, ®); rt2x00_set_field32(®, CSR14_TSF_COUNT, 1); rt2x00_set_field32(®, CSR14_TBCN, 1); @@ -710,7 +715,7 @@ static void rt2400pci_stop_queue(struct data_queue *queue) /* * Wait for possibly running tbtt tasklets. */ - tasklet_kill(&rt2x00dev->tbtt_tasklet); + tasklet_disable(&rt2x00dev->tbtt_tasklet); break; default: break; @@ -977,6 +982,12 @@ static void rt2400pci_toggle_irq(struct rt2x00_dev *rt2x00dev, if (state == STATE_RADIO_IRQ_ON) { rt2x00pci_register_read(rt2x00dev, CSR7, ®); rt2x00pci_register_write(rt2x00dev, CSR7, reg); + + /* + * Enable tasklets. + */ + tasklet_enable(&rt2x00dev->txstatus_tasklet); + tasklet_enable(&rt2x00dev->rxdone_tasklet); } /* @@ -1000,9 +1011,8 @@ static void rt2400pci_toggle_irq(struct rt2x00_dev *rt2x00dev, * Ensure that all tasklets are finished before * disabling the interrupts. */ - tasklet_kill(&rt2x00dev->txstatus_tasklet); - tasklet_kill(&rt2x00dev->rxdone_tasklet); - tasklet_kill(&rt2x00dev->tbtt_tasklet); + tasklet_disable(&rt2x00dev->txstatus_tasklet); + tasklet_disable(&rt2x00dev->rxdone_tasklet); } } @@ -1337,25 +1347,22 @@ static void rt2400pci_txstatus_tasklet(unsigned long data) /* * Enable all TXDONE interrupts again. */ - if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) { - spin_lock_irq(&rt2x00dev->irqmask_lock); + spin_lock_irq(&rt2x00dev->irqmask_lock); - rt2x00pci_register_read(rt2x00dev, CSR8, ®); - rt2x00_set_field32(®, CSR8_TXDONE_TXRING, 0); - rt2x00_set_field32(®, CSR8_TXDONE_ATIMRING, 0); - rt2x00_set_field32(®, CSR8_TXDONE_PRIORING, 0); - rt2x00pci_register_write(rt2x00dev, CSR8, reg); + rt2x00pci_register_read(rt2x00dev, CSR8, ®); + rt2x00_set_field32(®, CSR8_TXDONE_TXRING, 0); + rt2x00_set_field32(®, CSR8_TXDONE_ATIMRING, 0); + rt2x00_set_field32(®, CSR8_TXDONE_PRIORING, 0); + rt2x00pci_register_write(rt2x00dev, CSR8, reg); - spin_unlock_irq(&rt2x00dev->irqmask_lock); - } + spin_unlock_irq(&rt2x00dev->irqmask_lock); } static void rt2400pci_tbtt_tasklet(unsigned long data) { struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; rt2x00lib_beacondone(rt2x00dev); - if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) - rt2400pci_enable_interrupt(rt2x00dev, CSR8_TBCN_EXPIRE); + rt2400pci_enable_interrupt(rt2x00dev, CSR8_TBCN_EXPIRE); } static void rt2400pci_rxdone_tasklet(unsigned long data) @@ -1363,7 +1370,7 @@ static void rt2400pci_rxdone_tasklet(unsigned long data) struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; if (rt2x00pci_rxdone(rt2x00dev)) tasklet_schedule(&rt2x00dev->rxdone_tasklet); - else if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) + else rt2400pci_enable_interrupt(rt2x00dev, CSR8_RXDONE); } diff --git a/trunk/drivers/net/wireless/rt2x00/rt2500pci.c b/trunk/drivers/net/wireless/rt2x00/rt2500pci.c index b46c3b8866fa..c288d951c034 100644 --- a/trunk/drivers/net/wireless/rt2x00/rt2500pci.c +++ b/trunk/drivers/net/wireless/rt2x00/rt2500pci.c @@ -735,6 +735,11 @@ static void rt2500pci_start_queue(struct data_queue *queue) rt2x00pci_register_write(rt2x00dev, RXCSR0, reg); break; case QID_BEACON: + /* + * Allow the tbtt tasklet to be scheduled. + */ + tasklet_enable(&rt2x00dev->tbtt_tasklet); + rt2x00pci_register_read(rt2x00dev, CSR14, ®); rt2x00_set_field32(®, CSR14_TSF_COUNT, 1); rt2x00_set_field32(®, CSR14_TBCN, 1); @@ -800,7 +805,7 @@ static void rt2500pci_stop_queue(struct data_queue *queue) /* * Wait for possibly running tbtt tasklets. */ - tasklet_kill(&rt2x00dev->tbtt_tasklet); + tasklet_disable(&rt2x00dev->tbtt_tasklet); break; default: break; @@ -1132,6 +1137,12 @@ static void rt2500pci_toggle_irq(struct rt2x00_dev *rt2x00dev, if (state == STATE_RADIO_IRQ_ON) { rt2x00pci_register_read(rt2x00dev, CSR7, ®); rt2x00pci_register_write(rt2x00dev, CSR7, reg); + + /* + * Enable tasklets. + */ + tasklet_enable(&rt2x00dev->txstatus_tasklet); + tasklet_enable(&rt2x00dev->rxdone_tasklet); } /* @@ -1154,9 +1165,8 @@ static void rt2500pci_toggle_irq(struct rt2x00_dev *rt2x00dev, /* * Ensure that all tasklets are finished. */ - tasklet_kill(&rt2x00dev->txstatus_tasklet); - tasklet_kill(&rt2x00dev->rxdone_tasklet); - tasklet_kill(&rt2x00dev->tbtt_tasklet); + tasklet_disable(&rt2x00dev->txstatus_tasklet); + tasklet_disable(&rt2x00dev->rxdone_tasklet); } } @@ -1469,25 +1479,22 @@ static void rt2500pci_txstatus_tasklet(unsigned long data) /* * Enable all TXDONE interrupts again. */ - if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) { - spin_lock_irq(&rt2x00dev->irqmask_lock); + spin_lock_irq(&rt2x00dev->irqmask_lock); - rt2x00pci_register_read(rt2x00dev, CSR8, ®); - rt2x00_set_field32(®, CSR8_TXDONE_TXRING, 0); - rt2x00_set_field32(®, CSR8_TXDONE_ATIMRING, 0); - rt2x00_set_field32(®, CSR8_TXDONE_PRIORING, 0); - rt2x00pci_register_write(rt2x00dev, CSR8, reg); + rt2x00pci_register_read(rt2x00dev, CSR8, ®); + rt2x00_set_field32(®, CSR8_TXDONE_TXRING, 0); + rt2x00_set_field32(®, CSR8_TXDONE_ATIMRING, 0); + rt2x00_set_field32(®, CSR8_TXDONE_PRIORING, 0); + rt2x00pci_register_write(rt2x00dev, CSR8, reg); - spin_unlock_irq(&rt2x00dev->irqmask_lock); - } + spin_unlock_irq(&rt2x00dev->irqmask_lock); } static void rt2500pci_tbtt_tasklet(unsigned long data) { struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; rt2x00lib_beacondone(rt2x00dev); - if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) - rt2500pci_enable_interrupt(rt2x00dev, CSR8_TBCN_EXPIRE); + rt2500pci_enable_interrupt(rt2x00dev, CSR8_TBCN_EXPIRE); } static void rt2500pci_rxdone_tasklet(unsigned long data) @@ -1495,7 +1502,7 @@ static void rt2500pci_rxdone_tasklet(unsigned long data) struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; if (rt2x00pci_rxdone(rt2x00dev)) tasklet_schedule(&rt2x00dev->rxdone_tasklet); - else if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) + else rt2500pci_enable_interrupt(rt2x00dev, CSR8_RXDONE); } diff --git a/trunk/drivers/net/wireless/rt2x00/rt2800pci.c b/trunk/drivers/net/wireless/rt2x00/rt2800pci.c index cabf249aa55b..ebc17ad61dec 100644 --- a/trunk/drivers/net/wireless/rt2x00/rt2800pci.c +++ b/trunk/drivers/net/wireless/rt2x00/rt2800pci.c @@ -200,6 +200,13 @@ static void rt2800pci_start_queue(struct data_queue *queue) rt2x00pci_register_write(rt2x00dev, MAC_SYS_CTRL, reg); break; case QID_BEACON: + /* + * Allow beacon tasklets to be scheduled for periodic + * beacon updates. + */ + tasklet_enable(&rt2x00dev->tbtt_tasklet); + tasklet_enable(&rt2x00dev->pretbtt_tasklet); + rt2x00pci_register_read(rt2x00dev, BCN_TIME_CFG, ®); rt2x00_set_field32(®, BCN_TIME_CFG_TSF_TICKING, 1); rt2x00_set_field32(®, BCN_TIME_CFG_TBTT_ENABLE, 1); @@ -262,13 +269,10 @@ static void rt2800pci_stop_queue(struct data_queue *queue) rt2x00pci_register_write(rt2x00dev, INT_TIMER_EN, reg); /* - * Wait for current invocation to finish. The tasklet - * won't be scheduled anymore afterwards since we disabled - * the TBTT and PRE TBTT timer. + * Wait for tbtt tasklets to finish. */ - tasklet_kill(&rt2x00dev->tbtt_tasklet); - tasklet_kill(&rt2x00dev->pretbtt_tasklet); - + tasklet_disable(&rt2x00dev->tbtt_tasklet); + tasklet_disable(&rt2x00dev->pretbtt_tasklet); break; default: break; @@ -433,6 +437,14 @@ static void rt2800pci_toggle_irq(struct rt2x00_dev *rt2x00dev, if (state == STATE_RADIO_IRQ_ON) { rt2x00pci_register_read(rt2x00dev, INT_SOURCE_CSR, ®); rt2x00pci_register_write(rt2x00dev, INT_SOURCE_CSR, reg); + + /* + * Enable tasklets. The beacon related tasklets are + * enabled when the beacon queue is started. + */ + tasklet_enable(&rt2x00dev->txstatus_tasklet); + tasklet_enable(&rt2x00dev->rxdone_tasklet); + tasklet_enable(&rt2x00dev->autowake_tasklet); } spin_lock_irqsave(&rt2x00dev->irqmask_lock, flags); @@ -460,13 +472,12 @@ static void rt2800pci_toggle_irq(struct rt2x00_dev *rt2x00dev, if (state == STATE_RADIO_IRQ_OFF) { /* - * Wait for possibly running tasklets to finish. + * Ensure that all tasklets are finished before + * disabling the interrupts. */ - tasklet_kill(&rt2x00dev->txstatus_tasklet); - tasklet_kill(&rt2x00dev->rxdone_tasklet); - tasklet_kill(&rt2x00dev->autowake_tasklet); - tasklet_kill(&rt2x00dev->tbtt_tasklet); - tasklet_kill(&rt2x00dev->pretbtt_tasklet); + tasklet_disable(&rt2x00dev->txstatus_tasklet); + tasklet_disable(&rt2x00dev->rxdone_tasklet); + tasklet_disable(&rt2x00dev->autowake_tasklet); } } @@ -802,16 +813,14 @@ static void rt2800pci_pretbtt_tasklet(unsigned long data) { struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; rt2x00lib_pretbtt(rt2x00dev); - if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) - rt2800pci_enable_interrupt(rt2x00dev, INT_MASK_CSR_PRE_TBTT); + rt2800pci_enable_interrupt(rt2x00dev, INT_MASK_CSR_PRE_TBTT); } static void rt2800pci_tbtt_tasklet(unsigned long data) { struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; rt2x00lib_beacondone(rt2x00dev); - if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) - rt2800pci_enable_interrupt(rt2x00dev, INT_MASK_CSR_TBTT); + rt2800pci_enable_interrupt(rt2x00dev, INT_MASK_CSR_TBTT); } static void rt2800pci_rxdone_tasklet(unsigned long data) @@ -819,7 +828,7 @@ static void rt2800pci_rxdone_tasklet(unsigned long data) struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; if (rt2x00pci_rxdone(rt2x00dev)) tasklet_schedule(&rt2x00dev->rxdone_tasklet); - else if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) + else rt2800pci_enable_interrupt(rt2x00dev, INT_MASK_CSR_RX_DONE); } @@ -827,8 +836,7 @@ static void rt2800pci_autowake_tasklet(unsigned long data) { struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; rt2800pci_wakeup(rt2x00dev); - if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) - rt2800pci_enable_interrupt(rt2x00dev, INT_MASK_CSR_AUTO_WAKEUP); + rt2800pci_enable_interrupt(rt2x00dev, INT_MASK_CSR_AUTO_WAKEUP); } static void rt2800pci_txstatus_interrupt(struct rt2x00_dev *rt2x00dev) diff --git a/trunk/drivers/net/wireless/rt2x00/rt2x00dev.c b/trunk/drivers/net/wireless/rt2x00/rt2x00dev.c index 92ff6a72a2bb..0955c941317f 100644 --- a/trunk/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/trunk/drivers/net/wireless/rt2x00/rt2x00dev.c @@ -946,6 +946,7 @@ static int rt2x00lib_probe_hw(struct rt2x00_dev *rt2x00dev) tasklet_init(&rt2x00dev->taskletname, \ rt2x00dev->ops->lib->taskletname, \ (unsigned long)rt2x00dev); \ + tasklet_disable(&rt2x00dev->taskletname); \ } RT2X00_TASKLET_INIT(txstatus_tasklet); diff --git a/trunk/drivers/net/wireless/rt2x00/rt61pci.c b/trunk/drivers/net/wireless/rt2x00/rt61pci.c index 058ef4b19d1d..53110b83bf6e 100644 --- a/trunk/drivers/net/wireless/rt2x00/rt61pci.c +++ b/trunk/drivers/net/wireless/rt2x00/rt61pci.c @@ -1142,6 +1142,11 @@ static void rt61pci_start_queue(struct data_queue *queue) rt2x00pci_register_write(rt2x00dev, TXRX_CSR0, reg); break; case QID_BEACON: + /* + * Allow the tbtt tasklet to be scheduled. + */ + tasklet_enable(&rt2x00dev->tbtt_tasklet); + rt2x00pci_register_read(rt2x00dev, TXRX_CSR9, ®); rt2x00_set_field32(®, TXRX_CSR9_TSF_TICKING, 1); rt2x00_set_field32(®, TXRX_CSR9_TBTT_ENABLE, 1); @@ -1225,7 +1230,7 @@ static void rt61pci_stop_queue(struct data_queue *queue) /* * Wait for possibly running tbtt tasklets. */ - tasklet_kill(&rt2x00dev->tbtt_tasklet); + tasklet_disable(&rt2x00dev->tbtt_tasklet); break; default: break; @@ -1726,6 +1731,13 @@ static void rt61pci_toggle_irq(struct rt2x00_dev *rt2x00dev, rt2x00pci_register_read(rt2x00dev, MCU_INT_SOURCE_CSR, ®); rt2x00pci_register_write(rt2x00dev, MCU_INT_SOURCE_CSR, reg); + + /* + * Enable tasklets. + */ + tasklet_enable(&rt2x00dev->txstatus_tasklet); + tasklet_enable(&rt2x00dev->rxdone_tasklet); + tasklet_enable(&rt2x00dev->autowake_tasklet); } /* @@ -1760,10 +1772,9 @@ static void rt61pci_toggle_irq(struct rt2x00_dev *rt2x00dev, /* * Ensure that all tasklets are finished. */ - tasklet_kill(&rt2x00dev->txstatus_tasklet); - tasklet_kill(&rt2x00dev->rxdone_tasklet); - tasklet_kill(&rt2x00dev->autowake_tasklet); - tasklet_kill(&rt2x00dev->tbtt_tasklet); + tasklet_disable(&rt2x00dev->txstatus_tasklet); + tasklet_disable(&rt2x00dev->rxdone_tasklet); + tasklet_disable(&rt2x00dev->autowake_tasklet); } } @@ -2289,24 +2300,22 @@ static void rt61pci_txstatus_tasklet(unsigned long data) { struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; rt61pci_txdone(rt2x00dev); - if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) - rt61pci_enable_interrupt(rt2x00dev, INT_MASK_CSR_TXDONE); + rt61pci_enable_interrupt(rt2x00dev, INT_MASK_CSR_TXDONE); } static void rt61pci_tbtt_tasklet(unsigned long data) { struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; rt2x00lib_beacondone(rt2x00dev); - if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) - rt61pci_enable_interrupt(rt2x00dev, INT_MASK_CSR_BEACON_DONE); + rt61pci_enable_interrupt(rt2x00dev, INT_MASK_CSR_BEACON_DONE); } static void rt61pci_rxdone_tasklet(unsigned long data) { struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; if (rt2x00pci_rxdone(rt2x00dev)) - tasklet_schedule(&rt2x00dev->rxdone_tasklet); - else if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) + rt2x00pci_rxdone(rt2x00dev); + else rt61pci_enable_interrupt(rt2x00dev, INT_MASK_CSR_RXDONE); } @@ -2316,8 +2325,7 @@ static void rt61pci_autowake_tasklet(unsigned long data) rt61pci_wakeup(rt2x00dev); rt2x00pci_register_write(rt2x00dev, M2H_CMD_DONE_CSR, 0xffffffff); - if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) - rt61pci_enable_mcu_interrupt(rt2x00dev, MCU_INT_MASK_CSR_TWAKEUP); + rt61pci_enable_mcu_interrupt(rt2x00dev, MCU_INT_MASK_CSR_TWAKEUP); } static irqreturn_t rt61pci_interrupt(int irq, void *dev_instance) diff --git a/trunk/drivers/net/wireless/rtlwifi/pci.c b/trunk/drivers/net/wireless/rtlwifi/pci.c index 9983fa18065a..56f12358389d 100644 --- a/trunk/drivers/net/wireless/rtlwifi/pci.c +++ b/trunk/drivers/net/wireless/rtlwifi/pci.c @@ -218,6 +218,7 @@ static void rtl_pci_disable_aspm(struct ieee80211_hw *hw) struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); u8 pcibridge_vendor = pcipriv->ndis_adapter.pcibridge_vendor; + u32 pcicfg_addrport = pcipriv->ndis_adapter.pcicfg_addrport; u8 num4bytes = pcipriv->ndis_adapter.num4bytes; /*Retrieve original configuration settings. */ u8 linkctrl_reg = pcipriv->ndis_adapter.linkctrl_reg; @@ -253,8 +254,9 @@ static void rtl_pci_disable_aspm(struct ieee80211_hw *hw) udelay(50); /*4 Disable Pci Bridge ASPM */ - pci_write_config_byte(rtlpci->pdev, (num4bytes << 2), - pcibridge_linkctrlreg); + rtl_pci_raw_write_port_ulong(PCI_CONF_ADDRESS, + pcicfg_addrport + (num4bytes << 2)); + rtl_pci_raw_write_port_uchar(PCI_CONF_DATA, pcibridge_linkctrlreg); udelay(50); } @@ -275,6 +277,7 @@ static void rtl_pci_enable_aspm(struct ieee80211_hw *hw) u8 pcibridge_devnum = pcipriv->ndis_adapter.pcibridge_devnum; u8 pcibridge_funcnum = pcipriv->ndis_adapter.pcibridge_funcnum; u8 pcibridge_vendor = pcipriv->ndis_adapter.pcibridge_vendor; + u32 pcicfg_addrport = pcipriv->ndis_adapter.pcicfg_addrport; u8 num4bytes = pcipriv->ndis_adapter.num4bytes; u16 aspmlevel; u8 u_pcibridge_aspmsetting; @@ -290,6 +293,8 @@ static void rtl_pci_enable_aspm(struct ieee80211_hw *hw) } /*4 Enable Pci Bridge ASPM */ + rtl_pci_raw_write_port_ulong(PCI_CONF_ADDRESS, + pcicfg_addrport + (num4bytes << 2)); u_pcibridge_aspmsetting = pcipriv->ndis_adapter.pcibridge_linkctrlreg | @@ -298,8 +303,7 @@ static void rtl_pci_enable_aspm(struct ieee80211_hw *hw) if (pcibridge_vendor == PCI_BRIDGE_VENDOR_INTEL) u_pcibridge_aspmsetting &= ~BIT(0); - pci_write_config_byte(rtlpci->pdev, (num4bytes << 2), - u_pcibridge_aspmsetting); + rtl_pci_raw_write_port_uchar(PCI_CONF_DATA, u_pcibridge_aspmsetting); RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("PlatformEnableASPM():PciBridge busnumber[%x], " @@ -331,18 +335,25 @@ static void rtl_pci_enable_aspm(struct ieee80211_hw *hw) static bool rtl_pci_get_amd_l1_patch(struct ieee80211_hw *hw) { - struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); + struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw); + u32 pcicfg_addrport = pcipriv->ndis_adapter.pcicfg_addrport; bool status = false; u8 offset_e0; unsigned offset_e4; - pci_write_config_byte(rtlpci->pdev, 0xe0, 0xa0); + rtl_pci_raw_write_port_ulong(PCI_CONF_ADDRESS, + pcicfg_addrport + 0xE0); + rtl_pci_raw_write_port_uchar(PCI_CONF_DATA, 0xA0); - pci_read_config_byte(rtlpci->pdev, 0xe0, &offset_e0); + rtl_pci_raw_write_port_ulong(PCI_CONF_ADDRESS, + pcicfg_addrport + 0xE0); + rtl_pci_raw_read_port_uchar(PCI_CONF_DATA, &offset_e0); if (offset_e0 == 0xA0) { - pci_read_config_dword(rtlpci->pdev, 0xe4, &offset_e4); + rtl_pci_raw_write_port_ulong(PCI_CONF_ADDRESS, + pcicfg_addrport + 0xE4); + rtl_pci_raw_read_port_ulong(PCI_CONF_DATA, &offset_e4); if (offset_e4 & BIT(23)) status = true; } @@ -353,15 +364,17 @@ static bool rtl_pci_get_amd_l1_patch(struct ieee80211_hw *hw) static void rtl_pci_get_linkcontrol_field(struct ieee80211_hw *hw) { struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw); - struct rtl_pci *rtlpci = rtl_pcidev(pcipriv); u8 capabilityoffset = pcipriv->ndis_adapter.pcibridge_pciehdr_offset; + u32 pcicfg_addrport = pcipriv->ndis_adapter.pcicfg_addrport; u8 linkctrl_reg; u8 num4bbytes; num4bbytes = (capabilityoffset + 0x10) / 4; /*Read Link Control Register */ - pci_read_config_byte(rtlpci->pdev, (num4bbytes << 2), &linkctrl_reg); + rtl_pci_raw_write_port_ulong(PCI_CONF_ADDRESS, + pcicfg_addrport + (num4bbytes << 2)); + rtl_pci_raw_read_port_uchar(PCI_CONF_DATA, &linkctrl_reg); pcipriv->ndis_adapter.pcibridge_linkctrlreg = linkctrl_reg; } @@ -1705,6 +1718,10 @@ static bool _rtl_pci_find_adapter(struct pci_dev *pdev, PCI_SLOT(bridge_pdev->devfn); pcipriv->ndis_adapter.pcibridge_funcnum = PCI_FUNC(bridge_pdev->devfn); + pcipriv->ndis_adapter.pcicfg_addrport = + (pcipriv->ndis_adapter.pcibridge_busnum << 16) | + (pcipriv->ndis_adapter.pcibridge_devnum << 11) | + (pcipriv->ndis_adapter.pcibridge_funcnum << 8) | (1 << 31); pcipriv->ndis_adapter.pcibridge_pciehdr_offset = pci_pcie_cap(bridge_pdev); pcipriv->ndis_adapter.num4bytes = diff --git a/trunk/drivers/net/wireless/rtlwifi/pci.h b/trunk/drivers/net/wireless/rtlwifi/pci.h index a24e505b202b..c53c62046747 100644 --- a/trunk/drivers/net/wireless/rtlwifi/pci.h +++ b/trunk/drivers/net/wireless/rtlwifi/pci.h @@ -212,6 +212,7 @@ struct mp_adapter { u16 pcibridge_vendorid; u16 pcibridge_deviceid; + u32 pcicfg_addrport; u8 num4bytes; u8 pcibridge_pciehdr_offset; @@ -272,4 +273,29 @@ static inline void pci_write32_async(struct rtl_priv *rtlpriv, writel(val, (u8 __iomem *) rtlpriv->io.pci_mem_start + addr); } +static inline void rtl_pci_raw_write_port_ulong(u32 port, u32 val) +{ + outl(val, port); +} + +static inline void rtl_pci_raw_write_port_uchar(u32 port, u8 val) +{ + outb(val, port); +} + +static inline void rtl_pci_raw_read_port_uchar(u32 port, u8 *pval) +{ + *pval = inb(port); +} + +static inline void rtl_pci_raw_read_port_ushort(u32 port, u16 *pval) +{ + *pval = inw(port); +} + +static inline void rtl_pci_raw_read_port_ulong(u32 port, u32 *pval) +{ + *pval = inl(port); +} + #endif diff --git a/trunk/include/linux/ssb/ssb_regs.h b/trunk/include/linux/ssb/ssb_regs.h index 98941203a27f..efbf459d571c 100644 --- a/trunk/include/linux/ssb/ssb_regs.h +++ b/trunk/include/linux/ssb/ssb_regs.h @@ -462,46 +462,6 @@ #define SSB_SPROM8_OFDM5GLPO 0x014A /* 5.2GHz OFDM power offset */ #define SSB_SPROM8_OFDM5GHPO 0x014E /* 5.8GHz OFDM power offset */ -/* Values for boardflags_lo read from SPROM */ -#define SSB_BFL_BTCOEXIST 0x0001 /* implements Bluetooth coexistance */ -#define SSB_BFL_PACTRL 0x0002 /* GPIO 9 controlling the PA */ -#define SSB_BFL_AIRLINEMODE 0x0004 /* implements GPIO 13 radio disable indication */ -#define SSB_BFL_RSSI 0x0008 /* software calculates nrssi slope. */ -#define SSB_BFL_ENETSPI 0x0010 /* has ephy roboswitch spi */ -#define SSB_BFL_XTAL_NOSLOW 0x0020 /* no slow clock available */ -#define SSB_BFL_CCKHIPWR 0x0040 /* can do high power CCK transmission */ -#define SSB_BFL_ENETADM 0x0080 /* has ADMtek switch */ -#define SSB_BFL_ENETVLAN 0x0100 /* can do vlan */ -#define SSB_BFL_AFTERBURNER 0x0200 /* supports Afterburner mode */ -#define SSB_BFL_NOPCI 0x0400 /* board leaves PCI floating */ -#define SSB_BFL_FEM 0x0800 /* supports the Front End Module */ -#define SSB_BFL_EXTLNA 0x1000 /* has an external LNA */ -#define SSB_BFL_HGPA 0x2000 /* had high gain PA */ -#define SSB_BFL_BTCMOD 0x4000 /* BFL_BTCOEXIST is given in alternate GPIOs */ -#define SSB_BFL_ALTIQ 0x8000 /* alternate I/Q settings */ - -/* Values for boardflags_hi read from SPROM */ -#define SSB_BFH_NOPA 0x0001 /* has no PA */ -#define SSB_BFH_RSSIINV 0x0002 /* RSSI uses positive slope (not TSSI) */ -#define SSB_BFH_PAREF 0x0004 /* uses the PARef LDO */ -#define SSB_BFH_3TSWITCH 0x0008 /* uses a triple throw switch shared with bluetooth */ -#define SSB_BFH_PHASESHIFT 0x0010 /* can support phase shifter */ -#define SSB_BFH_BUCKBOOST 0x0020 /* has buck/booster */ -#define SSB_BFH_FEM_BT 0x0040 /* has FEM and switch to share antenna with bluetooth */ - -/* Values for boardflags2_lo read from SPROM */ -#define SSB_BFL2_RXBB_INT_REG_DIS 0x0001 /* external RX BB regulator present */ -#define SSB_BFL2_APLL_WAR 0x0002 /* alternative A-band PLL settings implemented */ -#define SSB_BFL2_TXPWRCTRL_EN 0x0004 /* permits enabling TX Power Control */ -#define SSB_BFL2_2X4_DIV 0x0008 /* 2x4 diversity switch */ -#define SSB_BFL2_5G_PWRGAIN 0x0010 /* supports 5G band power gain */ -#define SSB_BFL2_PCIEWAR_OVR 0x0020 /* overrides ASPM and Clkreq settings */ -#define SSB_BFL2_CAESERS_BRD 0x0040 /* is Caesers board (unused) */ -#define SSB_BFL2_BTC3WIRE 0x0080 /* used 3-wire bluetooth coexist */ -#define SSB_BFL2_SKWRKFEM_BRD 0x0100 /* 4321mcm93 uses Skyworks FEM */ -#define SSB_BFL2_SPUR_WAR 0x0200 /* has a workaround for clock-harmonic spurs */ -#define SSB_BFL2_GPLL_WAR 0x0400 /* altenative G-band PLL settings implemented */ - /* Values for SSB_SPROM1_BINF_CCODE */ enum { SSB_SPROM1CCODE_WORLD = 0, diff --git a/trunk/include/net/lib80211.h b/trunk/include/net/lib80211.h index 2ec896bb72b2..b95bbb083ee8 100644 --- a/trunk/include/net/lib80211.h +++ b/trunk/include/net/lib80211.h @@ -117,7 +117,10 @@ void lib80211_crypt_info_free(struct lib80211_crypt_info *info); int lib80211_register_crypto_ops(struct lib80211_crypto_ops *ops); int lib80211_unregister_crypto_ops(struct lib80211_crypto_ops *ops); struct lib80211_crypto_ops *lib80211_get_crypto_ops(const char *name); +void lib80211_crypt_deinit_entries(struct lib80211_crypt_info *, int); +void lib80211_crypt_deinit_handler(unsigned long); void lib80211_crypt_delayed_deinit(struct lib80211_crypt_info *info, struct lib80211_crypt_data **crypt); +void lib80211_crypt_quiescing(struct lib80211_crypt_info *info); #endif /* LIB80211_H */ diff --git a/trunk/net/mac80211/rc80211_minstrel_ht.c b/trunk/net/mac80211/rc80211_minstrel_ht.c index 21588386a302..66a1eeb279c6 100644 --- a/trunk/net/mac80211/rc80211_minstrel_ht.c +++ b/trunk/net/mac80211/rc80211_minstrel_ht.c @@ -608,13 +608,7 @@ minstrel_ht_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta, return mac80211_minstrel.get_rate(priv, sta, &msp->legacy, txrc); info->flags |= mi->tx_flags; - - /* Don't use EAPOL frames for sampling on non-mrr hw */ - if (mp->hw->max_rates == 1 && - txrc->skb->protocol == cpu_to_be16(ETH_P_PAE)) - sample_idx = -1; - else - sample_idx = minstrel_get_sample_rate(mp, mi); + sample_idx = minstrel_get_sample_rate(mp, mi); #ifdef CONFIG_MAC80211_DEBUGFS /* use fixed index if set */ diff --git a/trunk/net/mac80211/tx.c b/trunk/net/mac80211/tx.c index 69fd494f32f9..8cb0d2d0ac69 100644 --- a/trunk/net/mac80211/tx.c +++ b/trunk/net/mac80211/tx.c @@ -1608,9 +1608,7 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb, struct ieee80211_radiotap_header *prthdr = (struct ieee80211_radiotap_header *)skb->data; struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); - struct ieee80211_hdr *hdr; u16 len_rthdr; - u8 *payload; /* * Frame injection is not allowed if beaconing is not allowed @@ -1661,24 +1659,6 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb, skb_set_network_header(skb, len_rthdr); skb_set_transport_header(skb, len_rthdr); - /* - * Initialize skb->protocol if the injected frame is a data frame - * carrying a rfc1042 header - */ - if (skb->len > len_rthdr + 2) { - hdr = (struct ieee80211_hdr *)(skb->data + len_rthdr); - if (ieee80211_is_data(hdr->frame_control) && - skb->len >= len_rthdr + - ieee80211_hdrlen(hdr->frame_control) + - sizeof(rfc1042_header) + 2) { - payload = (u8 *)hdr + - ieee80211_hdrlen(hdr->frame_control); - if (compare_ether_addr(payload, rfc1042_header) == 0) - skb->protocol = cpu_to_be16((payload[6] << 8) | - payload[7]); - } - } - memset(info, 0, sizeof(*info)); info->flags |= IEEE80211_TX_CTL_REQ_TX_STATUS; diff --git a/trunk/net/wireless/lib80211.c b/trunk/net/wireless/lib80211.c index a55c27b75ee5..3268fac5ab22 100644 --- a/trunk/net/wireless/lib80211.c +++ b/trunk/net/wireless/lib80211.c @@ -41,11 +41,6 @@ struct lib80211_crypto_alg { static LIST_HEAD(lib80211_crypto_algs); static DEFINE_SPINLOCK(lib80211_crypto_lock); -static void lib80211_crypt_deinit_entries(struct lib80211_crypt_info *info, - int force); -static void lib80211_crypt_quiescing(struct lib80211_crypt_info *info); -static void lib80211_crypt_deinit_handler(unsigned long data); - const char *print_ssid(char *buf, const char *ssid, u8 ssid_len) { const char *s = ssid; @@ -116,8 +111,7 @@ void lib80211_crypt_info_free(struct lib80211_crypt_info *info) } EXPORT_SYMBOL(lib80211_crypt_info_free); -static void lib80211_crypt_deinit_entries(struct lib80211_crypt_info *info, - int force) +void lib80211_crypt_deinit_entries(struct lib80211_crypt_info *info, int force) { struct lib80211_crypt_data *entry, *next; unsigned long flags; @@ -137,9 +131,10 @@ static void lib80211_crypt_deinit_entries(struct lib80211_crypt_info *info, } spin_unlock_irqrestore(info->lock, flags); } +EXPORT_SYMBOL(lib80211_crypt_deinit_entries); /* After this, crypt_deinit_list won't accept new members */ -static void lib80211_crypt_quiescing(struct lib80211_crypt_info *info) +void lib80211_crypt_quiescing(struct lib80211_crypt_info *info) { unsigned long flags; @@ -147,8 +142,9 @@ static void lib80211_crypt_quiescing(struct lib80211_crypt_info *info) info->crypt_quiesced = 1; spin_unlock_irqrestore(info->lock, flags); } +EXPORT_SYMBOL(lib80211_crypt_quiescing); -static void lib80211_crypt_deinit_handler(unsigned long data) +void lib80211_crypt_deinit_handler(unsigned long data) { struct lib80211_crypt_info *info = (struct lib80211_crypt_info *)data; unsigned long flags; @@ -164,6 +160,7 @@ static void lib80211_crypt_deinit_handler(unsigned long data) } spin_unlock_irqrestore(info->lock, flags); } +EXPORT_SYMBOL(lib80211_crypt_deinit_handler); void lib80211_crypt_delayed_deinit(struct lib80211_crypt_info *info, struct lib80211_crypt_data **crypt) diff --git a/trunk/net/wireless/reg.c b/trunk/net/wireless/reg.c index 9f3aa5cabdef..02751dbc5a97 100644 --- a/trunk/net/wireless/reg.c +++ b/trunk/net/wireless/reg.c @@ -49,8 +49,10 @@ #include "nl80211.h" #ifdef CONFIG_CFG80211_REG_DEBUG -#define REG_DBG_PRINT(format, args...) \ - printk(KERN_DEBUG pr_fmt(format), ##args) +#define REG_DBG_PRINT(format, args...) \ + do { \ + printk(KERN_DEBUG pr_fmt(format), ##args); \ + } while (0) #else #define REG_DBG_PRINT(args...) #endif @@ -888,7 +890,7 @@ static bool ignore_reg_update(struct wiphy *wiphy, wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY) { REG_DBG_PRINT("Ignoring regulatory request %s " "since the driver uses its own custom " - "regulatory domain\n", + "regulatory domain ", reg_initiator_name(initiator)); return true; } @@ -902,7 +904,7 @@ static bool ignore_reg_update(struct wiphy *wiphy, !is_world_regdom(last_request->alpha2)) { REG_DBG_PRINT("Ignoring regulatory request %s " "since the driver requires its own regulatory " - "domain to be set first\n", + "domain to be set first", reg_initiator_name(initiator)); return true; } @@ -1472,7 +1474,7 @@ static void reg_process_pending_hints(void) /* When last_request->processed becomes true this will be rescheduled */ if (last_request && !last_request->processed) { REG_DBG_PRINT("Pending regulatory request, waiting " - "for it to be processed...\n"); + "for it to be processed..."); goto out; } @@ -2185,7 +2187,7 @@ void reg_device_remove(struct wiphy *wiphy) static void reg_timeout_work(struct work_struct *work) { REG_DBG_PRINT("Timeout while waiting for CRDA to reply, " - "restoring regulatory settings\n"); + "restoring regulatory settings"); restore_regulatory_settings(true); }