diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2012-02-09 09:08:15 -0500 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2012-02-27 16:26:33 -0500 |
commit | ed277c9361e423df2bc19312c60b9d06cac31ee6 (patch) | |
tree | 210cc5dfe7636aa1a525849a4ca05afe1b73c2a6 /drivers/net/wireless/iwlwifi/iwl-op-mode.h | |
parent | cbe6ab4e11603e426e01c6349cd5643f3a287ba4 (diff) |
iwlwifi: virtualize op_mode's free skb
This handler allows the transport layer to free an skb from the
op_mode. This can happen when the driver is stopped while Tx
packets are pending in the transport layer.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-op-mode.h')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-op-mode.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-op-mode.h b/drivers/net/wireless/iwlwifi/iwl-op-mode.h index c85c8dcabb49..59dd3074bf73 100644 --- a/drivers/net/wireless/iwlwifi/iwl-op-mode.h +++ b/drivers/net/wireless/iwlwifi/iwl-op-mode.h | |||
@@ -65,6 +65,7 @@ | |||
65 | 65 | ||
66 | struct iwl_op_mode; | 66 | struct iwl_op_mode; |
67 | struct iwl_trans; | 67 | struct iwl_trans; |
68 | struct sk_buff; | ||
68 | 69 | ||
69 | /** | 70 | /** |
70 | * struct iwl_op_mode_ops - op_mode specific operations | 71 | * struct iwl_op_mode_ops - op_mode specific operations |
@@ -75,10 +76,15 @@ struct iwl_trans; | |||
75 | * May sleep | 76 | * May sleep |
76 | * @stop: stop the op_mode | 77 | * @stop: stop the op_mode |
77 | * May sleep | 78 | * May sleep |
79 | * @free_skb: allows the transport layer to free skbs that haven't been | ||
80 | * reclaimed by the op_mode. This can happen when the driver is freed and | ||
81 | * there are Tx packets pending in the transport layer. | ||
82 | * Must be atomic | ||
78 | */ | 83 | */ |
79 | struct iwl_op_mode_ops { | 84 | struct iwl_op_mode_ops { |
80 | struct iwl_op_mode *(*start)(struct iwl_trans *trans); | 85 | struct iwl_op_mode *(*start)(struct iwl_trans *trans); |
81 | void (*stop)(struct iwl_op_mode *op_mode); | 86 | void (*stop)(struct iwl_op_mode *op_mode); |
87 | void (*free_skb)(struct iwl_op_mode *op_mode, struct sk_buff *skb); | ||
82 | }; | 88 | }; |
83 | 89 | ||
84 | /** | 90 | /** |
@@ -100,6 +106,12 @@ static inline void iwl_op_mode_stop(struct iwl_op_mode *op_mode) | |||
100 | op_mode->ops->stop(op_mode); | 106 | op_mode->ops->stop(op_mode); |
101 | } | 107 | } |
102 | 108 | ||
109 | static inline void iwl_op_mode_free_skb(struct iwl_op_mode *op_mode, | ||
110 | struct sk_buff *skb) | ||
111 | { | ||
112 | op_mode->ops->free_skb(op_mode, skb); | ||
113 | } | ||
114 | |||
103 | /***************************************************** | 115 | /***************************************************** |
104 | * Op mode layers implementations | 116 | * Op mode layers implementations |
105 | ******************************************************/ | 117 | ******************************************************/ |