aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-trans.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2013-02-08 15:18:40 -0500
committerDavid S. Miller <davem@davemloft.net>2013-02-08 15:18:40 -0500
commitbfb235d78387c4fd38e296ed7bd9a4f2b0a5b2b9 (patch)
tree209d4fd6fb00e660c76ca8ac5d4caed59dbb9957 /drivers/net/wireless/iwlwifi/iwl-trans.h
parentMerge branch 'tg3' (diff)
parentMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem (diff)
downloadlinux-dev-bfb235d78387c4fd38e296ed7bd9a4f2b0a5b2b9.tar.xz
linux-dev-bfb235d78387c4fd38e296ed7bd9a4f2b0a5b2b9.zip
Merge branch 'wireless'
John W. Linville says: ==================== Please accept this pull request intended for the 3.9 stream! Included are a mac80211 pull, an iwlwifi pull (actually two -- one was a fast-forward), a wl12xx pull, and a couple of Bluetooth pulls. On mac80211, Johannes says: "I've included * AKM definitions from Bing, * mesh fixes from Thomas, including a fix from him for me breaking his patch while applying, * channel check fix from Simon, * an old patch from Yoni Divinsky who doesn't even work for TI any more, to configure the WEP TX key for ARP offload etc. * MAC ACL API from Vasanth * a fix for the infamous chanctx_conf warning from Arnd * from myself, a fix for my previous aggregation changes, some cleanup and some improvements and fixes for WoWLAN" On iwlwifi, Johannes says: "Two small changes for iwlwifi-next, one to update all our Copyright notices and one to provide the RX page order." And also: "So what I have here is some cleanups, preparations and the new MVM (multi-virtual MAC) driver itself and (this is new) some work on the transport API as well as a message flooding fix." On wl12xx, Luca says: "Lots of bugfixes and improvements in our TI wireless drivers, including support for multi-channel. Intended for 3.9." On Bluetooth, Gustavo says: "This is my first pull request to 3.9. The biggest changes here are from Johan Hedberg who made a lot of fixes in the Management interface. The issues arose due to a new test tool we wrote and the usage of the Management interface as default in BlueZ 5. The rest of the patches are more clean ups and small fixes." And also: "Here goes another batch intended for 3.9, the majority of the patch here are from Johan who is fixing many issues in the management interface that have appeared lately. The rest of the patches are just small improvements, fixes and clean ups." Along with those are the usual variety of updates/enhancements to the mwl8k, mwifiex, ath9k, rtlwifi, and rt2x00 drivers as well as a few updates for the ssb and bcma busses. I don't think there are any big headliners there. Please let me know if there are problems! ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-trans.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans.h52
1 files changed, 35 insertions, 17 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h
index 0f85eb305878..0a3d4df5f434 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans.h
+++ b/drivers/net/wireless/iwlwifi/iwl-trans.h
@@ -5,7 +5,7 @@
*
* GPL LICENSE SUMMARY
*
- * Copyright(c) 2007 - 2012 Intel Corporation. All rights reserved.
+ * Copyright(c) 2007 - 2013 Intel Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
@@ -30,7 +30,7 @@
*
* BSD LICENSE
*
- * Copyright(c) 2005 - 2012 Intel Corporation. All rights reserved.
+ * Copyright(c) 2005 - 2013 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -193,11 +193,11 @@ struct iwl_rx_packet {
* @CMD_ON_DEMAND: This command is sent by the test mode pipe.
*/
enum CMD_MODE {
- CMD_SYNC = 0,
- CMD_ASYNC = BIT(0),
- CMD_WANT_SKB = BIT(1),
- CMD_WANT_HCMD = BIT(2),
- CMD_ON_DEMAND = BIT(3),
+ CMD_SYNC = 0,
+ CMD_ASYNC = BIT(0),
+ CMD_WANT_SKB = BIT(1),
+ CMD_WANT_HCMD = BIT(2),
+ CMD_ON_DEMAND = BIT(3),
};
#define DEF_CMD_PAYLOAD_SIZE 320
@@ -274,6 +274,7 @@ struct iwl_rx_cmd_buffer {
struct page *_page;
int _offset;
bool _page_stolen;
+ u32 _rx_page_order;
unsigned int truesize;
};
@@ -294,6 +295,11 @@ static inline struct page *rxb_steal_page(struct iwl_rx_cmd_buffer *r)
return r->_page;
}
+static inline void iwl_free_rxb(struct iwl_rx_cmd_buffer *r)
+{
+ __free_pages(r->_page, r->_rx_page_order);
+}
+
#define MAX_NO_RECLAIM_CMDS 6
#define IWL_MASK(lo, hi) ((1 << (hi)) | ((1 << (hi)) - (1 << (lo))))
@@ -410,8 +416,12 @@ struct iwl_trans;
* the op_mode. May be called several times before start_fw, can't be
* called after that.
* @set_pmi: set the power pmi state
- * @grab_nic_access: wake the NIC to be able to access non-HBUS regs
- * @release_nic_access: let the NIC go to sleep
+ * @grab_nic_access: wake the NIC to be able to access non-HBUS regs.
+ * Sleeping is not allowed between grab_nic_access and
+ * release_nic_access.
+ * @release_nic_access: let the NIC go to sleep. The "flags" parameter
+ * must be the same one that was sent before to the grab_nic_access.
+ * @set_bits_mask - set SRAM register according to value and mask.
*/
struct iwl_trans_ops {
@@ -454,8 +464,12 @@ struct iwl_trans_ops {
void (*configure)(struct iwl_trans *trans,
const struct iwl_trans_config *trans_cfg);
void (*set_pmi)(struct iwl_trans *trans, bool state);
- bool (*grab_nic_access)(struct iwl_trans *trans, bool silent);
- void (*release_nic_access)(struct iwl_trans *trans);
+ bool (*grab_nic_access)(struct iwl_trans *trans, bool silent,
+ unsigned long *flags);
+ void (*release_nic_access)(struct iwl_trans *trans,
+ unsigned long *flags);
+ void (*set_bits_mask)(struct iwl_trans *trans, u32 reg, u32 mask,
+ u32 value);
};
/**
@@ -475,7 +489,6 @@ enum iwl_trans_state {
* @ops - pointer to iwl_trans_ops
* @op_mode - pointer to the op_mode
* @cfg - pointer to the configuration
- * @reg_lock - protect hw register access
* @dev - pointer to struct device * that represents the device
* @hw_id: a u32 with the ID of the device / subdevice.
* Set during transport allocation.
@@ -496,7 +509,6 @@ struct iwl_trans {
struct iwl_op_mode *op_mode;
const struct iwl_cfg *cfg;
enum iwl_trans_state state;
- spinlock_t reg_lock;
struct device *dev;
u32 hw_rev;
@@ -756,14 +768,20 @@ static inline void iwl_trans_set_pmi(struct iwl_trans *trans, bool state)
trans->ops->set_pmi(trans, state);
}
-#define iwl_trans_grab_nic_access(trans, silent) \
+static inline void
+iwl_trans_set_bits_mask(struct iwl_trans *trans, u32 reg, u32 mask, u32 value)
+{
+ trans->ops->set_bits_mask(trans, reg, mask, value);
+}
+
+#define iwl_trans_grab_nic_access(trans, silent, flags) \
__cond_lock(nic_access, \
- likely((trans)->ops->grab_nic_access(trans, silent)))
+ likely((trans)->ops->grab_nic_access(trans, silent, flags)))
static inline void __releases(nic_access)
-iwl_trans_release_nic_access(struct iwl_trans *trans)
+iwl_trans_release_nic_access(struct iwl_trans *trans, unsigned long *flags)
{
- trans->ops->release_nic_access(trans);
+ trans->ops->release_nic_access(trans, flags);
__release(nic_access);
}