Skip to content

Commit

Permalink
iwlwifi: add iwl_sta_id()
Browse files Browse the repository at this point in the history
In places where the station struct is
guaranteed to exist (presumably), use
this helper to get the station ID out
of it (and warn if there's no station
struct after all).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
  • Loading branch information
Johannes Berg authored and Reinette Chatre committed May 10, 2010
1 parent fd1af15 commit 64ba9a5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/net/wireless/iwlwifi/iwl-sta.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,12 @@ int iwl_sta_rx_agg_start(struct iwl_priv *priv,
int iwl_sta_rx_agg_stop(struct iwl_priv *priv, const u8 *addr, int tid);
void iwl_sta_modify_ps_wake(struct iwl_priv *priv, int sta_id);
void iwl_sta_modify_sleep_tx_count(struct iwl_priv *priv, int sta_id, int cnt);

static inline int iwl_sta_id(struct ieee80211_sta *sta)
{
if (WARN_ON(!sta))
return IWL_INVALID_STATION;

return ((struct iwl_station_priv_common *)sta->drv_priv)->sta_id;
}
#endif /* __iwl_sta_h__ */

0 comments on commit 64ba9a5

Please sign in to comment.