Skip to contentSkip to conversation

mac80211: use put_unaligned_le16 in mesh_plink_frame_tx

PATCH In review Chun-Yeow Yeoh 2 participants 2 messages Nov 13, 2013 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211: use put_unaligned_le16 in mesh_plink_frame_tx

Use put_unaligned_le16 in mesh_plink_frame_tx.

---
 net/mac80211/cfg.c        |    4 ++--
 net/mac80211/mesh_plink.c |   54 ++++++++++++++++++++++-----------------------
 net/mac80211/mesh_ps.c    |    2 +-
 net/mac80211/sta_info.c   |    2 +-
 net/mac80211/sta_info.h   |    6 ++---
 5 files changed, 34 insertions(+), 34 deletions(-)
net/mac80211/cfg.c +2 -2
index 30cbeaf..e50857b 100644
@@ -532,8 +532,8 @@ static void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
 				 STATION_INFO_PEER_PM |
 				 STATION_INFO_NONPEER_PM;
 
-		sinfo->llid = le16_to_cpu(sta->llid);
-		sinfo->plid = le16_to_cpu(sta->plid);
+		sinfo->llid = sta->llid;
+		sinfo->plid = sta->plid;
 		sinfo->plink_state = sta->plink_state;
 		if (test_sta_flag(sta, WLAN_STA_TOFFSET_KNOWN)) {
 			sinfo->filled |= STATION_INFO_T_OFFSET;
net/mac80211/mesh_plink.c +27 -27

167 lines not on this page · raw message

net/mac80211/mesh_ps.c +1 -1
index 9493868..2802f9d 100644
@@ -578,7 +578,7 @@ void ieee80211_mps_frame_release(struct sta_info *sta,
 
 	if (sta->plink_state == NL80211_PLINK_ESTAB)
 		has_buffered = ieee80211_check_tim(elems->tim, elems->tim_len,
-						   le16_to_cpu(sta->llid));
+						   sta->llid);
 
 	if (has_buffered)
 		mps_dbg(sta->sdata, "%pM indicates buffered frames\n",
net/mac80211/sta_info.c +1 -1
index 7a91515..45b5f61 100644
@@ -631,7 +631,7 @@ void sta_info_recalc_tim(struct sta_info *sta)
 	} else if (ieee80211_vif_is_mesh(&sta->sdata->vif)) {
 		ps = &sta->sdata->u.mesh.ps;
 		/* TIM map only for 1 <= PLID <= IEEE80211_MAX_AID */
-		id = le16_to_cpu(sta->plid) % (IEEE80211_MAX_AID + 1);
+		id = sta->plid % (IEEE80211_MAX_AID + 1);
 #endif
 	} else {
 		return;
net/mac80211/sta_info.h +3 -3
index 6b0d6c2..a2c9a4c 100644
@@ -390,9 +390,9 @@ struct sta_info {
 	 * Mesh peer link attributes
 	 * TODO: move to a sub-structure that is referenced with pointer?
 	 */
-	__le16 llid;
-	__le16 plid;
-	__le16 reason;
+	u16 llid;
+	u16 plid;
+	u16 reason;
 	u8 plink_retries;
 	bool ignore_plink_timer;
 	enum nl80211_plink_state plink_state;
Signature · 1 line
1.7.9.5
maintainer
#1 lore raw
Quoted 1 line · Chun-Yeow Yeoh

Use put_unaligned_le16 in mesh_plink_frame_tx.

Nice, applied both.

johannes