Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ff1d2767 authored by Jouni Malinen's avatar Jouni Malinen Committed by Jeff Garzik
Browse files

Add HostAP wireless driver.

Includes minor cleanups from Adrian Bunk <bunk@stusta.de>.
parent 88d7bd8c
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -965,6 +965,13 @@ M: mike.miller@hp.com
L:	iss_storagedev@hp.com
S:	Supported
 
HOST AP DRIVER
P:	Jouni Malinen
M:	jkmaline@cc.hut.fi
L:	hostap@shmoo.com
W:	http://hostap.epitest.fi/
S:	Maintained

HP100:	Driver for HP 10/100 Mbit/s Voice Grade Network Adapter Series
P:	Jaroslav Kysela
M:	perex@suse.cz
+2 −0
Original line number Diff line number Diff line
@@ -355,6 +355,8 @@ config PRISM54
	  say M here and read <file:Documentation/modules.txt>.  The module
	  will be called prism54.ko.

source "drivers/net/wireless/hostap/Kconfig"

# yes, this works even when no drivers are selected
config NET_WIRELESS
	bool
+2 −0
Original line number Diff line number Diff line
@@ -28,6 +28,8 @@ obj-$(CONFIG_PCMCIA_ATMEL) += atmel_cs.o

obj-$(CONFIG_PRISM54)		+= prism54/

obj-$(CONFIG_HOSTAP)		+= hostap/

# 16-bit wireless PCMCIA client drivers
obj-$(CONFIG_PCMCIA_RAYCS)	+= ray_cs.o
obj-$(CONFIG_PCMCIA_WL3501)	+= wl3501_cs.o
+33 −32
Original line number Diff line number Diff line
@@ -1040,7 +1040,7 @@ typedef struct {
	u16 status;
} WifiCtlHdr;

WifiCtlHdr wifictlhdr8023 = {
static WifiCtlHdr wifictlhdr8023 = {
	.ctlhdr = {
		.ctl	= HOST_DONT_RLSE,
	}
@@ -1111,13 +1111,13 @@ static int airo_thread(void *data);
static void timer_func( struct net_device *dev );
static int airo_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
#ifdef WIRELESS_EXT
struct iw_statistics *airo_get_wireless_stats (struct net_device *dev);
static struct iw_statistics *airo_get_wireless_stats (struct net_device *dev);
static void airo_read_wireless_stats (struct airo_info *local);
#endif /* WIRELESS_EXT */
#ifdef CISCO_EXT
static int readrids(struct net_device *dev, aironet_ioctl *comp);
static int writerids(struct net_device *dev, aironet_ioctl *comp);
int flashcard(struct net_device *dev, aironet_ioctl *comp);
static int flashcard(struct net_device *dev, aironet_ioctl *comp);
#endif /* CISCO_EXT */
#ifdef MICSUPPORT
static void micinit(struct airo_info *ai);
@@ -1223,6 +1223,12 @@ static int setup_proc_entry( struct net_device *dev,
static int takedown_proc_entry( struct net_device *dev,
				struct airo_info *apriv );

static int cmdreset(struct airo_info *ai);
static int setflashmode (struct airo_info *ai);
static int flashgchar(struct airo_info *ai,int matchbyte,int dwelltime);
static int flashputbuf(struct airo_info *ai);
static int flashrestart(struct airo_info *ai,struct net_device *dev);

#ifdef MICSUPPORT
/***********************************************************************
 *                              MIC ROUTINES                           *
@@ -1231,10 +1237,11 @@ static int takedown_proc_entry( struct net_device *dev,

static int RxSeqValid (struct airo_info *ai,miccntx *context,int mcast,u32 micSeq);
static void MoveWindow(miccntx *context, u32 micSeq);
void emmh32_setseed(emmh32_context *context, u8 *pkey, int keylen, struct crypto_tfm *);
void emmh32_init(emmh32_context *context);
void emmh32_update(emmh32_context *context, u8 *pOctets, int len);
void emmh32_final(emmh32_context *context, u8 digest[4]);
static void emmh32_setseed(emmh32_context *context, u8 *pkey, int keylen, struct crypto_tfm *);
static void emmh32_init(emmh32_context *context);
static void emmh32_update(emmh32_context *context, u8 *pOctets, int len);
static void emmh32_final(emmh32_context *context, u8 digest[4]);
static int flashpchar(struct airo_info *ai,int byte,int dwelltime);

/* micinit - Initialize mic seed */

@@ -1312,7 +1319,7 @@ static int micsetup(struct airo_info *ai) {
	return SUCCESS;
}

char micsnap[]= {0xAA,0xAA,0x03,0x00,0x40,0x96,0x00,0x02};
static char micsnap[] = {0xAA,0xAA,0x03,0x00,0x40,0x96,0x00,0x02};

/*===========================================================================
 * Description: Mic a packet
@@ -1567,7 +1574,7 @@ static void MoveWindow(miccntx *context, u32 micSeq)
static unsigned char aes_counter[16];

/* expand the key to fill the MMH coefficient array */
void emmh32_setseed(emmh32_context *context, u8 *pkey, int keylen, struct crypto_tfm *tfm)
static void emmh32_setseed(emmh32_context *context, u8 *pkey, int keylen, struct crypto_tfm *tfm)
{
  /* take the keying material, expand if necessary, truncate at 16-bytes */
  /* run through AES counter mode to generate context->coeff[] */
@@ -1599,7 +1606,7 @@ void emmh32_setseed(emmh32_context *context, u8 *pkey, int keylen, struct crypto
}

/* prepare for calculation of a new mic */
void emmh32_init(emmh32_context *context)
static void emmh32_init(emmh32_context *context)
{
	/* prepare for new mic calculation */
	context->accum = 0;
@@ -1607,7 +1614,7 @@ void emmh32_init(emmh32_context *context)
}

/* add some bytes to the mic calculation */
void emmh32_update(emmh32_context *context, u8 *pOctets, int len)
static void emmh32_update(emmh32_context *context, u8 *pOctets, int len)
{
	int	coeff_position, byte_position;
  
@@ -1649,7 +1656,7 @@ void emmh32_update(emmh32_context *context, u8 *pOctets, int len)
static u32 mask32[4] = { 0x00000000L, 0xFF000000L, 0xFFFF0000L, 0xFFFFFF00L };

/* calculate the mic */
void emmh32_final(emmh32_context *context, u8 digest[4])
static void emmh32_final(emmh32_context *context, u8 digest[4])
{
	int	coeff_position, byte_position;
	u32	val;
@@ -2251,7 +2258,7 @@ static void airo_read_stats(struct airo_info *ai) {
	ai->stats.rx_fifo_errors = vals[0];
}

struct net_device_stats *airo_get_stats(struct net_device *dev)
static struct net_device_stats *airo_get_stats(struct net_device *dev)
{
	struct airo_info *local =  dev->priv;

@@ -2410,7 +2417,7 @@ EXPORT_SYMBOL(stop_airo_card);

static int add_airo_dev( struct net_device *dev );

int wll_header_parse(struct sk_buff *skb, unsigned char *haddr)
static int wll_header_parse(struct sk_buff *skb, unsigned char *haddr)
{
	memcpy(haddr, skb->mac.raw + 10, ETH_ALEN);
	return ETH_ALEN;
@@ -2677,7 +2684,7 @@ static struct net_device *init_wifidev(struct airo_info *ai,
	return dev;
}

int reset_card( struct net_device *dev , int lock) {
static int reset_card( struct net_device *dev , int lock) {
	struct airo_info *ai = dev->priv;

	if (lock && down_interruptible(&ai->sem))
@@ -2692,7 +2699,7 @@ int reset_card( struct net_device *dev , int lock) {
	return 0;
}

struct net_device *_init_airo_card( unsigned short irq, int port,
static struct net_device *_init_airo_card( unsigned short irq, int port,
					   int is_pcmcia, struct pci_dev *pci,
					   struct device *dmdev )
{
@@ -7177,7 +7184,7 @@ static void airo_read_wireless_stats(struct airo_info *local)
	local->wstats.miss.beacon = vals[34];
}

struct iw_statistics *airo_get_wireless_stats(struct net_device *dev)
static struct iw_statistics *airo_get_wireless_stats(struct net_device *dev)
{
	struct airo_info *local =  dev->priv;

@@ -7392,14 +7399,8 @@ static int writerids(struct net_device *dev, aironet_ioctl *comp) {
 * Flash command switch table
 */

int flashcard(struct net_device *dev, aironet_ioctl *comp) {
static int flashcard(struct net_device *dev, aironet_ioctl *comp) {
	int z;
	int cmdreset(struct airo_info *);
	int setflashmode(struct airo_info *);
	int flashgchar(struct airo_info *,int,int);
	int flashpchar(struct airo_info *,int,int);
	int flashputbuf(struct airo_info *);
	int flashrestart(struct airo_info *,struct net_device *);

	/* Only super-user can modify flash */
	if (!capable(CAP_NET_ADMIN))
@@ -7457,7 +7458,7 @@ int flashcard(struct net_device *dev, aironet_ioctl *comp) {
 * card.
 */

int cmdreset(struct airo_info *ai) {
static int cmdreset(struct airo_info *ai) {
	disable_MAC(ai, 1);

	if(!waitbusy (ai)){
@@ -7481,7 +7482,7 @@ int cmdreset(struct airo_info *ai) {
 * mode
 */

int setflashmode (struct airo_info *ai) {
static int setflashmode (struct airo_info *ai) {
	set_bit (FLAG_FLASHING, &ai->flags);

	OUT4500(ai, SWS0, FLASH_COMMAND);
@@ -7508,7 +7509,7 @@ int setflashmode (struct airo_info *ai) {
 * x 50us for  echo .
 */

int flashpchar(struct airo_info *ai,int byte,int dwelltime) {
static int flashpchar(struct airo_info *ai,int byte,int dwelltime) {
	int echo;
	int waittime;

@@ -7548,7 +7549,7 @@ int flashpchar(struct airo_info *ai,int byte,int dwelltime) {
 * Get a character from the card matching matchbyte
 * Step 3)
 */
int flashgchar(struct airo_info *ai,int matchbyte,int dwelltime){
static int flashgchar(struct airo_info *ai,int matchbyte,int dwelltime){
	int           rchar;
	unsigned char rbyte=0;

@@ -7579,7 +7580,7 @@ int flashgchar(struct airo_info *ai,int matchbyte,int dwelltime){
 * send to the card
 */

int flashputbuf(struct airo_info *ai){
static int flashputbuf(struct airo_info *ai){
	int            nwords;

	/* Write stuff */
@@ -7601,7 +7602,7 @@ int flashputbuf(struct airo_info *ai){
/*
 *
 */
int flashrestart(struct airo_info *ai,struct net_device *dev){
static int flashrestart(struct airo_info *ai,struct net_device *dev){
	int    i,status;

	ssleep(1);			/* Added 12/7/00 */
+104 −0
Original line number Diff line number Diff line
config HOSTAP
	tristate "IEEE 802.11 for Host AP (Prism2/2.5/3 and WEP/TKIP/CCMP)"
	depends on NET_RADIO
	---help---
	Shared driver code for IEEE 802.11b wireless cards based on
	Intersil Prism2/2.5/3 chipset. This driver supports so called
	Host AP mode that allows the card to act as an IEEE 802.11
	access point.

	In addition, this includes generic IEEE 802.11 code, e.g., for
	WEP/TKIP/CCMP encryption that can be shared with other drivers.

	See <http://hostap.epitest.fi/> for more information about the
	Host AP driver configuration and tools. This site includes
	information and tools (hostapd and wpa_supplicant) for WPA/WPA2
	support.

	This option includes the base Host AP driver code that is shared by
	different hardware models. You will also need to enable support for
	PLX/PCI/CS version of the driver to actually use the driver.

	The driver can be compiled as a module and it will be called
	"hostap.ko".

config HOSTAP_WEP
	tristate "IEEE 802.11 WEP encryption"
	depends on HOSTAP
	select CRYPTO
	---help---
	Software implementation of IEEE 802.11 WEP encryption.

	This can be compiled as a modules and it will be called
	"hostap_crypt_wep.ko".

config HOSTAP_TKIP
	tristate "IEEE 802.11 TKIP encryption"
	depends on HOSTAP
	select CRYPTO
	---help---
	Software implementation of IEEE 802.11 TKIP encryption.

	This can be compiled as a modules and it will be called
	"hostap_crypt_tkip.ko".

config HOSTAP_CCMP
	tristate "IEEE 802.11 CCMP encryption"
	depends on HOSTAP
	select CRYPTO
	---help---
	Software implementation of IEEE 802.11 CCMP encryption.

	This can be compiled as a modules and it will be called
	"hostap_crypt_ccmp.ko".

config HOSTAP_FIRMWARE
	bool "Support downloading firmware images with Host AP driver"
	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.

	Firmware image downloading needs 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"
	depends on PCI && HOSTAP
	---help---
	Host AP driver's version for Prism2/2.5/3 PC Cards in PLX9052 based
	PCI adaptors.

	"Host AP support for Prism2/2.5/3 IEEE 802.11b" is required for this
	driver and its help text includes more information about the Host AP
	driver.

	The driver can be compiled as a module and will be named
	"hostap_plx.ko".

config HOSTAP_PCI
	tristate "Host AP driver for Prism2.5 PCI adaptors"
	depends on PCI && HOSTAP
	---help---
	Host AP driver's version for Prism2.5 PCI adaptors.

	"Host AP support for Prism2/2.5/3 IEEE 802.11b" is required for this
	driver and its help text includes more information about the Host AP
	driver.

	The driver can be compiled as a module and will be named
	"hostap_pci.ko".

config HOSTAP_CS
	tristate "Host AP driver for Prism2/2.5/3 PC Cards"
	depends on PCMCIA!=n && HOSTAP
	---help---
	Host AP driver's version for Prism2/2.5/3 PC Cards.

	"Host AP support for Prism2/2.5/3 IEEE 802.11b" is required for this
	driver and its help text includes more information about the Host AP
	driver.

	The driver can be compiled as a module and will be named
	"hostap_cs.ko".
Loading