Skip to content

Commit

Permalink
Merge branch 'upstream-jgarzik' of git://git.tuxdriver.com/git/wirele…
Browse files Browse the repository at this point in the history
…ss-2.6
  • Loading branch information
Jeff Garzik committed Jan 17, 2006
2 parents 2664b25 + 5fad5a2 commit 0f1c122
Show file tree
Hide file tree
Showing 25 changed files with 156 additions and 540 deletions.
2 changes: 1 addition & 1 deletion drivers/net/wireless/airo.c
Original file line number Diff line number Diff line change
Expand Up @@ -5783,7 +5783,7 @@ static int airo_get_essid(struct net_device *dev,
/* If none, we may want to get the one that was set */

/* Push it out ! */
dwrq->length = status_rid.SSIDlen + 1;
dwrq->length = status_rid.SSIDlen;
dwrq->flags = 1; /* active */

return 0;
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/atmel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1718,11 +1718,11 @@ static int atmel_get_essid(struct net_device *dev,
if (priv->new_SSID_size != 0) {
memcpy(extra, priv->new_SSID, priv->new_SSID_size);
extra[priv->new_SSID_size] = '\0';
dwrq->length = priv->new_SSID_size + 1;
dwrq->length = priv->new_SSID_size;
} else {
memcpy(extra, priv->SSID, priv->SSID_size);
extra[priv->SSID_size] = '\0';
dwrq->length = priv->SSID_size + 1;
dwrq->length = priv->SSID_size;
}

dwrq->flags = !priv->connect_to_any_BSS; /* active */
Expand Down
22 changes: 18 additions & 4 deletions drivers/net/wireless/hostap/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,25 @@ config HOSTAP_FIRMWARE
depends on HOSTAP
---help---
Configure Host AP driver to include support for firmware image
download. Current version supports only downloading to volatile, i.e.,
RAM memory. Flash upgrade is not yet supported.
download. This option by itself only enables downloading to the
volatile memory, i.e. the card RAM. This option is required to
support cards that don't have firmware in flash, such as D-Link
DWL-520 rev E and D-Link DWL-650 rev P.

Firmware image downloading needs user space tool, prism2_srec. It is
available from http://hostap.epitest.fi/.
Firmware image downloading needs a user space tool, prism2_srec.
It is available from http://hostap.epitest.fi/.

config HOSTAP_FIRMWARE_NVRAM
bool "Support for non-volatile firmware download"
depends on HOSTAP_FIRMWARE
---help---
Allow Host AP driver to write firmware images to the non-volatile
card memory, i.e. flash memory that survives power cycling.
Enable this option if you want to be able to change card firmware
permanently.

Firmware image downloading needs a user space tool, prism2_srec.
It is available from http://hostap.epitest.fi/.

config HOSTAP_PLX
tristate "Host AP driver for Prism2/2.5/3 in PLX9052 PCI adaptors"
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/wireless/hostap/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
hostap-y := hostap_main.o
hostap-y := hostap_80211_rx.o hostap_80211_tx.o hostap_ap.o hostap_info.o \
hostap_ioctl.o hostap_main.o hostap_proc.o
obj-$(CONFIG_HOSTAP) += hostap.o

obj-$(CONFIG_HOSTAP_CS) += hostap_cs.o
Expand Down
37 changes: 37 additions & 0 deletions drivers/net/wireless/hostap/hostap.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
#ifndef HOSTAP_H
#define HOSTAP_H

#include <linux/ethtool.h>

#include "hostap_wlan.h"
#include "hostap_ap.h"

static const long freq_list[] = { 2412, 2417, 2422, 2427, 2432, 2437, 2442,
2447, 2452, 2457, 2462, 2467, 2472, 2484 };
#define FREQ_COUNT (sizeof(freq_list) / sizeof(freq_list[0]))

/* hostap.c */

extern struct proc_dir_entry *hostap_proc;
Expand Down Expand Up @@ -40,6 +49,26 @@ int prism2_update_comms_qual(struct net_device *dev);
int prism2_sta_send_mgmt(local_info_t *local, u8 *dst, u16 stype,
u8 *body, size_t bodylen);
int prism2_sta_deauth(local_info_t *local, u16 reason);
int prism2_wds_add(local_info_t *local, u8 *remote_addr,
int rtnl_locked);
int prism2_wds_del(local_info_t *local, u8 *remote_addr,
int rtnl_locked, int do_not_remove);


/* hostap_ap.c */

int ap_control_add_mac(struct mac_restrictions *mac_restrictions, u8 *mac);
int ap_control_del_mac(struct mac_restrictions *mac_restrictions, u8 *mac);
void ap_control_flush_macs(struct mac_restrictions *mac_restrictions);
int ap_control_kick_mac(struct ap_data *ap, struct net_device *dev, u8 *mac);
void ap_control_kickall(struct ap_data *ap);
void * ap_crypt_get_ptrs(struct ap_data *ap, u8 *addr, int permanent,
struct ieee80211_crypt_data ***crypt);
int prism2_ap_get_sta_qual(local_info_t *local, struct sockaddr addr[],
struct iw_quality qual[], int buf_size,
int aplist);
int prism2_ap_translate_scan(struct net_device *dev, char *buffer);
int prism2_hostapd(struct ap_data *ap, struct prism2_hostapd_param *param);


/* hostap_proc.c */
Expand All @@ -54,4 +83,12 @@ void hostap_info_init(local_info_t *local);
void hostap_info_process(local_info_t *local, struct sk_buff *skb);


/* hostap_ioctl.c */

extern const struct iw_handler_def hostap_iw_handler_def;
extern struct ethtool_ops prism2_ethtool_ops;

int hostap_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);


#endif /* HOSTAP_H */
3 changes: 3 additions & 0 deletions drivers/net/wireless/hostap/hostap_80211.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#ifndef HOSTAP_80211_H
#define HOSTAP_80211_H

#include <linux/types.h>
#include <net/ieee80211_crypt.h>

struct hostap_ieee80211_mgmt {
u16 frame_control;
u16 duration;
Expand Down
11 changes: 11 additions & 0 deletions drivers/net/wireless/hostap/hostap_80211_rx.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
#include <linux/etherdevice.h>
#include <net/ieee80211_crypt.h>

#include "hostap_80211.h"
#include "hostap.h"
#include "hostap_ap.h"

/* See IEEE 802.1H for LLC/SNAP encapsulation/decapsulation */
/* Ethernet-II snap header (RFC1042 for most EtherTypes) */
static unsigned char rfc1042_header[] =
{ 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 };
/* Bridge-Tunnel header (for EtherTypes ETH_P_AARP and ETH_P_IPX) */
static unsigned char bridge_tunnel_header[] =
{ 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 };
/* No encapsulation header if EtherType < 0x600 (=length) */

void hostap_dump_rx_80211(const char *name, struct sk_buff *skb,
struct hostap_80211_rx_status *rx_stats)
Expand Down
15 changes: 15 additions & 0 deletions drivers/net/wireless/hostap/hostap_80211_tx.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
#include "hostap_80211.h"
#include "hostap_common.h"
#include "hostap_wlan.h"
#include "hostap.h"
#include "hostap_ap.h"

/* See IEEE 802.1H for LLC/SNAP encapsulation/decapsulation */
/* Ethernet-II snap header (RFC1042 for most EtherTypes) */
static unsigned char rfc1042_header[] =
{ 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 };
/* Bridge-Tunnel header (for EtherTypes ETH_P_AARP and ETH_P_IPX) */
static unsigned char bridge_tunnel_header[] =
{ 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 };
/* No encapsulation header if EtherType < 0x600 (=length) */

void hostap_dump_tx_80211(const char *name, struct sk_buff *skb)
{
struct ieee80211_hdr_4addr *hdr;
Expand Down
36 changes: 20 additions & 16 deletions drivers/net/wireless/hostap/hostap_ap.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
* (8802.11: 5.5)
*/

#include <linux/proc_fs.h>
#include <linux/delay.h>
#include <linux/random.h>

#include "hostap_wlan.h"
#include "hostap.h"
#include "hostap_ap.h"

static int other_ap_policy[MAX_PARM_DEVICES] = { AP_OTHER_AP_SKIP_ALL,
DEF_INTS };
module_param_array(other_ap_policy, int, NULL, 0444);
Expand Down Expand Up @@ -360,8 +368,7 @@ static int ap_control_proc_read(char *page, char **start, off_t off,
}


static int ap_control_add_mac(struct mac_restrictions *mac_restrictions,
u8 *mac)
int ap_control_add_mac(struct mac_restrictions *mac_restrictions, u8 *mac)
{
struct mac_entry *entry;

Expand All @@ -380,8 +387,7 @@ static int ap_control_add_mac(struct mac_restrictions *mac_restrictions,
}


static int ap_control_del_mac(struct mac_restrictions *mac_restrictions,
u8 *mac)
int ap_control_del_mac(struct mac_restrictions *mac_restrictions, u8 *mac)
{
struct list_head *ptr;
struct mac_entry *entry;
Expand Down Expand Up @@ -433,7 +439,7 @@ static int ap_control_mac_deny(struct mac_restrictions *mac_restrictions,
}


static void ap_control_flush_macs(struct mac_restrictions *mac_restrictions)
void ap_control_flush_macs(struct mac_restrictions *mac_restrictions)
{
struct list_head *ptr, *n;
struct mac_entry *entry;
Expand All @@ -454,8 +460,7 @@ static void ap_control_flush_macs(struct mac_restrictions *mac_restrictions)
}


static int ap_control_kick_mac(struct ap_data *ap, struct net_device *dev,
u8 *mac)
int ap_control_kick_mac(struct ap_data *ap, struct net_device *dev, u8 *mac)
{
struct sta_info *sta;
u16 resp;
Expand Down Expand Up @@ -486,7 +491,7 @@ static int ap_control_kick_mac(struct ap_data *ap, struct net_device *dev,
#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */


static void ap_control_kickall(struct ap_data *ap)
void ap_control_kickall(struct ap_data *ap)
{
struct list_head *ptr, *n;
struct sta_info *sta;
Expand Down Expand Up @@ -2321,9 +2326,9 @@ static void schedule_packet_send(local_info_t *local, struct sta_info *sta)
}


static int prism2_ap_get_sta_qual(local_info_t *local, struct sockaddr addr[],
struct iw_quality qual[], int buf_size,
int aplist)
int prism2_ap_get_sta_qual(local_info_t *local, struct sockaddr addr[],
struct iw_quality qual[], int buf_size,
int aplist)
{
struct ap_data *ap = local->ap;
struct list_head *ptr;
Expand Down Expand Up @@ -2363,7 +2368,7 @@ static int prism2_ap_get_sta_qual(local_info_t *local, struct sockaddr addr[],

/* Translate our list of Access Points & Stations to a card independant
* format that the Wireless Tools will understand - Jean II */
static int prism2_ap_translate_scan(struct net_device *dev, char *buffer)
int prism2_ap_translate_scan(struct net_device *dev, char *buffer)
{
struct hostap_interface *iface;
local_info_t *local;
Expand Down Expand Up @@ -2608,8 +2613,7 @@ static int prism2_hostapd_sta_clear_stats(struct ap_data *ap,
}


static int prism2_hostapd(struct ap_data *ap,
struct prism2_hostapd_param *param)
int prism2_hostapd(struct ap_data *ap, struct prism2_hostapd_param *param)
{
switch (param->cmd) {
case PRISM2_HOSTAPD_FLUSH:
Expand Down Expand Up @@ -3207,8 +3211,8 @@ void hostap_update_rates(local_info_t *local)
}


static void * ap_crypt_get_ptrs(struct ap_data *ap, u8 *addr, int permanent,
struct ieee80211_crypt_data ***crypt)
void * ap_crypt_get_ptrs(struct ap_data *ap, u8 *addr, int permanent,
struct ieee80211_crypt_data ***crypt)
{
struct sta_info *sta;

Expand Down
2 changes: 2 additions & 0 deletions drivers/net/wireless/hostap/hostap_ap.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef HOSTAP_AP_H
#define HOSTAP_AP_H

#include "hostap_80211.h"

/* AP data structures for STAs */

/* maximum number of frames to buffer per STA */
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/wireless/hostap/hostap_common.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#ifndef HOSTAP_COMMON_H
#define HOSTAP_COMMON_H

#include <linux/types.h>
#include <linux/if_ether.h>

#define BIT(x) (1 << (x))

#define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
Expand Down
13 changes: 4 additions & 9 deletions drivers/net/wireless/hostap/hostap_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,10 @@
#define PRISM2_DOWNLOAD_SUPPORT
#endif

#ifdef PRISM2_DOWNLOAD_SUPPORT
/* Allow writing firmware images into flash, i.e., to non-volatile storage.
* Before you enable this option, you should make absolutely sure that you are
* using prism2_srec utility that comes with THIS version of the driver!
* In addition, please note that it is possible to kill your card with
* non-volatile download if you are using incorrect image. This feature has not
* been fully tested, so please be careful with it. */
/* #define PRISM2_NON_VOLATILE_DOWNLOAD */
#endif /* PRISM2_DOWNLOAD_SUPPORT */
/* Allow kernel configuration to enable non-volatile download support. */
#ifdef CONFIG_HOSTAP_FIRMWARE_NVRAM
#define PRISM2_NON_VOLATILE_DOWNLOAD
#endif

/* Save low-level I/O for debugging. This should not be enabled in normal use.
*/
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/wireless/hostap/hostap_info.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/* Host AP driver Info Frame processing (part of hostap.o module) */

#include "hostap_wlan.h"
#include "hostap.h"
#include "hostap_ap.h"

/* Called only as a tasklet (software IRQ) */
static void prism2_info_commtallies16(local_info_t *local, unsigned char *buf,
Expand Down
12 changes: 7 additions & 5 deletions drivers/net/wireless/hostap/hostap_ioctl.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
/* ioctl() (mostly Linux Wireless Extensions) routines for Host AP driver */

#ifdef in_atomic
/* Get kernel_locked() for in_atomic() */
#include <linux/types.h>
#include <linux/smp_lock.h>
#endif
#include <linux/ethtool.h>
#include <net/ieee80211_crypt.h>

#include "hostap_wlan.h"
#include "hostap.h"
#include "hostap_ap.h"

static struct iw_statistics *hostap_get_wireless_stats(struct net_device *dev)
{
Expand Down Expand Up @@ -3910,7 +3912,7 @@ static void prism2_get_drvinfo(struct net_device *dev,
local->sta_fw_ver & 0xff);
}

static struct ethtool_ops prism2_ethtool_ops = {
struct ethtool_ops prism2_ethtool_ops = {
.get_drvinfo = prism2_get_drvinfo
};

Expand Down Expand Up @@ -3985,7 +3987,7 @@ static const iw_handler prism2_private_handler[] =
(iw_handler) prism2_ioctl_priv_readmif, /* 3 */
};

static const struct iw_handler_def hostap_iw_handler_def =
const struct iw_handler_def hostap_iw_handler_def =
{
.num_standard = sizeof(prism2_handler) / sizeof(iw_handler),
.num_private = sizeof(prism2_private_handler) / sizeof(iw_handler),
Expand Down
Loading

0 comments on commit 0f1c122

Please sign in to comment.