diff -urN --exclude *CVS* linux-wlan-0.3.4/config.mk linux-wlan/config.mk --- linux-wlan-0.3.4/config.mk Fri Nov 5 18:21:58 1999 +++ linux-wlan/config.mk Wed Dec 6 22:16:01 2000 @@ -1,7 +1,8 @@ LINUX_SRC=/usr/src/linux -PCMCIA_SRC= -MODULES_DIR=/lib/modules/2.2.9 +PCMCIA_SRC=/usr/src/modules/pcmcia-cs +#PCMCIA_SRC=/usr/src/linux +MODULES_DIR=/lib/modules/2.4.0-test10 INST_EXEDIR=/sbin DESTDIR= MAKE_ISA=y -MAKE_CS=n +MAKE_CS=y diff -urN --exclude *CVS* linux-wlan-0.3.4/driver/am930cs.c linux-wlan/driver/am930cs.c --- linux-wlan-0.3.4/driver/am930cs.c Fri Nov 5 18:21:06 1999 +++ linux-wlan/driver/am930cs.c Wed Dec 6 21:50:38 2000 @@ -292,7 +292,7 @@ *curr = instance->next; /* free the memory */ - kfree_s(instance, sizeof(struct dev_link_t)); + kfree(instance); } } diff -urN --exclude *CVS* linux-wlan-0.3.4/driver/am930di.c linux-wlan/driver/am930di.c --- linux-wlan-0.3.4/driver/am930di.c Fri Nov 5 18:21:06 1999 +++ linux-wlan/driver/am930di.c Wed Dec 6 21:51:22 2000 @@ -41,7 +41,7 @@ /* PCMCIA headers generated during PCMCIA package installation */ #include -#include +#include /* Module related headers, non-module drivers should not include */ #include @@ -190,8 +190,8 @@ if (ret != 0) { am930_drvr_cs_error(instance->handle, RegisterClient, ret); - kfree_s( instance->dev, sizeof(struct dev_node_t)); - kfree_s( instance, sizeof(struct dev_link_t)); + kfree( instance->dev); + kfree( instance); instance = NULL; } } @@ -260,7 +260,7 @@ if (instance->dev != NULL ) { - kfree_s( instance->dev, sizeof(dev_node_t)); + kfree( instance->dev); instance->dev = NULL; } diff -urN --exclude *CVS* linux-wlan-0.3.4/driver/am930hw.c linux-wlan/driver/am930hw.c --- linux-wlan-0.3.4/driver/am930hw.c Fri Nov 5 18:21:06 1999 +++ linux-wlan/driver/am930hw.c Wed Dec 6 21:45:15 2000 @@ -610,7 +610,7 @@ DBFENTER; #if (WLAN_OS == WLAN_LINUX_KERNEL) - kfree_s( hw, sizeof(am930hw_t)); + kfree( hw); #elif (WLAN_OS == WLAN_LWOS) #else #error "No WLAN_OS match!" @@ -988,6 +988,7 @@ #else #error "No WLAN_OS match!" #endif + { /* Make sure we have not overlapped ISR calls */ if ( hw->state & AM930HW_INTOCURRED ) @@ -1033,7 +1034,6 @@ { WLAN_LOG_DEBUG0(1,"in ISR, int_status1 == 0\n"); } - do { handled++; if ( SUCS_INT_IS_RX(int_status1) ) diff -urN --exclude *CVS* linux-wlan-0.3.4/driver/am930llc.c linux-wlan/driver/am930llc.c --- linux-wlan-0.3.4/driver/am930llc.c Fri Nov 5 18:21:07 1999 +++ linux-wlan/driver/am930llc.c Thu Dec 7 04:17:39 2000 @@ -35,14 +35,14 @@ #include #include +#include /* The following prevents "kernel_version" from being set in this file. */ #define __NO_VERSION__ /* PCMCIA headers generated during PCMCIA package installation */ #ifdef WLAN_PCMCIA -#include -#include +/*new #include */ #endif /* Module related headers, non-module drivers should not include */ @@ -176,7 +176,7 @@ llc->dev = kmalloc( sizeof(device_t), GFP_KERNEL); if ( llc->dev == NULL ) { - kfree_s(llc, sizeof(am930llc_t)); + kfree(llc); return NULL; } memset( llc->dev, 0, sizeof(device_t)); @@ -184,28 +184,25 @@ llc->dev->priv = kmalloc( sizeof(devpriv_t), GFP_KERNEL); if ( llc->dev->priv == NULL ) { - kfree_s(llc->dev, sizeof(device_t)); - kfree_s(llc, sizeof(am930llc_t)); + kfree(llc->dev); + kfree(llc); return NULL; } memset( llc->dev->priv, 0, sizeof(devpriv_t)); /* the dev name field will point to the same memory used by the node_t field of the pcmcia di object */ - #ifdef WLAN_PCMCIA - llc->dev->name = ((dev_link_t*)(llc->mac->di))->dev->dev_name; - #else + llc->dev->name = kmalloc(WLAN_DEVNAME_LEN, GFP_KERNEL); if ( llc->dev->name == NULL ) { WLAN_LOG_ERROR0("Failed to alloc device name space.\n"); - kfree_s( llc->dev->priv, sizeof(devpriv_t)); - kfree_s( llc->dev, sizeof(device_t)); - kfree_s( llc, sizeof(am930llc_t)); + kfree( llc->dev->priv); + kfree( llc->dev); + kfree( llc); return NULL; } llc->dev->name[0] = '\0'; - #endif /* set the private data to point back at the llc */ V2P(llc->dev->priv)->llc = llc; @@ -234,6 +231,10 @@ } WLAN_LOG_INFO1("Device %s registered\n", llc->dev->name); + init_waitqueue_head(&(llc->cmdwq)); + #ifdef WLAN_PCMCIA + strcpy(((dev_link_t*)(llc->mac->di))->dev->dev_name, llc->dev->name); + #endif #if 0 /* now set up the kernel timer */ init_timer(&llc->timer); @@ -270,8 +271,9 @@ llc->timer.expires = 0; /* Assume the timer was set up to watch us while an ioctl's in */ - /* the wait queue. Check for NULL and if not, wake it */ - if ( llc->cmdwq != NULL ){ + /* the wait queue. Check for NULL (in <2.3 kernels) and if not, wake */ + + if ( WLAN_CMDWQ_TEST(llc) ) { wake_up_interruptible(&(llc->cmdwq)); } @@ -324,13 +326,13 @@ if ( llc->dev != NULL ) { del_timer(&llc->timer); - llc->dev->start = 0; + WLAN_CLEAR_START(llc->dev); /* 2.2 compatibility */ unregister_netdev( llc->dev ); kfree(llc->dev); llc->dev = NULL; } - kfree_s( llc, sizeof(am930llc_t)); + kfree( llc); DBFEXIT; return; @@ -368,7 +370,7 @@ { DBFENTER; - if ( llc->cmdwq != NULL ){ + if ( WLAN_CMDWQ_TEST(llc) ) { /* 2.2 compatibility */ llc->cmdstatus = status; wake_up_interruptible(&(llc->cmdwq)); } @@ -448,8 +450,8 @@ /* Now, do an interruptible_sleep, we'll be awakened by: */ /* a signal the process, cmdtimerfunc (timeout), or llc_scancomplete */ - interruptible_sleep_on(&(llc->cmdwq)); - llc->cmdwq = NULL; + interruptible_sleep_on(&(llc->cmdwq)); + WLAN_CMDWQ_CLEAR(llc); /* 2.2 compatibility */ /* If sleep return is via signal */ if ( signal_pending(current) ) { @@ -534,7 +536,7 @@ (cmd->nitems * sizeof(netitem_t))) ) { result = -EFAULT; } - kfree_s(cmd, sizeof(wlan_netlist_t)+(tmp.nitems*sizeof(netitem_t))); + kfree(cmd); break; } case WLAN_BSSCREATE: @@ -578,7 +580,7 @@ /* Now, do an interruptible_sleep, we'll be awakened by: */ /* a signal the process, cmdtimerfunc (timeout), or llc_scancomplete */ interruptible_sleep_on(&(llc->cmdwq)); - llc->cmdwq = NULL; + WLAN_CMDWQ_CLEAR(llc); /* 2.2 compatibility */ /* If sleep return is via signal */ if ( signal_pending(current) ) { @@ -622,7 +624,7 @@ /* Now, do an interruptible_sleep, we'll be awakened by: */ /* a signal the process, cmdtimerfunc (timeout), or llc_scancomplete */ interruptible_sleep_on(&(llc->cmdwq)); - llc->cmdwq = NULL; + WLAN_CMDWQ_CLEAR(llc); /* 2.2 compatibility */ /* If sleep return is via signal */ if ( signal_pending(current) ) { @@ -662,7 +664,7 @@ } if ( copy_from_user( &mibcode, req->data, 4 ) ) { - kfree_s(p, req->len); + kfree(p); result = -EFAULT; break; } @@ -696,7 +698,7 @@ if ( copy_to_user( ((UINT8*)(req->data)) + 4, p, size)) { result = -EFAULT; } - kfree_s(p, req->len); + kfree(p); break; } case WLAN_SETMIBITEM: @@ -855,7 +857,7 @@ DBFENTER; - if ( dev->start == 1 ) + if ( netif_running(dev) ) { /* If some higher layer thinks we've missed a tx-done, we are passed NULL. Caution: dev_tint handles the cli/sti .. @@ -869,64 +871,53 @@ } #endif - if ( test_and_set_bit(0, (void*)&(dev->tbusy)) != 0 ) - { - /* TODO: add a f/w reset capability here. see skeleton.c */ - WLAN_LOG_DEBUG2(1, "called when tbusy set," - "txllc.len=%d txmac.len=%d\n", - llc->mac->llcq->len, - llc->mac->macq->len); - result = 1; - } - else - { - dev->trans_start = jiffies; - - /* OK, now we setup the ether to 802.11 conversion */ - pb = am930llc_pballoc(); + netif_stop_queue(dev); + dev->trans_start = jiffies; - if ( pb != NULL ) - { - pb->ethhostbuf = skb; - pb->ethfree = am930llc_pbfreeskb; - pb->ethbuf = skb->data; - pb->ethbuflen = skb->len; - pb->ethfrmlen = skb->len; - pb->eth_hdr = (wlan_ethhdr_t*)pb->ethbuf; + /* OK, now we setup the ether to 802.11 conversion */ + pb = am930llc_pballoc(); - if ( am930llc_pb_ether_to_p80211( llc, pb) != 0 ) - { - /* convert failed */ - result = 1; - am930llc_pbfree(pb); - } - else - { - txresult = - am930mac_txllc( llc->mac, pb->eth_hdr->daddr, - pb->eth_hdr->saddr, pb); - - if ( txresult == 0) /* success and more buf avail, re: hw_txdata */ - { - dev->tbusy = 0; - result = 0; - } - else if ( txresult == 1 ) /* success, no more avail */ - { - result = 0; - } - else if ( txresult == 2 ) /* alloc failure, drop frame */ - { - result = 0; - am930llc_pbfree(pb); - } - else /* buffer full or queue busy */ - { - result = 1; - pb->ethfree = NULL; - } - } - } + if ( pb != NULL ) + { + pb->ethhostbuf = skb; + pb->ethfree = am930llc_pbfreeskb; + pb->ethbuf = skb->data; + pb->ethbuflen = skb->len; + pb->ethfrmlen = skb->len; + pb->eth_hdr = (wlan_ethhdr_t*)pb->ethbuf; + + if ( am930llc_pb_ether_to_p80211( llc, pb) != 0 ) + { + /* convert failed */ + result = 1; + am930llc_pbfree(pb); + } + else + { + txresult = + am930mac_txllc( llc->mac, pb->eth_hdr->daddr, + pb->eth_hdr->saddr, pb); + + if ( txresult == 0) /* success and more buf avail, re: hw_txdata */ + { + netif_wake_queue(dev); + result = 0; + } + else if ( txresult == 1 ) /* success, no more avail */ + { + result = 0; + } + else if ( txresult == 2 ) /* alloc failure, drop frame */ + { + result = 0; + am930llc_pbfree(pb); + } + else /* buffer full or queue busy */ + { + result = 1; + pb->ethfree = NULL; + } + } } } @@ -948,10 +939,7 @@ DBFENTER; /* set the flags in the device object */ - dev->tbusy = 0; - dev->interrupt = 0; - dev->start = 1; - + netif_start_queue(dev); #ifdef WLAN_PCMCIA MOD_INC_USE_COUNT; #endif @@ -975,8 +963,7 @@ DBFENTER; /* set the flags in the device object */ - dev->start = 0; - dev->tbusy = 1; + netif_stop_queue(dev); #ifdef WLAN_PCMCIA MOD_DEC_USE_COUNT; @@ -1348,7 +1335,7 @@ #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0)) dev_kfree_skb( (struct sk_buff*)buf, FREE_WRITE); #else - dev_kfree_skb( (struct sk_buff*)buf ); + dev_kfree_skb_any( (struct sk_buff*)buf ); #endif } @@ -1362,7 +1349,7 @@ ----------------------------------------------------------------*/ void am930llc_pbkfree_s( void *buf, int size) { - kfree_s( buf, size); + kfree( buf); } @@ -1430,7 +1417,7 @@ { (*(pb->p80211free))(pb->p80211hostbuf, pb->p80211buflen); } - kfree_s(pb, sizeof(wlan_pb_t)); + kfree(pb); } @@ -1446,9 +1433,8 @@ DBFENTER; - llc->dev->interrupt = 1; - - if ( llc->dev->start ) + WLAN_SET_INTERRUPT(llc->dev) + if ( netif_running(llc->dev) ) { if ( am930llc_pb_p80211_to_ether(llc, pb) == 0 ) { @@ -1470,7 +1456,7 @@ } } - llc->dev->interrupt = 0; + WLAN_CLEAR_INTERRUPT(llc->dev); am930llc_pbfree(pb); @@ -1631,8 +1617,7 @@ V2P(llc->dev->priv)->stats.tx_packets++; } - llc->dev->tbusy = 0; - mark_bh(NET_BH); + netif_wake_queue(llc->dev); DBFEXIT; return; diff -urN --exclude *CVS* linux-wlan-0.3.4/driver/am930llc.h linux-wlan/driver/am930llc.h --- linux-wlan-0.3.4/driver/am930llc.h Fri Nov 5 18:21:07 1999 +++ linux-wlan/driver/am930llc.h Thu Dec 7 04:14:04 2000 @@ -42,7 +42,44 @@ /*--- Macros -------------------------------------------------*/ /*=============================================================*/ +/* compatibility layer for 2.2 */ #define V2P(x) ((devpriv_t*)(x)) +#if LINUX_VERSION_CODE < 0x020312 +#define WLAN_CMDWQ_TEST(llc) (llc->cmdwq != NULL) +#define WLAN_CMDWQ_CLEAR(llc) llc->cmdwq = NULL +#define WLAN_WAIT_QUEUE_HEAD(name) \ + struct wait_queue *name; +#else +#define WLAN_CMDWQ_TEST(llc) 1 +#define WLAN_CMDWQ_CLEAR(llc) +#define WLAN_WAIT_QUEUE_HEAD(name) \ + wait_queue_head_t name; +#endif + +#if LINUX_VERSION_CODE < 0x02032F +#define dev_kfree_skb_any(a) dev_kfree_skb(a) +#endif + +#if LINUX_VERSION_CODE < 0x02032B +#define WLAN_CLEAR_START(dev) dev->start = 0 +#define WLAN_CLEAR_INTERRUPT(dev) dev->interrupt = 0 +#define WLAN_SET_INTERRUPT(dev) dev->interrupt = 1 +#define netif_running(dev) dev->start == 1 +#define netif_stop_queue(dev) set_bit(0, &dev->tbusy) +#define netif_wake_queue(dev) clear_bit(0, &dev->tbusy) +static inline void netif_start_queue(struct net_device *dev) +{ + + dev->tbusy = 0; + dev->interrupt = 0; + dev->start = 1; + +} +#else +#define WLAN_CLEAR_START(dev) +#define WLAN_CLEAR_INTERRUPT(dev) +#define WLAN_SET_INTERRUPT(dev) +#endif /*=============================================================*/ /*--- Types ---------------------------------------------------*/ @@ -261,8 +298,7 @@ UINT cmdbusy; UINT currcmd; struct timer_list cmdtimer; /* ioctl cmd timeout timer */ - struct wait_queue *cmdwq; /* ioctl blocking wait queue */ - + WLAN_WAIT_QUEUE_HEAD(cmdwq); /* ioctl blocking wait queue */ /* Implementation specific config items */ int ethconv; struct sock *nlsk; diff -urN --exclude *CVS* linux-wlan-0.3.4/driver/am930mac.c linux-wlan/driver/am930mac.c --- linux-wlan-0.3.4/driver/am930mac.c Fri Nov 5 18:21:07 1999 +++ linux-wlan/driver/am930mac.c Mon Dec 4 23:47:47 2000 @@ -361,16 +361,16 @@ { am930shim_pbfree(pb); } - kfree_s( mac->llcq, sizeof(am930q_t)); + kfree( mac->llcq); while ( (mac->macq != NULL) && (pb = (wlan_pb_t*)am930q_dequeue(mac->macq)) ) { am930shim_pbfree(pb); } - kfree_s( mac->macq, sizeof(am930q_t)); + kfree( mac->macq); /* all subobjects handled, now free the mac object */ - kfree_s( mac, sizeof(am930mac_t)); + kfree( mac); DBFEXIT; return; @@ -626,7 +626,7 @@ { am930mgr_class2err(mac->mgr, pb->p80211_hdr->a3.a2); am930shim_pbfree(pb); - kfree_s( stats, sizeof(am930rxstats_t)); + kfree( stats); return; } } @@ -637,7 +637,7 @@ { am930mgr_class3err(mac->mgr, pb->p80211_hdr->a3.a2); am930shim_pbfree(pb); - kfree_s( stats, sizeof(am930rxstats_t)); + kfree( stats); return; } } @@ -669,14 +669,14 @@ { am930shim_pbfree(pb2); am930shim_pbfree(pb); - kfree_s( stats, sizeof(am930rxstats_t)); + kfree( stats); return; } } else /* alloc failure, drop the frame */ { am930shim_pbfree(pb); - kfree_s( stats, sizeof(am930rxstats_t)); + kfree( stats); return; } } @@ -732,7 +732,7 @@ am930shim_rxframe( mac->llc, pb); } } - kfree_s( stats, sizeof(am930rxstats_t)); + kfree( stats); DBFEXIT; return; } @@ -761,7 +761,7 @@ /* drop the frame */ am930shim_pbfree( pb ); am930shim_free(stats, sizeof(am930rxstats_t)); - kfree_s(item, sizeof(am930mac_rxitem_t)); + kfree(item); } else { @@ -803,14 +803,14 @@ { pb = item->f; stats = item->s; - kfree_s( item, sizeof(*item)); + kfree( item); ftype = WLAN_GET_FC_FTYPE(ieee2host16(pb->p80211_hdr->a3.fc)); if ( ftype != WLAN_FTYPE_MGMT && ftype != WLAN_FTYPE_DATA ) { /* we've got a frame we shouldn't...drop it */ WLAN_LOG_WARNING0("Ctl or unknown frame type received, dropped\n"); - kfree_s( stats, sizeof(am930rxstats_t)); + kfree( stats); am930shim_pbfree(pb); } @@ -820,7 +820,7 @@ if ( pb == NULL ) { /* the frame was absorbed by a fragment pool, do no more */ - kfree_s( stats, sizeof(am930rxstats_t)); + kfree( stats); } else { @@ -829,7 +829,7 @@ if ( pb == NULL ) { /* the frame failed decryption somehow, do no more */ - kfree_s( stats, sizeof(am930rxstats_t)); + kfree( stats); } else { @@ -1272,7 +1272,7 @@ { /* mgmt frame with DA that's not me...silently drop it */ am930shim_pbfree( pb ); - kfree_s(stats, sizeof(am930rxstats_t)); + kfree(stats); } else { @@ -1489,7 +1489,7 @@ * am930q_init * * Initilizes a new queue. To get rid of it, the caller should -* empty it and then use kfree_s(q, sizeof(am930q_t)). +* empty it and then use kfree(q). * * returns: * NULL - alloc failure @@ -1613,7 +1613,7 @@ { q->head = q->tail = NULL; } - kfree_s(qitem, sizeof(am930qitem_t)); + kfree(qitem); q->len--; } q->busy = 0; diff -urN --exclude *CVS* linux-wlan-0.3.4/driver/am930mgr.c linux-wlan/driver/am930mgr.c --- linux-wlan-0.3.4/driver/am930mgr.c Fri Nov 5 18:21:08 1999 +++ linux-wlan/driver/am930mgr.c Mon Dec 4 23:47:47 2000 @@ -343,9 +343,9 @@ bss = mgr->bsslist; mgr->bsslist = bss->next; /* TODO: when we add ttl, need to kill any timer funcs */ - kfree_s( bss, sizeof( knownbss_t )); + kfree( bss); } - kfree_s(mgr, sizeof(am930mgr_t)); + kfree(mgr); } DBFEXIT; } @@ -652,7 +652,7 @@ } /* the response(s) will be handled in auth_rx */ - kfree_s( f, sizeof(wlan_fr_authen_t) + WLAN_AUTHEN_FR_MAXLEN); + kfree( f); } } DBFEXIT; @@ -951,7 +951,7 @@ } /* discard the buffer */ - kfree_s( reply, sizeof(wlan_fr_authen_t) + WLAN_AUTHEN_FR_MAXLEN); + kfree( reply); } } @@ -2444,7 +2444,7 @@ } am930shim_pbfree( rxpb ); - kfree_s(stats, sizeof(am930rxstats_t)); + kfree(stats); DBFEXIT; return; @@ -2488,7 +2488,7 @@ { bss = mgr->bsslist; mgr->bsslist = mgr->bsslist->next; - kfree_s( bss, sizeof( knownbss_t )); + kfree( bss); } mgr->scanstate = MGR_ISSCANNING; diff -urN --exclude *CVS* linux-wlan-0.3.4/include/wlan/k_compat.h linux-wlan/include/wlan/k_compat.h --- linux-wlan-0.3.4/include/wlan/k_compat.h Wed Dec 31 16:00:00 1969 +++ linux-wlan/include/wlan/k_compat.h Wed Dec 6 23:43:33 2000 @@ -0,0 +1,279 @@ +/* + * k_compat.h 1.130 2000/10/04 01:09:26 + * + * The contents of this file are subject to the Mozilla Public License + * Version 1.1 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License + * at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific language governing rights and + * limitations under the License. + * + * The initial developer of the original code is David A. Hinds + * . Portions created by David A. Hinds + * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License version 2 (the "GPL"), in which + * case the provisions of the GPL are applicable instead of the + * above. If you wish to allow the use of your version of this file + * only under the terms of the GPL and not to allow others to use + * your version of this file under the MPL, indicate your decision by + * deleting the provisions above and replace them with the notice and + * other provisions required by the GPL. If you do not delete the + * provisions above, a recipient may use your version of this file + * under either the MPL or the GPL. + */ + +#ifndef _LINUX_K_COMPAT_H +#define _LINUX_K_COMPAT_H + +#define __LINUX__ +#define VERSION(v,p,s) (((v)<<16)+(p<<8)+s) + +/* These are deprecated: should not use any more */ +#define RUN_AT(x) (jiffies+(x)) +#define CONST const +#define ALLOC_SKB(len) dev_alloc_skb(len+2) +#define DEVICE(req) ((req)->rq_dev) +#define GET_PACKET(dev, skb, count)\ + skb_reserve((skb), 2); \ + BLOCK_INPUT(skb_put((skb), (count)), (count)); \ + (skb)->protocol = eth_type_trans((skb), (dev)) + +#define BLK_DEV_HDR "linux/blk.h" +#define NEW_MULTICAST +#ifdef CONFIG_NET_PCMCIA_RADIO +#define HAS_WIRELESS_EXTENSIONS +#endif + +#define FREE_IRQ(i,d) free_irq(i, d) +#define REQUEST_IRQ(i,h,f,n,d) request_irq(i,h,f,n,d) +#define IRQ(a,b,c) (a,b,c) +#define DEV_ID dev_id +#define IRQ_MAP(irq, dev) do { } while (0) + +#if (LINUX_VERSION_CODE < VERSION(2,2,18)) +#if (LINUX_VERSION_CODE < VERSION(2,0,16)) +#define init_waitqueue_head(p) (*(p) = NULL) +#else +#define init_waitqueue_head(p) init_waitqueue(p) +#endif +typedef struct wait_queue *wait_queue_head_t; +#endif + +#define FS_SIZE_T ssize_t +#define U_FS_SIZE_T size_t + +#if (LINUX_VERSION_CODE < VERSION(2,1,31)) +#define FS_RELEASE_T void +#else +#define FS_RELEASE_T int +#endif + +#if (LINUX_VERSION_CODE < VERSION(2,1,38)) +#define test_and_set_bit set_bit +#endif + +#if (LINUX_VERSION_CODE > VERSION(2,1,16)) +#define AUTOCONF_INCLUDED +#define EXPORT_SYMTAB +#define register_symtab(x) +#endif +#ifdef CONFIG_MODVERSIONS +#define MODVERSIONS 1 +#include +#endif +#include + +#if (LINUX_VERSION_CODE < VERSION(2,1,45)) +#define F_INODE(file) ((file)->f_inode) +#else +#define F_INODE(file) ((file)->f_dentry->d_inode) +#endif + +#if (LINUX_VERSION_CODE < VERSION(2,1,51)) +#define INVALIDATE_INODES(r) invalidate_inodes(r) +#else +#define INVALIDATE_INODES(r) \ + do { struct super_block *sb = get_super(r); \ + if (sb) invalidate_inodes(sb); } while (0) +#endif + +#if (LINUX_VERSION_CODE < VERSION(2,1,60)) +#define FOPS(i,f,b,c,p) (i,f,b,c) +#define FPOS (file->f_pos) +#else +#define FOPS(i,f,b,c,p) (f,b,c,p) +#define FPOS (*ppos) +#endif + +#if (LINUX_VERSION_CODE < VERSION(2,1,68)) +#define signal_pending(cur) ((cur)->signal & ~(cur)->blocked) +#endif + +#if (LINUX_VERSION_CODE < VERSION(2,1,89)) +#define POLL_WAIT(f, q, w) poll_wait(q, w) +#else +#define POLL_WAIT(f, q, w) poll_wait(f, q, w) +#endif + +#include +#ifndef le16_to_cpu +#define le16_to_cpu(x) (x) +#define le32_to_cpu(x) (x) +#define cpu_to_le16(x) (x) +#define cpu_to_le32(x) (x) +#endif + +#if (LINUX_VERSION_CODE < VERSION(2,1,90)) +#define spin_lock(l) do { } while (0) +#define spin_unlock(l) do { } while (0) +#define spin_lock_irqsave(l,f) do { save_flags(f); cli(); } while (0) +#define spin_unlock_irqrestore(l,f) do { restore_flags(f); } while (0) +#define spin_lock_init(s) do { } while (0) +#define spin_trylock(l) (1) +typedef int spinlock_t; +#else +#if (LINUX_VERSION_CODE < VERSION(2,3,17)) +#include +#else +#include +#endif +#if defined(CONFIG_SMP) || (LINUX_VERSION_CODE > VERSION(2,3,6)) || \ + (defined(__powerpc__) && (LINUX_VERSION_CODE > VERSION(2,2,11))) +#define USE_SPIN_LOCKS +#endif +#endif + +#if (LINUX_VERSION_CODE < VERSION(2,2,12)) && \ + !defined(CONFIG_SMP) && defined(__alpha__) +#undef spin_trylock +#define spin_trylock(l) (1) +#endif + +#ifndef spin_is_locked +#define spin_is_locked(l) (0) +#endif + +#if (LINUX_VERSION_CODE < VERSION(2,1,104)) +#define mdelay(x) { int i; for (i=0;istate = TASK_INTERRUPTIBLE; } while (0) +#elif (LINUX_VERSION_CODE < VERSION(2,2,18)) +#define __set_current_state(n) do { current->state = (n); } while (0) +#endif + +#define wacquire(w) do { } while (0) +#define wrelease(w) do { } while (0) +#define wsleep(w) interruptible_sleep_on(w) +#define wakeup(w) wake_up_interruptible(w) +#define wsleeptimeout(w,t) interruptible_sleep_on_timeout(w,t) +#if (LINUX_VERSION_CODE < VERSION(2,1,127)) +#define interruptible_sleep_on_timeout(w,t) \ + ({(current->timeout=jiffies+(t));wsleep(w);current->timeout;}) +#define schedule_timeout(t) \ + do { current->timeout = jiffies+(t); schedule(); } while (0) +#endif + +#include +#ifndef readw_ns +#ifdef __powerpc__ +#if (LINUX_VERSION_CODE < VERSION(2,2,0)) +#define readw_ns(p) ld_be16((volatile unsigned short *)(p)) +#define readl_ns(p) ld_be32((volatile unsigned *)(p)) +#define writew_ns(v,p) st_be16((volatile unsigned short *)(p),(v)) +#define writel_ns(v,p) st_be32((volatile unsigned *)(p),(v)) +#else +#define readw_ns(p) in_be16((volatile unsigned short *)(p)) +#define readl_ns(p) in_be32((volatile unsigned *)(p)) +#define writew_ns(v,p) out_be16((volatile unsigned short *)(p),(v)) +#define writel_ns(v,p) out_be32((volatile unsigned *)(p),(v)) +#endif +#define inw_ns(p) in_be16((unsigned short *)((p)+_IO_BASE)) +#define inl_ns(p) in_be32((unsigned *)((p)+_IO_BASE)) +#define outw_ns(v,p) out_be16((unsigned short *)((p)+_IO_BASE),(v)) +#define outl_ns(v,p) out_be32((unsigned *)((p)+_IO_BASE),(v)) +#else +#define readw_ns(p) readw(p) +#define readl_ns(p) readl(p) +#define writew_ns(v,p) writew(v,p) +#define writel_ns(v,p) writel(v,p) +#define inw_ns(p) inw(p) +#define inl_ns(p) inl(p) +#define outw_ns(v,p) outw(v,p) +#define outl_ns(v,p) outl(v,p) +#endif +#endif +#ifndef insw_ns +#define insw_ns(p,b,l) insw(p,b,l) +#define insl_ns(p,b,l) insl(p,b,l) +#define outsw_ns(p,b,l) outsw(p,b,l) +#define outsl_ns(p,b,l) outsl(p,b,l) +#endif + +#if (LINUX_VERSION_CODE < VERSION(2,1,126)) +#define SCSI_DISK0_MAJOR SCSI_DISK_MAJOR +#endif + +typedef unsigned long k_time_t; +#define ACQUIRE_RESOURCE_LOCK do {} while (0) +#define RELEASE_RESOURCE_LOCK do {} while (0) + +/* Only for backwards compatibility */ +#include + +#include +#if defined(check_mem_region) && !defined(HAVE_MEMRESERVE) +#define HAVE_MEMRESERVE +#endif +#ifndef HAVE_MEMRESERVE +#define vacate_region release_region +#define vacate_mem_region release_mem_region +extern int check_mem_region(unsigned long base, unsigned long num); +extern void request_mem_region(unsigned long base, unsigned long num, + char *name); +extern void release_mem_region(unsigned long base, unsigned long num); +#endif + +#if (LINUX_VERSION_CODE < VERSION(2,2,0)) +#define in_interrupt() (intr_count) +#endif + +#if (LINUX_VERSION_CODE < VERSION(2,3,32)) +#define BLK_DEFAULT_QUEUE(n) blk_dev[n].request_fn +#define blk_init_queue(q, req) q = (req) +#define blk_cleanup_queue(q) q = NULL +#define request_arg_t void +#else +#define request_arg_t request_queue_t *q +#endif + +#include +#ifndef CAP_SYS_ADMIN +#define capable(x) (suser()) +#endif + +#if (LINUX_VERSION_CODE < VERSION(2,3,38)) +#define block_device_operations file_operations +#endif + +#if (LINUX_VERSION_CODE < VERSION(2,3,40)) +#define register_disk(dev, drive, minors, ops, size) \ + do { (dev)->part[(drive)*(minors)].nr_sects = size; \ + if (size == 0) (dev)->part[(drive)*(minors)].start_sect = -1; \ + resetup_one_dev(dev, drive); } while (0); +#endif + +#if (LINUX_VERSION_CODE < VERSION(2,2,0)) +#define timer_pending(a) (((a)->prev) != NULL) +#define mod_timer(a, b) \ + do { del_timer(a); (a)->expires = (b); add_timer(a); } while (0) +#endif + +#endif /* _LINUX_K_COMPAT_H */ diff -urN --exclude *CVS* linux-wlan-0.3.4/include/wlan/wlan_compat.h linux-wlan/include/wlan/wlan_compat.h --- linux-wlan-0.3.4/include/wlan/wlan_compat.h Fri Nov 5 18:21:09 1999 +++ linux-wlan/include/wlan/wlan_compat.h Thu Dec 7 04:14:26 2000 @@ -417,7 +417,7 @@ #define am930shim_pballoc am930llc_pballoc #define am930shim_pbfree am930llc_pbfree #define am930shim_malloc(l,d) kmalloc((l), (d)) - #define am930shim_free(p,l) kfree_s((p), (l)) + #define am930shim_free(p,l) kfree((p)) #define am930shim_rxframe(o,p) am930llc_rxframe((o), (p)) #define am930shim_ontxcomplete(o,r) am930llc_ontxcomplete((o), (r)) typedef UINT32 wlan_flags_t;