Skip to contentSkip to conversation

mac80211: replace ieee80211_get_morefrag with ieee80211_has_morefrags

PATCH Superseded Harvey Harrison 2 participants 5 messages Jun 6, 2008 – Jun 9, 2008

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 2/7 mac80211: replace ieee80211_get_morefrag with ieee80211_has_morefrags

---
 drivers/net/wireless/iwlwifi/iwl-tx.c       |    4 ++--
 drivers/net/wireless/iwlwifi/iwl3945-base.c |    4 ++--
 drivers/net/wireless/rt2x00/rt2x00queue.c   |    2 +-
 drivers/net/wireless/rtl8187_dev.c          |    2 +-
 include/linux/ieee80211.h                   |   13 -------------
 5 files changed, 6 insertions(+), 19 deletions(-)
drivers/net/wireless/iwlwifi/iwl-tx.c +2 -2
index cfe6f4b..b22dc54 100644
@@ -595,7 +595,7 @@ static void iwl_tx_cmd_build_basic(struct iwl_priv *priv,
 
 
 	tx_cmd->sta_id = std_id;
-	if (ieee80211_get_morefrag(hdr))
+	if (ieee80211_has_morefrags(hdr->frame_control))
 		tx_flags |= TX_CMD_FLG_MORE_FRAG_MSK;
 
 	if (ieee80211_is_qos_data(fc)) {
@@ -952,7 +952,7 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
 	tx_cmd->dram_lsb_ptr = cpu_to_le32(scratch_phys);
 	tx_cmd->dram_msb_ptr = iwl_get_dma_hi_address(scratch_phys);
 
-	if (!ieee80211_get_morefrag(hdr)) {
+	if (!ieee80211_has_morefrags(hdr->frame_control)) {
 		txq->need_update = 1;
 		if (qc)
 			priv->stations[sta_id].tid[tid].seq_number = seq_number;
drivers/net/wireless/iwlwifi/iwl3945-base.c +2 -2
index 72279e0..77a0113 100644
@@ -2448,7 +2448,7 @@ static void iwl3945_build_tx_cmd_basic(struct iwl3945_priv *priv,
 	}
 
 	cmd->cmd.tx.sta_id = std_id;
-	if (ieee80211_get_morefrag(hdr))
+	if (ieee80211_has_morefrags(hdr->frame_control))
 		tx_flags |= TX_CMD_FLG_MORE_FRAG_MSK;
 
 	if (ieee80211_is_qos_data(fc)) {
@@ -2732,7 +2732,7 @@ static int iwl3945_tx_skb(struct iwl3945_priv *priv, struct sk_buff *skb)
 	out_cmd->cmd.tx.tx_flags &= ~TX_CMD_FLG_ANT_A_MSK;
 	out_cmd->cmd.tx.tx_flags &= ~TX_CMD_FLG_ANT_B_MSK;
 
-	if (!ieee80211_get_morefrag(hdr)) {
+	if (!ieee80211_has_morefrags(hdr->frame_control)) {
 		txq->need_update = 1;
 		if (qc) {
 			priv->stations[sta_id].tid[tid].seq_number = seq_number;
drivers/net/wireless/rt2x00/rt2x00queue.c +1 -1
index e69ef4b..95ed617 100644
@@ -91,7 +91,7 @@ void rt2x00queue_create_tx_descriptor(struct queue_entry *entry,
 	/*
 	 * Check if more fragments are pending
 	 */
-	if (ieee80211_get_morefrag(hdr)) {
+	if (ieee80211_has_morefrags(hdr->frame_control)) {
 		__set_bit(ENTRY_TXD_BURST, &txdesc->flags);
 		__set_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags);
 	}
drivers/net/wireless/rtl8187_dev.c +1 -1
index 0078c7e..c553b82 100644
@@ -181,7 +181,7 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
 	flags |= RTL8187_TX_FLAG_NO_ENCRYPT;
 
 	flags |= ieee80211_get_tx_rate(dev, info)->hw_value << 24;
-	if (ieee80211_get_morefrag((struct ieee80211_hdr *)skb->data))
+	if (ieee80211_has_morefrags(((struct ieee80211_hdr *)skb->data)->frame_control)
 		flags |= RTL8187_TX_FLAG_MORE_FRAG;
 	if (info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) {
 		flags |= RTL8187_TX_FLAG_RTS;
include/linux/ieee80211.h +0 -13
index 5773c62..9496bea 100644
@@ -651,17 +651,4 @@ static inline u8 *ieee80211_get_DA(struct ieee80211_hdr *hdr)
 		return hdr->addr1;
 }
 
-/**
- * ieee80211_get_morefrag - determine whether the MOREFRAGS bit is set
- *
- * This function determines whether the "more fragments" bit is set
- * in the frame.
- *
- * @hdr: the frame
- */
-static inline int ieee80211_get_morefrag(struct ieee80211_hdr *hdr)
-{
-	return ieee80211_has_morefrags(hdr->frame_control);
-}
-
 #endif /* IEEE80211_H */
Signature · 1 line
1.5.6.rc1.257.gba91d
maintainer
#1 lore raw

Review

Quoted 3 lines
(quoted diff) +1 -1
-	if (ieee80211_get_morefrag(hdr))
+	if (ieee80211_has_morefrags(hdr->frame_control))

looks fine to me, though I wonder if we should have

ieee80211_has_morefrags(struct 80211hdr)
and
__ieee80211_has_morefrags(__le16 fc)

or something with variants of the functions that do the ->frame_control?

johannes

#2 lore raw
Quoted 10 lines · Johannes Berg

Review

Quoted 2 lines
(quoted diff) +1 -1
-	if (ieee80211_get_morefrag(hdr))
+	if (ieee80211_has_morefrags(hdr->frame_control))

=20
looks fine to me, though I wonder if we should have
=20
ieee80211_has_morefrags(struct 80211hdr)
and
__ieee80211_has_morefrags(__le16 fc)
=20
or something with variants of the functions that do the ->frame_contr=

ol?

I considered that, but thought it was a small benefit for doubling the number of helpers.

I chose the __le16 variant as there is some driver code that checks the= se
values in driver-specific structures, so I just left it up to the calle= r
to dereference whatever structure the frame control is held in.

But if both sets are wanted, I would suggest:

=EF=BB=BFieee80211_fc_has_morefrags(__le16 fc);

ieee80211_has_morefrags(struct ieee80211 *hdr)

{
	return ieee80211_fc_has_morefrags(hdr->frame_control);
}

Do you think I should add the struct helper(s)?

Harvey

--
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#3 lore raw
Quoted 21 lines · Harvey Harrison
Quoted 10 lines · Johannes Berg

Review

Quoted 2 lines
(quoted diff) +1 -1
-	if (ieee80211_get_morefrag(hdr))
+	if (ieee80211_has_morefrags(hdr->frame_control))

looks fine to me, though I wonder if we should have

ieee80211_has_morefrags(struct 80211hdr)
and
__ieee80211_has_morefrags(__le16 fc)

or something with variants of the functions that do the ->frame_control?

I considered that, but thought it was a small benefit for doubling the number of helpers.

I chose the __le16 variant as there is some driver code that checks these values in driver-specific structures, so I just left it up to the caller to dereference whatever structure the frame control is held in.

But if both sets are wanted, I would suggest:

Quoted 8 lines

ieee80211_fc_has_morefrags(__le16 fc);

ieee80211_has_morefrags(struct ieee80211 *hdr)

{
	return ieee80211_fc_has_morefrags(hdr->frame_control);
}

Do you think I should add the struct helper(s)?

It looks like you'd be using them in many places, so don't you think it would be helpful? I don't really care too much.

johannes

#4 lore raw
Quoted 12 lines · Johannes Berg
Quoted 11 lines · Harvey Harrison
Quoted 10 lines · Johannes Berg

Review

Quoted 2 lines
(quoted diff) +1 -1
-	if (ieee80211_get_morefrag(hdr))
+	if (ieee80211_has_morefrags(hdr->frame_control))

=20
looks fine to me, though I wonder if we should have
=20
ieee80211_has_morefrags(struct 80211hdr)
and
__ieee80211_has_morefrags(__le16 fc)
=20
or something with variants of the functions that do the ->frame_c=

ontrol?

Quoted 2 lines
Quoted 2 lines

=20
I considered that, but thought it was a small benefit for doubling =

the

Quoted 3 lines
Quoted 3 lines

number of helpers.
=20
I chose the __le16 variant as there is some driver code that checks=

these

Quoted 1 line
Quoted 1 line

values in driver-specific structures, so I just left it up to the c=

aller

Quoted 12 lines
Quoted 7 lines

to dereference whatever structure the frame control is held in. =20
But if both sets are wanted, I would suggest:
=20
=EF=BB=BFieee80211_fc_has_morefrags(__le16 fc);
=20
ieee80211_has_morefrags(struct ieee80211 *hdr)

Quoted 5 lines
{
	return ieee80211_fc_has_morefrags(hdr->frame_control);
}

=20
Do you think I should add the struct helper(s)?

Quoted 2 lines

=20
It looks like you'd be using them in many places, so don't you think =

it

Quoted 2 lines

would be helpful? I don't really care too much.
=20

OK, I've added kernel-doc and incorporated the other comments, I'm not going to add additional helpers for the struct ieee80211 case at this time.

I'll check it over and send a revised version in a bit.

Harvey

--
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html