Skip to contentSkip to conversation

wireless-dev updated -- 15 November 2006

PATCH John W. Linville 1 participant 1 message Nov 16, 2006

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Another round of merges. Wireless developers, please pull...

---

The following changes since commit aa3e54d82345b2b373603632b04d3cacd59c0c0d:
John W. Linville:
Merge branch 'from-linus'

are found in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-dev.git

David Kimdon:

      d80211: remove bitfields from ieee80211_tx_control
      d80211: remove bitfields from ieee80211_tx_status
      d80211: remove bitfields from ieee80211_key_conf
      d80211: remove bitfields from ieee80211_hw
      d80211: remove bitfields from ieee80211_conf
      d80211: endian annotations for ieee80211_frame_info, etc.
      d80211: fix usage of capability field for ibss mode

Hong Liu:
d80211: hardware TKIP support

 drivers/net/wireless/d80211/adm8211/adm8211.c      |   24 +--
 drivers/net/wireless/d80211/bcm43xx/bcm43xx_dma.c  |    3 
 drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c |   24 ++-
 drivers/net/wireless/d80211/bcm43xx/bcm43xx_pio.c  |    3 
 drivers/net/wireless/d80211/bcm43xx/bcm43xx_xmit.c |   17 +-
 drivers/net/wireless/d80211/p54/prism54common.c    |   28 ++--
 drivers/net/wireless/d80211/rt2x00/rt2400pci.c     |   38 +++--
 drivers/net/wireless/d80211/rt2x00/rt2500pci.c     |   38 +++--
 drivers/net/wireless/d80211/rt2x00/rt2500usb.c     |   38 +++--
 drivers/net/wireless/d80211/rt2x00/rt61pci.c       |   38 +++--
 drivers/net/wireless/d80211/rt2x00/rt73usb.c       |   38 +++--
 include/net/d80211.h                               |  138 +++++++++++--------
 include/net/d80211_common.h                        |   30 ++--
 net/d80211/ieee80211.c                             |  142 ++++++++++++--------
 net/d80211/ieee80211_ioctl.c                       |   36 +++--
 net/d80211/ieee80211_scan.c                        |    4 -
 net/d80211/ieee80211_sta.c                         |    8 +
 net/d80211/ieee80211_sysfs.c                       |    7 +
 net/d80211/sta_info.c                              |    2 
 net/d80211/sta_info.h                              |    2 
 net/d80211/tkip.c                                  |   30 +++-
 net/d80211/tkip.h                                  |    4 +
 net/d80211/wpa.c                                   |   72 +++++++---
 23 files changed, 427 insertions(+), 337 deletions(-)
drivers/net/wireless/d80211/adm8211/adm8211.c +10 -14
index 0244ab0..7456486 100644
@@ -428,17 +428,20 @@ static void adm8211_interrupt_tci(struct
 
 		if (status & TDES0_STATUS_ES) {
 			stats->tx_errors++;
-			priv->tx_buffers[entry].tx_status.ack = 0;
+			priv->tx_buffers[entry].tx_status.flags &=
+						~IEEE80211_TX_STATUS_ACK;
 
 			if (status & (TDES0_STATUS_TUF | TDES0_STATUS_TRO))
 				stats->tx_fifo_errors++;
 		} else
-			priv->tx_buffers[entry].tx_status.ack = 1;
+			priv->tx_buffers[entry].tx_status.flags |=
+						IEEE80211_TX_STATUS_ACK;
 
 		pci_unmap_single(priv->pdev, priv->tx_buffers[entry].mapping,
 				 priv->tx_buffers[entry].skb->len, PCI_DMA_TODEVICE);
 
-		if (priv->tx_buffers[entry].tx_status.control.req_tx_status ||
+		if ((priv->tx_buffers[entry].tx_status.control.flags &
+		     IEEE80211_TXCTL_REQ_TX_STATUS) ||
 		    !is_multicast_ether_addr(ieee80211_get_DA(&priv->tx_buffers[entry].hdr))) {
 			struct ieee80211_hdr *hdr;
 			size_t hdrlen = ieee80211_get_hdrlen(le16_to_cpu(priv->tx_buffers[entry].hdr.frame_control));
@@ -1870,7 +1873,7 @@ static int adm8211_tx(struct net_device 
 	if (short_preamble)
 		txhdr->header_control |= cpu_to_le16(ADM8211_TXHDRCTL_SHORT_PREAMBLE);
 
-	if (control->use_rts_cts)
+	if (control->flags & IEEE80211_TXCTL_USE_RTS_CTS)
 		txhdr->header_control |= cpu_to_le16(ADM8211_TXHDRCTL_ENABLE_RTS);
 
 	if (fc & IEEE80211_FCTL_PROTECTED)
@@ -2022,17 +2025,10 @@ #endif
 
 	hw->version = 2;
 	hw->name = "adm8211";
-	hw->host_gen_beacon = 0;
-	hw->device_hides_wep = 0;
-	hw->rx_includes_fcs = 0;	// however, FCS is kept in promisc mode
-	hw->host_broadcast_ps_buffering = 0;
-	hw->wep_include_iv = 1;
-	hw->data_nullfunc_ack = 0;
-	hw->no_tkip_wmm_hwaccel = 1;
 	hw->extra_tx_headroom = 0;
-	hw->device_strips_mic = 0;
-	hw->monitor_during_oper = 0;
-	hw->fraglist = 0;
+	hw->flags = IEEE80211_HW_WEP_INCLUDE_IV | IEEE80211_HW_NO_TKIP_WMM_HWACCEL;
+	// however, IEEE80211_HW_RX_INCLUDES_FCS in promisc mode
+
 	hw->channel_change_time = 1000;
 
 	hw->num_modes = 1;
drivers/net/wireless/d80211/bcm43xx/bcm43xx_dma.c +2 -1
index 24fc47d..bae2b0c 100644
@@ -1127,7 +1127,8 @@ void bcm43xx_dma_handle_txstatus(struct 
 			 * status of the transmission.
 			 * Some fields of txstat are already filled in dma_tx().
 			 */
-			meta->txstat.ack = status->acked;
+			if (status->acked)
+				meta->txstat.flags |= IEEE80211_TX_STATUS_ACK;
 			meta->txstat.retry_count = status->frame_count - 1;
 			ieee80211_tx_status_irqsafe(bcm->net_dev, meta->skb, &(meta->txstat));
 			/* skb is freed by ieee80211_tx_status_irqsafe() */
drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c +12 -12
index 6c36ece..bdf41d3 100644
@@ -3562,9 +3562,9 @@ static int bcm43xx_net_config(struct net
 		bcm43xx_radio_selectchannel(bcm, conf->channel_val, 0);
 
 	/* Enable/Disable ShortSlot timing. */
-	if (conf->short_slot_time != bcm->short_slot) {
+	if (!!(conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME) != bcm->short_slot) {
 		assert(phy->type == BCM43xx_PHYTYPE_G);
-		if (conf->short_slot_time)
+		if (conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME)
 			bcm43xx_short_slot_timing_enable(bcm);
 		else
 			bcm43xx_short_slot_timing_disable(bcm);
@@ -3577,7 +3577,7 @@ static int bcm43xx_net_config(struct net
 	}
 
 	/* Hide/Show the SSID (AP mode only). */
-	if (conf->ssid_hidden) {
+	if (conf->flags & IEEE80211_CONF_SSID_HIDDEN) {
 		bcm43xx_write32(bcm->wlcore, BCM43xx_MMIO_STATUS_BITFIELD,
 				bcm43xx_read32(bcm->wlcore, BCM43xx_MMIO_STATUS_BITFIELD)
 				| BCM43xx_SBF_NO_SSID_BCAST);
@@ -3667,7 +3667,7 @@ static int bcm43xx_net_set_key(struct ne
 	}
 	if (bcm43xx_current_phy(bcm)->fw == BCM43xx_FW_3) {
 		/* No support for HW-crypto with v3 firmware. */
-		key->force_sw_encrypt = 1;
+		key->flags |= IEEE80211_KEY_FORCE_SW_ENCRYPT;
 		err = 0;
 		goto out_unlock;
 	}
@@ -3678,7 +3678,7 @@ static int bcm43xx_net_set_key(struct ne
 		if (algorithm == BCM43xx_SEC_ALGO_TKIP) {
 			/* FIXME: No TKIP hardware encryption for now. */
 			err = 0;
-			key->force_sw_encrypt = 1;
+			key->flags |= IEEE80211_KEY_FORCE_SW_ENCRYPT;
 			goto out_unlock;
 		}
 
@@ -3702,7 +3702,7 @@ static int bcm43xx_net_set_key(struct ne
 					 bcm43xx_hf_read(bcm) &
 					 ~BCM43xx_HF_USEDEFKEYS);
 		}
-		key->force_sw_encrypt = 0;
+		key->flags &= ~IEEE80211_KEY_FORCE_SW_ENCRYPT;
 		break;
 	case DISABLE_KEY:
 		if (is_broadcast_ether_addr(addr)) {
@@ -3735,7 +3735,8 @@ out:
 	if (!err) {
 		dprintk(KERN_DEBUG PFX "Using %s based encryption for keyidx: %d, "
 			"mac: " MAC_FMT "\n",
-			(key->force_sw_encrypt) ? "software" : "hardware",
+			(key->flags & IEEE80211_KEY_FORCE_SW_ENCRYPT) ?
+			"software" : "hardware",
 			key->keyidx, MAC_ARG(addr));
 	}
 	return err;
@@ -3970,9 +3971,10 @@ #endif
 		goto out;
 	ieee->version = IEEE80211_VERSION;
 	ieee->name = KBUILD_MODNAME;
-	ieee->host_gen_beacon_template = 1;
-	ieee->rx_includes_fcs = 0;
-	ieee->monitor_during_oper = 1;
+	ieee->flags = IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE |
+		      IEEE80211_HW_MONITOR_DURING_OPER |
+		      IEEE80211_HW_DEVICE_HIDES_WEP |
+		      IEEE80211_HW_WEP_INCLUDE_IV;
 	ieee->maxssi = BCM43xx_RX_MAX_SSI;
 	ieee->tx = bcm43xx_net_hard_start_xmit;
 	ieee->open = bcm43xx_net_open;
@@ -3984,12 +3986,10 @@ #endif
 	ieee->config_interface = bcm43xx_config_interface;
 	ieee->set_multicast_list = bcm43xx_set_multicast_list;
 	ieee->set_key = bcm43xx_net_set_key;
-	ieee->device_hides_wep = 1;
 	ieee->get_stats = bcm43xx_net_get_stats;
 	ieee->queues = 1;
 	ieee->get_tx_stats = bcm43xx_net_get_tx_stats;
 	ieee->conf_tx = bcm43xx_net_conf_tx;
-	ieee->wep_include_iv = 1;
 
 	net_dev = ieee80211_alloc_hw(sizeof(*bcm), bcm43xx_netdev_setup);
 	if (!net_dev) {
drivers/net/wireless/d80211/bcm43xx/bcm43xx_pio.c +2 -1
index 58879f3..1c16f2c 100644
@@ -500,7 +500,8 @@ void bcm43xx_pio_handle_txstatus(struct 
 	queue->tx_devq_packets--;
 	queue->tx_devq_used -= (packet->skb->len + phy->txhdr_size);
 
-	packet->txstat.ack = status->acked;
+	if (status->acked)
+		packet->txstat.flags |= IEEE80211_TX_STATUS_ACK;
 	packet->txstat.retry_count = status->frame_count - 1;
 	ieee80211_tx_status_irqsafe(bcm->net_dev, packet->skb,
 				    &(packet->txstat));
drivers/net/wireless/d80211/bcm43xx/bcm43xx_xmit.c +9 -8
index 134ba50..b5675eb 100644
@@ -294,7 +294,7 @@ static void generate_txhdr_fw3(struct bc
 	u16 wsec_rate = 0;
 
 	/* No support for HW encryption with v3 firmware. */
-	assert(txctl->do_not_encrypt || txctl->key_idx < 0);
+	assert((txctl->flags & IEEE80211_TXCTL_DO_NOT_ENCRYPT) || txctl->key_idx < 0);
 
 	/* Now construct the TX header. */
 	memset(txhdr, 0, sizeof(*txhdr));
@@ -331,14 +331,14 @@ static void generate_txhdr_fw3(struct bc
 		   & BCM43xx_TXHDRCTL_ANTENNADIV_MASK;
 
 	/* Set the FLAGS field */
-	if (!txctl->no_ack)
+	if (!(txctl->flags & IEEE80211_TXCTL_NO_ACK))
 		flags |= BCM43xx_TXHDRFLAG_EXPECTACK;
 	if (!(((fctl & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_CTL) &&
 	      ((fctl & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PSPOLL)))
 		flags |= 0x10;
 	if (fallback_ofdm_modulation)
 		flags |= BCM43xx_TXHDRFLAG_FALLBACKOFDM;
-	if (txctl->first_fragment)
+	if (txctl->flags & IEEE80211_TXCTL_FIRST_FRAGMENT)
 		flags |= BCM43xx_TXHDRFLAG_FIRSTFRAGMENT;
 
 	/* Set WSEC/RATE field */
@@ -350,7 +350,7 @@ static void generate_txhdr_fw3(struct bc
 	 *        if we are on 80211g. If we get too many
 	 *        failures (hidden nodes), we should switch back to RTS/CTS.
 	 */
-	if (txctl->use_rts_cts) {
+	if (txctl->flags & IEEE80211_TXCTL_USE_RTS_CTS) {
 		bcm43xx_generate_rts(phy, txhdr, &flags,
 				     txctl->rts_cts_rate,
 				     wireless_header);
@@ -371,7 +371,8 @@ static void generate_txhdr_fw4(struct bc
 	const struct bcm43xx_phyinfo *phy = bcm43xx_current_phy(bcm);
 	const struct bcm43xx_radioinfo *radio = bcm43xx_current_radio(bcm);
 	const struct ieee80211_hdr *wlhdr = (const struct ieee80211_hdr *)fragment_data;
-	int use_encryption = ((!txctl->do_not_encrypt) && (txctl->key_idx >= 0));
+	int use_encryption = ((!(txctl->flags & IEEE80211_TXCTL_DO_NOT_ENCRYPT)) &&
+			      (txctl->key_idx >= 0));
 	u16 fctl = le16_to_cpu(wlhdr->frame_control);
 	u8 rate, rate_fb;
 	int rate_ofdm, rate_fb_ofdm;
@@ -461,17 +462,17 @@ static void generate_txhdr_fw4(struct bc
 	}
 
 	/* MAC control */
-	if (!txctl->no_ack)
+	if (!(txctl->flags & IEEE80211_TXCTL_NO_ACK))
 		mac_ctl |= BCM43xx_TX4_MAC_ACK;
 	if (!(((fctl & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_CTL) &&
 	      ((fctl & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PSPOLL)))
 		mac_ctl |= BCM43xx_TX4_MAC_HWSEQ;
-	if (txctl->first_fragment)
+	if (txctl->flags & IEEE80211_TXCTL_FIRST_FRAGMENT)
 		mac_ctl |= BCM43xx_TX4_MAC_STMSDU;
 	if (phy->type == BCM43xx_PHYTYPE_A)
 		mac_ctl |= BCM43xx_TX4_MAC_5GHZ;
 
-	if (txctl->use_rts_cts) {
+	if (txctl->flags & IEEE80211_TXCTL_USE_RTS_CTS) {
 		//TODO
 	}
 
drivers/net/wireless/d80211/p54/prism54common.c +13 -15
index 7fbcfa8..318e4f6 100644
@@ -250,7 +250,8 @@ static void p54_rx_frame_sent(struct net
 			memcpy(&status.control, range->control,
 			       sizeof(status.control));
 			kfree(range->control);
-			status.ack = (payload->status >> 8) & 1;
+			if ((payload->status >> 8) & 1)
+				status.flags |= IEEE80211_TX_STATUS_ACK;
 			status.ack_signal = le16_to_cpu(payload->ack_rssi);
 			skb_pull(entry, sizeof(*hdr) + sizeof(struct p54_tx_control_allocdata));
 			ieee80211_tx_status_irqsafe(dev, entry, &status);
@@ -396,7 +397,7 @@ static int p54_tx(struct net_device *dev
 
 	hdr->magic1 = __constant_cpu_to_le16(0x0010);
 	hdr->len = skb->len - sizeof(*hdr);
-	hdr->type = control->no_ack ? 0 : 1;
+	hdr->type = (control->flags & IEEE80211_TXCTL_NO_ACK) ? 0 : 1;
 	hdr->retry1 = hdr->retry2 = control->retry_limit;
 	p54_assign_address(dev, skb, hdr, skb->len, control_copy);
 
@@ -405,8 +406,10 @@ static int p54_tx(struct net_device *dev
 	txhdr->wep_key_present = 0;
 	txhdr->wep_key_len = 0;
 	txhdr->frame_type = __constant_cpu_to_le32(0x4);
-	txhdr->magic4 = control->no_ack ? 0 : __constant_cpu_to_le32(0x7f020000);
-	txhdr->magic5 = control->no_ack ? 0 : __constant_cpu_to_le32(0x23);
+	txhdr->magic4 = (control->flags & IEEE80211_TXCTL_NO_ACK) ?
+			 0 : __constant_cpu_to_le32(0x7f020000);
+	txhdr->magic5 = (control->flags & IEEE80211_TXCTL_NO_ACK) ?
+			 0 : __constant_cpu_to_le32(0x23);
 
 	priv->tx(dev, hdr, skb->len, 0);
 	return 0;
@@ -630,17 +633,12 @@ void p54_init_common(struct net_device *
 	priv->modes[0].num_channels = ARRAY_SIZE(p54_channels);
 	priv->modes[0].channels = priv->channels;
 	hw->version = 2;
-	hw->host_gen_beacon = 0;
-	hw->host_gen_beacon_template = 1;
-	hw->device_hides_wep = 0;
-	hw->rx_includes_fcs = 1;
-	hw->host_broadcast_ps_buffering = 1; /* not sure */
-	hw->wep_include_iv = 1;
-	hw->data_nullfunc_ack = 1; /* TODO: check */
-	hw->no_tkip_wmm_hwaccel = 0;
-	hw->device_strips_mic = 0;
-	hw->monitor_during_oper = 0; /* FIXME: check */
-	hw->fraglist = 0;
+	hw->flags = IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE |
+		    IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING | /* not sure */
+		    IEEE80211_HW_RX_INCLUDES_FCS |
+		    IEEE80211_HW_WEP_INCLUDE_IV |
+		    IEEE80211_HW_DATA_NULLFUNC_ACK; /* TODO: check */
+		    /* IEEE80211_HW_MONITOR_DURING_OPER FIXME: check */
 	hw->channel_change_time = 1000;	/* TODO: find actual value */
 
 	hw->num_modes = 2;
drivers/net/wireless/d80211/rt2x00/rt2400pci.c +18 -20
index 356e6e3..d3efc11 100644
@@ -742,7 +742,8 @@ static void rt2400pci_config_rate(struct
 
 	rt2x00_register_read(rt2x00dev, TXCSR1, &reg[0]);
 	value = SIFS + PLCP
-		+ (2 * (conf->short_slot_time ? SHORT_SLOT_TIME : SLOT_TIME))
+		+ (2 * ((conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME) ?
+			SHORT_SLOT_TIME : SLOT_TIME))
 		+ preamble
 		+ get_duration(ACK_SIZE, 10);
 	rt2x00_set_field32(&reg[0], TXCSR1_ACK_TIMEOUT, value);
@@ -1556,14 +1557,15 @@ static void rt2400pci_write_tx_desc(stru
 		tx_rate = control->tx_rate;
 
 	rt2x00_set_field32(&txd->word0, TXD_W0_VALID, 1);
-	rt2x00_set_field32(&txd->word0, TXD_W0_ACK, !control->no_ack);
+	rt2x00_set_field32(&txd->word0, TXD_W0_ACK,
+			   !(control->flags & IEEE80211_TXCTL_NO_ACK));
 
 	/*
 	 * Set IFS to IFS_SIFS when the this is not the first fragment,
 	 * or this fragment came after RTS/CTS.
 	 */
 	if (((le16_to_cpu(ieee80211hdr->seq_ctrl) & IEEE80211_SCTL_FRAG) > 0) ||
-	    control->use_rts_cts)
+	    (control->flags & IEEE80211_TXCTL_USE_RTS_CTS))
 		rt2x00_set_field32(&txd->word0, TXD_W0_IFS, IFS_SIFS);
 	else
 		rt2x00_set_field32(&txd->word0, TXD_W0_IFS, IFS_BACKOFF);
@@ -1748,10 +1750,11 @@ static void rt2400pci_txdone(void *data)
 
 		ack = rt2x00_get_field32(txd->word0, TXD_W0_ACK);
 
+		entry->tx_status.flags  = 0;
 		/*
-		 * TODO: How can te below field be set correctly?
+		 * TODO: How can bit IEEE80211_TX_STATUS_TX_FILTERED of
+		 * entry->tx_status.flags be set correctly?
 		 */
-		entry->tx_status.tx_filtered = 0;
 
 		entry->tx_status.queue_length = ring->stats.limit;
 		entry->tx_status.queue_number = entry->tx_status.control.queue;
@@ -1763,11 +1766,10 @@ static void rt2400pci_txdone(void *data)
 		 * was succesfull.
 		 */
 		tx_status = rt2x00_get_field32(txd->word0, TXD_W0_RESULT);
-		entry->tx_status.ack = 0;
 		entry->tx_status.excessive_retries = 0;
 		if (ack && (tx_status == TX_SUCCESS ||
 		    tx_status == TX_SUCCESS_RETRY))
-			entry->tx_status.ack = 1;
+			entry->tx_status.flags |= IEEE80211_TX_STATUS_ACK;
 		else if (ack && tx_status == TX_FAIL_RETRY) {
 			rt2x00dev->low_level_stats.dot11ACKFailureCount++;
 			entry->tx_status.excessive_retries = 1;
@@ -1914,7 +1916,7 @@ static int rt2400pci_tx(struct net_devic
 	 * create and queue that frame first.
 	 */
 	frame_control = le16_to_cpu(ieee80211hdr->frame_control);
-	if (control->use_rts_cts &&
+	if ((control->flags & IEEE80211_TXCTL_USE_RTS_CTS) &&
 	    (frame_control & IEEE80211_FCTL_STYPE) != IEEE80211_STYPE_RTS) {
 		skb_rts = rt2400pci_create_rts(rt2x00dev,
 				ieee80211hdr, control->rts_cts_duration);
@@ -2087,7 +2089,8 @@ static int rt2400pci_config(struct net_d
 		conf->channel_val, conf->channel, conf->freq);
 	rt2400pci_config_txpower(rt2x00dev, conf->power_level);
 	rt2400pci_config_antenna(rt2x00dev, conf->antenna_sel);
-	rt2400pci_config_duration(rt2x00dev, conf->short_slot_time);
+	rt2400pci_config_duration(rt2x00dev,
+				  conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME);
 	rt2400pci_config_phymode(rt2x00dev, conf->phymode);
 
 	/*
@@ -2577,18 +2580,13 @@ static int rt2400pci_init_hw(struct rt2x
 	 */
 	hw->version = IEEE80211_VERSION;
 	hw->name = DRV_NAME;
-	hw->host_gen_beacon = 1;
-	hw->host_gen_beacon_template = 0;
-	hw->device_hides_wep = 0;
-	hw->rx_includes_fcs = 0;
-	hw->host_broadcast_ps_buffering = 1;
-	hw->wep_include_iv = 1;
-	hw->data_nullfunc_ack = 1;
-	hw->no_tkip_wmm_hwaccel = 1;
 	hw->extra_tx_headroom = 0;
-	hw->device_strips_mic = 0;
-	hw->monitor_during_oper = 1;
-	hw->fraglist = 0;
+ 	hw->flags = IEEE80211_HW_HOST_GEN_BEACON |
+		    IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING |
+		    IEEE80211_HW_WEP_INCLUDE_IV |
+		    IEEE80211_HW_DATA_NULLFUNC_ACK |
+		    IEEE80211_HW_NO_TKIP_WMM_HWACCEL |
+		    IEEE80211_HW_MONITOR_DURING_OPER;
 	hw->maxssi = RT2X00_RX_MAX_SSI;
 
 	/*
drivers/net/wireless/d80211/rt2x00/rt2500pci.c +18 -20
index 677c5ae..b06728e 100644
@@ -808,7 +808,8 @@ static void rt2500pci_config_rate(struct
 
 	rt2x00_register_read(rt2x00dev, TXCSR1, &reg[0]);
 	value = SIFS + PLCP
-		+ (2 * (conf->short_slot_time ? SHORT_SLOT_TIME : SLOT_TIME))
+		+ (2 * ((conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME) ?
+			SHORT_SLOT_TIME : SLOT_TIME))
 		+ preamble
 		+ get_duration(ACK_SIZE, 10);
 	rt2x00_set_field32(&reg[0], TXCSR1_ACK_TIMEOUT, value);
@@ -1681,7 +1682,8 @@ static void rt2500pci_write_tx_desc(stru
 		tx_rate = control->tx_rate;
 
 	rt2x00_set_field32(&txd->word0, TXD_W0_VALID, 1);
-	rt2x00_set_field32(&txd->word0, TXD_W0_ACK, !control->no_ack);
+	rt2x00_set_field32(&txd->word0, TXD_W0_ACK,
+			   !(control->flags & IEEE80211_TXCTL_NO_ACK));
 
 	ring = rt2x00_get_ring(rt2x00dev, control->queue);
 	if (unlikely(!ring))
@@ -1697,7 +1699,7 @@ static void rt2500pci_write_tx_desc(stru
 	 * or this fragment came after RTS/CTS.
 	 */
 	if (((le16_to_cpu(ieee80211hdr->seq_ctrl) & IEEE80211_SCTL_FRAG) > 0) ||
-	    control->use_rts_cts)
+	    (control->flags & IEEE80211_TXCTL_USE_RTS_CTS))
 		rt2x00_set_field32(&txd->word0, TXD_W0_IFS, IFS_SIFS);
 	else
 		rt2x00_set_field32(&txd->word0, TXD_W0_IFS, IFS_BACKOFF);
@@ -1897,10 +1899,11 @@ static void rt2500pci_txdone(void *data)
 
 		ack = rt2x00_get_field32(txd->word0, TXD_W0_ACK);
 
+		entry->tx_status.flags = 0;
 		/*
-		 * TODO: How can te below field be set correctly?
+		 * TODO: How can the IEEE80211_TX_STATUS_TX_FILTERED bit of
+		 * entry->tx_status.flags be set correctly?
 		 */
-		entry->tx_status.tx_filtered = 0;
 
 		entry->tx_status.queue_length = ring->stats.limit;
 		entry->tx_status.queue_number = entry->tx_status.control.queue;
@@ -1912,11 +1915,10 @@ static void rt2500pci_txdone(void *data)
 		 * was succesfull.
 		 */
 		tx_status = rt2x00_get_field32(txd->word0, TXD_W0_RESULT);
-		entry->tx_status.ack = 0;
 		entry->tx_status.excessive_retries = 0;
 		if (ack && (tx_status == TX_SUCCESS ||
 		    tx_status == TX_SUCCESS_RETRY))
-			entry->tx_status.ack = 1;
+			entry->tx_status.flags |= IEEE80211_TX_STATUS_ACK;
 		else if (ack && tx_status == TX_FAIL_RETRY) {
 			rt2x00dev->low_level_stats.dot11ACKFailureCount++;
 			entry->tx_status.excessive_retries = 1;
@@ -2063,7 +2065,7 @@ static int rt2500pci_tx(struct net_devic
 	 * create and queue that frame first.
 	 */
 	frame_control = le16_to_cpu(ieee80211hdr->frame_control);
-	if (control->use_rts_cts &&
+	if ((control->flags & IEEE80211_TXCTL_USE_RTS_CTS) &&
 	    (frame_control & IEEE80211_FCTL_STYPE) != IEEE80211_STYPE_RTS) {
 		skb_rts = rt2500pci_create_rts(rt2x00dev,
 				ieee80211hdr, control->rts_cts_duration);
@@ -2237,7 +2239,8 @@ static int rt2500pci_config(struct net_d
 		conf->power_level);
 	rt2500pci_config_txpower(rt2x00dev, conf->power_level);
 	rt2500pci_config_antenna(rt2x00dev, conf->antenna_sel);
-	rt2500pci_config_duration(rt2x00dev, conf->short_slot_time);
+	rt2500pci_config_duration(rt2x00dev,
+				  conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME);
 	rt2500pci_config_phymode(rt2x00dev, conf->phymode);
 
 	/*
@@ -2731,18 +2734,13 @@ static int rt2500pci_init_hw(struct rt2x
 	 */
 	hw->version = IEEE80211_VERSION;
 	hw->name = DRV_NAME;
-	hw->host_gen_beacon = 1;
-	hw->host_gen_beacon_template = 0;
-	hw->device_hides_wep = 0;
-	hw->rx_includes_fcs = 0;
-	hw->host_broadcast_ps_buffering = 1;
-	hw->wep_include_iv = 1;
-	hw->data_nullfunc_ack = 1;
-	hw->no_tkip_wmm_hwaccel = 1;
+	hw->flags = IEEE80211_HW_HOST_GEN_BEACON |
+		    IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING |
+		    IEEE80211_HW_WEP_INCLUDE_IV |
+		    IEEE80211_HW_DATA_NULLFUNC_ACK |
+		    IEEE80211_HW_NO_TKIP_WMM_HWACCEL |
+		    IEEE80211_HW_MONITOR_DURING_OPER;
 	hw->extra_tx_headroom = 0;
-	hw->device_strips_mic = 0;
-	hw->monitor_during_oper = 1;
-	hw->fraglist = 0;
 	hw->maxssi = RT2X00_RX_MAX_SSI;
 
 	/*
drivers/net/wireless/d80211/rt2x00/rt2500usb.c +18 -20
index 5dfa92e..b191edc 100644
@@ -657,7 +657,8 @@ static void rt2500usb_config_rate(struct
 
 	rt2x00_register_read(rt2x00dev, TXRX_CSR1, &reg);
 	value = SIFS + PLCP
-		+ (2 * (conf->short_slot_time ? SHORT_SLOT_TIME : SLOT_TIME))
+		+ (2 * ((conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME) ?
+			SHORT_SLOT_TIME : SLOT_TIME))
 		+ preamble
 		+ get_duration(ACK_SIZE, 10);
 	rt2x00_set_field16_nb(&reg, TXRX_CSR1_ACK_TIMEOUT, value);
@@ -1459,7 +1460,8 @@ static void rt2500usb_write_tx_desc(stru
 	else
 		tx_rate = control->tx_rate;
 
-	rt2x00_set_field32(&txd->word0, TXD_W0_ACK, !control->no_ack);
+	rt2x00_set_field32(&txd->word0, TXD_W0_ACK,
+			   !(control->flags & IEEE80211_TXCTL_NO_ACK));
 
 	ring = rt2x00_get_ring(rt2x00dev, control->queue);
 	if (unlikely(!ring))
@@ -1475,7 +1477,7 @@ static void rt2500usb_write_tx_desc(stru
 	 * or this fragment came after RTS/CTS.
 	 */
 	if (((le16_to_cpu(ieee80211hdr->seq_ctrl) & IEEE80211_SCTL_FRAG) > 0) ||
-	    control->use_rts_cts)
+	    (control->flags & IEEE80211_TXCTL_USE_RTS_CTS))
 		rt2x00_set_field32(&txd->word0, TXD_W0_IFS, IFS_SIFS);
 	else
 		rt2x00_set_field32(&txd->word0, TXD_W0_IFS, IFS_BACKOFF);
@@ -1685,10 +1687,11 @@ static void rt2500usb_txdone(void *data)
 
 		ack = rt2x00_get_field32(txd->word0, TXD_W0_ACK);
 
+		entry->tx_status.flags = 0;
 		/*
-		 * TODO: How can te below field be set correctly?
+		 * TODO: How can bit IEEE80211_TX_STATUS_TX_FILTERED of
+		 * entry->tx_status.flags be set correctly?
 		 */
-		entry->tx_status.tx_filtered = 0;
 
 		entry->tx_status.queue_length = entry->ring->stats.limit;
 		entry->tx_status.queue_number = entry->tx_status.control.queue;
@@ -1698,10 +1701,9 @@ static void rt2500usb_txdone(void *data)
 		 * ACK response when ACK was requested and status
 		 * was succesfull.
 		 */
-		entry->tx_status.ack = 0;
 		entry->tx_status.excessive_retries = 0;
 		if (ack && (urb->status == TX_SUCCESS))
-			entry->tx_status.ack = 1;
+			entry->tx_status.flags |= IEEE80211_TX_STATUS_ACK;
 		else if (ack && urb->status == TX_FAIL_OTHER) {
 			rt2x00dev->low_level_stats.dot11ACKFailureCount++;
 			entry->tx_status.excessive_retries = 1;
@@ -1800,7 +1802,7 @@ static int rt2500usb_tx(struct net_devic
 	 * create and queue that frame first.
 	 */
 	frame_control = le16_to_cpu(ieee80211hdr->frame_control);
-	if (control->use_rts_cts &&
+	if ((control->flags & IEEE80211_TXCTL_USE_RTS_CTS) &&
 	    (frame_control & IEEE80211_FCTL_STYPE) != IEEE80211_STYPE_RTS) {
 		skb_rts = rt2500usb_create_rts(rt2x00dev,
 				ieee80211hdr, control->rts_cts_duration);
@@ -1970,7 +1972,8 @@ static int rt2500usb_config(struct net_d
 		conf->power_level);
 	rt2500usb_config_txpower(rt2x00dev, conf->power_level);
 	rt2500usb_config_antenna(rt2x00dev, conf->antenna_sel);
-	rt2500usb_config_duration(rt2x00dev, conf->short_slot_time);
+	rt2500usb_config_duration(rt2x00dev,
+				  conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME);
 	rt2500usb_config_phymode(rt2x00dev, conf->phymode);
 
 	/*
@@ -2419,18 +2422,13 @@ static int rt2500usb_init_hw(struct rt2x
 	 */
 	hw->version = IEEE80211_VERSION;
 	hw->name = DRV_NAME;
-	hw->host_gen_beacon = 1;
-	hw->host_gen_beacon_template = 0;
-	hw->device_hides_wep = 0;
-	hw->rx_includes_fcs = 0;
-	hw->host_broadcast_ps_buffering = 1;
-	hw->wep_include_iv = 1;
-	hw->data_nullfunc_ack = 1;
-	hw->no_tkip_wmm_hwaccel = 1;
+	hw->flags = IEEE80211_HW_HOST_GEN_BEACON |
+		    IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING |
+		    IEEE80211_HW_WEP_INCLUDE_IV |
+		    IEEE80211_HW_DATA_NULLFUNC_ACK |
+		    IEEE80211_HW_NO_TKIP_WMM_HWACCEL |
+		    IEEE80211_HW_MONITOR_DURING_OPER;
 	hw->extra_tx_headroom = 0;
-	hw->device_strips_mic = 0;
-	hw->monitor_during_oper = 1;
-	hw->fraglist = 0;
 	hw->maxssi = RT2X00_RX_MAX_SSI;
 
 	/*
drivers/net/wireless/d80211/rt2x00/rt61pci.c +18 -20
index 526bc27..36542a3 100644
@@ -1033,7 +1033,8 @@ static void rt61pci_config_rate(struct r
 
 	rt2x00_register_read(rt2x00dev, TXRX_CSR0, &reg);
 	value = SIFS + PLCP
-		+ (2 * (conf->short_slot_time ? SHORT_SLOT_TIME : SLOT_TIME))
+		+ (2 * ((conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME) ?
+			SHORT_SLOT_TIME : SLOT_TIME))
 		+ preamble
 		+ get_duration(ACK_SIZE, 10);
 	rt2x00_set_field32(&reg, TXRX_CSR0_RX_ACK_TIMEOUT, value);
@@ -2111,7 +2112,8 @@ static void rt61pci_write_tx_desc(struct
 		tx_rate = control->tx_rate;
 
 	rt2x00_set_field32(&txd->word0, TXD_W0_VALID, 1);
-	rt2x00_set_field32(&txd->word0, TXD_W0_ACK, !control->no_ack);
+	rt2x00_set_field32(&txd->word0, TXD_W0_ACK,
+		       	   !(control->flags & IEEE80211_TXCTL_NO_ACK));
 
 	ring = rt2x00_get_ring(rt2x00dev, control->queue);
 	if (unlikely(!ring))
@@ -2127,7 +2129,7 @@ static void rt61pci_write_tx_desc(struct
 	 * or this fragment came after RTS/CTS.
 	 */
 	if (((le16_to_cpu(ieee80211hdr->seq_ctrl) & IEEE80211_SCTL_FRAG) > 0) ||
-	    control->use_rts_cts)
+	    (control->flags & IEEE80211_TXCTL_USE_RTS_CTS))
 		rt2x00_set_field32(&txd->word0, TXD_W0_IFS, IFS_SIFS);
 	else
 		rt2x00_set_field32(&txd->word0, TXD_W0_IFS, IFS_BACKOFF);
@@ -2333,10 +2335,11 @@ static void rt61pci_txdone_entry(struct 
 
 	ack = rt2x00_get_field32(txd->word0, TXD_W0_ACK);
 
+	entry->tx_status.flags = 0;
 	/*
-	 * TODO: How can te below field be set correctly?
+	 * TODO: How can the IEEE80211_TX_STATUS_TX_FILTERED bit of
+	 * entry->tx_status.flags be set correctly?
 	 */
-	entry->tx_status.tx_filtered = 0;
 
 	entry->tx_status.queue_length = entry->ring->stats.limit;
 	entry->tx_status.queue_number = entry->tx_status.control.queue;
@@ -2348,11 +2351,10 @@ static void rt61pci_txdone_entry(struct 
 	 * was succesfull.
 	 */
 	tx_status = rt2x00_get_field32(sta_csr4, STA_CSR4_TX_RESULT);
-	entry->tx_status.ack = 0;
 	entry->tx_status.excessive_retries = 0;
 	if (ack && (tx_status == TX_SUCCESS ||
 	    tx_status == TX_SUCCESS_RETRY))
-		entry->tx_status.ack = 1;
+		entry->tx_status.flags |= IEEE80211_TX_STATUS_ACK;
 	else if (ack && tx_status == TX_FAIL_RETRY) {
 		rt2x00dev->low_level_stats.dot11ACKFailureCount++;
 		entry->tx_status.excessive_retries = 1;
@@ -2539,7 +2541,7 @@ static int rt61pci_tx(struct net_device 
 	 * create and queue that frame first.
 	 */
 	frame_control = le16_to_cpu(ieee80211hdr->frame_control);
-	if (control->use_rts_cts &&
+	if ((control->flags & IEEE80211_TXCTL_USE_RTS_CTS) &&
 	    (frame_control & IEEE80211_FCTL_STYPE) != IEEE80211_STYPE_RTS) {
 		skb_rts = rt61pci_create_rts(rt2x00dev,
 				ieee80211hdr, control->rts_cts_duration);
@@ -2712,7 +2714,8 @@ static int rt61pci_config(struct net_dev
 		conf->power_level);
 	rt61pci_config_txpower(rt2x00dev, conf->power_level);
 	rt61pci_config_antenna(rt2x00dev, conf->antenna_sel, conf->phymode);
-	rt61pci_config_duration(rt2x00dev, conf->short_slot_time);
+	rt61pci_config_duration(rt2x00dev,
+				conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME);
 	rt61pci_config_phymode(rt2x00dev, conf->phymode);
 
 	/*
@@ -3251,18 +3254,13 @@ static int rt61pci_init_hw(struct rt2x00
 	 */
 	hw->version = IEEE80211_VERSION;
 	hw->name = DRV_NAME;
-	hw->host_gen_beacon = 1;
-	hw->host_gen_beacon_template = 0;
-	hw->device_hides_wep = 0;
-	hw->rx_includes_fcs = 0;
-	hw->host_broadcast_ps_buffering = 1;
-	hw->wep_include_iv = 1;
-	hw->data_nullfunc_ack = 1;
-	hw->no_tkip_wmm_hwaccel = 1;
+	hw->flags = IEEE80211_HW_HOST_GEN_BEACON |
+		    IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING |
+		    IEEE80211_HW_WEP_INCLUDE_IV |
+		    IEEE80211_HW_DATA_NULLFUNC_ACK |
+		    IEEE80211_HW_NO_TKIP_WMM_HWACCEL |
+		    IEEE80211_HW_MONITOR_DURING_OPER;
 	hw->extra_tx_headroom = 0;
-	hw->device_strips_mic = 0;
-	hw->monitor_during_oper = 1;
-	hw->fraglist = 0;
 	hw->maxssi = RT2X00_RX_MAX_SSI;
 
 	/*
drivers/net/wireless/d80211/rt2x00/rt73usb.c +18 -20
index 1feac24..0a38cde 100644
@@ -771,7 +771,8 @@ static void rt73usb_config_rate(struct r
 
 	rt2x00_register_read(rt2x00dev, TXRX_CSR0, &reg);
 	value = SIFS + PLCP
-		+ (2 * (conf->short_slot_time ? SHORT_SLOT_TIME : SLOT_TIME))
+		+ (2 * ((conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME) ?
+			SHORT_SLOT_TIME : SLOT_TIME))
 		+ preamble
 		+ get_duration(ACK_SIZE, 10);
 	rt2x00_set_field32(&reg, TXRX_CSR0_RX_ACK_TIMEOUT, value);
@@ -1732,7 +1733,8 @@ static void rt73usb_write_tx_desc(struct
 		tx_rate = control->tx_rate;
 
 	rt2x00_set_field32(&txd->word0, TXD_W0_VALID, 1);
-	rt2x00_set_field32(&txd->word0, TXD_W0_ACK, !control->no_ack);
+	rt2x00_set_field32(&txd->word0, TXD_W0_ACK,
+			   !(control->flags & IEEE80211_TXCTL_NO_ACK));
 
 	ring = rt2x00_get_ring(rt2x00dev, control->queue);
 	if (unlikely(!ring))
@@ -1748,7 +1750,7 @@ static void rt73usb_write_tx_desc(struct
 	 * or this fragment came after RTS/CTS.
 	 */
 	if (((le16_to_cpu(ieee80211hdr->seq_ctrl) & IEEE80211_SCTL_FRAG) > 0) ||
-	    control->use_rts_cts)
+	    (control->flags & IEEE80211_TXCTL_USE_RTS_CTS))
 		rt2x00_set_field32(&txd->word0, TXD_W0_IFS, IFS_SIFS);
 	else
 		rt2x00_set_field32(&txd->word0, TXD_W0_IFS, IFS_BACKOFF);
@@ -1975,10 +1977,11 @@ static void rt73usb_txdone(void *data)
 
 		ack = rt2x00_get_field32(txd->word0, TXD_W0_ACK);
 
+		entry->tx_status.flags = 0;
 		/*
-		 * TODO: How can te below field be set correctly?
+		 * TODO: How can bit IEEE80211_TX_STATUS_TX_FILTERED of
+		 * entry->tx_status.flags be set correctly?
 		 */
-		entry->tx_status.tx_filtered = 0;
 
 		entry->tx_status.queue_length = entry->ring->stats.limit;
 		entry->tx_status.queue_number = entry->tx_status.control.queue;
@@ -1988,10 +1991,9 @@ static void rt73usb_txdone(void *data)
 		 * ACK response when ACK was requested and status
 		 * was succesfull.
 		 */
-		entry->tx_status.ack = 0;
 		entry->tx_status.excessive_retries = 0;
 		if (ack && (urb->status == TX_SUCCESS))
-			entry->tx_status.ack = 1;
+			entry->tx_status.flags |= IEEE80211_TX_STATUS_ACK;
 		else {
 			rt2x00dev->low_level_stats.dot11ACKFailureCount++;
 			entry->tx_status.excessive_retries = 1;
@@ -2089,7 +2091,7 @@ static int rt73usb_tx(struct net_device 
 	 * create and queue that frame first.
 	 */
 	frame_control = le16_to_cpu(ieee80211hdr->frame_control);
-	if (control->use_rts_cts &&
+	if ((control->flags & IEEE80211_TXCTL_USE_RTS_CTS) &&
 	    (frame_control & IEEE80211_FCTL_STYPE) != IEEE80211_STYPE_RTS) {
 		skb_rts = rt73usb_create_rts(rt2x00dev,
 				ieee80211hdr, control->rts_cts_duration);
@@ -2259,7 +2261,8 @@ static int rt73usb_config(struct net_dev
 		conf->power_level);
 	rt73usb_config_txpower(rt2x00dev, conf->power_level);
 	rt73usb_config_antenna(rt2x00dev, conf->antenna_sel, conf->phymode);
-	rt73usb_config_duration(rt2x00dev, conf->short_slot_time);
+	rt73usb_config_duration(rt2x00dev,
+				conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME);
 	rt73usb_config_phymode(rt2x00dev, conf->phymode);
 
 	/*
@@ -2792,18 +2795,13 @@ static int rt73usb_init_hw(struct rt2x00
 	 */
 	hw->version = IEEE80211_VERSION;
 	hw->name = DRV_NAME;
-	hw->host_gen_beacon = 1;
-	hw->host_gen_beacon_template = 0;
-	hw->device_hides_wep = 0;
-	hw->rx_includes_fcs = 0;
-	hw->host_broadcast_ps_buffering = 1;
-	hw->wep_include_iv = 1;
-	hw->data_nullfunc_ack = 1;
-	hw->no_tkip_wmm_hwaccel = 1;
+	hw->flags = IEEE80211_HW_HOST_GEN_BEACON |
+		    IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING |
+		    IEEE80211_HW_WEP_INCLUDE_IV |
+		    IEEE80211_HW_DATA_NULLFUNC_ACK |
+		    IEEE80211_HW_NO_TKIP_WMM_HWACCEL |
+		    IEEE80211_HW_MONITOR_DURING_OPER;
 	hw->extra_tx_headroom = 0;
-	hw->device_strips_mic = 0;
-	hw->monitor_during_oper = 1;
-	hw->fraglist = 0;
 	hw->maxssi = RT2X00_RX_MAX_SSI;
 
 	/*
include/net/d80211.h +81 -57

198 lines not on this page · raw message

include/net/d80211_common.h +15 -15
index 69ea939..0b575a2 100644
@@ -20,26 +20,26 @@ #include <linux/types.h>
 #define IEEE80211_FI_VERSION 0x80211001
 
 struct ieee80211_frame_info {
-        u32 version;
-        u32 length;
-        u64 mactime;
-        u64 hosttime;
-        u32 phytype;
-        u32 channel;
-        u32 datarate;
-        u32 antenna;
-        u32 priority;
-        u32 ssi_type;
-        u32 ssi_signal;
-        u32 ssi_noise;
-        u32 preamble;
-        u32 encoding;
+	__be32 version;
+	__be32 length;
+	__be64 mactime;
+	__be64 hosttime;
+	__be32 phytype;
+	__be32 channel;
+	__be32 datarate;
+	__be32 antenna;
+	__be32 priority;
+	__be32 ssi_type;
+	__be32 ssi_signal;
+	__be32 ssi_noise;
+	__be32 preamble;
+	__be32 encoding;
 
 	/* Note: this structure is otherwise identical to capture format used
 	 * in linux-wlan-ng, but this additional field is used to provide meta
 	 * data about the frame to hostapd. This was the easiest method for
 	 * providing this information, but this might change in the future. */
-	u32 msg_type;
+	__be32 msg_type;
 } __attribute__ ((packed));
 
 
net/d80211/ieee80211.c +82 -60

402 lines not on this page · raw message

net/d80211/ieee80211_ioctl.c +22 -14
index 9ae4e79..fb2e888 100644
@@ -126,7 +126,7 @@ static int ieee80211_ioctl_get_hw_featur
 	struct ieee80211_channel_data *chan;
 
 	param->u.hw_features.flags = 0;
-	if (local->hw->data_nullfunc_ack)
+	if (local->hw->flags & IEEE80211_HW_DATA_NULLFUNC_ACK)
 		param->u.hw_features.flags |= HOSTAP_HW_FLAG_NULLFUNC_OK;
 
 	param->u.hw_features.num_modes = local->hw->num_modes;
@@ -218,7 +218,7 @@ static int ieee80211_ioctl_flush(struct 
 struct iapp_layer2_update {
 	u8 da[ETH_ALEN]; /* broadcast */
 	u8 sa[ETH_ALEN]; /* STA addr */
-	u16 len; /* 6 */
+	__be16 len; /* 6 */
 	u8 dsap; /* 0 */
 	u8 ssap; /* 0 */
 	u8 control;
@@ -331,7 +331,7 @@ static int ieee80211_ioctl_add_sta(struc
 		memset(&conf, 0, sizeof(conf));
 		conf.hw_key_idx = HW_KEY_IDX_INVALID;
 		conf.alg = ALG_NULL;
-		conf.force_sw_encrypt = 1;
+		conf.flags |= IEEE80211_KEY_FORCE_SW_ENCRYPT;
 		if (local->hw->set_key(dev, SET_KEY, sta->addr, &conf,
 				       sta->aid)) {
 			sta->key_idx_compression = HW_KEY_IDX_INVALID;
@@ -492,7 +492,8 @@ int ieee80211_set_hw_encryption(struct n
 		key->force_sw_encrypt = 1;
 
 	if (key && local->hw->set_key &&
-	    (!local->conf.sw_encrypt || !local->conf.sw_decrypt) &&
+	    (!(local->conf.flags & IEEE80211_CONF_SW_ENCRYPT) ||
+	     !(local->conf.flags & IEEE80211_CONF_SW_DECRYPT)) &&
 	    (keyconf = ieee80211_key_data2conf(local, key)) != NULL) {
 		if (local->hw->set_key(dev, SET_KEY, addr,
 				       keyconf, sta ? sta->aid : 0)) {
@@ -501,7 +502,7 @@ int ieee80211_set_hw_encryption(struct n
 			key->hw_key_idx = HW_KEY_IDX_INVALID;
 		} else {
 			key->force_sw_encrypt =
-				keyconf->force_sw_encrypt;
+				!!(keyconf->flags & IEEE80211_KEY_FORCE_SW_ENCRYPT);
 			key->hw_key_idx =
 				keyconf->hw_key_idx;
 
@@ -594,14 +595,15 @@ #endif /* CONFIG_D80211_VERBOSE_DEBUG */
 		try_hwaccel = 0;
 	}
 
-	if (local->hw->device_hides_wep) {
+	if (local->hw->flags & IEEE80211_HW_DEVICE_HIDES_WEP) {
 		/* Software encryption cannot be used with devices that hide
 		 * encryption from the host system, so always try to use
 		 * hardware acceleration with such devices. */
 		try_hwaccel = 1;
 	}
 
-	if (local->hw->no_tkip_wmm_hwaccel && alg == ALG_TKIP) {
+	if ((local->hw->flags & IEEE80211_HW_NO_TKIP_WMM_HWACCEL) &&
+	    alg == ALG_TKIP) {
 		if (sta && (sta->flags & WLAN_STA_WME)) {
 		/* Hardware does not support hwaccel with TKIP when using WMM.
 		 */
@@ -2297,14 +2299,15 @@ static void ieee80211_key_enable_hwaccel
 	u8 addr[ETH_ALEN];
 
 	if (!key || key->alg != ALG_WEP || !key->force_sw_encrypt ||
-	    local->hw->device_hides_wep)
+	    (local->hw->flags & IEEE80211_HW_DEVICE_HIDES_WEP))
 		return;
 
 	memset(addr, 0xff, ETH_ALEN);
 	keyconf = ieee80211_key_data2conf(local, key);
 	if (keyconf && local->hw->set_key &&
 	    local->hw->set_key(local->mdev, SET_KEY, addr, keyconf, 0) == 0) {
-		key->force_sw_encrypt = keyconf->force_sw_encrypt;
+		key->force_sw_encrypt =
+			!!(keyconf->flags & IEEE80211_KEY_FORCE_SW_ENCRYPT);
 		key->hw_key_idx = keyconf->hw_key_idx;
 	}
 	kfree(keyconf);
@@ -2318,7 +2321,7 @@ static void ieee80211_key_disable_hwacce
 	u8 addr[ETH_ALEN];
 
 	if (!key || key->alg != ALG_WEP || key->force_sw_encrypt ||
-	    local->hw->device_hides_wep)
+	    (local->hw->flags & IEEE80211_HW_DEVICE_HIDES_WEP))
 		return;
 
 	memset(addr, 0xff, ETH_ALEN);
@@ -2430,7 +2433,10 @@ static int ieee80211_ioctl_prism2_param(
                 local->stat_time = value;
                 break;
 	case PRISM2_PARAM_SHORT_SLOT_TIME:
-		local->conf.short_slot_time = value;
+		if (value)
+			local->conf.flags |= IEEE80211_CONF_SHORT_SLOT_TIME;
+		else
+			local->conf.flags &= ~IEEE80211_CONF_SHORT_SLOT_TIME;
 		if (ieee80211_hw_config(dev))
 			ret = -EINVAL;
 		break;
@@ -2477,8 +2483,10 @@ static int ieee80211_ioctl_prism2_param(
 	case PRISM2_PARAM_BROADCAST_SSID:
 		if ((value < 0) || (value > 1))
 			ret = -EINVAL;
+		else if (value)
+			local->conf.flags |= IEEE80211_CONF_SSID_HIDDEN;
 		else
-			local->conf.ssid_hidden = value;
+			local->conf.flags &= ~IEEE80211_CONF_SSID_HIDDEN;
 		break;
 
 	case PRISM2_PARAM_STA_ANTENNA_SEL:
@@ -2656,7 +2664,7 @@ static int ieee80211_ioctl_get_prism2_pa
                 *param = local->stat_time;
                 break;
 	case PRISM2_PARAM_SHORT_SLOT_TIME:
-		*param = local->conf.short_slot_time;
+		*param = !!(local->conf.flags & IEEE80211_CONF_SHORT_SLOT_TIME);
 		break;
 
 	case PRISM2_PARAM_NEXT_MODE:
@@ -2676,7 +2684,7 @@ static int ieee80211_ioctl_get_prism2_pa
 		break;
 
 	case PRISM2_PARAM_BROADCAST_SSID:
-		*param = local->conf.ssid_hidden;
+		*param = !!(local->conf.flags & IEEE80211_CONF_SSID_HIDDEN);
 		break;
 
 	case PRISM2_PARAM_STA_ANTENNA_SEL:
net/d80211/ieee80211_scan.c +2 -2
index add0bf3..7089f9a 100644
@@ -329,12 +329,12 @@ void ieee80211_init_scan(struct net_devi
 
 	memset(&local->scan.tx_control, 0, sizeof(local->scan.tx_control));
 	local->scan.tx_control.key_idx = HW_KEY_IDX_INVALID;
-	local->scan.tx_control.do_not_encrypt = 1;
+	local->scan.tx_control.flags |= IEEE80211_TXCTL_DO_NOT_ENCRYPT;
 	memset(&extra, 0, sizeof(extra));
 	extra.endidx = local->num_curr_rates;
 	local->scan.tx_control.tx_rate =
 		rate_control_get_rate(local, dev, local->scan.skb, &extra)->val;
-	local->scan.tx_control.no_ack = 1;
+	local->scan.tx_control.flags |= IEEE80211_TXCTL_NO_ACK;
 }
 
 
net/d80211/ieee80211_sta.c +4 -4
index bf74b6b..4b73545 100644
@@ -1984,7 +1984,7 @@ static int ieee80211_sta_join_ibss(struc
 
 	sdata = IEEE80211_DEV_TO_SUB_IF(dev);
 	sdata->drop_unencrypted = bss->capability &
-		cpu_to_le16(WLAN_CAPABILITY_PRIVACY) ? 1 : 0;
+		WLAN_CAPABILITY_PRIVACY ? 1 : 0;
 
 	memset(&rq, 0, sizeof(rq));
 	rq.m = bss->freq * 100000;
@@ -2064,7 +2064,7 @@ static int ieee80211_sta_join_ibss(struc
 			rate->val2 : rate->val;
 		control.antenna_sel = local->conf.antenna_sel;
 		control.power_level = local->conf.power_level;
-		control.no_ack = 1;
+		control.flags |= IEEE80211_TXCTL_NO_ACK;
 		control.retry_limit = 1;
 		control.rts_cts_duration = 0;
 
@@ -2153,9 +2153,9 @@ #endif
 	bss->channel = local->conf.channel;
 	bss->freq = local->conf.freq;
 	bss->last_update = jiffies;
-	bss->capability = cpu_to_le16(WLAN_CAPABILITY_IBSS);
+	bss->capability = WLAN_CAPABILITY_IBSS;
 	if (sdata->default_key) {
-		bss->capability |= cpu_to_le16(WLAN_CAPABILITY_PRIVACY);
+		bss->capability |= WLAN_CAPABILITY_PRIVACY;
 	} else
 		sdata->drop_unencrypted = 0;
 	bss->supp_rates_len = local->num_curr_rates;
net/d80211/ieee80211_sysfs.c +4 -3
index 545dc6e..dbdd28e 100644
@@ -530,9 +530,10 @@ static ssize_t ieee80211_if_fmt_mode(con
 {
 	struct ieee80211_local *local = sdata->local;
 
-	return sprintf(buf, "%s\n", (local->hw->monitor_during_oper ||
-				     local->open_count == local->monitors) ?
-				    "hard" : "soft");
+	return sprintf(buf, "%s\n",
+		       ((local->hw->flags & IEEE80211_HW_MONITOR_DURING_OPER) ||
+			local->open_count == local->monitors) ?
+		       "hard" : "soft");
 }
 __IEEE80211_IF_SHOW(mode);
 
net/d80211/sta_info.c +1 -1
index 17f4b92..6e73fab 100644
@@ -255,7 +255,7 @@ void sta_info_free(struct sta_info *sta,
 		memset(&conf, 0, sizeof(conf));
 		conf.hw_key_idx = sta->key_idx_compression;
 		conf.alg = ALG_NULL;
-		conf.force_sw_encrypt = 1;
+		conf.flags |= IEEE80211_KEY_FORCE_SW_ENCRYPT;
 		local->hw->set_key(local->mdev, DISABLE_KEY, sta->addr, &conf,
 				   sta->aid);
 		sta->key_idx_compression = HW_KEY_IDX_INVALID;
net/d80211/sta_info.h +1 -1
index acac699..ad000a2 100644
@@ -74,7 +74,7 @@ struct sta_info {
 	void *rate_ctrl_priv;
 
 	/* last received seq/frag number from this STA (per RX queue) */
-	u16 last_seq_ctrl[NUM_RX_DATA_QUEUES];
+	__le16 last_seq_ctrl[NUM_RX_DATA_QUEUES];
 	unsigned long num_duplicates; /* number of duplicate frames received
 				       * from this STA */
 	unsigned long tx_fragments; /* number of transmitted MPDUs */
net/d80211/tkip.c +21 -9
index 1e2621a..11966e0 100644
@@ -191,17 +191,16 @@ u8 * ieee80211_tkip_add_iv(u8 *pos, stru
 }
 
 
-/* Encrypt packet payload with TKIP using @key. @pos is a pointer to the
- * beginning of the buffer containing payload. This payload must include
- * headroom of eight octets for IV and Ext. IV and taildroom of four octets
- * for ICV. @payload_len is the length of payload (_not_ including extra
- * headroom and tailroom). @ta is the transmitter addresses. */
-void ieee80211_tkip_encrypt_data(struct crypto_blkcipher *tfm,
-				 struct ieee80211_key *key,
-				 u8 *pos, size_t payload_len, u8 *ta)
+void ieee80211_tkip_gen_phase1key(struct ieee80211_key *key, u8 *ta,
+				  u16 *phase1key)
 {
-	u8 rc4key[16];
+	tkip_mixing_phase1(ta, &key->key[ALG_TKIP_TEMP_ENCR_KEY],
+			   key->u.tkip.iv32, phase1key);
+}
 
+void ieee80211_tkip_gen_rc4key(struct ieee80211_key *key, u8 *ta,
+			       u8 *rc4key)
+{
 	/* Calculate per-packet key */
 	if (key->u.tkip.iv16 == 0 || !key->u.tkip.tx_initialized) {
 		/* IV16 wrapped around - perform TKIP phase 1 */
@@ -212,7 +211,20 @@ void ieee80211_tkip_encrypt_data(struct 
 
 	tkip_mixing_phase2(key->u.tkip.p1k, &key->key[ALG_TKIP_TEMP_ENCR_KEY],
 			   key->u.tkip.iv16, rc4key);
+}
+
+/* Encrypt packet payload with TKIP using @key. @pos is a pointer to the
+ * beginning of the buffer containing payload. This payload must include
+ * headroom of eight octets for IV and Ext. IV and taildroom of four octets
+ * for ICV. @payload_len is the length of payload (_not_ including extra
+ * headroom and tailroom). @ta is the transmitter addresses. */
+void ieee80211_tkip_encrypt_data(struct crypto_blkcipher *tfm,
+				 struct ieee80211_key *key,
+				 u8 *pos, size_t payload_len, u8 *ta)
+{
+	u8 rc4key[16];
 
+	ieee80211_tkip_gen_rc4key(key, ta, rc4key);
 	pos = ieee80211_tkip_add_iv(pos, key, rc4key[0], rc4key[1], rc4key[2]);
 	ieee80211_wep_encrypt_data(tfm, rc4key, 16, pos, payload_len);
 }
net/d80211/tkip.h +4 -0
index c715077..a0d181a 100644
@@ -15,6 +15,10 @@ #include "ieee80211_key.h"
 
 u8 * ieee80211_tkip_add_iv(u8 *pos, struct ieee80211_key *key,
 			   u8 iv0, u8 iv1, u8 iv2);
+void ieee80211_tkip_gen_phase1key(struct ieee80211_key *key, u8 *ta,
+				  u16 *phase1key);
+void ieee80211_tkip_gen_rc4key(struct ieee80211_key *key, u8 *ta,
+			       u8 *rc4key);
 void ieee80211_tkip_encrypt_data(struct crypto_blkcipher *tfm,
 				 struct ieee80211_key *key,
 				 u8 *pos, size_t payload_len, u8 *ta);
net/d80211/wpa.c +52 -20

155 lines not on this page · raw message

Signature · 2 lines
John W. Linville
[email protected]