linux-wlan-ng-0.2.9+dfsg/0000755000175000017500000000000011026545443014537 5ustar tormodtormodlinux-wlan-ng-0.2.9+dfsg/src/0000755000175000017500000000000011026545443015326 5ustar tormodtormodlinux-wlan-ng-0.2.9+dfsg/src/wlanctl/0000755000175000017500000000000011026545443016772 5ustar tormodtormodlinux-wlan-ng-0.2.9+dfsg/src/wlanctl/wlanctl.h0000644000175000017500000000527711024763161020617 0ustar tormodtormod/* src/wlanctl/wlanctl.h * * Shared declarations for the wlanctl utility * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- */ #ifndef _WLANCTL_H #define _WLANCTL_H /*================================================================*/ /* System Includes */ /*================================================================*/ /* Project Includes */ /*================================================================*/ /* Constants */ /*================================================================*/ /* Macros */ /*================================================================*/ /* Types */ /*================================================================*/ /* Extern Declarations */ extern char *cmdcats[]; /*================================================================*/ /* Function Declarations */ void usage(void); /* help.c */ void print_allrequests(void); /* help.c */ void print_allmibs(void); /* help.c */ #endif /* _WLANCTL_H */ linux-wlan-ng-0.2.9+dfsg/src/wlanctl/Makefile0000644000175000017500000000471611024763161020437 0ustar tormodtormod# src/wlanctl/Makefile # # Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. # -------------------------------------------------------------------- # # linux-wlan # # 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. # # 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. # # -------------------------------------------------------------------- # # Inquiries regarding the linux-wlan Open Source project can be # made directly to: # # AbsoluteValue Systems Inc. # info@linux-wlan.com # http://www.linux-wlan.com # # -------------------------------------------------------------------- # # Portions of the development of this software were funded by # Intersil Corporation as part of PRISM(R) chipset product development. # # -------------------------------------------------------------------- -include ../../config.mk CPPFLAGS= -I../include -I$(LINUX_SRC)/include -D__LINUX_WLAN__ SRCS = wlanctl.c \ help.c \ ../shared/p80211types.c \ ../shared/p80211meta.c \ ../shared/p80211metamsg.c \ ../shared/p80211metamib.c OBJS = wlanctl.o \ help.o \ ../shared/p80211types.o \ ../shared/p80211meta.o \ ../shared/p80211metamsg.o \ ../shared/p80211metamib.o wlanctl: $(OBJS) $(CC) $(LDFLAGS) -o wlanctl $(OBJS) install: mkdir -p $(TARGET_INST_EXEDIR) cp wlanctl $(TARGET_INST_EXEDIR)/wlanctl-ng clean: rm -f core core.* *.o .*.o *.s *.a .depend tmp_make *~ tags rm -f wlanctl for i in *_obj; do if [ -d $$i ]; then rm -fr $$i; fi; done linux-wlan-ng-0.2.9+dfsg/src/wlanctl/wlanctl.c0000644000175000017500000003435611024763161020612 0ustar tormodtormod/* src/wlanctl/wlanctl.c * * user utility for the wlan card * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- */ /*================================================================*/ /* System Includes */ #include #include #include #include /* Ugly hack for LinuxPPC R4, don't have time to figure it out right now */ #if defined(__WLAN_PPC__) #undef __GLIBC__ #endif #include #include #include /*================================================================*/ /* Project Includes */ #include #include #include #include #include #include #include #include "wlanctl.h" /*================================================================*/ /* Local Constants */ /*================================================================*/ /* Local Macros */ /*================================================================*/ /* Local Types */ /*================================================================*/ /* Local Static Definitions */ char *devname; char *cmdcats[] = { "dot11req", "lnxreq", "p2req" }; static int debug = 0; /*================================================================*/ /* Local Function Declarations */ INT cmdline2requestmsg( UINT8 *msg, UINT32 msgcode, int argc, char **argv ); void printmsg( UINT8 *msg, UINT32 msgcode ); void sim_ioctl( UINT8 *msg, UINT32 msgcode ); int do_ioctl( UINT8 *msg, UINT32 msgcode ); void dump_msg(void *msg); /*================================================================*/ /* Function Definitions */ /*---------------------------------------------------------------- * main * * wlanctl-ng entry point. * * Arguments: * argc number of command line arguments * argv array of argument strings * * Returns: * 0 - success * ~0 - failure ----------------------------------------------------------------*/ int main ( int argc, char **argv ) { UINT8 message[MSG_BUFF_LEN]; UINT32 msgcode = P80211DID_INVALID; INT result = 0; INT i; if ( argc < 4 && argc >= 2 && strcmp( argv[1], "version") == 0) { printf("wlanctl-ng: %s\n", WLAN_RELEASE); } else if ( argc < 4 && argc >= 2 && strcmp( argv[1], "commands") == 0) { print_allrequests(); } else if ( argc < 4 && argc >= 2 && strcmp( argv[1], "mibs") == 0) { print_allmibs(); } else if ( argc < 3 ) { usage(); } else { /* stuff the device name in a global */ devname = argv[1]; /* returns P80211DID_INVALID no match */ for ( i = 0; i < sizeof(cmdcats)/sizeof(cmdcats[0]); i++) { msgcode = p80211_text2did(msg_catlist, cmdcats[i], argv[2], NULL); if ( msgcode != P80211DID_INVALID ) { break; } } if (msgcode != P80211DID_INVALID) { /* msgcode valid */ result = cmdline2requestmsg( message, msgcode, argc, argv ); if ( result == 0 ) { if ( (result = do_ioctl( message, msgcode )) == 0 ){ printmsg( message, msgcode ); } } else { printmsg( message, msgcode ); /* printf("Message \"%s\" was unable to be created\n", argv[2]); */ } } else { /* msgcode invalid */ printf("The cmd \'%s\' is invalid\n", argv[2]); result=msgcode; } } return(result); } /*---------------------------------------------------------------- * do_ioctl * * TODO: describe * * Arguments: * argc number of command line arguments * argv array of argument strings * * Returns: * 0 - success * ~0 - failure ----------------------------------------------------------------*/ int do_ioctl( UINT8 *msg, UINT32 msgcode ) { int result = -1; int fd; p80211ioctl_req_t req; /* set the magic */ req.magic = P80211_IOCTL_MAGIC; /* get a socket */ fd = socket(AF_INET, SOCK_STREAM, 0); if ( fd == -1 ) { perror("wlanctl-ng"); return result; } req.len = MSG_BUFF_LEN; /* TODO: need to fix the length */ req.data = msg; strcpy( req.name, devname); req.result = 0; if ( debug ) { fprintf(stderr, "raw msg before ioctl:\n"); dump_msg(msg); } result = ioctl( fd, P80211_IFREQ, &req); if ( debug ) { fprintf(stderr, "raw msg after ioctl:\n"); dump_msg(msg); } if ( result == -1 ) { perror("wlanctl-ng"); } close(fd); return result; } void dump_msg(void *msg) { p80211msgd_t *msgp = msg; int i; int bodylen; fprintf(stderr, " msgcode=0x%08lx msglen=%lu devname=%s\n", msgp->msgcode, msgp->msglen, msgp->devname); fprintf(stderr, "body: "); bodylen=msgp->msglen - (sizeof(msgp->msgcode) + sizeof(msgp->msglen) + sizeof(msgp->devname)); for ( i = 0; i < bodylen; i+=4) { fprintf(stderr, "%02x%02x%02x%02x ", msgp->args[i], msgp->args[i+1], msgp->args[i+2], msgp->args[i+3]); } fprintf(stderr,"\n"); } /*---------------------------------------------------------------- * cmdline2requestmsg * * Default command line to request message converter. Takes the * command (request) code and the cmdline arguments, compares them * to the metadata for the request arguments for the given request * and if all required arguments are present and valid, builds a * message structure. This function handles the general case. * * Arguments: * msg buffer to build msg in (assumed to be at least MSG_BUFF_LEN bytes) * msgcode partial did containing category and group indices * argc number of command line arguments * argv array of argument strings * * Returns: * 0 - success * ~0 - failure ----------------------------------------------------------------*/ INT cmdline2requestmsg( UINT8 *msg, UINT32 msgcode, int argc, char **argv ) { UINT8 *cmdlinelist; UINT8 *msgptr; UINT8 *start; UINT8 tmpitem[MSG_BUFF_LEN]; p80211meta_t *alist = NULL; grplistitem_t *grp = NULL; INT found; INT i; INT j; INT32 narg; UINT32 tmpdid; size_t itemlen; size_t offset; /* Create an array of bytes where each byte represents a flag for each command line argument. For each argument on the command line following the msg code, the repsective byte will contain either a 0 (for not found) or 1 (found) after an attempt to match the command line argument to one of the metadata arguments for the user entered 'valid' msg, such as 'scan' or 'powermgmt'. */ if ( (cmdlinelist = (UINT8 *)malloc(argc)) == NULL ) { printf("wlanctl-ng: cmdlinelist memory allocation failed\n"); return 1; } /* initialize all the bytes to 0 for not found */ memset( cmdlinelist, 0, argc); memset( msg, 0, MSG_BUFF_LEN); memset( tmpitem, 0, MSG_BUFF_LEN); ((p80211msg_t *)msg)->msgcode = msgcode; strncpy(((p80211msg_t *)msg)->devname, devname, WLAN_DEVNAMELEN_MAX - 1 ); ((p80211msg_t *)msg)->msglen = sizeof(p80211msg_t); start = msg + sizeof( p80211msg_t ); msgptr = start; /* acquire the msg argument metadata list */ if ( (grp = p80211_did2grp(msg_catlist, msgcode)) != NULL ) { alist = grp->itemlist; narg = GETMETASIZE(alist); } else { printf("wlanctl-ng: Invalid msgcode of %u\n", (unsigned int)msgcode); free( cmdlinelist ); return 1; } /* printf("The cmd %s is valid with a code of 0x%08lx\n", argv[2], msgcode); printf(" argc=%d, narg is %lu\n", argc, narg); */ /* Loop through the metadata for all the arguments of the message and initialize the did, the len and set the status to status code of "no value" (i.e. the data isn't set) */ for ( i = 1; i < narg; i++) { tmpdid = msgcode | P80211DID_MKITEM(i) | alist[i].did; if ( (offset = p80211item_getoffset(msg_catlist, tmpdid)) != 0xffffffff ) { msgptr = start + offset; ((p80211item_t *)msgptr)->did = tmpdid; ((p80211item_t *)msgptr)->status = (short)P80211ENUM_msgitem_status_no_value; if ( (((p80211item_t *)msgptr)->len = (short)(p80211item_maxdatalen(msg_catlist, tmpdid))) != 0xffff ) { ((p80211msg_t *)msg)->msglen += ( sizeof(p80211item_t) + ((p80211item_t *)msgptr)->len ); } else { printf("wlanctl-ng: invalid data length for %s\n", alist[i].name); free( cmdlinelist ); return 1; } } else { printf("wlanctl-ng: [1] error creating offset for %s\n", alist[i].name); free( cmdlinelist ); return 1; } } /* Build message in the same order as the metadata argument list by by looping through msg arg metadata, args always start at index 1 */ msgptr = start; for ( i = 1; i < narg; i++) { found = 0; tmpdid = msgcode | P80211DID_MKITEM(i) | alist[i].did; if ( (offset = p80211item_getoffset(msg_catlist, tmpdid)) != 0xffffffff ) { /* printf("cmdline2request: " "curr meta data item %s: " "offset=%d\n", alist[i].name, offset); */ msgptr = start + offset; } else { printf("wlanctl-ng: [2] error creating offset for %s\n", alist[i].name); free( cmdlinelist ); return 1; } /* loop through msg arguments on cmdline */ for ( j = 3; (j < argc) && (!found); j++) { /* does meta match cmdline arg? */ if ( strncmp(alist[i].name,argv[j], strlen(alist[i].name)) == 0 ) { if ( P80211ITEM_ISREQUEST(alist[i].flags) ) { found = 1; cmdlinelist[j] = (UINT8)1; if ( alist[i].fromtextptr != NULL ) { (*(alist[i].fromtextptr)) (msg_catlist, tmpdid, tmpitem, argv[j]); } itemlen = sizeof(p80211item_t) + p80211item_maxdatalen(msg_catlist, tmpdid); memcpy(msgptr, tmpitem, itemlen); } else { printf("non-request argument found on cmdline.\n"); free( cmdlinelist ); return 1; } } /* if cmdline match */ } /* for each cmdline arg */ } /* for each msg argument metadata */ /* Loop through the built message and check the status field. For required request arguments, the status must be "data ok" or it's an error. If the status code is "no value", the argument can not be a required request argument; otherwise, it's an error. Any other status code is an error. */ msgptr = start; for ( i = 1; i < narg; i++) { if ( ((p80211item_t *)msgptr)->status > (short)P80211ENUM_msgitem_status_no_value ) { p80211_error2text( ((p80211item_t *)msgptr)->status, tmpitem ); printf("%s=\"%s\"\n", alist[i].name, tmpitem); free( cmdlinelist ); return 1; } else if ( ((p80211item_t *)msgptr)->status == (short)P80211ENUM_msgitem_status_no_value ) { if ( (P80211ITEM_ISREQUIRED(alist[i].flags)) && (P80211ITEM_ISREQUEST(alist[i].flags)) ) { printf("The required argument \'%s\' has no value.\n", alist[i].name); free( cmdlinelist ); return 1; } } msgptr += (sizeof(p80211item_t) + ((p80211item_t *)msgptr)->len); } /* check to see that each message argument on the command line was */ /* matched to an argument metadata for the message */ for ( j = 3; j < argc; j++) { if ( !(cmdlinelist[j]) ) { printf("\'%s\' entered on the command line " "was either an invalid\n" "argument to the cmd \'%s\' or an extra " "occurence of a valid argument.\n", argv[j], argv[2]); free( cmdlinelist ); return 1; } } free( cmdlinelist ); return 0; } /*---------------------------------------------------------------- * printmsg * * Traverse the message items printing each. * * Arguments: * msg buffer containing a complete msg * msgcode integer identifying the msg * * Returns: * 0 - success * ~0 - failure ----------------------------------------------------------------*/ void printmsg( UINT8 *msg, UINT32 msgcode ) { UINT8 tmpitem[MSG_BUFF_LEN]; UINT8 *msgptr; UINT8 *start; INT i; grplistitem_t *grp; UINT32 narg; UINT32 offset; UINT32 tmpdid; p80211meta_t *alist; msgptr = msg; /* acquire the msg argument metadata list */ if ( (grp = p80211_did2grp(msg_catlist, msgcode)) != NULL ) { alist = grp->itemlist; narg = GETMETASIZE(alist); } else { printf("wlanctl-ng: Invalid msgcode of %u\n", (unsigned int)msgcode); return; } /* print the message code */ printf("message=%s\n", grp->name); start = msg + sizeof(p80211msg_t); for ( i = 1; i < narg; i++ ) { tmpdid = msgcode | P80211DID_MKITEM(i) | alist[i].did; offset = p80211item_getoffset(msg_catlist, tmpdid); msgptr = start + offset; /* pass tmpdid since the 'totext' functions */ /* expect a non-zero did */ if ( ((p80211item_t *)msgptr)->status == P80211ENUM_msgitem_status_data_ok ) { if ( alist[i].totextptr != NULL ) { (*(alist[i].totextptr)) ( msg_catlist, tmpdid, msgptr, tmpitem); printf(" %s\n", tmpitem); } else { p80211_error2text( P80211ENUM_msgitem_status_missing_print_func, tmpitem); printf(" %s=%s\n", alist[i].name, tmpitem); } } else { p80211_error2text( ((p80211item_t *)msgptr)->status, tmpitem); printf(" %s=%s\n", alist[i].name, tmpitem); } } /* for each argument in the metadata */ } linux-wlan-ng-0.2.9+dfsg/src/wlanctl/help.c0000644000175000017500000002300611024763161020064 0ustar tormodtormod/* src/wlanctl/help.c * * wlanctl-ng help messages * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- */ /*================================================================*/ /* System Includes */ #include #include #include /*================================================================*/ /* Project Includes */ #include #include #include #include #include #include #include #include "wlanctl.h" /*================================================================*/ /* Local Constants */ /*================================================================*/ /* Local Macros */ /*================================================================*/ /* Local Types */ /*================================================================*/ /* Local Static Definitions */ /*================================================================*/ /* Local Function Declarations */ void usage(void); void print_allrequests(void); void print_allmibs(void); /*================================================================*/ /* Function Definitions */ /*---------------------------------------------------------------- * usage * * Print a short usage message * * Arguments: * none * * Returns: * nothing ----------------------------------------------------------------*/ void usage(void) { printf("wlanctl-ng: - control utility for 802.11 devices\n"); printf(" usage: wlanctl-ng interface|version|commands|mibs cmd cmdarg [cmdarg...]\n\n"); printf(" where \"interface\" is the name of a wireless\n"); printf(" network interface. Running \'ifconfig\' will list\n"); printf(" all network interfaces.\n\n"); printf(" For a list of available commands, run \'wlanctl-ng commands\'\n\n"); printf(" For a list of available mib items, run \'wlanctl-ng mibs\'\n"); } /*---------------------------------------------------------------- * print_allrequests * * Traverse all of the requests in the message and message argument * metadata. Print the name of the request, the name of each request * argument and any validation requirements. * * Arguments: * none * * Returns: * nothing ----------------------------------------------------------------*/ void print_allrequests(void) { int i; int j; int k; UINT32 did; p80211meta_t *msg_item; grplistitem_t *grp; int msg_cat; int ncats; int ncmds; int nitems; p80211enum_t *enump; ncats = GETMETASIZE(msg_catlist); for (msg_cat = 1; msg_cat < ncats; msg_cat++ ) { if ( strstr(msg_catlist[msg_cat].name, "req") == NULL ) { continue; } ncmds = GETMETASIZE(msg_catlist[msg_cat].grplist); for (i = 1; i < ncmds; i++ ) { did = P80211DID_MKSECTION(msg_cat) | P80211DID_MKGROUP(i); if ( (grp = p80211_did2grp(msg_catlist, did)) != NULL ) { printf("Command: %s\n", grp->name); msg_item = grp->itemlist; nitems = GETMETASIZE(msg_item); for ( j = 1; j < nitems; j++) { if ( P80211ITEM_ISREQUEST(msg_item[j].flags) ) { printf( " %s(%s):", msg_item[j].name, P80211ITEM_ISREQUIRED(msg_item[j].flags) ? "required" : "optional"); switch (p80211item_gettype(&msg_item[j])) { case P80211_TYPE_OCTETSTR: printf("OCTETSTR{"); printf("minlen=%ld, ", msg_item[j].minlen); printf("maxlen=%ld}", msg_item[j].maxlen); break; case P80211_TYPE_DISPLAYSTR: printf("DISPLAYSTR{"); printf("minlen=%ld, ", msg_item[j].minlen); printf("maxlen=%ld}", msg_item[j].maxlen); break; case P80211_TYPE_INT: if (msg_item[j].min || msg_item[j].max) { printf("INT{min=%ld, max=%ld}", msg_item[j].min, msg_item[j].max); } else { printf("INT{}"); } break; case P80211_TYPE_ENUMINT: printf("ENUMINT{"); enump = msg_item[j].enumptr; for ( k = 0; k < enump->nitems; k++){ printf("%s", enump->list[k].name); if ( k < enump->nitems - 1) { printf("|"); } } printf("}"); break; case P80211_TYPE_BITARRAY: printf("BITARRAY{"); printf("min=%ld, max=%ld}", msg_item[j].min, msg_item[j].max); break; case P80211_TYPE_INTARRAY: printf("INTARRAY{"); printf("maxlen=%ld}", msg_item[j].maxlen); break; case P80211_TYPE_MACARRAY: printf("MACARRAY{"); printf("maxlen=%ld}", msg_item[j].maxlen); break; case P80211_TYPE_UNKDATA: printf("UNKDATA{"); printf("maxlen=%ld}", msg_item[j].maxlen); break; default: printf("ERROR: unknown type!\n"); break; } printf("\n"); } } } else { printf("help.c: invalid group did\n"); } } } } /*---------------------------------------------------------------- * print_allmibs * * Traverse all of the mib items in the mib metadata. Print the * name of the group, the name of each mib item and any * validation requirements. * * Arguments: * none * * Returns: * nothing ----------------------------------------------------------------*/ void print_allmibs(void) { int i; int j; int k; UINT32 did; p80211meta_t *mib_item; grplistitem_t *grp; int mib_cat; int ncats; int ncmds; int nitems; p80211enum_t *enump; ncats = GETMETASIZE(mib_catlist); for (mib_cat = 1; mib_cat < ncats; mib_cat++ ) { ncmds = GETMETASIZE(mib_catlist[mib_cat].grplist); for (i = 1; i < ncmds; i++ ) { did = P80211DID_MKSECTION(mib_cat) | P80211DID_MKGROUP(i); if ( (grp = p80211_did2grp(mib_catlist, did)) != NULL ) { printf("Mib Group: %s\n", grp->name); mib_item = grp->itemlist; nitems = GETMETASIZE(mib_item); for ( j = 1; j < nitems; j++) { char access_type[8]; switch (P80211DID_ACCESS(mib_item[j].did)) { case P80211DID_WRITEONLY: strcpy(access_type,"-w" ); break; case P80211DID_READONLY: strcpy(access_type,"r-" ); break; case P80211DID_READWRITE: strcpy(access_type,"rw" ); break; default: strcpy(access_type,"--" ); break; } printf( " %s(%s):", mib_item[j].name, access_type); switch (p80211item_gettype(&mib_item[j])) { case P80211_TYPE_OCTETSTR: printf("OCTETSTR{"); printf("minlen=%ld, ", mib_item[j].minlen); printf("maxlen=%ld}", mib_item[j].maxlen); break; case P80211_TYPE_DISPLAYSTR: printf("DISPLAYSTR{"); printf("minlen=%ld, ", mib_item[j].minlen); printf("maxlen=%ld}", mib_item[j].maxlen); break; case P80211_TYPE_INT: if (mib_item[j].min || mib_item[j].max) { printf("INT{min=%ld, max=%ld}", mib_item[j].min, mib_item[j].max); } else { printf("INT{}"); } break; case P80211_TYPE_ENUMINT: printf("ENUMINT{"); enump = mib_item[j].enumptr; for ( k = 0; k < enump->nitems; k++){ printf("%s", enump->list[k].name); if ( k < enump->nitems - 1) { printf("|"); } } printf("}"); break; case P80211_TYPE_BITARRAY: printf("BITARRAY{"); printf("min=%ld, max=%ld}", mib_item[j].min, mib_item[j].max); break; case P80211_TYPE_INTARRAY: printf("INTARRAY{"); printf("maxlen=%ld}", mib_item[j].maxlen); break; case P80211_TYPE_MACARRAY: printf("MACARRAY{"); printf("maxlen=%ld}", mib_item[j].maxlen); break; case P80211_TYPE_UNKDATA: printf("UNKDATA{"); printf("maxlen=%ld}", mib_item[j].maxlen); break; default: printf("ERROR: unknown type!\n"); break; } printf("\n"); } } else { printf("help.c: invalid group did\n"); } } } } linux-wlan-ng-0.2.9+dfsg/src/README0000644000175000017500000000444011024763201016200 0ustar tormodtormod* src/README * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- ./src - root for linux-wlan source code directories src/am930 - source for the AMD MAC specific driver src/include - header files shared by various components. Header files that are only used by one component are in that component's source directory src/p80211 - source for 802.11 services src/prism2 - source for the Intersil PRISM2 MAC specific driver src/shared - source files (.c) that are shared among two or more components src/wlanctl - source for the wlanctl user-mode utility linux-wlan-ng-0.2.9+dfsg/src/mkmeta/0000755000175000017500000000000011026545443016604 5ustar tormodtormodlinux-wlan-ng-0.2.9+dfsg/src/mkmeta/mkmetastructhead.txt0000644000175000017500000000375611024763201022715 0ustar tormodtormod/* This file is GENERATED AUTOMATICALLY. DO NOT EDIT OR MODIFY. * -------------------------------------------------------------------- * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- */ #ifndef _P80211MKMETASTRUCT_H #define _P80211MKMETASTRUCT_H linux-wlan-ng-0.2.9+dfsg/src/mkmeta/mkmetadefhead.txt0000644000175000017500000000375011024763201022121 0ustar tormodtormod/* This file is GENERATED AUTOMATICALLY. DO NOT EDIT OR MODIFY. * -------------------------------------------------------------------- * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- */ #ifndef _P80211MKMETADEF_H #define _P80211MKMETADEF_H linux-wlan-ng-0.2.9+dfsg/src/mkmeta/Makefile0000644000175000017500000000730511024763201020241 0ustar tormodtormod# src/mkmeta/Makefile # # Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. # -------------------------------------------------------------------- # # linux-wlan # # 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. # # 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. # # -------------------------------------------------------------------- # # Inquiries regarding the linux-wlan Open Source project can be # made directly to: # # AbsoluteValue Systems Inc. # info@linux-wlan.com # http://www.linux-wlan.com # # -------------------------------------------------------------------- # # Portions of the development of this software were funded by # Intersil Corporation as part of PRISM(R) chipset product development. # # -------------------------------------------------------------------- -include ../../config.mk CPPFLAGS= -I../include -I$(LINUX_SRC)/include \ -D__LINUX_WLAN__ # Implicit rules to handle the separate obj dirs OBJ_DIR=obj $(OBJ_DIR)/%.o : ../shared/%.c $(HOST_CC) -c $(HOST_CFLAGS) $(CPPFLAGS) $< -o $@ $(OBJ_DIR)/%.o : %.c $(HOST_CC) -c $(HOST_CFLAGS) $(CPPFLAGS) $< -o $@ # Source and obj and target definitions SHSRC= ../shared/p80211types.c \ ../shared/p80211metamsg.c \ ../shared/p80211metamib.c \ ../shared/p80211meta.c SHOBJ= $(OBJ_DIR)/p80211types.o \ $(OBJ_DIR)/p80211metamsg.o \ $(OBJ_DIR)/p80211metamib.o \ $(OBJ_DIR)/p80211meta.o MKMETADEF_SRC= $(SHSRC) \ mkmetadef.c MKMETADEF_OBJ= $(SHOBJ) \ $(OBJ_DIR)/mkmetadef.o MKMETASTRUCT_SRC= $(SHSRC) \ mkmetastruct.c MKMETASTRUCT_OBJ= $(SHOBJ) \ $(OBJ_DIR)/mkmetastruct.o DEP_SRC=$(MKMETADEF_SRC) $(MKMETASTRUCT_SRC) # Rules all : .depend dirs mkmetadef mkmetastruct dep .depend: $(DEP_SRC) ../../config.mk $(HOST_CPP) -M $(CPPFLAGS) $(DEP_SRC) > .depend dirs : mkdir -p $(OBJ_DIR) mkmetadef: $(MKMETADEF_OBJ) mkmetadefhead.txt $(HOST_CC) $(LDFLAGS) -o $@ $(MKMETADEF_OBJ) cat mkmetadefhead.txt > ../include/wlan/p80211metadef.h ./mkmetadef >> ../include/wlan/p80211metadef.h echo "#endif" >> ../include/wlan/p80211metadef.h mkmetastruct: $(MKMETASTRUCT_OBJ) mkmetastructhead.txt $(HOST_CC) $(LDFLAGS) -o $@ $(MKMETASTRUCT_OBJ) cat mkmetastructhead.txt > ../include/wlan/p80211metastruct.h ./mkmetastruct >> ../include/wlan/p80211metastruct.h echo "#endif" >> ../include/wlan/p80211metastruct.h install: echo "Nothing to install" clean: rm -f core core.* *.o .*.o *.s *.a .depend tmp_make *~ tags rm -f ../shared/*.o rm -fr $(OBJ_DIR) rm -f mkmetadef mkmetastruct rm -f ../include/wlan/p80211metastruct.h rm -f ../include/wlan/p80211metadef.h # # Include a dependency file (if one exists) # ifneq ($(MAKECMDGOALS), clean) ifeq (.depend,$(wildcard .depend)) include .depend endif endif linux-wlan-ng-0.2.9+dfsg/src/mkmeta/mkmetadef.c0000644000175000017500000001113011024763201020671 0ustar tormodtormod/* src/mkmeta/mkmetadef.c * * Generates #defines for all msg and mib DIDs * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- * * The purpose of this program is to generate a header file containing * all the defines for all message and mib metadata category names, * group names and data item names. */ #include #include #include #include #include #include #include int main(int argc, char **argv) { int c, g, i, totgrps, totitems; /* Metadata for the Message Category List */ for ( c = 1; c < msg_catlist_size; c++ ) { printf("#define DIDmsg_cat_%s \\\n", msg_catlist[c].name); printf("\t\t\tP80211DID_MKSECTION(%d)\n", c); totgrps = GETMETASIZE(msg_catlist[c].grplist); for ( g = 1; g < totgrps; g++ ) { printf("#define DIDmsg_%s \\\n", msg_catlist[c].grplist[g].name); printf("\t\t\t(P80211DID_MKSECTION(%d) | \\\n", c); printf("\t\t\tP80211DID_MKGROUP(%d))\n", g); totitems = GETMETASIZE(msg_catlist[c].grplist[g].itemlist); for ( i = 1; i < totitems; i++ ) { printf("#define DIDmsg_%s_%s \\\n", msg_catlist[c].grplist[g].name, msg_catlist[c].grplist[g].itemlist[i].name); printf("\t\t\t(P80211DID_MKSECTION(%d) | \\\n", c); printf("\t\t\tP80211DID_MKGROUP(%d) | \\\n", g); printf("\t\t\tP80211DID_MKITEM(%d) | ", i); printf("0x%08x)\n",(unsigned int) msg_catlist[c].grplist[g].itemlist[i].did); } } } /* Metadata for the Mib Category List */ for ( c = 1; c < mib_catlist_size; c++ ) { printf("#define DIDmib_cat_%s \\\n", mib_catlist[c].name); printf("\t\t\tP80211DID_MKSECTION(%d)\n", c); totgrps = GETMETASIZE(mib_catlist[c].grplist); for ( g = 1; g < totgrps; g++ ) { printf("#define DIDmib_%s_%s \\\n", mib_catlist[c].name, mib_catlist[c].grplist[g].name); printf("\t\t\t(P80211DID_MKSECTION(%d) | \\\n", c); printf("\t\t\tP80211DID_MKGROUP(%d))\n", g); totitems = GETMETASIZE(mib_catlist[c].grplist[g].itemlist); for ( i = 1; i < totitems; i++ ) { printf("#define DIDmib_%s_%s_%s \\\n", mib_catlist[c].name, mib_catlist[c].grplist[g].name, mib_catlist[c].grplist[g].itemlist[i].name); printf("\t\t\t(P80211DID_MKSECTION(%d) | \\\n", c); printf("\t\t\tP80211DID_MKGROUP(%d) | \\\n", g); printf("\t\t\tP80211DID_MKITEM(%d) | ", i); printf("0x%08x)\n", (unsigned int) mib_catlist[c].grplist[g].itemlist[i].did); } } } return 0; } linux-wlan-ng-0.2.9+dfsg/src/mkmeta/mkmetastruct.c0000644000175000017500000001403611024763201021467 0ustar tormodtormod/* src/mkmeta/mkmetastruct.c * * Generates the message structures and typedefs * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- */ #include #include #include #include #include #include #include #include int main(int argc, char **argv) { int c, g, i, totgrps, totitems, type; char name[82]; int pad_id = 0; /* traverse the message metadata to build the structures and typedefs */ for ( c = 1; c < msg_catlist_size; c++ ) { totgrps = GETMETASIZE(msg_catlist[c].grplist); for ( g = 1; g < totgrps; g++ ) { strcpy(name, "p80211msg"); printf("typedef struct %s_%s\n{\n", name, msg_catlist[c].grplist[g].name); printf("\tUINT32\t\tmsgcode ;\n"); printf("\tUINT32\t\tmsglen ;\n"); printf("\tUINT8\t\tdevname[WLAN_DEVNAMELEN_MAX] ;\n"); totitems = GETMETASIZE(msg_catlist[c].grplist[g].itemlist); for ( i = 1; i < totitems; i++ ) { type = p80211item_gettype(&msg_catlist[c].grplist[g].itemlist[i]); switch ( type ) { case P80211_TYPE_INT: case P80211_TYPE_ENUMINT: case P80211_TYPE_BITARRAY: /* already aligned */ printf("\tp80211item_uint32_t"); printf("\t%s ;\n", msg_catlist[c].grplist[g].itemlist[i].name); break; case P80211_TYPE_UNKDATA: /* already aligned */ printf("\tp80211item_unk%d_t", msg_catlist[c].grplist[g].itemlist[i].maxlen); printf("\t%s ;\n", msg_catlist[c].grplist[g].itemlist[i].name); break; case P80211_TYPE_INTARRAY: /* already aligned */ printf("\tstruct {\n"); printf("\t\tUINT32\tdid ;\n"); printf("\t\tUINT16\tstatus ;\n"); printf("\t\tUINT16\tlen ;\n"); printf("\t\tUINT32\tdata[%d] ;\n", msg_catlist[c].grplist[g].itemlist[i].maxlen); printf("\t\t} %s ;\n", msg_catlist[c].grplist[g].itemlist[i].name); break; case P80211_TYPE_MACARRAY: /* May not be aligned, thanks to variable-length array. */ printf("\tstruct {\n"); printf("\t\tUINT32\tdid ;\n"); printf("\t\tUINT16\tstatus ;\n"); printf("\t\tUINT16\tlen ;\n"); printf("\t\tUINT32\tcnt ;\n"); printf("\t\tUINT8\tdata[%d][WLAN_ADDR_LEN] ;\n", msg_catlist[c].grplist[g].itemlist[i].maxlen); if (msg_catlist[c].grplist[g].itemlist[i].maxlen % 4) printf("\t\tUINT8\tpad_%dB[%d] ;\n", pad_id++, (4 - ((msg_catlist[c].grplist[g].itemlist[i].maxlen * 6) % 4))); printf("\t\t} %s ;\n", msg_catlist[c].grplist[g].itemlist[i].name); break; case P80211_TYPE_OCTETSTR: /* May not be aligned. it's a string. */ printf("\tp80211item_pstr%d_t", msg_catlist[c].grplist[g].itemlist[i].maxlen); printf("\t%s ;\n", msg_catlist[c].grplist[g].itemlist[i].name); if ((msg_catlist[c].grplist[g].itemlist[i].maxlen + 1) % 4) printf("\tUINT8\tpad_%dC[%d] ;\n", pad_id++, (4 - ((msg_catlist[c].grplist[g].itemlist[i].maxlen + 1) % 4))); break; default: /* May not be aligned. it's a string. */ printf("\tp80211item_pstr%d_t", msg_catlist[c].grplist[g].itemlist[i].maxlen); printf("\t%s ;\n", msg_catlist[c].grplist[g].itemlist[i].name); if ((msg_catlist[c].grplist[g].itemlist[i].maxlen + 1) % 4) printf("\tUINT8\tpad_%dD[%d] ;\n", pad_id++, (4 - ((msg_catlist[c].grplist[g].itemlist[i].maxlen + 1) % 4))); break; } } printf("} __WLAN_ATTRIB_PACK__ %s_%s_t;\n\n", name, msg_catlist[c].grplist[g].name); } } return 0; } linux-wlan-ng-0.2.9+dfsg/src/nwepgen/0000755000175000017500000000000011026545443016771 5ustar tormodtormodlinux-wlan-ng-0.2.9+dfsg/src/nwepgen/nwepgen.c0000644000175000017500000001202011024763157020575 0ustar tormodtormod/* src/nwepgen/nwepgen.c * * Management request handler functions. * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- * * This program generates a set of WEP keys in a manner that is compatible * with the windows based config utility developed by Neesus Datacom. * * The algorithm was supplied by Neesus, but was dependent on the srand() * and rand() functions in a binary-only driver. Juan Arango of Zoom * Telephonics developed the code in the nwepgen() function to match * the behavior of that library. * * -------------------------------------------------------------------- */ #include #include #include #include #include void nwepgen(char *genstr, int keylen, UINT8 wep_key[WLAN_WEP_NKEYS][WLAN_WEP_MAXKEYLEN]); int main(int argc, char *argv[]) { UINT8 wep_key[WLAN_WEP_NKEYS][WLAN_WEP_MAXKEYLEN]; int i; int j; int keylen; if ( argc < 2 || argc > 3 ) { printf("nwepgen: generates Neesus Datacom compatible WEP keys from a string\n"); printf(" Usage: nwepgen \n"); return 0; } keylen = (argc < 3) ? 5 : atoi(argv[2]); if ( keylen < 1 || keylen > WLAN_WEP_MAXKEYLEN ) { printf(" Invalid key length. Valid range is 1-%d.\n", WLAN_WEP_MAXKEYLEN); return 0; } nwepgen( argv[1], keylen, wep_key); for ( i = 0; i < WLAN_WEP_NKEYS; i++) { /* printf("%d-", i); */ for ( j=0; j < keylen; j++) { printf((j < keylen-1) ? "%02x:" : "%02x\n", wep_key[i][j]); } } return 0; } /*---------------------------------------------------------------- * nwepgen * * Generates a set of WEP keys from a generator string. This is * intended as a convenience. Entering hex bytes can be a pain. * * Based on an algorithm supplied by Neesus Datacom, * http://www.neesus.com * * This function was authored by Zoom Telephonics Engineer * Juan Arango. * http://www.zoomtel.com * * Juan's Note: * Changing the code in this function could make this product * incompatible with other ZoomAir wireless products because * these other products rely on Microsoft's rand() and srand() * function implementations!!! This code uses the same algorithm. * * Distributed with permission from Zoom Telephonics. * * Arguments: * genstr a null terminated string * keylen number of bytes in key * wep_key a 2d array that is filled with the wep keys * Returns: * nothing ----------------------------------------------------------------*/ void nwepgen(char *genstr, int keylen, UINT8 wep_key[WLAN_WEP_NKEYS][WLAN_WEP_MAXKEYLEN]) { unsigned int i,j; unsigned char pseed[4]={0,0,0,0}; unsigned int len; int randNumber=0; len = strlen(genstr); if (len) { /* generate seed for random number generator using */ /* key string... */ for (i=0; i>16) & 0x7fff); } } } return; } linux-wlan-ng-0.2.9+dfsg/src/nwepgen/Makefile0000644000175000017500000000415211024763160020427 0ustar tormodtormod# src/nwepgen/Makefile # # Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. # -------------------------------------------------------------------- # # linux-wlan # # 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. # # 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. # # -------------------------------------------------------------------- # # Inquiries regarding the linux-wlan Open Source project can be # made directly to: # # AbsoluteValue Systems Inc. # info@linux-wlan.com # http://www.linux-wlan.com # # -------------------------------------------------------------------- # # Portions of the development of this software were funded by # Intersil Corporation as part of PRISM(R) chipset product development. # # -------------------------------------------------------------------- -include ../../config.mk CPPFLAGS= -I../include -I$(LINUX_SRC)/include \ -D__LINUX_WLAN__ nwepgen: nwepgen.o $(CC) $(LDFLAGS) -o nwepgen nwepgen.o install: mkdir -p $(TARGET_INST_EXEDIR) cp nwepgen $(TARGET_INST_EXEDIR) clean: rm -f core core.* *.o .*.o *.s *.a .depend tmp_make *~ nwepgen linux-wlan-ng-0.2.9+dfsg/src/include/0000755000175000017500000000000011026545443016751 5ustar tormodtormodlinux-wlan-ng-0.2.9+dfsg/src/include/wlan/0000755000175000017500000000000011026545443017712 5ustar tormodtormodlinux-wlan-ng-0.2.9+dfsg/src/include/wlan/p80211conv.h0000644000175000017500000001243011024763157021606 0ustar tormodtormod/* src/include/wlan/p80211conv.h * * Ether/802.11 conversions and packet buffer routines * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- * * This file declares the functions, types and macros that perform * Ethernet to/from 802.11 frame conversions. * * -------------------------------------------------------------------- */ #ifndef _LINUX_P80211CONV_H #define _LINUX_P80211CONV_H /*================================================================*/ /* Constants */ #define WLAN_ETHADDR_LEN 6 #define WLAN_IEEE_OUI_LEN 3 #define WLAN_ETHCONV_ENCAP 1 #define WLAN_ETHCONV_RFC1042 2 #define WLAN_ETHCONV_8021h 3 #define WLAN_MIN_ETHFRM_LEN 60 #define WLAN_MAX_ETHFRM_LEN 1514 #define WLAN_ETHHDR_LEN 14 #define P80211CAPTURE_VERSION 0x80211001 /*================================================================*/ /* Macros */ #define P80211_FRMMETA_MAGIC 0x802110 #define P80211SKB_FRMMETA(s) \ (((((p80211_frmmeta_t*)((s)->cb))->magic)==P80211_FRMMETA_MAGIC) ? \ ((p80211_frmmeta_t*)((s)->cb)) : \ (NULL)) #define P80211SKB_RXMETA(s) \ (P80211SKB_FRMMETA((s)) ? P80211SKB_FRMMETA((s))->rx : ((p80211_rxmeta_t*)(NULL))) typedef struct p80211_rxmeta { struct wlandevice *wlandev; UINT64 mactime; /* Hi-rez MAC-supplied time value */ UINT64 hosttime; /* Best-rez host supplied time value */ UINT rxrate; /* Receive data rate in 100kbps */ UINT priority; /* 0-15, 0=contention, 6=CF */ INT signal; /* An SSI, see p80211netdev.h */ INT noise; /* An SSI, see p80211netdev.h */ UINT channel; /* Receive channel (mostly for snifs) */ UINT preamble; /* P80211ENUM_preambletype_* */ UINT encoding; /* P80211ENUM_encoding_* */ } p80211_rxmeta_t; typedef struct p80211_frmmeta { UINT magic; p80211_rxmeta_t *rx; } p80211_frmmeta_t; void p80211skb_free(struct wlandevice *wlandev, struct sk_buff *skb); int p80211skb_rxmeta_attach(struct wlandevice *wlandev, struct sk_buff *skb); void p80211skb_rxmeta_detach(struct sk_buff *skb); /*================================================================*/ /* Types */ /* * Frame capture header. (See doc/capturefrm.txt) */ typedef struct p80211_caphdr { UINT32 version; UINT32 length; UINT64 mactime; UINT64 hosttime; UINT32 phytype; UINT32 channel; UINT32 datarate; UINT32 antenna; UINT32 priority; UINT32 ssi_type; INT32 ssi_signal; INT32 ssi_noise; UINT32 preamble; UINT32 encoding; } p80211_caphdr_t; /* buffer free method pointer type */ typedef void (* freebuf_method_t)(void *buf, int size); typedef struct p80211_metawep { void *data; UINT8 iv[4]; UINT8 icv[4]; } p80211_metawep_t; /* local ether header type */ typedef struct wlan_ethhdr { UINT8 daddr[WLAN_ETHADDR_LEN]; UINT8 saddr[WLAN_ETHADDR_LEN]; UINT16 type; } __WLAN_ATTRIB_PACK__ wlan_ethhdr_t; /* local llc header type */ typedef struct wlan_llc { UINT8 dsap; UINT8 ssap; UINT8 ctl; } __WLAN_ATTRIB_PACK__ wlan_llc_t; /* local snap header type */ typedef struct wlan_snap { UINT8 oui[WLAN_IEEE_OUI_LEN]; UINT16 type; } __WLAN_ATTRIB_PACK__ wlan_snap_t; /* Circular include trick */ struct wlandevice; /*================================================================*/ /* Externs */ /*================================================================*/ /*Function Declarations */ int skb_p80211_to_ether( struct wlandevice *wlandev, UINT32 ethconv, struct sk_buff *skb); int skb_ether_to_p80211( struct wlandevice *wlandev, UINT32 ethconv, struct sk_buff *skb, p80211_hdr_t *p80211_hdr, p80211_metawep_t *p80211_wep ); int p80211_stt_findproto(UINT16 proto); int p80211_stt_addproto(UINT16 proto); #endif linux-wlan-ng-0.2.9+dfsg/src/include/wlan/p80211types.h0000644000175000017500000006015211024763157022011 0ustar tormodtormod/* src/include/wlan/p80211types.h * * Macros, constants, types, and funcs for p80211 data types * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- * * This file declares some of the constants and types used in various * parts of the linux-wlan system. * * Notes: * - Constant values are always in HOST byte order. * * All functions and statics declared here are implemented in p80211types.c * -------------------------------------------------------------------- */ #ifndef _P80211TYPES_H #define _P80211TYPES_H /*================================================================*/ /* System Includes */ /*================================================================*/ /*================================================================*/ /* Project Includes */ /*================================================================*/ #ifndef _WLAN_COMPAT_H #include #endif /*================================================================*/ /* Constants */ /*================================================================*/ /*----------------------------------------------------------------*/ /* p80211 data type codes used for MIB items and message */ /* arguments. The various metadata structures provide additional */ /* information about these types. */ #define P80211_TYPE_OCTETSTR 1 /* pascal array of bytes */ #define P80211_TYPE_DISPLAYSTR 2 /* pascal array of bytes containing ascii */ #define P80211_TYPE_INT 4 /* UINT32 min and max limited by 32 bits */ #define P80211_TYPE_ENUMINT 5 /* UINT32 holding a numeric code that can be mapped to a textual name */ #define P80211_TYPE_UNKDATA 6 /* Data item containing an unknown data type */ #define P80211_TYPE_INTARRAY 7 /* Array of 32-bit integers. */ #define P80211_TYPE_BITARRAY 8 /* Array of bits. */ #define P80211_TYPE_MACARRAY 9 /* Array of MAC addresses. */ /*----------------------------------------------------------------*/ /* The following constants are indexes into the Mib Category List */ /* and the Message Category List */ /* Mib Category List */ #define P80211_MIB_CAT_DOT11SMT 1 #define P80211_MIB_CAT_DOT11MAC 2 #define P80211_MIB_CAT_DOT11PHY 3 #define P80211SEC_DOT11SMT P80211_MIB_CAT_DOT11SMT #define P80211SEC_DOT11MAC P80211_MIB_CAT_DOT11MAC #define P80211SEC_DOT11PHY P80211_MIB_CAT_DOT11PHY /* Message Category List */ #define P80211_MSG_CAT_DOT11REQ 1 #define P80211_MSG_CAT_DOT11IND 2 /* #define P80211_MSG_CAT_DOT11CFM 3 (doesn't exist at this time) */ #define P80211SEC_DOT11REQ P80211_MSG_CAT_DOT11REQ #define P80211SEC_DOT11IND P80211_MSG_CAT_DOT11IND /* #define P80211SEC_DOT11CFM P80211_MSG_CAT_DOT11CFM (doesn't exist at this time */ /*----------------------------------------------------------------*/ /* p80211 DID field codes that represent access type and */ /* is_table status. */ #define P80211DID_ACCESS_READ 0x10000000 #define P80211DID_ACCESS_WRITE 0x08000000 #define P80211DID_WRITEONLY 0x00000001 #define P80211DID_READONLY 0x00000002 #define P80211DID_READWRITE 0x00000003 #define P80211DID_ISTABLE_FALSE 0 #define P80211DID_ISTABLE_TRUE 1 /*----------------------------------------------------------------*/ /* p80211 enumeration constants. The value to text mappings for */ /* these is in p80211types.c. These defines were generated */ /* from the mappings. */ /* error codes for lookups */ #define P80211ENUM_BAD 0xffffffffUL #define P80211ENUM_BADSTR "P80211ENUM_BAD" #define P80211ENUM_truth_false 0 #define P80211ENUM_truth_true 1 #define P80211ENUM_ifstate_disable 0 #define P80211ENUM_ifstate_fwload 1 #define P80211ENUM_ifstate_enable 2 #define P80211ENUM_powermgmt_active 1 #define P80211ENUM_powermgmt_powersave 2 #define P80211ENUM_bsstype_infrastructure 1 #define P80211ENUM_bsstype_independent 2 #define P80211ENUM_bsstype_any 3 #define P80211ENUM_authalg_opensystem 1 #define P80211ENUM_authalg_sharedkey 2 #define P80211ENUM_phytype_fhss 1 #define P80211ENUM_phytype_dsss 2 #define P80211ENUM_phytype_irbaseband 3 #define P80211ENUM_temptype_commercial 1 #define P80211ENUM_temptype_industrial 2 #define P80211ENUM_regdomain_fcc 16 #define P80211ENUM_regdomain_doc 32 #define P80211ENUM_regdomain_etsi 48 #define P80211ENUM_regdomain_spain 49 #define P80211ENUM_regdomain_france 50 #define P80211ENUM_regdomain_mkk 64 #define P80211ENUM_ccamode_edonly 1 #define P80211ENUM_ccamode_csonly 2 #define P80211ENUM_ccamode_edandcs 4 #define P80211ENUM_ccamode_cswithtimer 8 #define P80211ENUM_ccamode_hrcsanded 16 #define P80211ENUM_diversity_fixedlist 1 #define P80211ENUM_diversity_notsupported 2 #define P80211ENUM_diversity_dynamic 3 #define P80211ENUM_scantype_active 1 #define P80211ENUM_scantype_passive 2 #define P80211ENUM_scantype_both 3 #define P80211ENUM_resultcode_success 1 #define P80211ENUM_resultcode_invalid_parameters 2 #define P80211ENUM_resultcode_not_supported 3 #define P80211ENUM_resultcode_timeout 4 #define P80211ENUM_resultcode_too_many_req 5 #define P80211ENUM_resultcode_refused 6 #define P80211ENUM_resultcode_bss_already 7 #define P80211ENUM_resultcode_invalid_access 8 #define P80211ENUM_resultcode_invalid_mibattribute 9 #define P80211ENUM_resultcode_cant_set_readonly_mib 10 #define P80211ENUM_resultcode_implementation_failure 11 #define P80211ENUM_resultcode_cant_get_writeonly_mib 12 #define P80211ENUM_reason_unspec_reason 1 #define P80211ENUM_reason_auth_not_valid 2 #define P80211ENUM_reason_deauth_lv_ss 3 #define P80211ENUM_reason_inactivity 4 #define P80211ENUM_reason_ap_overload 5 #define P80211ENUM_reason_class23_err 6 #define P80211ENUM_reason_class3_err 7 #define P80211ENUM_reason_disas_lv_ss 8 #define P80211ENUM_reason_asoc_not_auth 9 #define P80211ENUM_status_successful 0 #define P80211ENUM_status_unspec_failure 1 #define P80211ENUM_status_unsup_cap 10 #define P80211ENUM_status_reasoc_no_asoc 11 #define P80211ENUM_status_fail_other 12 #define P80211ENUM_status_unspt_alg 13 #define P80211ENUM_status_auth_seq_fail 14 #define P80211ENUM_status_chlng_fail 15 #define P80211ENUM_status_auth_timeout 16 #define P80211ENUM_status_ap_full 17 #define P80211ENUM_status_unsup_rate 18 #define P80211ENUM_status_unsup_shortpreamble 19 #define P80211ENUM_status_unsup_pbcc 20 #define P80211ENUM_status_unsup_agility 21 #define P80211ENUM_msgitem_status_data_ok 0 #define P80211ENUM_msgitem_status_no_value 1 #define P80211ENUM_msgitem_status_invalid_itemname 2 #define P80211ENUM_msgitem_status_invalid_itemdata 3 #define P80211ENUM_msgitem_status_missing_itemdata 4 #define P80211ENUM_msgitem_status_incomplete_itemdata 5 #define P80211ENUM_msgitem_status_invalid_msg_did 6 #define P80211ENUM_msgitem_status_invalid_mib_did 7 #define P80211ENUM_msgitem_status_missing_conv_func 8 #define P80211ENUM_msgitem_status_string_too_long 9 #define P80211ENUM_msgitem_status_data_out_of_range 10 #define P80211ENUM_msgitem_status_string_too_short 11 #define P80211ENUM_msgitem_status_missing_valid_func 12 #define P80211ENUM_msgitem_status_unknown 13 #define P80211ENUM_msgitem_status_invalid_did 14 #define P80211ENUM_msgitem_status_missing_print_func 15 #define P80211ENUM_lnxroam_reason_unknown 0 #define P80211ENUM_lnxroam_reason_beacon 1 #define P80211ENUM_lnxroam_reason_signal 2 #define P80211ENUM_lnxroam_reason_txretry 3 #define P80211ENUM_lnxroam_reason_notjoined 4 #define P80211ENUM_p2preamble_long 0 #define P80211ENUM_p2preamble_short 2 #define P80211ENUM_p2preamble_mixed 3 /*----------------------------------------------------------------*/ /* p80211 max length constants for the different pascal strings. */ #define MAXLEN_PSTR6 (6) /* pascal array of 6 bytes */ #define MAXLEN_PSTR14 (14) /* pascal array of 14 bytes */ #define MAXLEN_PSTR32 (32) /* pascal array of 32 bytes */ #define MAXLEN_PSTR255 (255) /* pascal array of 255 bytes */ #define MAXLEN_MIBATTRIBUTE (392) /* maximum mibattribute */ /* where the size of the DATA itself */ /* is a DID-LEN-DATA triple */ /* with a max size of 4+4+384 */ #define P80211_SET_INT(item, value) do { \ (item).data = (value); \ (item).status = P80211ENUM_msgitem_status_data_ok; \ } while(0) /*----------------------------------------------------------------*/ /* string constants */ #define NOT_SET "NOT_SET" #define NOT_SUPPORTED "NOT_SUPPORTED" #define UNKNOWN_DATA "UNKNOWN_DATA" /*--------------------------------------------------------------------*/ /* Metadata flags */ /* MSM: Do these belong in p80211meta.h? I'm not sure. */ #define ISREQUIRED (0x80000000UL) #define ISREQUEST (0x40000000UL) #define ISCONFIRM (0x20000000UL) /*================================================================*/ /* Macros */ /*--------------------------------------------------------------------*/ /* The following macros are used to manipulate the 'flags' field in */ /* the metadata. These are only used when the metadata is for */ /* command arguments to determine if the data item is required, and */ /* whether the metadata item is for a request command, confirm */ /* command or both. */ /*--------------------------------------------------------------------*/ /* MSM: Do these belong in p80211meta.h? I'm not sure */ #define P80211ITEM_SETFLAGS(q, r, c) ( q | r | c ) #define P80211ITEM_ISREQUIRED(flags) (((UINT32)(flags & ISREQUIRED)) >> 31 ) #define P80211ITEM_ISREQUEST(flags) (((UINT32)(flags & ISREQUEST)) >> 30 ) #define P80211ITEM_ISCONFIRM(flags) (((UINT32)(flags & ISCONFIRM)) >> 29 ) /*----------------------------------------------------------------*/ /* The following macro creates a name for an enum */ #define MKENUMNAME(name) p80211enum_ ## name /*---------------------------------------------------------------- * The following constants and macros are used to construct and * deconstruct the Data ID codes. The coding is as follows: * * ...rwtnnnnnnnniiiiiiggggggssssss s - Section * g - Group * i - Item * n - Index * t - Table flag * w - Write flag * r - Read flag * . - Unused */ #define P80211DID_INVALID 0xffffffffUL #define P80211DID_VALID 0x00000000UL #define P80211DID_LSB_SECTION (0) #define P80211DID_LSB_GROUP (6) #define P80211DID_LSB_ITEM (12) #define P80211DID_LSB_INDEX (18) #define P80211DID_LSB_ISTABLE (26) #define P80211DID_LSB_ACCESS (27) #define P80211DID_MASK_SECTION (0x0000003fUL) #define P80211DID_MASK_GROUP (0x0000003fUL) #define P80211DID_MASK_ITEM (0x0000003fUL) #define P80211DID_MASK_INDEX (0x000000ffUL) #define P80211DID_MASK_ISTABLE (0x00000001UL) #define P80211DID_MASK_ACCESS (0x00000003UL) #define P80211DID_MK(a,m,l) ((((UINT32)(a)) & (m)) << (l)) #define P80211DID_MKSECTION(a) P80211DID_MK(a, \ P80211DID_MASK_SECTION, \ P80211DID_LSB_SECTION ) #define P80211DID_MKGROUP(a) P80211DID_MK(a, \ P80211DID_MASK_GROUP, \ P80211DID_LSB_GROUP ) #define P80211DID_MKITEM(a) P80211DID_MK(a, \ P80211DID_MASK_ITEM, \ P80211DID_LSB_ITEM ) #define P80211DID_MKINDEX(a) P80211DID_MK(a, \ P80211DID_MASK_INDEX, \ P80211DID_LSB_INDEX ) #define P80211DID_MKISTABLE(a) P80211DID_MK(a, \ P80211DID_MASK_ISTABLE, \ P80211DID_LSB_ISTABLE ) #define P80211DID_MKID(s,g,i,n,t,a) (P80211DID_MKSECTION(s) | \ P80211DID_MKGROUP(g) | \ P80211DID_MKITEM(i) | \ P80211DID_MKINDEX(n) | \ P80211DID_MKISTABLE(t) | \ (a) ) #define P80211DID_GET(a,m,l) ((((UINT32)(a)) >> (l)) & (m)) #define P80211DID_SECTION(a) P80211DID_GET(a, \ P80211DID_MASK_SECTION, \ P80211DID_LSB_SECTION) #define P80211DID_GROUP(a) P80211DID_GET(a, \ P80211DID_MASK_GROUP, \ P80211DID_LSB_GROUP) #define P80211DID_ITEM(a) P80211DID_GET(a, \ P80211DID_MASK_ITEM, \ P80211DID_LSB_ITEM) #define P80211DID_INDEX(a) P80211DID_GET(a, \ P80211DID_MASK_INDEX, \ P80211DID_LSB_INDEX) #define P80211DID_ISTABLE(a) P80211DID_GET(a, \ P80211DID_MASK_ISTABLE, \ P80211DID_LSB_ISTABLE) #define P80211DID_ACCESS(a) P80211DID_GET(a, \ P80211DID_MASK_ACCESS, \ P80211DID_LSB_ACCESS) /*================================================================*/ /* Types */ /*----------------------------------------------------------------*/ /* The following structure types are used for the represenation */ /* of ENUMINT type metadata. */ typedef struct p80211enumpair { UINT32 val; char *name; } p80211enumpair_t; typedef struct p80211enum { INT nitems; p80211enumpair_t *list; } p80211enum_t; /*----------------------------------------------------------------*/ /* The following structure types are used to store data items in */ /* messages. */ /* Template pascal string */ typedef struct p80211pstr { UINT8 len; } __WLAN_ATTRIB_PACK__ p80211pstr_t; typedef struct p80211pstrd { UINT8 len; UINT8 data[0]; } __WLAN_ATTRIB_PACK__ p80211pstrd_t; /* Maximum pascal string */ typedef struct p80211pstr255 { UINT8 len; UINT8 data[MAXLEN_PSTR255]; } __WLAN_ATTRIB_PACK__ p80211pstr255_t; /* pascal string for macaddress and bssid */ typedef struct p80211pstr6 { UINT8 len; UINT8 data[MAXLEN_PSTR6]; } __WLAN_ATTRIB_PACK__ p80211pstr6_t; /* pascal string for channel list */ typedef struct p80211pstr14 { UINT8 len; UINT8 data[MAXLEN_PSTR14]; } __WLAN_ATTRIB_PACK__ p80211pstr14_t; /* pascal string for ssid */ typedef struct p80211pstr32 { UINT8 len; UINT8 data[MAXLEN_PSTR32]; } __WLAN_ATTRIB_PACK__ p80211pstr32_t; /* MAC address array */ typedef struct p80211macarray { UINT32 cnt; UINT8 data[1][MAXLEN_PSTR6]; } __WLAN_ATTRIB_PACK__ p80211macarray_t; /* prototype template */ typedef struct p80211item { UINT32 did; UINT16 status; UINT16 len; } __WLAN_ATTRIB_PACK__ p80211item_t; /* prototype template w/ data item */ typedef struct p80211itemd { UINT32 did; UINT16 status; UINT16 len; UINT8 data[0]; } __WLAN_ATTRIB_PACK__ p80211itemd_t; /* message data item for INT, BOUNDEDINT, ENUMINT */ typedef struct p80211item_uint32 { UINT32 did; UINT16 status; UINT16 len; UINT32 data; } __WLAN_ATTRIB_PACK__ p80211item_uint32_t; /* message data item for OCTETSTR, DISPLAYSTR */ typedef struct p80211item_pstr6 { UINT32 did; UINT16 status; UINT16 len; p80211pstr6_t data; } __WLAN_ATTRIB_PACK__ p80211item_pstr6_t; /* message data item for OCTETSTR, DISPLAYSTR */ typedef struct p80211item_pstr14 { UINT32 did; UINT16 status; UINT16 len; p80211pstr14_t data; } __WLAN_ATTRIB_PACK__ p80211item_pstr14_t; /* message data item for OCTETSTR, DISPLAYSTR */ typedef struct p80211item_pstr32 { UINT32 did; UINT16 status; UINT16 len; p80211pstr32_t data; } __WLAN_ATTRIB_PACK__ p80211item_pstr32_t; /* message data item for OCTETSTR, DISPLAYSTR */ typedef struct p80211item_pstr255 { UINT32 did; UINT16 status; UINT16 len; p80211pstr255_t data; } __WLAN_ATTRIB_PACK__ p80211item_pstr255_t; /* message data item for UNK 392, namely mib items */ typedef struct p80211item_unk392 { UINT32 did; UINT16 status; UINT16 len; UINT8 data[MAXLEN_MIBATTRIBUTE]; } __WLAN_ATTRIB_PACK__ p80211item_unk392_t; /* message data item for UNK 1025, namely p2 pdas */ typedef struct p80211item_unk1024 { UINT32 did; UINT16 status; UINT16 len; UINT8 data[1024]; } __WLAN_ATTRIB_PACK__ p80211item_unk1024_t; /* message data item for UNK 4096, namely p2 download chunks */ typedef struct p80211item_unk4096 { UINT32 did; UINT16 status; UINT16 len; UINT8 data[4096]; } __WLAN_ATTRIB_PACK__ p80211item_unk4096_t; struct catlistitem; /*----------------------------------------------------------------*/ /* The following structure type is used to represent all of the */ /* metadata items. Some components may choose to use more, */ /* less or different metadata items. */ typedef void (*p80211_totext_t)( struct catlistitem *, UINT32 did, UINT8* itembuf, char *textbuf); typedef void (*p80211_fromtext_t)( struct catlistitem *, UINT32 did, UINT8* itembuf, char *textbuf); typedef UINT32 (*p80211_valid_t)( struct catlistitem *, UINT32 did, UINT8* itembuf); /*================================================================*/ /* Extern Declarations */ /*----------------------------------------------------------------*/ /* Enumeration Lists */ /* The following are the external declarations */ /* for all enumerations */ extern p80211enum_t MKENUMNAME(truth); extern p80211enum_t MKENUMNAME(ifstate); extern p80211enum_t MKENUMNAME(powermgmt); extern p80211enum_t MKENUMNAME(bsstype); extern p80211enum_t MKENUMNAME(authalg); extern p80211enum_t MKENUMNAME(phytype); extern p80211enum_t MKENUMNAME(temptype); extern p80211enum_t MKENUMNAME(regdomain); extern p80211enum_t MKENUMNAME(ccamode); extern p80211enum_t MKENUMNAME(diversity); extern p80211enum_t MKENUMNAME(scantype); extern p80211enum_t MKENUMNAME(resultcode); extern p80211enum_t MKENUMNAME(reason); extern p80211enum_t MKENUMNAME(status); extern p80211enum_t MKENUMNAME(msgcode); extern p80211enum_t MKENUMNAME(msgitem_status); extern p80211enum_t MKENUMNAME(lnxroam_reason); extern p80211enum_t MKENUMNAME(p2preamble); /*================================================================*/ /* Function Declarations */ /*----------------------------------------------------------------*/ /* The following declare some utility functions for use with the */ /* p80211enum_t type. */ UINT32 p80211enum_text2int(p80211enum_t *ep, char *text); UINT32 p80211enum_int2text(p80211enum_t *ep, UINT32 val, char *text); void p80211_error2text(int err_code, char *err_str); /*----------------------------------------------------------------*/ /* The following declare some utility functions for use with the */ /* p80211item_t and p80211meta_t types. */ /*----------------------------------------------------------------*/ /* The following declare functions that perform validation and */ /* text to binary conversions based on the metadata for interface */ /* and MIB data items. */ /*----------------------------------------------------------------*/ /*-- DISPLAYSTR ------------------------------------------------------*/ /* pstr ==> cstr */ void p80211_totext_displaystr( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ); /* cstr ==> pstr */ void p80211_fromtext_displaystr( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ); /* function that checks validity of a displaystr binary value */ UINT32 p80211_isvalid_displaystr( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf ); /*-- OCTETSTR --------------------------------------------------------*/ /* pstr ==> "xx:xx:...." */ void p80211_totext_octetstr( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ); /* "xx:xx:...." ==> pstr */ void p80211_fromtext_octetstr( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ); /* function that checks validity of an octetstr binary value */ UINT32 p80211_isvalid_octetstr( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf ); /*-- INT -------------------------------------------------------------*/ /* UINT32 ==> %d */ void p80211_totext_int( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ); /* %d ==> UINT32 */ void p80211_fromtext_int( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ); /* function that checks validity of an int's binary value (always successful) */ UINT32 p80211_isvalid_int( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf ); /*-- ENUMINT ---------------------------------------------------------*/ /* UINT32 ==> */ void p80211_totext_enumint( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ); /* ==> UINT32 */ void p80211_fromtext_enumint( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ); /* function that checks validity of an enum's binary value */ UINT32 p80211_isvalid_enumint( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf ); /*-- INTARRAY --------------------------------------------------------*/ /* UINT32[] => %d,%d,%d,... */ void p80211_totext_intarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ); /* %d,%d,%d,... ==> UINT32[] */ void p80211_fromtext_intarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ); /* function that checks validity of an integer array's value */ UINT32 p80211_isvalid_intarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf ); /*-- BITARRAY --------------------------------------------------------*/ /* UINT32 ==> %d,%d,%d,... */ void p80211_totext_bitarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ); /* %d,%d,%d,... ==> UINT32 */ void p80211_fromtext_bitarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ); /* function that checks validity of a bit array's value */ UINT32 p80211_isvalid_bitarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf ); /*-- MACARRAY --------------------------------------------------------*/ void p80211_totext_macarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ); void p80211_fromtext_macarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ); /* function that checks validity of a MAC address array's value */ UINT32 p80211_isvalid_macarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf ); /*-- MIBATTRIUBTE ------------------------------------------------------*/ /* ==> */ void p80211_totext_getmibattribute( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ); void p80211_totext_setmibattribute( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ); /* ==> */ void p80211_fromtext_getmibattribute( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ); void p80211_fromtext_setmibattribute( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ); /* function that checks validity of a mibitem's binary value */ UINT32 p80211_isvalid_getmibattribute( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf ); UINT32 p80211_isvalid_setmibattribute( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf ); #endif /* _P80211TYPES_H */ linux-wlan-ng-0.2.9+dfsg/src/include/wlan/p80211hdr.h0000644000175000017500000002521111024763157021417 0ustar tormodtormod/* src/include/wlan/p80211hdr.h * * Macros, types, and functions for handling 802.11 MAC headers * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- * * This file declares the constants and types used in the interface * between a wlan driver and the user mode utilities. * * Note: * - Constant values are always in HOST byte order. To assign * values to multi-byte fields they _must_ be converted to * ieee byte order. To retrieve multi-byte values from incoming * frames, they must be converted to host order. * * All functions declared here are implemented in p80211.c * -------------------------------------------------------------------- */ #ifndef _P80211HDR_H #define _P80211HDR_H /*================================================================*/ /* System Includes */ /*================================================================*/ /* Project Includes */ #ifndef _WLAN_COMPAT_H #include #endif /*================================================================*/ /* Constants */ /*--- Sizes -----------------------------------------------*/ #define WLAN_ADDR_LEN 6 #define WLAN_CRC_LEN 4 #define WLAN_BSSID_LEN 6 #define WLAN_BSS_TS_LEN 8 #define WLAN_HDR_A3_LEN 24 #define WLAN_HDR_A4_LEN 30 #define WLAN_SSID_MAXLEN 32 #define WLAN_DATA_MAXLEN 2312 #define WLAN_A3FR_MAXLEN (WLAN_HDR_A3_LEN + WLAN_DATA_MAXLEN + WLAN_CRC_LEN) #define WLAN_A4FR_MAXLEN (WLAN_HDR_A4_LEN + WLAN_DATA_MAXLEN + WLAN_CRC_LEN) #define WLAN_BEACON_FR_MAXLEN (WLAN_HDR_A3_LEN + 334) #define WLAN_ATIM_FR_MAXLEN (WLAN_HDR_A3_LEN + 0) #define WLAN_DISASSOC_FR_MAXLEN (WLAN_HDR_A3_LEN + 2) #define WLAN_ASSOCREQ_FR_MAXLEN (WLAN_HDR_A3_LEN + 48) #define WLAN_ASSOCRESP_FR_MAXLEN (WLAN_HDR_A3_LEN + 16) #define WLAN_REASSOCREQ_FR_MAXLEN (WLAN_HDR_A3_LEN + 54) #define WLAN_REASSOCRESP_FR_MAXLEN (WLAN_HDR_A3_LEN + 16) #define WLAN_PROBEREQ_FR_MAXLEN (WLAN_HDR_A3_LEN + 44) #define WLAN_PROBERESP_FR_MAXLEN (WLAN_HDR_A3_LEN + 78) #define WLAN_AUTHEN_FR_MAXLEN (WLAN_HDR_A3_LEN + 261) #define WLAN_DEAUTHEN_FR_MAXLEN (WLAN_HDR_A3_LEN + 2) #define WLAN_WEP_NKEYS 4 #define WLAN_WEP_MAXKEYLEN 13 #define WLAN_CHALLENGE_IE_LEN 130 #define WLAN_CHALLENGE_LEN 128 #define WLAN_WEP_IV_LEN 4 #define WLAN_WEP_ICV_LEN 4 /*--- Frame Control Field -------------------------------------*/ /* Frame Types */ #define WLAN_FTYPE_MGMT 0x00 #define WLAN_FTYPE_CTL 0x01 #define WLAN_FTYPE_DATA 0x02 /* Frame subtypes */ /* Management */ #define WLAN_FSTYPE_ASSOCREQ 0x00 #define WLAN_FSTYPE_ASSOCRESP 0x01 #define WLAN_FSTYPE_REASSOCREQ 0x02 #define WLAN_FSTYPE_REASSOCRESP 0x03 #define WLAN_FSTYPE_PROBEREQ 0x04 #define WLAN_FSTYPE_PROBERESP 0x05 #define WLAN_FSTYPE_BEACON 0x08 #define WLAN_FSTYPE_ATIM 0x09 #define WLAN_FSTYPE_DISASSOC 0x0a #define WLAN_FSTYPE_AUTHEN 0x0b #define WLAN_FSTYPE_DEAUTHEN 0x0c /* Control */ #define WLAN_FSTYPE_BLOCKACKREQ 0x8 #define WLAN_FSTYPE_BLOCKACK 0x9 #define WLAN_FSTYPE_PSPOLL 0x0a #define WLAN_FSTYPE_RTS 0x0b #define WLAN_FSTYPE_CTS 0x0c #define WLAN_FSTYPE_ACK 0x0d #define WLAN_FSTYPE_CFEND 0x0e #define WLAN_FSTYPE_CFENDCFACK 0x0f /* Data */ #define WLAN_FSTYPE_DATAONLY 0x00 #define WLAN_FSTYPE_DATA_CFACK 0x01 #define WLAN_FSTYPE_DATA_CFPOLL 0x02 #define WLAN_FSTYPE_DATA_CFACK_CFPOLL 0x03 #define WLAN_FSTYPE_NULL 0x04 #define WLAN_FSTYPE_CFACK 0x05 #define WLAN_FSTYPE_CFPOLL 0x06 #define WLAN_FSTYPE_CFACK_CFPOLL 0x07 /*================================================================*/ /* Macros */ /*--- FC Macros ----------------------------------------------*/ /* Macros to get/set the bitfields of the Frame Control Field */ /* GET_FC_??? - takes the host byte-order value of an FC */ /* and retrieves the value of one of the */ /* bitfields and moves that value so its lsb is */ /* in bit 0. */ /* SET_FC_??? - takes a host order value for one of the FC */ /* bitfields and moves it to the proper bit */ /* location for ORing into a host order FC. */ /* To send the FC produced from SET_FC_???, */ /* one must put the bytes in IEEE order. */ /* e.g. */ /* printf("the frame subtype is %x", */ /* GET_FC_FTYPE( ieee2host( rx.fc ))) */ /* */ /* tx.fc = host2ieee( SET_FC_FTYPE(WLAN_FTYP_CTL) | */ /* SET_FC_FSTYPE(WLAN_FSTYPE_RTS) ); */ /*------------------------------------------------------------*/ #define WLAN_GET_FC_PVER(n) (((UINT16)(n)) & (BIT0 | BIT1)) #define WLAN_GET_FC_FTYPE(n) ((((UINT16)(n)) & (BIT2 | BIT3)) >> 2) #define WLAN_GET_FC_FSTYPE(n) ((((UINT16)(n)) & (BIT4|BIT5|BIT6|BIT7)) >> 4) #define WLAN_GET_FC_TODS(n) ((((UINT16)(n)) & (BIT8)) >> 8) #define WLAN_GET_FC_FROMDS(n) ((((UINT16)(n)) & (BIT9)) >> 9) #define WLAN_GET_FC_MOREFRAG(n) ((((UINT16)(n)) & (BIT10)) >> 10) #define WLAN_GET_FC_RETRY(n) ((((UINT16)(n)) & (BIT11)) >> 11) #define WLAN_GET_FC_PWRMGT(n) ((((UINT16)(n)) & (BIT12)) >> 12) #define WLAN_GET_FC_MOREDATA(n) ((((UINT16)(n)) & (BIT13)) >> 13) #define WLAN_GET_FC_ISWEP(n) ((((UINT16)(n)) & (BIT14)) >> 14) #define WLAN_GET_FC_ORDER(n) ((((UINT16)(n)) & (BIT15)) >> 15) #define WLAN_SET_FC_PVER(n) ((UINT16)(n)) #define WLAN_SET_FC_FTYPE(n) (((UINT16)(n)) << 2) #define WLAN_SET_FC_FSTYPE(n) (((UINT16)(n)) << 4) #define WLAN_SET_FC_TODS(n) (((UINT16)(n)) << 8) #define WLAN_SET_FC_FROMDS(n) (((UINT16)(n)) << 9) #define WLAN_SET_FC_MOREFRAG(n) (((UINT16)(n)) << 10) #define WLAN_SET_FC_RETRY(n) (((UINT16)(n)) << 11) #define WLAN_SET_FC_PWRMGT(n) (((UINT16)(n)) << 12) #define WLAN_SET_FC_MOREDATA(n) (((UINT16)(n)) << 13) #define WLAN_SET_FC_ISWEP(n) (((UINT16)(n)) << 14) #define WLAN_SET_FC_ORDER(n) (((UINT16)(n)) << 15) /*--- Duration Macros ----------------------------------------*/ /* Macros to get/set the bitfields of the Duration Field */ /* - the duration value is only valid when bit15 is zero */ /* - the firmware handles these values, so I'm not going */ /* these macros right now. */ /*------------------------------------------------------------*/ /*--- Sequence Control Macros -------------------------------*/ /* Macros to get/set the bitfields of the Sequence Control */ /* Field. */ /*------------------------------------------------------------*/ #define WLAN_GET_SEQ_FRGNUM(n) (((UINT16)(n)) & (BIT0|BIT1|BIT2|BIT3)) #define WLAN_GET_SEQ_SEQNUM(n) ((((UINT16)(n)) & (~(BIT0|BIT1|BIT2|BIT3))) >> 4) /*--- Data ptr macro -----------------------------------------*/ /* Creates a UINT8* to the data portion of a frame */ /* Assumes you're passing in a ptr to the beginning of the hdr*/ /*------------------------------------------------------------*/ #define WLAN_HDR_A3_DATAP(p) (((UINT8*)(p)) + WLAN_HDR_A3_LEN) #define WLAN_HDR_A4_DATAP(p) (((UINT8*)(p)) + WLAN_HDR_A4_LEN) #define DOT11_RATE5_ISBASIC_GET(r) (((UINT8)(r)) & BIT7) /*================================================================*/ /* Types */ /* BSS Timestamp */ typedef UINT8 wlan_bss_ts_t[WLAN_BSS_TS_LEN]; /* Generic 802.11 Header types */ typedef struct p80211_hdr_a3 { UINT16 fc; UINT16 dur; UINT8 a1[WLAN_ADDR_LEN]; UINT8 a2[WLAN_ADDR_LEN]; UINT8 a3[WLAN_ADDR_LEN]; UINT16 seq; } __WLAN_ATTRIB_PACK__ p80211_hdr_a3_t; typedef struct p80211_hdr_a4 { UINT16 fc; UINT16 dur; UINT8 a1[WLAN_ADDR_LEN]; UINT8 a2[WLAN_ADDR_LEN]; UINT8 a3[WLAN_ADDR_LEN]; UINT16 seq; UINT8 a4[WLAN_ADDR_LEN]; } __WLAN_ATTRIB_PACK__ p80211_hdr_a4_t; typedef union p80211_hdr { p80211_hdr_a3_t a3; p80211_hdr_a4_t a4; } __WLAN_ATTRIB_PACK__ p80211_hdr_t; /*================================================================*/ /* Extern Declarations */ /*================================================================*/ /* Function Declarations */ /* Frame and header lenght macros */ #define WLAN_CTL_FRAMELEN(fstype) (\ (fstype) == WLAN_FSTYPE_BLOCKACKREQ ? 24 : \ (fstype) == WLAN_FSTYPE_BLOCKACK ? 152 : \ (fstype) == WLAN_FSTYPE_PSPOLL ? 20 : \ (fstype) == WLAN_FSTYPE_RTS ? 20 : \ (fstype) == WLAN_FSTYPE_CTS ? 14 : \ (fstype) == WLAN_FSTYPE_ACK ? 14 : \ (fstype) == WLAN_FSTYPE_CFEND ? 20 : \ (fstype) == WLAN_FSTYPE_CFENDCFACK ? 20 : 4) #define WLAN_FCS_LEN 4 /* ftcl in HOST order */ inline static UINT16 p80211_headerlen(UINT16 fctl) { UINT16 hdrlen = 0; switch ( WLAN_GET_FC_FTYPE(fctl) ) { case WLAN_FTYPE_MGMT: hdrlen = WLAN_HDR_A3_LEN; break; case WLAN_FTYPE_DATA: hdrlen = WLAN_HDR_A3_LEN; if ( WLAN_GET_FC_TODS(fctl) && WLAN_GET_FC_FROMDS(fctl) ) { hdrlen += WLAN_ADDR_LEN; } break; case WLAN_FTYPE_CTL: hdrlen = WLAN_CTL_FRAMELEN(WLAN_GET_FC_FSTYPE(fctl)) - WLAN_FCS_LEN; break; default: hdrlen = WLAN_HDR_A3_LEN; } return hdrlen; } #endif /* _P80211HDR_H */ linux-wlan-ng-0.2.9+dfsg/src/include/wlan/p80211netdev.h0000644000175000017500000002370411024763157022134 0ustar tormodtormod/* src/include/wlan/p80211netdev.h * * WLAN net device structure and functions * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- * * This file declares the structure type that represents each wlan * interface. * * -------------------------------------------------------------------- */ #ifndef _LINUX_P80211NETDEV_H #define _LINUX_P80211NETDEV_H #include #include /*================================================================*/ /* Constants */ #define WLAN_DEVICE_CLOSED 0 #define WLAN_DEVICE_OPEN 1 #define WLAN_MACMODE_NONE 0 #define WLAN_MACMODE_IBSS_STA 1 #define WLAN_MACMODE_ESS_STA 2 #define WLAN_MACMODE_ESS_AP 3 /* MSD States */ #define WLAN_MSD_START -1 #define WLAN_MSD_DRIVERLOADED 0 #define WLAN_MSD_HWPRESENT_PENDING 1 #define WLAN_MSD_HWFAIL 2 #define WLAN_MSD_HWPRESENT 3 #define WLAN_MSD_FWLOAD_PENDING 4 #define WLAN_MSD_FWLOAD 5 #define WLAN_MSD_RUNNING_PENDING 6 #define WLAN_MSD_RUNNING 7 #ifndef ETH_P_ECONET #define ETH_P_ECONET 0x0018 /* needed for 2.2.x kernels */ #endif #define ETH_P_80211_RAW (ETH_P_ECONET + 1) #ifndef ARPHRD_IEEE80211 #define ARPHRD_IEEE80211 801 /* kernel 2.4.6 */ #endif #ifndef ARPHRD_IEEE80211_PRISM /* kernel 2.4.18 */ #define ARPHRD_IEEE80211_PRISM 802 #endif /*--- NSD Capabilities Flags ------------------------------*/ #define P80211_NSDCAP_HARDWAREWEP 0x01 /* hardware wep engine */ #define P80211_NSDCAP_TIEDWEP 0x02 /* can't decouple en/de */ #define P80211_NSDCAP_NOHOSTWEP 0x04 /* must use hardware wep */ #define P80211_NSDCAP_PBCC 0x08 /* hardware supports PBCC */ #define P80211_NSDCAP_SHORT_PREAMBLE 0x10 /* hardware supports */ #define P80211_NSDCAP_AGILITY 0x20 /* hardware supports */ #define P80211_NSDCAP_AP_RETRANSMIT 0x40 /* nsd handles retransmits */ #define P80211_NSDCAP_HWFRAGMENT 0x80 /* nsd handles frag/defrag */ #define P80211_NSDCAP_AUTOJOIN 0x100 /* nsd does autojoin */ #define P80211_NSDCAP_NOSCAN 0x200 /* nsd can scan */ /*================================================================*/ /* Macros */ /*================================================================*/ /* Types */ /* Received frame statistics */ typedef struct p80211_frmrx_t { UINT32 mgmt; UINT32 assocreq; UINT32 assocresp; UINT32 reassocreq; UINT32 reassocresp; UINT32 probereq; UINT32 proberesp; UINT32 beacon; UINT32 atim; UINT32 disassoc; UINT32 authen; UINT32 deauthen; UINT32 mgmt_unknown; UINT32 ctl; UINT32 pspoll; UINT32 rts; UINT32 cts; UINT32 ack; UINT32 cfend; UINT32 cfendcfack; UINT32 ctl_unknown; UINT32 data; UINT32 dataonly; UINT32 data_cfack; UINT32 data_cfpoll; UINT32 data__cfack_cfpoll; UINT32 null; UINT32 cfack; UINT32 cfpoll; UINT32 cfack_cfpoll; UINT32 data_unknown; UINT32 decrypt; UINT32 decrypt_err; } p80211_frmrx_t; #ifdef WIRELESS_EXT /* called by /proc/net/wireless */ struct iw_statistics* p80211wext_get_wireless_stats(netdevice_t *dev); /* wireless extensions' ioctls */ int p80211wext_support_ioctl(netdevice_t *dev, struct ifreq *ifr, int cmd); #if WIRELESS_EXT > 12 extern struct iw_handler_def p80211wext_handler_def; #endif int p80211wext_event_associated(struct wlandevice *wlandev, int assoc); #endif /* wireless extensions */ /* WEP stuff */ #define NUM_WEPKEYS 4 #define MAX_KEYLEN 32 #define HOSTWEP_DEFAULTKEY_MASK (BIT1|BIT0) #define HOSTWEP_DECRYPT BIT4 #define HOSTWEP_ENCRYPT BIT5 #define HOSTWEP_PRIVACYINVOKED BIT6 #define HOSTWEP_EXCLUDEUNENCRYPTED BIT7 extern int wlan_watchdog; extern int wlan_wext_write; /* WLAN device type */ typedef struct wlandevice { struct wlandevice *next; /* link for list of devices */ void *priv; /* private data for MSD */ /* Subsystem State */ char name[WLAN_DEVNAMELEN_MAX]; /* Dev name, from register_wlandev()*/ char *nsdname; UINT32 state; /* Device I/F state (open/closed) */ UINT32 msdstate; /* state of underlying driver */ UINT32 hwremoved; /* Has the hw been yanked out? */ /* Hardware config */ UINT irq; UINT iobase; UINT membase; UINT32 nsdcaps; /* NSD Capabilities flags */ /* Config vars */ UINT ethconv; /* device methods (init by MSD, used by p80211 */ int (*open)(struct wlandevice *wlandev); int (*close)(struct wlandevice *wlandev); void (*reset)(struct wlandevice *wlandev ); int (*txframe)(struct wlandevice *wlandev, struct sk_buff *skb, p80211_hdr_t *p80211_hdr, p80211_metawep_t *p80211_wep); int (*mlmerequest)(struct wlandevice *wlandev, p80211msg_t *msg); int (*set_multicast_list)(struct wlandevice *wlandev, netdevice_t *dev); void (*tx_timeout)(struct wlandevice *wlandev); #ifdef CONFIG_PROC_FS int (*nsd_proc_read)(char *page, char **start, off_t offset, int count, int *eof, void *data); #endif /* 802.11 State */ UINT8 bssid[WLAN_BSSID_LEN]; p80211pstr32_t ssid; UINT32 macmode; int linkstatus; int shortpreamble; /* C bool */ /* WEP State */ UINT8 wep_keys[NUM_WEPKEYS][MAX_KEYLEN]; UINT8 wep_keylens[NUM_WEPKEYS]; int hostwep; /* Request/Confirm i/f state (used by p80211) */ unsigned long request_pending; /* flag, access atomically */ /* netlink socket */ /* queue for indications waiting for cmd completion */ /* Linux netdevice and support */ netdevice_t *netdev; /* ptr to linux netdevice */ struct net_device_stats linux_stats; #ifdef CONFIG_PROC_FS /* Procfs support */ struct proc_dir_entry *procdir; struct proc_dir_entry *procwlandev; #endif /* Rx bottom half */ struct tasklet_struct rx_bh; struct sk_buff_head nsd_rxq; /* 802.11 device statistics */ struct p80211_frmrx_t rx; /* compatibility to wireless extensions */ #ifdef WIRELESS_EXT struct iw_statistics wstats; /* jkriegl: iwspy fields */ UINT8 spy_number; char spy_address[IW_MAX_SPY][ETH_ALEN]; struct iw_quality spy_stat[IW_MAX_SPY]; #endif struct mutex ioctl_lock; } wlandevice_t; /* WEP stuff */ int wep_change_key(wlandevice_t *wlandev, int keynum, UINT8* key, int keylen); int wep_decrypt(wlandevice_t *wlandev, UINT8 *buf, UINT32 len, int key_override, UINT8 *iv, UINT8 *icv); int wep_encrypt(wlandevice_t *wlandev, UINT8 *buf, UINT8 *dst, UINT32 len, int keynum, UINT8 *iv, UINT8 *icv); /*================================================================*/ /* Externs */ /*================================================================*/ /* Function Declarations */ void p80211netdev_startup(void); void p80211netdev_shutdown(void); int wlan_setup(wlandevice_t *wlandev); int wlan_unsetup(wlandevice_t *wlandev); int register_wlandev(wlandevice_t *wlandev); int unregister_wlandev(wlandevice_t *wlandev); void p80211netdev_rx(wlandevice_t *wlandev, struct sk_buff *skb); void p80211netdev_hwremoved(wlandevice_t *wlandev); void p80211_suspend(wlandevice_t *wlandev); void p80211_resume(wlandevice_t *wlandev); void p80211_allow_ioctls(wlandevice_t *wlandev); /*================================================================*/ /* Function Definitions */ static inline void p80211netdev_stop_queue(wlandevice_t *wlandev) { if ( !wlandev ) return; if ( !wlandev->netdev ) return; #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,38) ) wlandev->netdev->tbusy = 1; wlandev->netdev->start = 0; #else netif_stop_queue(wlandev->netdev); #endif } static inline void p80211netdev_start_queue(wlandevice_t *wlandev) { if ( !wlandev ) return; if ( !wlandev->netdev ) return; #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,38) ) wlandev->netdev->tbusy = 0; wlandev->netdev->start = 1; #else netif_start_queue(wlandev->netdev); #endif } static inline void p80211netdev_wake_queue(wlandevice_t *wlandev) { if ( !wlandev ) return; if ( !wlandev->netdev ) return; #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,38) ) wlandev->netdev->tbusy = 0; mark_bh(NET_BH); #else netif_wake_queue(wlandev->netdev); #endif } #ifdef CONFIG_HOTPLUG #define WLAN_HOTPLUG_REGISTER "register" #define WLAN_HOTPLUG_REMOVE "remove" #define WLAN_HOTPLUG_STARTUP "startup" #define WLAN_HOTPLUG_SHUTDOWN "shutdown" #define WLAN_HOTPLUG_SUSPEND "suspend" #define WLAN_HOTPLUG_RESUME "resume" int p80211_run_sbin_hotplug(wlandevice_t *wlandev, char *action); #endif #endif linux-wlan-ng-0.2.9+dfsg/src/include/wlan/p80211metamib.h0000644000175000017500000000674111024763157022267 0ustar tormodtormod/* src/include/wlan/p80211metamib.h * * Macros, const, types, and funcs for p80211 mib metadata * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- * * This file declares some of the constants and types used in various * parts of the linux-wlan system. * * Notes: * - Constant values are always in HOST byte order. * * All functions and statics declared here are implemented in p80211types.c * -------------------------------------------------------------------- */ #ifndef _P80211METAMIB_H #define _P80211METAMIB_H /*================================================================*/ /* System Includes */ /*================================================================*/ /* Project Includes */ #ifndef _WLAN_COMPAT_H #include #endif /*================================================================*/ /* Constants */ /*----------------------------------------------------------------*/ /* */ /*================================================================*/ /* Macros */ /*----------------------------------------------------------------*/ /* */ /*================================================================*/ /* Types */ /*----------------------------------------------------------------*/ /* */ /*================================================================*/ /* Extern Declarations */ /*----------------------------------------------------------------*/ /* The following is the external declaration for the mib */ /* category metadata list */ extern catlistitem_t mib_catlist[]; extern UINT32 mib_catlist_size; /*================================================================*/ /* Function Declarations */ /*----------------------------------------------------------------*/ /* */ #endif /* _P80211METAMIB_H */ linux-wlan-ng-0.2.9+dfsg/src/include/wlan/p80211ioctl.h0000644000175000017500000001074311024763157021760 0ustar tormodtormod/* src/include/wlan/p80211ioctl.h * * Declares constants and types for the p80211 ioctls * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- * * While this file is called 'ioctl' is purpose goes a little beyond * that. This file defines the types and contants used to implement * the p80211 request/confirm/indicate interfaces on Linux. The * request/confirm interface is, in fact, normally implemented as an * ioctl. The indicate interface on the other hand, is implemented * using the Linux 'netlink' interface. * * The reason I say that request/confirm is 'normally' implemented * via ioctl is that we're reserving the right to be able to send * request commands via the netlink interface. This will be necessary * if we ever need to send request messages when there aren't any * wlan network devices present (i.e. sending a message that only p80211 * cares about. * -------------------------------------------------------------------- */ #ifndef _P80211IOCTL_H #define _P80211IOCTL_H /*================================================================*/ /* Constants */ /*----------------------------------------------------------------*/ /* p80211 ioctl "request" codes. See argument 2 of ioctl(2). */ #define P80211_IFTEST (SIOCDEVPRIVATE + 0) #define P80211_IFREQ (SIOCDEVPRIVATE + 1) /*----------------------------------------------------------------*/ /* Magic number, a quick test to see we're getting the desired struct */ #define P80211_IOCTL_MAGIC (0x4a2d464dUL) /*----------------------------------------------------------------*/ /* Netlink protocol numbers for the indication interface */ #define P80211_NL_SOCK_IND NETLINK_USERSOCK /*----------------------------------------------------------------*/ /* Netlink multicast bits for different types of messages */ #define P80211_NL_MCAST_GRP_MLME BIT0 /* Local station messages */ #define P80211_NL_MCAST_GRP_SNIFF BIT1 /* Sniffer messages */ #define P80211_NL_MCAST_GRP_DIST BIT2 /* Distribution system messages */ /*================================================================*/ /* Macros */ /*================================================================*/ /* Types */ /*----------------------------------------------------------------*/ /* A ptr to the following structure type is passed as the third */ /* argument to the ioctl system call when issuing a request to */ /* the p80211 module. */ typedef struct p80211ioctl_req { char name[WLAN_DEVNAMELEN_MAX]; caddr_t data; UINT32 magic; UINT16 len; UINT32 result; } __WLAN_ATTRIB_PACK__ p80211ioctl_req_t; /*================================================================*/ /* Extern Declarations */ /*================================================================*/ /* Function Declarations */ #endif /* _P80211IOCTL_H */ linux-wlan-ng-0.2.9+dfsg/src/include/wlan/p80211meta.h0000644000175000017500000001451711024763157021577 0ustar tormodtormod/* src/include/wlan/p80211meta.h * * Macros, constants, types, and funcs for p80211 metadata * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- * * This file declares some of the constants and types used in various * parts of the linux-wlan system. * * Notes: * - Constant values are always in HOST byte order. * * All functions and statics declared here are implemented in p80211types.c * -------------------------------------------------------------------- */ #ifndef _P80211META_H #define _P80211META_H /*================================================================*/ /* System Includes */ /*================================================================*/ /* Project Includes */ #ifndef _WLAN_COMPAT_H #include #endif /*================================================================*/ /* Constants */ /*----------------------------------------------------------------*/ /* */ /*================================================================*/ /* Macros */ /*----------------------------------------------------------------*/ /* The following macros are used to ensure consistent naming */ /* conventions for all the different metadata lists. */ #define MKREQMETANAME(name) p80211meta_ ## req ## _ ## name #define MKINDMETANAME(name) p80211meta_ ## ind ## _ ## name #define MKMIBMETANAME(name) p80211meta_ ## mib ## _ ## name #define MKGRPMETANAME(name) p80211meta_ ## grp ## _ ## name #define MKREQMETASIZE(name) p80211meta_ ## req ## _ ## name ## _ ## size #define MKINDMETASIZE(name) p80211meta_ ## ind ## _ ## name ## _ ## size #define MKMIBMETASIZE(name) p80211meta_ ## mib ## _ ## name ## _ ## size #define MKGRPMETASIZE(name) p80211meta_ ## grp ## _ ## name ## _ ## size #define GETMETASIZE(aptr) (**((UINT32**)(aptr))) /*----------------------------------------------------------------*/ /* The following ifdef depends on the following defines: */ /* P80211_NOINCLUDESTRINGS - if defined, all metadata name fields */ /* are empty strings */ #ifdef P80211_NOINCLUDESTRINGS #define MKITEMNAME(s) ("") #else #define MKITEMNAME(s) (s) #endif /*================================================================*/ /* Types */ /*----------------------------------------------------------------*/ /* The following structure types are used for the metadata */ /* representation of category list metadata, group list metadata, */ /* and data item metadata for both Mib and Messages. */ typedef struct p80211meta { char *name; /* data item name */ UINT32 did; /* partial did */ UINT32 flags; /* set of various flag bits */ UINT32 min; /* min value of a BOUNDEDINT */ UINT32 max; /* max value of a BOUNDEDINT */ UINT32 maxlen; /* maxlen of a OCTETSTR or DISPLAYSTR */ UINT32 minlen; /* minlen of a OCTETSTR or DISPLAYSTR */ p80211enum_t *enumptr; /* ptr to the enum type for ENUMINT */ p80211_totext_t totextptr; /* ptr to totext conversion function */ p80211_fromtext_t fromtextptr; /* ptr to totext conversion function */ p80211_valid_t validfunptr; /* ptr to totext conversion function */ } p80211meta_t; typedef struct grplistitem { char *name; p80211meta_t *itemlist; } grplistitem_t; typedef struct catlistitem { char *name; grplistitem_t *grplist; } catlistitem_t; /*================================================================*/ /* Extern Declarations */ /*----------------------------------------------------------------*/ /* */ /*================================================================*/ /* Function Declarations */ /*----------------------------------------------------------------*/ /* */ UINT32 p80211_text2did(catlistitem_t *catlist, char *catname, char *grpname, char *itemname); UINT32 p80211_text2catdid(catlistitem_t *list, char *name ); UINT32 p80211_text2grpdid(grplistitem_t *list, char *name ); UINT32 p80211_text2itemdid(p80211meta_t *list, char *name ); UINT32 p80211_isvalid_did( catlistitem_t *catlist, UINT32 did ); UINT32 p80211_isvalid_catdid( catlistitem_t *catlist, UINT32 did ); UINT32 p80211_isvalid_grpdid( catlistitem_t *catlist, UINT32 did ); UINT32 p80211_isvalid_itemdid( catlistitem_t *catlist, UINT32 did ); catlistitem_t *p80211_did2cat( catlistitem_t *catlist, UINT32 did ); grplistitem_t *p80211_did2grp( catlistitem_t *catlist, UINT32 did ); p80211meta_t *p80211_did2item( catlistitem_t *catlist, UINT32 did ); UINT32 p80211item_maxdatalen( struct catlistitem *metalist, UINT32 did ); UINT32 p80211_metaname2did(struct catlistitem *metalist, char *itemname); UINT32 p80211item_getoffset( struct catlistitem *metalist, UINT32 did ); int p80211item_gettype(p80211meta_t *meta); #endif /* _P80211META_H */ linux-wlan-ng-0.2.9+dfsg/src/include/wlan/p80211metamsg.h0000644000175000017500000000674511024763157022312 0ustar tormodtormod/* src/include/wlan/p80211metamsg.h * * Macros, const, types, and funcs for p80211 msg metadata * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- * * This file declares some of the constants and types used in various * parts of the linux-wlan system. * * Notes: * - Constant values are always in HOST byte order. * * All functions and statics declared here are implemented in p80211types.c * -------------------------------------------------------------------- */ #ifndef _P80211METAMSG_H #define _P80211METAMSG_H /*================================================================*/ /* System Includes */ /*================================================================*/ /* Project Includes */ #ifndef _WLAN_COMPAT_H #include #endif /*================================================================*/ /* Constants */ /*----------------------------------------------------------------*/ /* */ /*================================================================*/ /* Macros */ /*----------------------------------------------------------------*/ /* */ /*================================================================*/ /* Types */ /*----------------------------------------------------------------*/ /* */ /*================================================================*/ /* Extern Declarations */ /*----------------------------------------------------------------*/ /* The following is the external declaration for the message */ /* category metadata list */ extern catlistitem_t msg_catlist[]; extern UINT32 msg_catlist_size; /*================================================================*/ /* Function Declarations */ /*----------------------------------------------------------------*/ /* */ #endif /* _P80211METAMSG_H */ linux-wlan-ng-0.2.9+dfsg/src/include/wlan/wlan_compat.h0000644000175000017500000006147011024763157022401 0ustar tormodtormod/* src/include/wlan/wlan_compat.h * * Types and macros to aid in portability * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- */ #ifndef _WLAN_COMPAT_H #define _WLAN_COMPAT_H /*=============================================================*/ /*------ Establish Platform Identity --------------------------*/ /*=============================================================*/ /* Key macros: */ /* WLAN_CPU_FAMILY */ #define WLAN_Ix86 1 #define WLAN_PPC 2 #define WLAN_Ix96 3 #define WLAN_ARM 4 #define WLAN_ALPHA 5 #define WLAN_MIPS 6 #define WLAN_HPPA 7 #define WLAN_SPARC 8 #define WLAN_SH 9 #define WLAN_x86_64 10 /* WLAN_SYSARCH */ #define WLAN_PCAT 1 #define WLAN_MBX 2 #define WLAN_RPX 3 #define WLAN_LWARCH 4 #define WLAN_PMAC 5 #define WLAN_SKIFF 6 #define WLAN_BITSY 7 #define WLAN_ALPHAARCH 7 #define WLAN_MIPSARCH 9 #define WLAN_HPPAARCH 10 #define WLAN_SPARCARCH 11 #define WLAN_SHARCH 12 /* Note: the PLX HOSTIF above refers to some vendors implementations for */ /* PCI. It's a PLX chip that is a PCI to PCMCIA adapter, but it */ /* isn't a real PCMCIA host interface adapter providing all the */ /* card&socket services. */ #if (defined(CONFIG_PPC) || defined(CONFIG_8xx) || defined(__powerpc__)) #ifndef __ppc__ #define __ppc__ #endif #endif #if defined(__KERNEL__) #ifndef AUTOCONF_INCLUDED #include #endif #if defined(__x86_64__) #define WLAN_CPU_FAMILY WLAN_x86_64 #define WLAN_SYSARCH WLAN_PCAT #elif defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__) #define WLAN_CPU_FAMILY WLAN_Ix86 #define WLAN_SYSARCH WLAN_PCAT #elif defined(__ppc__) #define WLAN_CPU_FAMILY WLAN_PPC #if defined(CONFIG_MBX) #define WLAN_SYSARCH WLAN_MBX #elif defined(CONFIG_RPXLITE) #define WLAN_SYSARCH WLAN_RPX #elif defined(CONFIG_RPXCLASSIC) #define WLAN_SYSARCH WLAN_RPX #else #define WLAN_SYSARCH WLAN_PMAC #endif #elif defined(__arm__) #define WLAN_CPU_FAMILY WLAN_ARM #define WLAN_SYSARCH WLAN_SKIFF #elif defined(__alpha__) #define WLAN_CPU_FAMILY WLAN_ALPHA #define WLAN_SYSARCH WLAN_ALPHAARCH #elif defined(__mips__) #define WLAN_CPU_FAMILY WLAN_MIPS #define WLAN_SYSARCH WLAN_MIPSARCH #elif defined(__hppa__) #define WLAN_CPU_FAMILY WLAN_HPPA #define WLAN_SYSARCH WLAN_HPPAARCH #elif defined(__sparc__) #define WLAN_CPU_FAMILY WLAN_SPARC #define WLAN_SYSARCH WLAN_SPARC #elif defined(__sh__) #define WLAN_CPU_FAMILY WLAN_SH #define WLAN_SYSARCH WLAN_SHARCH #ifndef __LITTLE_ENDIAN__ #define __LITTLE_ENDIAN__ #endif #else #error "No CPU identified!" #endif #endif /* __KERNEL__ */ /* Some big endian machines implicitly do all I/O in little endian mode. In particular: Linux/PPC on PowerMacs (PCI) Arm/Intel Xscale (PCI) This may also affect PLX boards and other BE &| PPC platforms; as new ones are discovered, add them below. */ #if defined(WLAN_HOSTIF) #if ((WLAN_HOSTIF == WLAN_PCI) || (WLAN_HOSTIF == WLAN_PLX)) #if ((WLAN_SYSARCH == WLAN_SKIFF) || (WLAN_SYSARCH == WLAN_PMAC) || (WLAN_SYSARCH == WLAN_SPARC)) #define REVERSE_ENDIAN #endif #endif #endif /*=============================================================*/ /*------ Bit settings -----------------------------------------*/ /*=============================================================*/ #define BIT0 0x00000001 #define BIT1 0x00000002 #define BIT2 0x00000004 #define BIT3 0x00000008 #define BIT4 0x00000010 #define BIT5 0x00000020 #define BIT6 0x00000040 #define BIT7 0x00000080 #define BIT8 0x00000100 #define BIT9 0x00000200 #define BIT10 0x00000400 #define BIT11 0x00000800 #define BIT12 0x00001000 #define BIT13 0x00002000 #define BIT14 0x00004000 #define BIT15 0x00008000 #define BIT16 0x00010000 #define BIT17 0x00020000 #define BIT18 0x00040000 #define BIT19 0x00080000 #define BIT20 0x00100000 #define BIT21 0x00200000 #define BIT22 0x00400000 #define BIT23 0x00800000 #define BIT24 0x01000000 #define BIT25 0x02000000 #define BIT26 0x04000000 #define BIT27 0x08000000 #define BIT28 0x10000000 #define BIT29 0x20000000 #define BIT30 0x40000000 #define BIT31 0x80000000 #include typedef u_int8_t UINT8; typedef u_int16_t UINT16; typedef u_int32_t UINT32; typedef int8_t INT8; typedef int16_t INT16; typedef int32_t INT32; typedef unsigned int UINT; typedef signed int INT; typedef u_int64_t UINT64; typedef int64_t INT64; #define UINT8_MAX (0xffUL) #define UINT16_MAX (0xffffUL) #define UINT32_MAX (0xffffffffUL) #define INT8_MAX (0x7fL) #define INT16_MAX (0x7fffL) #define INT32_MAX (0x7fffffffL) /*=============================================================*/ /*------ Compiler Portability Macros --------------------------*/ /*=============================================================*/ #define __WLAN_ATTRIB_PACK__ __attribute__ ((packed)) /*=============================================================*/ /*------ OS Portability Macros --------------------------------*/ /*=============================================================*/ #ifndef WLAN_DBVAR #define WLAN_DBVAR wlan_debug #endif #ifndef KERNEL_VERSION #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) #endif #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) # if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,8)) # include # else # include # endif #elif defined(__KERNEL__) # define PREEMPT_MASK (0x000000FFUL) # define preempt_count() (0UL) #endif #define WLAN_LOG_ERROR(x,args...) printk(KERN_ERR "%s: " x , __FUNCTION__ , ##args); #define WLAN_LOG_WARNING(x,args...) printk(KERN_WARNING "%s: " x , __FUNCTION__ , ##args); #define WLAN_LOG_NOTICE(x,args...) printk(KERN_NOTICE "%s: " x , __FUNCTION__ , ##args); #define WLAN_LOG_INFO(args... ) printk(KERN_INFO args) #if defined(WLAN_INCLUDE_DEBUG) #define WLAN_ASSERT(c) if ((!(c)) && WLAN_DBVAR >= 1) { \ WLAN_LOG_DEBUG(1, "Assertion failure!\n"); } #define WLAN_HEX_DUMP( l, x, p, n) if( WLAN_DBVAR >= (l) ){ \ int __i__; \ printk(KERN_DEBUG x ":"); \ for( __i__=0; __i__ < (n); __i__++) \ printk( " %02x", ((UINT8*)(p))[__i__]); \ printk("\n"); } #define DBFENTER { if ( WLAN_DBVAR >= 5 ){ WLAN_LOG_DEBUG(3,"---->\n"); } } #define DBFEXIT { if ( WLAN_DBVAR >= 5 ){ WLAN_LOG_DEBUG(3,"<----\n"); } } #define WLAN_LOG_DEBUG(l,x,args...) if ( WLAN_DBVAR >= (l)) printk(KERN_DEBUG "%s(%lu): " x , __FUNCTION__, (preempt_count() & PREEMPT_MASK), ##args ); #else #define WLAN_ASSERT(c) #define WLAN_HEX_DUMP( l, s, p, n) #define DBFENTER #define DBFEXIT #define WLAN_LOG_DEBUG(l, s, args...) #endif #ifdef CONFIG_SMP #define __SMP__ 1 #endif #if defined(__KERNEL__) #if ((LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))) #define URB_ONLY_CALLBACK #endif #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)) #define PT_REGS , struct pt_regs *regs #else #define PT_REGS #endif #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,7)) # define del_singleshot_timer_sync(a) del_timer_sync(a) #endif #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,17)) #define CONFIG_NETLINK 1 #endif #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)) #define kfree_s(a, b) kfree((a)) #endif #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)) #ifndef init_waitqueue_head #if (LINUX_VERSION_CODE < KERNEL_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; typedef struct wait_queue wait_queue_t; #define set_current_state(b) { current->state = (b); mb(); } #define init_waitqueue_entry(a, b) { (a)->task = current; } #endif #endif #ifndef wait_event_interruptible_timeout // retval == 0; signal met; we're good. // retval < 0; interrupted by signal. // retval > 0; timed out. #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)) // fixme? #define __wait_event_interruptible_timeout(wq, condition, ret) \ do { \ wait_queue_t __wait; \ init_waitqueue_entry(&__wait, current); \ \ add_wait_queue(&wq, &__wait); \ for (;;) { \ set_current_state(TASK_INTERRUPTIBLE); \ if (condition) \ break; \ if (!signal_pending(current)) { \ ret = schedule_timeout(ret) ; \ if (!ret) \ break; \ continue; \ } \ ret = -ERESTARTSYS; \ break; \ } \ set_current_state(TASK_RUNNING); \ remove_wait_queue(&wq, &__wait); \ } while (0) #else // 2.2 #define __wait_event_interruptible_timeout(wq, condition, ret) \ do { \ struct wait_queue __wait; \ \ __wait.task = current; \ add_wait_queue(&wq, &__wait); \ for (;;) { \ current->state = TASK_INTERRUPTIBLE; \ if (condition) \ break; \ if (!signal_pending(current)) { \ ret = schedule_timeout(ret); \ if (!ret) \ break; \ continue; \ } \ ret = -ERESTARTSYS; \ break; \ } \ current->state = TASK_RUNNING; \ remove_wait_queue(&wq, &__wait); \ } while (0) #endif // version >= 2.4 #define wait_event_interruptible_timeout(wq, condition, timeout) \ ({ \ long __ret = timeout; \ if (!(condition)) \ __wait_event_interruptible_timeout(wq, condition, __ret); \ __ret; \ }) #endif #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,20)) #ifdef _LINUX_LIST_H static inline void list_move_tail(struct list_head *list, struct list_head *head) { __list_del(list->prev, list->next); list_add_tail(list, head); } static inline void __list_splice(struct list_head *list, struct list_head *head) { struct list_head *first = list->next; struct list_head *last = list->prev; struct list_head *at = head->next; first->prev = head; head->next = first; last->next = at; at->prev = last; } static inline void list_move(struct list_head *list, struct list_head *head) { __list_del(list->prev, list->next); list_add(list, head); } static inline void list_splice_init(struct list_head *list, struct list_head *head) { if (!list_empty(list)) { __list_splice(list, head); INIT_LIST_HEAD(list); } } #endif // LIST_H #endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) #define SET_MODULE_OWNER(x) do { } while (0) #endif #if (LINUX_VERSION_CODE < KERNEL_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; #endif #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) // XXX ??? #define spin_lock_bh spin_lock #endif #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) #ifdef CONFIG_SMP #define spin_is_locked(x) (*(volatile char *)(&(x)->lock) <= 0) #else #define spin_is_locked(l) (0) #endif #endif #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,28)) #define __user #define __iomem #endif #ifdef _LINUX_PROC_FS_H #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) #define PROC_NET proc_net #else #define PROC_NET init_net.proc_net #endif #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,25)) extern inline struct proc_dir_entry * create_proc_read_entry(const char *name, mode_t mode, struct proc_dir_entry *base, read_proc_t *read_proc, void *data) { struct proc_dir_entry *res = create_proc_entry(name, mode, base); if (res) { res->read_proc = read_proc; res->data = data; } return res; } #endif #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,29)) #ifndef proc_mkdir #define proc_mkdir(name, root) create_proc_entry(name, S_IFDIR, root) #endif #endif #endif /* _LINUX_PROC_FS_H */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22) #define skb_reset_mac_header(__a) (__a)->mac.raw = (__a)->data #define SKB_MAC_HEADER(__a) (__a)->mac.raw #else #define SKB_MAC_HEADER(__a) (__a)->mac_header #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) #define IRQF_DISABLED SA_INTERRUPT #define IRQF_SHARED SA_SHIRQ #endif #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) #ifndef INIT_TQUEUE #define PREPARE_TQUEUE(_tq, _routine, _data) \ do { \ (_tq)->routine = _routine; \ (_tq)->data = _data; \ } while (0) #define INIT_TQUEUE(_tq, _routine, _data) \ do { \ INIT_LIST_HEAD(&(_tq)->list); \ (_tq)->sync = 0; \ PREPARE_TQUEUE((_tq), (_routine), (_data)); \ } while (0) #endif #ifndef container_of #define container_of(ptr, type, member) ({ \ const typeof( ((type *)0)->member ) *__mptr = (ptr); \ (type *)( (char *)__mptr - offsetof(type,member) );}) #endif #ifndef INIT_WORK #define work_struct tq_struct #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) #define schedule_work(a) queue_task(a, &tq_scheduler) #else #define schedule_work(a) schedule_task(a) #endif #define flush_scheduled_work flush_scheduled_tasks #define INIT_WORK2(_wq, _routine) INIT_TQUEUE(_wq, (void (*)(void *))_routine, _wq) #endif #else // >= 2.5 kernel #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) #define INIT_WORK2(_wq, _routine) INIT_WORK(_wq, (void (*)(void *))_routine, _wq) #else #define INIT_WORK2(_wq, _routine) INIT_WORK(_wq, _routine) #endif #endif // >= 2.5 kernel #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,38)) typedef struct device netdevice_t; #elif (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,4)) typedef struct net_device netdevice_t; #else #undef netdevice_t typedef struct net_device netdevice_t; #endif #ifdef WIRELESS_EXT #if (WIRELESS_EXT < 13) struct iw_request_info { __u16 cmd; /* Wireless Extension command */ __u16 flags; /* More to come ;-) */ }; #endif #endif #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,18)) #define MODULE_PARM(a,b) extern int __bogus_decl #define MODULE_AUTHOR(a) extern int __bogus_decl #define MODULE_DESCRIPTION(a) extern int __bogus_decl #define MODULE_SUPPORTED_DEVICE(a) extern int __bogus_decl #undef GET_USE_COUNT #define GET_USE_COUNT(m) mod_use_count_ #endif #ifndef MODULE_OWNER #define MODULE_OWNER(a) extern int __bogus_decl #define ANCIENT_MODULE_CODE #endif #ifndef MODULE_LICENSE #define MODULE_LICENSE(m) extern int __bogus_decl #endif /* TODO: Do we care about this? */ #ifndef MODULE_DEVICE_TABLE #define MODULE_DEVICE_TABLE(foo,bar) #endif #define wlan_minutes2ticks(a) ((a)*(wlan_ticks_per_sec * 60)) #define wlan_seconds2ticks(a) ((a)*(wlan_ticks_per_sec)) #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,47)) #define NEW_MODULE_CODE #ifdef ANCIENT_MODULE_CODE #undef ANCIENT_MODULE_CODE #endif #elif (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,25)) #define module_param(name, type, perm) \ static inline void *__check_existence_##name(void) { return &name; } \ MODULE_PARM(name, _MODULE_PARM_STRING_ ## type) #define _MODULE_PARM_STRING_byte "b" #define _MODULE_PARM_STRING_short "h" #define _MODULE_PARM_STRING_ushort "h" #define _MODULE_PARM_STRING_int "i" #define _MODULE_PARM_STRING_uint "i" #define _MODULE_PARM_STRING_long "l" #define _MODULE_PARM_STRING_ulong "l" #define _MODULE_PARM_STRING_bool "i" #endif /* linux < 2.5.69 */ #ifndef IRQ_NONE typedef void irqreturn_t; #define IRQ_NONE #define IRQ_HANDLED #define IRQ_RETVAL(x) #endif #ifndef in_atomic #define in_atomic() 0 #endif #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13)) #define URB_ASYNC_UNLINK 0 #endif #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,7)) #define URB_ASYNC_UNLINK USB_ASYNC_UNLINK #define usb_fill_bulk_urb FILL_BULK_URB #define usb_kill_urb usb_unlink_urb #else #define USB_QUEUE_BULK 0 #endif #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11)) typedef u32 pm_message_t; #endif #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,9)) #define hotplug_path "/etc/hotplug/wlan.agent" #endif #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)) #define free_netdev(x) kfree(x) #endif #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9)) #define eth_hdr(x) (x)->mac.ethernet #endif #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) #define del_timer_sync(a) del_timer(a) #endif #ifndef might_sleep #define might_sleep(a) do { } while (0) #endif /* Apparently 2.4.2 ethtool is quite different, maybe newer too? */ #if (defined(SIOETHTOOL) && !defined(ETHTOOL_GDRVINFO)) #undef SIOETHTOOL #endif // pcmcia-cs stuff #if ((LINUX_VERSION_CODE < KERNEL_VERSION(2,5,68)) && \ !defined(pcmcia_access_configuration_register)) #define pcmcia_access_configuration_register(handle, reg) \ CardServices(AccessConfigurationRegister, handle, reg) #define pcmcia_register_client(handle, reg) \ CardServices(RegisterClient, handle, reg) #define pcmcia_deregister_client(handle) \ CardServices(DeregisterClient, handle) #define pcmcia_get_first_tuple(handle, tuple) \ CardServices(GetFirstTuple, handle, tuple) #define pcmcia_get_next_tuple(handle, tuple) \ CardServices(GetNextTuple, handle, tuple) #define pcmcia_get_tuple_data(handle, tuple) \ CardServices(GetTupleData, handle, tuple) #define pcmcia_parse_tuple(handle, tuple, parse) \ CardServices(ParseTuple, handle, tuple, parse) #define pcmcia_get_configuration_info(handle, config) \ CardServices(GetConfigurationInfo, handle, config) #define pcmcia_request_io(handle, req) \ CardServices(RequestIO, handle, req) #define pcmcia_request_irq(handle, req) \ CardServices(RequestIRQ, handle, req) #define pcmcia_request_configuration(handle, req) \ CardServices(RequestConfiguration, handle, req) #define pcmcia_release_configuration(handle) \ CardServices(ReleaseConfiguration, handle) #define pcmcia_release_io(handle, req) \ CardServices(ReleaseIO, handle, req) #define pcmcia_release_irq(handle, req) \ CardServices(ReleaseIRQ, handle, req) #define pcmcia_release_window(win) \ CardServices(ReleaseWindow, win) #define pcmcia_get_card_services_info(info) \ CardServices(GetCardServicesInfo, info) #define pcmcia_report_error(handle, err) \ CardServices(ReportError, handle, err) #endif #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)) #define round_jiffies(a) (a) #endif #endif /* __KERNEL__ */ /*=============================================================*/ /*------ Hardware Portability Macros --------------------------*/ /*=============================================================*/ #define ieee2host16(n) __le16_to_cpu(n) #define ieee2host32(n) __le32_to_cpu(n) #define host2ieee16(n) __cpu_to_le16(n) #define host2ieee32(n) __cpu_to_le32(n) #if (WLAN_CPU_FAMILY != WLAN_MIPS) typedef UINT32 phys_t; #endif #if (WLAN_CPU_FAMILY == WLAN_PPC) #define wlan_inw(a) in_be16((unsigned short *)((a)+_IO_BASE)) #define wlan_inw_le16_to_cpu(a) inw((a)) #define wlan_outw(v,a) out_be16((unsigned short *)((a)+_IO_BASE), (v)) #define wlan_outw_cpu_to_le16(v,a) outw((v),(a)) #else #define wlan_inw(a) inw((a)) #define wlan_inw_le16_to_cpu(a) __cpu_to_le16(inw((a))) #define wlan_outw(v,a) outw((v),(a)) #define wlan_outw_cpu_to_le16(v,a) outw(__cpu_to_le16((v)),(a)) #endif /*=============================================================*/ /*--- General Macros ------------------------------------------*/ /*=============================================================*/ #define wlan_max(a, b) (((a) > (b)) ? (a) : (b)) #define wlan_min(a, b) (((a) < (b)) ? (a) : (b)) #define wlan_isprint(c) (((c) > (0x19)) && ((c) < (0x7f))) #define wlan_hexchar(x) (((x) < 0x0a) ? ('0' + (x)) : ('a' + ((x) - 0x0a))) /* Create a string of printable chars from something that might not be */ /* It's recommended that the str be 4*len + 1 bytes long */ #define wlan_mkprintstr(buf, buflen, str, strlen) \ { \ int i = 0; \ int j = 0; \ memset(str, 0, (strlen)); \ for (i = 0; i < (buflen); i++) { \ if ( wlan_isprint((buf)[i]) ) { \ (str)[j] = (buf)[i]; \ j++; \ } else { \ (str)[j] = '\\'; \ (str)[j+1] = 'x'; \ (str)[j+2] = wlan_hexchar(((buf)[i] & 0xf0) >> 4); \ (str)[j+3] = wlan_hexchar(((buf)[i] & 0x0f)); \ j += 4; \ } \ } \ } /*=============================================================*/ /*--- Variables -----------------------------------------------*/ /*=============================================================*/ #ifdef WLAN_INCLUDE_DEBUG extern int wlan_debug; #endif extern int wlan_ethconv; /* What's the default ethconv? */ /*=============================================================*/ /*--- Functions -----------------------------------------------*/ /*=============================================================*/ #endif /* _WLAN_COMPAT_H */ linux-wlan-ng-0.2.9+dfsg/src/include/wlan/p80211req.h0000644000175000017500000000462611024763157021440 0ustar tormodtormod/* src/include/wlan/p80211req.h * * Request handling functions * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- */ #ifndef _LINUX_P80211REQ_H #define _LINUX_P80211REQ_H /*================================================================*/ /* Constants */ /*================================================================*/ /* Macros */ /*================================================================*/ /* Types */ /*================================================================*/ /* Externs */ /*================================================================*/ /* Function Declarations */ int p80211req_dorequest(wlandevice_t *wlandev, UINT8 *msgbuf); #endif linux-wlan-ng-0.2.9+dfsg/src/include/wlan/p80211msg.h0000644000175000017500000000632311024763157021433 0ustar tormodtormod/* src/include/wlan/p80211msg.h * * Macros, constants, types, and funcs for req and ind messages * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- */ #ifndef _P80211MSG_H #define _P80211MSG_H /*================================================================*/ /* System Includes */ /*================================================================*/ /* Project Includes */ #ifndef _WLAN_COMPAT_H #include #endif /*================================================================*/ /* Constants */ #define MSG_BUFF_LEN 4000 #define WLAN_DEVNAMELEN_MAX 16 /*================================================================*/ /* Macros */ /*================================================================*/ /* Types */ /*--------------------------------------------------------------------*/ /*----- Message Structure Types --------------------------------------*/ /*--------------------------------------------------------------------*/ /* Prototype msg type */ typedef struct p80211msg { UINT32 msgcode; UINT32 msglen; UINT8 devname[WLAN_DEVNAMELEN_MAX]; } __WLAN_ATTRIB_PACK__ p80211msg_t; typedef struct p80211msgd { UINT32 msgcode; UINT32 msglen; UINT8 devname[WLAN_DEVNAMELEN_MAX]; UINT8 args[0]; } __WLAN_ATTRIB_PACK__ p80211msgd_t; /*================================================================*/ /* Extern Declarations */ /*================================================================*/ /* Function Declarations */ #endif /* _P80211MSG_H */ linux-wlan-ng-0.2.9+dfsg/src/include/wlan/p80211mgmt.h0000644000175000017500000004132611024763157021613 0ustar tormodtormod/* src/include/wlan/p80211mgmt.h * * Macros, types, and functions to handle 802.11 mgmt frames * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- * * This file declares the constants and types used in the interface * between a wlan driver and the user mode utilities. * * Notes: * - Constant values are always in HOST byte order. To assign * values to multi-byte fields they _must_ be converted to * ieee byte order. To retrieve multi-byte values from incoming * frames, they must be converted to host order. * * - The len member of the frame structure does NOT!!! include * the MAC CRC. Therefore, the len field on rx'd frames should * have 4 subtracted from it. * * All functions declared here are implemented in p80211.c * * The types, macros, and functions defined here are primarily * used for encoding and decoding management frames. They are * designed to follow these patterns of use: * * DECODE: * 1) a frame of length len is received into buffer b * 2) using the hdr structure and macros, we determine the type * 3) an appropriate mgmt frame structure, mf, is allocated and zeroed * 4) mf.hdr = b * mf.buf = b * mf.len = len * 5) call mgmt_decode( mf ) * 6) the frame field pointers in mf are now set. Note that any * multi-byte frame field values accessed using the frame field * pointers are in ieee byte order and will have to be converted * to host order. * * ENCODE: * 1) Library client allocates buffer space for maximum length * frame of the desired type * 2) Library client allocates a mgmt frame structure, called mf, * of the desired type * 3) Set the following: * mf.type = * mf.buf = * 4) call mgmt_encode( mf ) * 5) all of the fixed field pointers and fixed length information element * pointers in mf are now set to their respective locations in the * allocated space (fortunately, all variable length information elements * fall at the end of their respective frames). * 5a) The length field is set to include the last of the fixed and fixed * length fields. It may have to be updated for optional or variable * length information elements. * 6) Optional and variable length information elements are special cases * and must be handled individually by the client code. * -------------------------------------------------------------------- */ #ifndef _P80211MGMT_H #define _P80211MGMT_H /*================================================================*/ /* System Includes */ /*================================================================*/ /* Project Includes */ #ifndef _WLAN_COMPAT_H #include #endif #ifndef _P80211HDR_H #include #endif /*================================================================*/ /* Constants */ /*-- Information Element IDs --------------------*/ #define WLAN_EID_SSID 0 #define WLAN_EID_SUPP_RATES 1 #define WLAN_EID_FH_PARMS 2 #define WLAN_EID_DS_PARMS 3 #define WLAN_EID_CF_PARMS 4 #define WLAN_EID_TIM 5 #define WLAN_EID_IBSS_PARMS 6 /*-- values 7-15 reserved --*/ #define WLAN_EID_CHALLENGE 16 /*-- values 17-31 reserved for challenge text extension --*/ /*-- values 32-255 reserved --*/ /*-- Reason Codes -------------------------------*/ #define WLAN_MGMT_REASON_RSVD 0 #define WLAN_MGMT_REASON_UNSPEC 1 #define WLAN_MGMT_REASON_PRIOR_AUTH_INVALID 2 #define WLAN_MGMT_REASON_DEAUTH_LEAVING 3 #define WLAN_MGMT_REASON_DISASSOC_INACTIVE 4 #define WLAN_MGMT_REASON_DISASSOC_AP_BUSY 5 #define WLAN_MGMT_REASON_CLASS2_NONAUTH 6 #define WLAN_MGMT_REASON_CLASS3_NONASSOC 7 #define WLAN_MGMT_REASON_DISASSOC_STA_HASLEFT 8 #define WLAN_MGMT_REASON_CANT_ASSOC_NONAUTH 9 /*-- Status Codes -------------------------------*/ #define WLAN_MGMT_STATUS_SUCCESS 0 #define WLAN_MGMT_STATUS_UNSPEC_FAILURE 1 #define WLAN_MGMT_STATUS_CAPS_UNSUPPORTED 10 #define WLAN_MGMT_STATUS_REASSOC_NO_ASSOC 11 #define WLAN_MGMT_STATUS_ASSOC_DENIED_UNSPEC 12 #define WLAN_MGMT_STATUS_UNSUPPORTED_AUTHALG 13 #define WLAN_MGMT_STATUS_RX_AUTH_NOSEQ 14 #define WLAN_MGMT_STATUS_CHALLENGE_FAIL 15 #define WLAN_MGMT_STATUS_AUTH_TIMEOUT 16 #define WLAN_MGMT_STATUS_ASSOC_DENIED_BUSY 17 #define WLAN_MGMT_STATUS_ASSOC_DENIED_RATES 18 /* p80211b additions */ #define WLAN_MGMT_STATUS_ASSOC_DENIED_NOSHORT 19 #define WLAN_MGMT_STATUS_ASSOC_DENIED_NOPBCC 20 #define WLAN_MGMT_STATUS_ASSOC_DENIED_NOAGILITY 21 /*-- Auth Algorithm Field ---------------------------*/ #define WLAN_AUTH_ALG_OPENSYSTEM 0 #define WLAN_AUTH_ALG_SHAREDKEY 1 /*-- Management Frame Field Offsets -------------*/ /* Note: Not all fields are listed because of variable lengths, */ /* see the code in p80211.c to see how we search for fields */ /* Note: These offsets are from the start of the frame data */ #define WLAN_BEACON_OFF_TS 0 #define WLAN_BEACON_OFF_BCN_INT 8 #define WLAN_BEACON_OFF_CAPINFO 10 #define WLAN_BEACON_OFF_SSID 12 #define WLAN_DISASSOC_OFF_REASON 0 #define WLAN_ASSOCREQ_OFF_CAP_INFO 0 #define WLAN_ASSOCREQ_OFF_LISTEN_INT 2 #define WLAN_ASSOCREQ_OFF_SSID 4 #define WLAN_ASSOCRESP_OFF_CAP_INFO 0 #define WLAN_ASSOCRESP_OFF_STATUS 2 #define WLAN_ASSOCRESP_OFF_AID 4 #define WLAN_ASSOCRESP_OFF_SUPP_RATES 6 #define WLAN_REASSOCREQ_OFF_CAP_INFO 0 #define WLAN_REASSOCREQ_OFF_LISTEN_INT 2 #define WLAN_REASSOCREQ_OFF_CURR_AP 4 #define WLAN_REASSOCREQ_OFF_SSID 10 #define WLAN_REASSOCRESP_OFF_CAP_INFO 0 #define WLAN_REASSOCRESP_OFF_STATUS 2 #define WLAN_REASSOCRESP_OFF_AID 4 #define WLAN_REASSOCRESP_OFF_SUPP_RATES 6 #define WLAN_PROBEREQ_OFF_SSID 0 #define WLAN_PROBERESP_OFF_TS 0 #define WLAN_PROBERESP_OFF_BCN_INT 8 #define WLAN_PROBERESP_OFF_CAP_INFO 10 #define WLAN_PROBERESP_OFF_SSID 12 #define WLAN_AUTHEN_OFF_AUTH_ALG 0 #define WLAN_AUTHEN_OFF_AUTH_SEQ 2 #define WLAN_AUTHEN_OFF_STATUS 4 #define WLAN_AUTHEN_OFF_CHALLENGE 6 #define WLAN_DEAUTHEN_OFF_REASON 0 /*================================================================*/ /* Macros */ /*-- Capability Field ---------------------------*/ #define WLAN_GET_MGMT_CAP_INFO_ESS(n) ((n) & BIT0) #define WLAN_GET_MGMT_CAP_INFO_IBSS(n) (((n) & BIT1) >> 1) #define WLAN_GET_MGMT_CAP_INFO_CFPOLLABLE(n) (((n) & BIT2) >> 2) #define WLAN_GET_MGMT_CAP_INFO_CFPOLLREQ(n) (((n) & BIT3) >> 3) #define WLAN_GET_MGMT_CAP_INFO_PRIVACY(n) (((n) & BIT4) >> 4) /* p80211b additions */ #define WLAN_GET_MGMT_CAP_INFO_SHORT(n) (((n) & BIT5) >> 5) #define WLAN_GET_MGMT_CAP_INFO_PBCC(n) (((n) & BIT6) >> 6) #define WLAN_GET_MGMT_CAP_INFO_AGILITY(n) (((n) & BIT7) >> 7) #define WLAN_SET_MGMT_CAP_INFO_ESS(n) (n) #define WLAN_SET_MGMT_CAP_INFO_IBSS(n) ((n) << 1) #define WLAN_SET_MGMT_CAP_INFO_CFPOLLABLE(n) ((n) << 2) #define WLAN_SET_MGMT_CAP_INFO_CFPOLLREQ(n) ((n) << 3) #define WLAN_SET_MGMT_CAP_INFO_PRIVACY(n) ((n) << 4) /* p80211b additions */ #define WLAN_SET_MGMT_CAP_INFO_SHORT(n) ((n) << 5) #define WLAN_SET_MGMT_CAP_INFO_PBCC(n) ((n) << 6) #define WLAN_SET_MGMT_CAP_INFO_AGILITY(n) ((n) << 7) /*================================================================*/ /* Types */ /*-- Information Element Types --------------------*/ /* prototype structure, all IEs start with these members */ typedef struct wlan_ie { UINT8 eid; UINT8 len; } __WLAN_ATTRIB_PACK__ wlan_ie_t; /*-- Service Set Identity (SSID) -----------------*/ typedef struct wlan_ie_ssid { UINT8 eid; UINT8 len; UINT8 ssid[1]; /* may be zero, ptrs may overlap */ } __WLAN_ATTRIB_PACK__ wlan_ie_ssid_t; /*-- Supported Rates -----------------------------*/ typedef struct wlan_ie_supp_rates { UINT8 eid; UINT8 len; UINT8 rates[1]; /* had better be at LEAST one! */ } __WLAN_ATTRIB_PACK__ wlan_ie_supp_rates_t; /*-- FH Parameter Set ----------------------------*/ typedef struct wlan_ie_fh_parms { UINT8 eid; UINT8 len; UINT16 dwell; UINT8 hopset; UINT8 hoppattern; UINT8 hopindex; } __WLAN_ATTRIB_PACK__ wlan_ie_fh_parms_t; /*-- DS Parameter Set ----------------------------*/ typedef struct wlan_ie_ds_parms { UINT8 eid; UINT8 len; UINT8 curr_ch; } __WLAN_ATTRIB_PACK__ wlan_ie_ds_parms_t; /*-- CF Parameter Set ----------------------------*/ typedef struct wlan_ie_cf_parms { UINT8 eid; UINT8 len; UINT8 cfp_cnt; UINT8 cfp_period; UINT16 cfp_maxdur; UINT16 cfp_durremaining; } __WLAN_ATTRIB_PACK__ wlan_ie_cf_parms_t; /*-- TIM ------------------------------------------*/ typedef struct wlan_ie_tim { UINT8 eid; UINT8 len; UINT8 dtim_cnt; UINT8 dtim_period; UINT8 bitmap_ctl; UINT8 virt_bm[1]; } __WLAN_ATTRIB_PACK__ wlan_ie_tim_t; /*-- IBSS Parameter Set ---------------------------*/ typedef struct wlan_ie_ibss_parms { UINT8 eid; UINT8 len; UINT16 atim_win; } __WLAN_ATTRIB_PACK__ wlan_ie_ibss_parms_t; /*-- Challenge Text ------------------------------*/ typedef struct wlan_ie_challenge { UINT8 eid; UINT8 len; UINT8 challenge[1]; } __WLAN_ATTRIB_PACK__ wlan_ie_challenge_t; /*-------------------------------------------------*/ /* Frame Types */ /* prototype structure, all mgmt frame types will start with these members */ typedef struct wlan_fr_mgmt { UINT16 type; UINT16 len; /* DOES NOT include CRC !!!!*/ UINT8 *buf; p80211_hdr_t *hdr; /* used for target specific data, skb in Linux */ void *priv; /*-- fixed fields -----------*/ /*-- info elements ----------*/ } wlan_fr_mgmt_t; /*-- Beacon ---------------------------------------*/ typedef struct wlan_fr_beacon { UINT16 type; UINT16 len; UINT8 *buf; p80211_hdr_t *hdr; /* used for target specific data, skb in Linux */ void *priv; /*-- fixed fields -----------*/ UINT64 *ts; UINT16 *bcn_int; UINT16 *cap_info; /*-- info elements ----------*/ wlan_ie_ssid_t *ssid; wlan_ie_supp_rates_t *supp_rates; wlan_ie_fh_parms_t *fh_parms; wlan_ie_ds_parms_t *ds_parms; wlan_ie_cf_parms_t *cf_parms; wlan_ie_ibss_parms_t *ibss_parms; wlan_ie_tim_t *tim; } wlan_fr_beacon_t; /*-- IBSS ATIM ------------------------------------*/ typedef struct wlan_fr_ibssatim { UINT16 type; UINT16 len; UINT8* buf; p80211_hdr_t *hdr; /* used for target specific data, skb in Linux */ void *priv; /*-- fixed fields -----------*/ /*-- info elements ----------*/ /* this frame type has a null body */ } wlan_fr_ibssatim_t; /*-- Disassociation -------------------------------*/ typedef struct wlan_fr_disassoc { UINT16 type; UINT16 len; UINT8 *buf; p80211_hdr_t *hdr; /* used for target specific data, skb in Linux */ void *priv; /*-- fixed fields -----------*/ UINT16 *reason; /*-- info elements ----------*/ } wlan_fr_disassoc_t; /*-- Association Request --------------------------*/ typedef struct wlan_fr_assocreq { UINT16 type; UINT16 len; UINT8* buf; p80211_hdr_t *hdr; /* used for target specific data, skb in Linux */ void *priv; /*-- fixed fields -----------*/ UINT16 *cap_info; UINT16 *listen_int; /*-- info elements ----------*/ wlan_ie_ssid_t *ssid; wlan_ie_supp_rates_t *supp_rates; } wlan_fr_assocreq_t; /*-- Association Response -------------------------*/ typedef struct wlan_fr_assocresp { UINT16 type; UINT16 len; UINT8 *buf; p80211_hdr_t *hdr; /* used for target specific data, skb in Linux */ void *priv; /*-- fixed fields -----------*/ UINT16 *cap_info; UINT16 *status; UINT16 *aid; /*-- info elements ----------*/ wlan_ie_supp_rates_t *supp_rates; } wlan_fr_assocresp_t; /*-- Reassociation Request ------------------------*/ typedef struct wlan_fr_reassocreq { UINT16 type; UINT16 len; UINT8 *buf; p80211_hdr_t *hdr; /* used for target specific data, skb in Linux */ void *priv; /*-- fixed fields -----------*/ UINT16 *cap_info; UINT16 *listen_int; UINT8 *curr_ap; /*-- info elements ----------*/ wlan_ie_ssid_t *ssid; wlan_ie_supp_rates_t *supp_rates; } wlan_fr_reassocreq_t; /*-- Reassociation Response -----------------------*/ typedef struct wlan_fr_reassocresp { UINT16 type; UINT16 len; UINT8 *buf; p80211_hdr_t *hdr; /* used for target specific data, skb in Linux */ void *priv; /*-- fixed fields -----------*/ UINT16 *cap_info; UINT16 *status; UINT16 *aid; /*-- info elements ----------*/ wlan_ie_supp_rates_t *supp_rates; } wlan_fr_reassocresp_t; /*-- Probe Request --------------------------------*/ typedef struct wlan_fr_probereq { UINT16 type; UINT16 len; UINT8 *buf; p80211_hdr_t *hdr; /* used for target specific data, skb in Linux */ void *priv; /*-- fixed fields -----------*/ /*-- info elements ----------*/ wlan_ie_ssid_t *ssid; wlan_ie_supp_rates_t *supp_rates; } wlan_fr_probereq_t; /*-- Probe Response -------------------------------*/ typedef struct wlan_fr_proberesp { UINT16 type; UINT16 len; UINT8 *buf; p80211_hdr_t *hdr; /* used for target specific data, skb in Linux */ void *priv; /*-- fixed fields -----------*/ UINT64 *ts; UINT16 *bcn_int; UINT16 *cap_info; /*-- info elements ----------*/ wlan_ie_ssid_t *ssid; wlan_ie_supp_rates_t *supp_rates; wlan_ie_fh_parms_t *fh_parms; wlan_ie_ds_parms_t *ds_parms; wlan_ie_cf_parms_t *cf_parms; wlan_ie_ibss_parms_t *ibss_parms; } wlan_fr_proberesp_t; /*-- Authentication -------------------------------*/ typedef struct wlan_fr_authen { UINT16 type; UINT16 len; UINT8 *buf; p80211_hdr_t *hdr; /* used for target specific data, skb in Linux */ void *priv; /*-- fixed fields -----------*/ UINT16 *auth_alg; UINT16 *auth_seq; UINT16 *status; /*-- info elements ----------*/ wlan_ie_challenge_t *challenge; } wlan_fr_authen_t; /*-- Deauthenication -----------------------------*/ typedef struct wlan_fr_deauthen { UINT16 type; UINT16 len; UINT8 *buf; p80211_hdr_t *hdr; /* used for target specific data, skb in Linux */ void *priv; /*-- fixed fields -----------*/ UINT16 *reason; /*-- info elements ----------*/ } wlan_fr_deauthen_t; /*================================================================*/ /* Extern Declarations */ /*================================================================*/ /* Function Declarations */ void wlan_mgmt_encode_beacon( wlan_fr_beacon_t *f ); void wlan_mgmt_decode_beacon( wlan_fr_beacon_t *f ); void wlan_mgmt_encode_disassoc( wlan_fr_disassoc_t *f ); void wlan_mgmt_decode_disassoc( wlan_fr_disassoc_t *f ); void wlan_mgmt_encode_assocreq( wlan_fr_assocreq_t *f ); void wlan_mgmt_decode_assocreq( wlan_fr_assocreq_t *f ); void wlan_mgmt_encode_assocresp( wlan_fr_assocresp_t *f ); void wlan_mgmt_decode_assocresp( wlan_fr_assocresp_t *f ); void wlan_mgmt_encode_reassocreq( wlan_fr_reassocreq_t *f ); void wlan_mgmt_decode_reassocreq( wlan_fr_reassocreq_t *f ); void wlan_mgmt_encode_reassocresp( wlan_fr_reassocresp_t *f ); void wlan_mgmt_decode_reassocresp( wlan_fr_reassocresp_t *f ); void wlan_mgmt_encode_probereq( wlan_fr_probereq_t *f ); void wlan_mgmt_decode_probereq( wlan_fr_probereq_t *f ); void wlan_mgmt_encode_proberesp( wlan_fr_proberesp_t *f ); void wlan_mgmt_decode_proberesp( wlan_fr_proberesp_t *f ); void wlan_mgmt_encode_authen( wlan_fr_authen_t *f ); void wlan_mgmt_decode_authen( wlan_fr_authen_t *f ); void wlan_mgmt_encode_deauthen( wlan_fr_deauthen_t *f ); void wlan_mgmt_decode_deauthen( wlan_fr_deauthen_t *f ); #endif /* _P80211MGMT_H */ linux-wlan-ng-0.2.9+dfsg/src/prism2/0000755000175000017500000000000011026545532016541 5ustar tormodtormodlinux-wlan-ng-0.2.9+dfsg/src/prism2/download/0000755000175000017500000000000011026545443020351 5ustar tormodtormodlinux-wlan-ng-0.2.9+dfsg/src/prism2/download/prism2dl.c0000644000175000017500000021507411024763167022265 0ustar tormodtormod/* src/prism2/download/prism2dl.c * * user utility for downloading prism2 images * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- */ /*================================================================*/ /* System Includes */ #include #include #include #include #include #include #include #include #include #include #include #include /*================================================================*/ /* Project Includes */ #include #include #include #include #include #include #include #include #include #include #include /* Redefine macros for endianness to avoid using kernel headers */ #if __BYTE_ORDER == __LITTLE_ENDIAN #define hfa384x2host_16(n) (n) #define hfa384x2host_32(n) (n) #define host2hfa384x_16(n) (n) #define host2hfa384x_32(n) (n) #else #define hfa384x2host_16(n) bswap_16(n) #define hfa384x2host_32(n) bswap_32(n) #define host2hfa384x_16(n) bswap_16(n) #define host2hfa384x_32(n) bswap_32(n) #endif /*================================================================*/ /* Local Constants */ #define APPNAME "prism2dl" #define APPNAME_MAX 30 #define ADDPDRFILES_MAX 10 #define RAMFILES_MAX 10 #define FLASHFILES_MAX 10 #define S3DATA_MAX 5000 #define S3PLUG_MAX 200 #define S3CRC_MAX 200 #define S3INFO_MAX 50 #define SREC_LINE_MAX 264 #define S3LEN_TXTOFFSET 2 #define S3LEN_TXTLEN 2 #define S3ADDR_TXTOFFSET 4 #define S3ADDR_TXTLEN 8 #define S3DATA_TXTOFFSET 12 /*S3DATA_TXTLEN variable, depends on len field */ /*S3CKSUM_TXTOFFSET variable, depends on len field */ #define S3CKSUM_TXTLEN 2 #define SERNUM_LEN_MAX 12 #define S3PLUG_ITEMCODE_TXTOFFSET (S3DATA_TXTOFFSET) #define S3PLUG_ITEMCODE_TXTLEN 8 #define S3PLUG_ADDR_TXTOFFSET (S3DATA_TXTOFFSET+8) #define S3PLUG_ADDR_TXTLEN 8 #define S3PLUG_LEN_TXTOFFSET (S3DATA_TXTOFFSET+16) #define S3PLUG_LEN_TXTLEN 8 #define S3CRC_ADDR_TXTOFFSET (S3DATA_TXTOFFSET) #define S3CRC_ADDR_TXTLEN 8 #define S3CRC_LEN_TXTOFFSET (S3DATA_TXTOFFSET+8) #define S3CRC_LEN_TXTLEN 8 #define S3CRC_DOWRITE_TXTOFFSET (S3DATA_TXTOFFSET+16) #define S3CRC_DOWRITE_TXTLEN 8 #define S3INFO_LEN_TXTOFFSET (S3DATA_TXTOFFSET) #define S3INFO_LEN_TXTLEN 4 #define S3INFO_TYPE_TXTOFFSET (S3DATA_TXTOFFSET+4) #define S3INFO_TYPE_TXTLEN 4 #define S3INFO_DATA_TXTOFFSET (S3DATA_TXTOFFSET+8) /* S3INFO_DATA_TXTLEN variable, depends on INFO_LEN field */ #define S3ADDR_PLUG (0xff000000UL) #define S3ADDR_CRC (0xff100000UL) #define S3ADDR_INFO (0xff200000UL) #define PDAFILE_LINE_MAX 1024 #define CHUNKS_MAX 100 #define WRITESIZE_MAX 4096 /*================================================================*/ /* Local Macros */ /*================================================================*/ /* Local Types */ typedef struct s3datarec { UINT32 len; UINT32 addr; UINT8 checksum; UINT8 *data; } s3datarec_t; typedef struct s3plugrec { UINT32 itemcode; UINT32 addr; UINT32 len; } s3plugrec_t; typedef struct s3crcrec { UINT32 addr; UINT32 len; UINT dowrite; } s3crcrec_t; typedef struct s3inforec { UINT16 len; UINT16 type; union { hfa384x_compident_t version; hfa384x_caplevel_t compat; UINT16 buildseq; hfa384x_compident_t platform; } info; } s3inforec_t; typedef struct pda { UINT8 buf[HFA384x_PDA_LEN_MAX]; hfa384x_pdrec_t *rec[HFA384x_PDA_RECS_MAX]; UINT nrec; } pda_t; typedef struct imgchunk { UINT32 addr; /* start address */ UINT32 len; /* in bytes */ UINT16 crc; /* CRC value (if it falls at a chunk boundary) */ UINT8 *data; } imgchunk_t; /*================================================================*/ /* Local Static Definitions */ /*----------------------------------------------------------------*/ /* App support */ char appname[APPNAME_MAX + 1]; char *fullname; char devname[16]; /*----------------------------------------------------------------*/ /* option flags */ /* GENERAL options */ int opt_status = 0; /* -s => show status and exit */ int opt_verbose = 0; /* -v => boolean, verbose operation */ int opt_nowrite = 0; /* -n => boolean, process all data-but don't download */ int opt_debug = 0; /* -d => boolean, process all data-but don't download */ int opt_generate = 0; /* -g => boolean, if -s or -d output is in pdr and srec file format */ int opt_dumpchunks = 0; /* -D => boolean, dump the imgchunks after plugging and crc */ /* IMAGEFILE options */ int opt_ramloadcnt = 0; /* -r => boolean & count of ram filenames */ char rfname[RAMFILES_MAX][FILENAME_MAX+1]; /* -r filenames */ int opt_flashloadcnt = 0; /* -f => boolean & count of flash filenames */ char ffname[FLASHFILES_MAX][FILENAME_MAX+1]; /* -f filenames */ /* PDA options */ int opt_addpdrcnt = 0; /* -a => boolean & count of addfiles */ char addpdrfname[ADDPDRFILES_MAX][FILENAME_MAX+1]; /* -a filenames */ int opt_newpda = 0; /* -p => boolean for whole new PDA */ char newpdafname[FILENAME_MAX+1]; /* -p filename */ int opt_macaddr = 0; /* -m => boolean for cmdline MAC address */ UINT8 macaddr[WLAN_ADDR_LEN]; /* -m mac address */ int opt_sernum = 0; /* -S => boolean for cmdline serial # */ char sernum[SERNUM_LEN_MAX+1]; /* -S serial # string */ int opt_pdaloc = 0; /* -l => pda location */ /* -l address */ char opts[] = "svVndDgr:f:a:p:m:S:l:"; /*----------------------------------------------------------------*/ /* s-record image processing */ /* Data records */ UINT ns3data = 0; s3datarec_t s3data[S3DATA_MAX]; /* Plug records */ UINT ns3plug = 0; s3plugrec_t s3plug[S3PLUG_MAX]; /* CRC records */ UINT ns3crc = 0; s3crcrec_t s3crc[200]; /* Info records */ UINT ns3info = 0; s3inforec_t s3info[50]; /* S7 record (there _better_ be only one) */ UINT32 startaddr; /* Load image chunks */ UINT nfchunks; imgchunk_t fchunk[CHUNKS_MAX]; /* Note that for the following pdrec_t arrays, the len and code */ /* fields are stored in HOST byte order. The mkpdrlist() function */ /* does the conversion. */ /*----------------------------------------------------------------*/ /* PDA, built from [card|newfile]+[addfile1+addfile2...] */ pda_t pda; hfa384x_compident_t nicid; hfa384x_caplevel_t rfid; hfa384x_caplevel_t macid; hfa384x_caplevel_t priid; const UINT16 crc16tab[256] = { 0x0000, 0xc0c1, 0xc181, 0x0140, 0xc301, 0x03c0, 0x0280, 0xc241, 0xc601, 0x06c0, 0x0780, 0xc741, 0x0500, 0xc5c1, 0xc481, 0x0440, 0xcc01, 0x0cc0, 0x0d80, 0xcd41, 0x0f00, 0xcfc1, 0xce81, 0x0e40, 0x0a00, 0xcac1, 0xcb81, 0x0b40, 0xc901, 0x09c0, 0x0880, 0xc841, 0xd801, 0x18c0, 0x1980, 0xd941, 0x1b00, 0xdbc1, 0xda81, 0x1a40, 0x1e00, 0xdec1, 0xdf81, 0x1f40, 0xdd01, 0x1dc0, 0x1c80, 0xdc41, 0x1400, 0xd4c1, 0xd581, 0x1540, 0xd701, 0x17c0, 0x1680, 0xd641, 0xd201, 0x12c0, 0x1380, 0xd341, 0x1100, 0xd1c1, 0xd081, 0x1040, 0xf001, 0x30c0, 0x3180, 0xf141, 0x3300, 0xf3c1, 0xf281, 0x3240, 0x3600, 0xf6c1, 0xf781, 0x3740, 0xf501, 0x35c0, 0x3480, 0xf441, 0x3c00, 0xfcc1, 0xfd81, 0x3d40, 0xff01, 0x3fc0, 0x3e80, 0xfe41, 0xfa01, 0x3ac0, 0x3b80, 0xfb41, 0x3900, 0xf9c1, 0xf881, 0x3840, 0x2800, 0xe8c1, 0xe981, 0x2940, 0xeb01, 0x2bc0, 0x2a80, 0xea41, 0xee01, 0x2ec0, 0x2f80, 0xef41, 0x2d00, 0xedc1, 0xec81, 0x2c40, 0xe401, 0x24c0, 0x2580, 0xe541, 0x2700, 0xe7c1, 0xe681, 0x2640, 0x2200, 0xe2c1, 0xe381, 0x2340, 0xe101, 0x21c0, 0x2080, 0xe041, 0xa001, 0x60c0, 0x6180, 0xa141, 0x6300, 0xa3c1, 0xa281, 0x6240, 0x6600, 0xa6c1, 0xa781, 0x6740, 0xa501, 0x65c0, 0x6480, 0xa441, 0x6c00, 0xacc1, 0xad81, 0x6d40, 0xaf01, 0x6fc0, 0x6e80, 0xae41, 0xaa01, 0x6ac0, 0x6b80, 0xab41, 0x6900, 0xa9c1, 0xa881, 0x6840, 0x7800, 0xb8c1, 0xb981, 0x7940, 0xbb01, 0x7bc0, 0x7a80, 0xba41, 0xbe01, 0x7ec0, 0x7f80, 0xbf41, 0x7d00, 0xbdc1, 0xbc81, 0x7c40, 0xb401, 0x74c0, 0x7580, 0xb541, 0x7700, 0xb7c1, 0xb681, 0x7640, 0x7200, 0xb2c1, 0xb381, 0x7340, 0xb101, 0x71c0, 0x7080, 0xb041, 0x5000, 0x90c1, 0x9181, 0x5140, 0x9301, 0x53c0, 0x5280, 0x9241, 0x9601, 0x56c0, 0x5780, 0x9741, 0x5500, 0x95c1, 0x9481, 0x5440, 0x9c01, 0x5cc0, 0x5d80, 0x9d41, 0x5f00, 0x9fc1, 0x9e81, 0x5e40, 0x5a00, 0x9ac1, 0x9b81, 0x5b40, 0x9901, 0x59c0, 0x5880, 0x9841, 0x8801, 0x48c0, 0x4980, 0x8941, 0x4b00, 0x8bc1, 0x8a81, 0x4a40, 0x4e00, 0x8ec1, 0x8f81, 0x4f40, 0x8d01, 0x4dc0, 0x4c80, 0x8c41, 0x4400, 0x84c1, 0x8581, 0x4540, 0x8701, 0x47c0, 0x4680, 0x8641, 0x8201, 0x42c0, 0x4380, 0x8341, 0x4100, 0x81c1, 0x8081, 0x4040 }; /*================================================================*/ /* Local Function Declarations */ void usage(void); int read_srecfile(char *fname); int mkimage(imgchunk_t *clist, UINT *ccnt); int read_pdrfile( char *fname, int isnew); int read_cardpda(pda_t *pda, char *dev); int read_filepda(pda_t *pda, char *pdrfname); void merge_pda(pda_t *pda, UINT16 *pdwords, int nword); int mkpdrlist( pda_t *pda); int do_ioctl( p80211msg_t *msg ); void print_all_pdrs(pda_t *pda); int str2macaddr( UINT8 *a, char *s ); int s3datarec_compare(const void *p1, const void *p2); int mkpda_crc( pda_t *pda); int pda_write(pda_t *pda); int plugimage( imgchunk_t *fchunk, UINT nfchunks, s3plugrec_t* s3plug, UINT ns3plug, pda_t *pda, char *fname); int crcimage( imgchunk_t *fchunk, UINT nfchunks, s3crcrec_t *s3crc, UINT ns3crc); int writeimage(imgchunk_t *fchunk, UINT nfchunks, int isflash); void free_chunks(imgchunk_t *fchunk, UINT* nfchunks); void free_srecs(void); void dumpchunks( imgchunk_t *fchunk, UINT nfchunks); int validate_identity(void); /*================================================================*/ /* Function Definitions */ /*---------------------------------------------------------------- * main * * prism2dl entry point. * * Arguments: * argc number of command line arguments * argv array of argument strings * * Returns: * 0 - success * ~0 - failure ----------------------------------------------------------------*/ int main ( int argc, char **argv ) { INT result = 0; int optch; int i; int pda_changed = 0; /* has cardpda been altered? */ strcpy( appname, APPNAME ); fullname = argv[0]; /* Initialize the data structures */ memset(rfname, 0, sizeof(rfname)); memset(ffname, 0, sizeof(ffname)); memset(addpdrfname, 0, sizeof(addpdrfname)); memset(newpdafname, 0, sizeof(newpdafname)); memset(macaddr, 0, sizeof(macaddr)); memset(sernum, 0, sizeof(sernum)); memset(devname, 0, sizeof(devname)); ns3data = 0; memset(s3data, 0, sizeof(s3data)); ns3plug = 0; memset(s3plug, 0, sizeof(s3plug)); ns3crc = 0; memset(s3crc, 0, sizeof(s3crc)); ns3info = 0; memset(s3info, 0, sizeof(s3info)); startaddr = 0; nfchunks = 0; memset( fchunk, 0, sizeof(fchunk)); memset( &nicid, 0, sizeof(nicid)); memset( &rfid, 0, sizeof(rfid)); memset( &macid, 0, sizeof(macid)); memset( &priid, 0, sizeof(priid)); /* clear the pda and add an initial END record */ memset(&pda, 0, sizeof(pda)); pda.rec[0] = (hfa384x_pdrec_t*)pda.buf; pda.rec[0]->len = host2hfa384x_16(2); /* len in words */ /* len in words */ pda.rec[0]->code = host2hfa384x_16(HFA384x_PDR_END_OF_PDA); pda.nrec = 1; /* if no args, print the usage msg */ if ( argc < 2 ) { usage(); return -1; } /* collect the args */ while ( ((optch = getopt(argc, argv, opts)) != EOF) && (result == 0) ) { switch (optch) { case 'v': /* Verbose operation */ opt_verbose = 1; break; case 'V': /* Display version and exit */ printf("%s utility version %s\n", appname, WLAN_RELEASE); return 0; break; case 'n': /* Process files and card PDA, no download */ opt_nowrite = 1; break; case 'd': /* Process files, no card PDA, no download */ opt_debug = 1; opt_verbose = 1; break; case 'D': /* dump chunks */ opt_dumpchunks = 1; break; case 's': /* Show status */ opt_status = 1; break; case 'g': /* File generate */ opt_generate = 1; break; case 'r': /* Ram image filename, add to list */ if ( opt_ramloadcnt >= RAMFILES_MAX ) { fprintf(stderr,APPNAME": too many RAM files on cmd line. Exiting.\n"); exit(1); } strncpy(rfname[opt_ramloadcnt], optarg, FILENAME_MAX); opt_ramloadcnt++; break; case 'f': /* Flash image filename, add to list */ if ( opt_flashloadcnt >= FLASHFILES_MAX ) { fprintf(stderr,APPNAME": too many FLASH files on cmd line. Exiting.\n"); exit(1); } strncpy(ffname[opt_flashloadcnt], optarg, FILENAME_MAX); opt_flashloadcnt++; break; case 'a': /* Flash image filename, add to list */ if ( opt_addpdrcnt >= ADDPDRFILES_MAX ) { fprintf(stderr,APPNAME": too many ADDPDR files on cmd line. Exiting.\n"); exit(1); } strncpy(addpdrfname[opt_addpdrcnt], optarg, FILENAME_MAX); opt_addpdrcnt++; break; case 'p': /* New PDA filename */ if ( opt_newpda ) { fprintf(stderr,APPNAME": -p specified more than once. Exiting.\n"); exit(1); } opt_newpda = 1; strncpy(newpdafname, optarg, FILENAME_MAX); break; case 'l': opt_pdaloc = strtoul(optarg, NULL, 0); break; case 'm': /* cmdline MAC address */ if ( opt_macaddr ) { fprintf(stderr,APPNAME": -m specified more than once. Exiting.\n"); exit(1); } if ( str2macaddr(macaddr, optarg) != 0 ) { fprintf(stderr,APPNAME": mac address format error. Exiting.\n"); exit(1); } opt_macaddr = 1; break; case 'S': /* cmdline Serial number */ if ( opt_sernum ) { fprintf(stderr,APPNAME": -S specified more than once. Exiting.\n"); exit(1); } strncpy( sernum, optarg, SERNUM_LEN_MAX); opt_sernum = 1; break; default: fprintf(stderr,APPNAME": unrecognized option -%c.\n", optch); usage(); return -1; break; } } /* check for options that are mutually exclusive */ if ( opt_debug && opt_nowrite ) { fprintf(stderr,APPNAME": -n and -d are mutually exclusive. Exiting.\n"); exit(1); } /*-----------------------------------------------------*/ /* if we made it this far, the options must be pretty much OK */ /* save the interface name */ if ( optind >= argc && !opt_debug ) { /* we're missing the interface argument */ fprintf(stderr, APPNAME": missing argument - devname\n"); usage(); return -1; } else if (!opt_debug) { /* save the interface name */ strncpy( devname, argv[optind], sizeof(devname) ); } /*-----------------------------------------------------*/ /* Build the PDA we're going to use. */ pda_changed = 0; if ( !opt_newpda && !opt_debug ) { /* read pda from card */ if (read_cardpda(&pda, devname)) { fprintf(stderr,"load_cardpda failed, exiting.\n"); exit(1); } if ( opt_status && opt_addpdrcnt) { /* print note about pda */ printf( "Card PDA prior to file generated " "modifications:\n"); } } else if ( opt_newpda ){ /* read pda from file */ pda_changed = 1; read_filepda(&pda, newpdafname); if (opt_status && opt_addpdrcnt) { printf( "File PDA prior to file generated " "modifications:\n"); } } /* read the card's PRI-SUP */ if (!opt_debug) { p80211msg_dot11req_mibget_t getmsg; p80211itemd_t *item; UINT32 *data; memset(&getmsg, 0, sizeof(getmsg)); getmsg.msgcode = DIDmsg_dot11req_mibget; getmsg.msglen = sizeof(getmsg); strcpy(getmsg.devname, devname); getmsg.mibattribute.did = DIDmsg_dot11req_mibget_mibattribute; getmsg.mibattribute.status = P80211ENUM_msgitem_status_data_ok; getmsg.resultcode.did = DIDmsg_dot11req_mibget_resultcode; getmsg.resultcode.status = P80211ENUM_msgitem_status_no_value; item = (p80211itemd_t *) getmsg.mibattribute.data; item->did = DIDmib_p2_p2NIC_p2PRISupRange; item->status = P80211ENUM_msgitem_status_no_value; data = (UINT32*) item->data; do_ioctl((p80211msg_t*)&getmsg); if (getmsg.resultcode.data != P80211ENUM_resultcode_success) { printf("Couldn't fetch PRI-SUP info\n"); } /* Already in host order */ priid.role = *data++; priid.id = *data++; priid.variant = *data++; priid.bottom = *data++; priid.top = *data++; } /* If the MAC address is specified it should overwrite the * current value. */ if ( opt_macaddr ) { const unsigned nwords = WLAN_ADDR_LEN/sizeof(UINT16) + 2; UINT16 pdwords[nwords]; int i; /* index into byte array of macaddr */ int j; /* index into pdr words */ /* create mac address PDR word[0] : PDR length word[1] : MAC address PDR code (0x101) word[2-4] : MAC address (WLAN_ADDR_LEN bytes - usually 6) */ pdwords[0] = host2hfa384x_16(0x0004); pdwords[1] = host2hfa384x_16(0x0101); for (i = 0, j = 2; i < WLAN_ADDR_LEN; i += 2, j++) { pdwords[j] = host2hfa384x_16((UINT16) macaddr[i+1] << 8 | (UINT16) macaddr[i]); } /* merge the value into the PDA, so that it will eventually * be written. */ merge_pda(&pda, pdwords, nwords); pda_changed = 1; } /* If a serial number is specified add it to the PDA. */ if ( opt_sernum ) { const unsigned nwords = SERNUM_LEN_MAX/sizeof(UINT16) + 2; UINT16 pdwords[nwords]; int i; /* index into byte array of serial numbers bytes */ int j; /* index into pdr words */ /* create mac address PDR word[0] : PDR length word[1] : Serial number PDR code (0x0003) word[2-7] : Serial number (12 bytes) */ pdwords[0] = host2hfa384x_16(0x0007); pdwords[1] = host2hfa384x_16(0x0003); for (i = 0, j = 2; i < SERNUM_LEN_MAX; i += 2, j++) { pdwords[j] = host2hfa384x_16((UINT16) sernum[i+1] << 8 | (UINT16) sernum[i]); } /* merge the value into the PDA, so that it will eventually * be written. */ merge_pda(&pda, pdwords, nwords); pda_changed = 1; } if ( opt_status || opt_generate ) { /* print pda */ print_all_pdrs(&pda); } if ( opt_addpdrcnt ) { /* read the "add pdas" and merge them*/ pda_changed = 1; for ( i = 0; i < opt_addpdrcnt; i++) { read_filepda(&pda, addpdrfname[i]); } } if ( pda_changed ) { /* calculate the CRC for the new PDA */ mkpda_crc(&pda); } if ( (opt_status || opt_generate ) && pda_changed ) { printf("PDA after crc calc and/or \"-a\" file " "generated modifications:\n"); print_all_pdrs(&pda); /* Read and print the CIS? */ exit(0); } else if ( opt_status || opt_generate ) { /* We're done */ exit(0); } if ( opt_ramloadcnt && !opt_flashloadcnt ) { if (pda_changed) { printf("Warning: RAM load only, PDA changes will NOT be written to flash.\n"); } goto skip_pda_write; } if ( !opt_debug && !opt_nowrite && pda_changed) { /* write the PDA */ if ( opt_pdaloc == 0 ) { fprintf(stderr, APPNAME ": error, you must specifify a pda location\n"); usage(); exit(1); } pda_write(&pda); } skip_pda_write: /*-----------------------------------------------------*/ /* Read the flash files */ if ( opt_flashloadcnt ) { for ( i = 0; i < opt_flashloadcnt; i++) { /* For each file */ /* Read the S3 file */ result = read_srecfile(ffname[i]); if ( result ) { fprintf(stderr, APPNAME ": Failed to read %s, exiting.\n", ffname[i]); exit(1); } /* Sort the S3 data records */ qsort( s3data, ns3data, sizeof(s3datarec_t), s3datarec_compare); result = validate_identity(); if (startaddr != 0x00000000) { fprintf(stderr, APPNAME ": Can't flash a RAM download image!\n"); exit(1); } if ( result ) { fprintf(stderr, APPNAME ": Incompatible firmware image.\n"); exit(1); } /* Make the image chunks */ result = mkimage(fchunk, &nfchunks); /* Do any plugging */ result = plugimage(fchunk, nfchunks, s3plug, ns3plug, &pda, ffname[i]); if ( result ) { fprintf(stderr, APPNAME ": Failed to plug data for %s, exiting.\n", ffname[i]); exit(1); } /* Insert any CRCs */ if (crcimage(fchunk, nfchunks, s3crc, ns3crc) ) { fprintf(stderr, APPNAME ": Failed to insert all CRCs for " "%s, exiting.\n", ffname[i]); exit(1); } /* Write the image */ if ( opt_nowrite ) continue; result = writeimage(fchunk, nfchunks, 1); if ( result ) { fprintf(stderr, APPNAME ": Failed to flashwrite image data for " "%s, exiting.\n", ffname[i]); exit(1); } /* clear any allocated memory */ free_chunks(fchunk, &nfchunks); free_srecs(); } } /* Read the ram files */ if ( opt_ramloadcnt ) { for ( i = 0; i < opt_ramloadcnt; i++) { /* For each file */ /* Read the S3 file */ result = read_srecfile(rfname[i]); if ( result ) { fprintf(stderr, APPNAME ": Failed to read %s, exiting.\n", rfname[i]); exit(1); } /* Sort the S3 data records */ qsort( s3data, ns3data, sizeof(s3datarec_t), s3datarec_compare); result = validate_identity(); if ( result && !opt_newpda ) { fprintf(stderr, APPNAME ": Incompatible firmware image.\n"); exit(1); } if (startaddr == 0x00000000) { fprintf(stderr, APPNAME ": Can't RAM download a Flash image!\n"); exit(1); } /* Make the image chunks */ result = mkimage(fchunk, &nfchunks); /* Do any plugging */ result = plugimage(fchunk, nfchunks, s3plug, ns3plug, &pda, rfname[i]); if ( result ) { fprintf(stderr, APPNAME ": Failed to plug data for %s, exiting.\n", rfname[i]); exit(1); } /* Insert any CRCs */ if (crcimage(fchunk, nfchunks, s3crc, ns3crc) ) { fprintf(stderr, APPNAME ": Failed to insert all CRCs for " "%s, exiting.\n", rfname[i]); exit(1); } if ( opt_dumpchunks ) { /* Dump the contents of the image chunks */ dumpchunks(fchunk, nfchunks); } /* Write the image */ if ( opt_nowrite ) continue; result = writeimage(fchunk, nfchunks, 0); if ( result ) { fprintf(stderr, APPNAME ": Failed to ramwrite image data for " "%s, exiting.\n", rfname[i]); exit(1); } /* clear any allocated memory */ free_chunks(fchunk, &nfchunks); free_srecs(); } } printf(APPNAME": finished.\n"); return result; } /*---------------------------------------------------------------- * crcimage * * Adds a CRC16 in the two bytes prior to each block identified by * an S3 CRC record. Currently, we don't actually do a CRC we just * insert the value 0xC0DE in hfa384x order. * * Arguments: * fchunk Array of image chunks * nfchunks Number of image chunks * s3crc Array of crc records * ns3crc Number of crc records * * Returns: * 0 success * ~0 failure ----------------------------------------------------------------*/ int crcimage(imgchunk_t *fchunk, UINT nfchunks, s3crcrec_t *s3crc, UINT ns3crc) { int result = 0; int i; int c; UINT32 crcstart; UINT32 crcend; UINT32 cstart = 0; UINT32 cend; UINT8 *dest; UINT32 chunkoff; for ( i = 0; i < ns3crc; i++ ) { if ( !s3crc[i].dowrite ) continue; crcstart = s3crc[i].addr; crcend = s3crc[i].addr + s3crc[i].len; /* Find chunk */ for ( c = 0; c < nfchunks; c++) { cstart = fchunk[c].addr; cend = fchunk[c].addr + fchunk[c].len; /* the line below does an address & len match search */ /* unfortunately, I've found that the len fields of */ /* some crc records don't match with the length of */ /* the actual data, so we're not checking right */ /* now */ /* if ( crcstart-2 >= cstart && crcend <= cend ) break;*/ /* note the -2 below, it's to make sure the chunk has */ /* space for the CRC value */ if ( crcstart-2 >= cstart && crcstart < cend ) break; } if ( c >= nfchunks ) { fprintf(stderr, APPNAME ": Failed to find chunk for " "crcrec[%d], addr=0x%06lx len=%ld , " "aborting crc.\n", i, s3crc[i].addr, s3crc[i].len); return 1; } /* Insert crc */ if (opt_verbose) { printf("Adding crc @ 0x%06lx\n", s3crc[i].addr-2); } chunkoff = crcstart - cstart - 2; dest = fchunk[c].data + chunkoff; *dest = 0xde; *(dest+1) = 0xc0; } return result; } /*---------------------------------------------------------------- * do_ioctl * * Performs the ioctl call to send a message down to an 802.11 * device. * * Arguments: * msg the message to send * * Returns: * 0 success * ~0 failure ----------------------------------------------------------------*/ int do_ioctl( p80211msg_t *msg ) { int result = 0; int fd; p80211ioctl_req_t req; /* set the magic */ req.magic = P80211_IOCTL_MAGIC; /* get a socket */ fd = socket(AF_INET, SOCK_STREAM, 0); if ( fd == -1 ) { result = errno; perror(APPNAME); } else { req.len = msg->msglen; req.data = (caddr_t) msg; strcpy( req.name, msg->devname); req.result = 0; result = ioctl( fd, P80211_IFREQ, &req); if ( result == -1 ) { result = errno; perror(APPNAME); } close(fd); } return result; } /*---------------------------------------------------------------- * free_chunks * * Clears the chunklist data structures in preparation for a new file. * * Arguments: * none * * Returns: * nothing ----------------------------------------------------------------*/ void free_chunks(imgchunk_t *fchunk, UINT* nfchunks) { int i; for ( i = 0; i < *nfchunks; i++) { if ( fchunk[i].data != NULL ) { free(fchunk[i].data); } } *nfchunks = 0; memset( fchunk, 0, sizeof(fchunk)); } /*---------------------------------------------------------------- * free_srecs * * Clears the srec data structures in preparation for a new file. * * Arguments: * none * * Returns: * nothing ----------------------------------------------------------------*/ void free_srecs(void) { int i; for ( i = 0; i < ns3data; i++) { free(s3data[i].data); } ns3data = 0; memset(s3data, 0, sizeof(s3data)); ns3plug = 0; memset(s3plug, 0, sizeof(s3plug)); ns3crc = 0; memset(s3crc, 0, sizeof(s3crc)); ns3info = 0; memset(s3info, 0, sizeof(s3info)); startaddr = 0; } /*---------------------------------------------------------------- * mkimage * * Scans the currently loaded set of S records for data residing * in contiguous memory regions. Each contiguous region is then * made into a 'chunk'. This function assumes that we're building * a new chunk list. Assumes the s3data items are in sorted order. * * Arguments: none * * Returns: * 0 - success * ~0 - failure (probably an errno) ----------------------------------------------------------------*/ int mkimage(imgchunk_t *clist, UINT *ccnt) { int result = 0; int i; int j; int currchunk = 0; UINT32 nextaddr = 0; UINT32 s3start; UINT32 s3end; UINT32 cstart = 0; UINT32 cend; UINT32 coffset; /* There may already be data in the chunklist */ *ccnt = 0; /* Establish the location and size of each chunk */ for ( i = 0; i < ns3data; i++) { if ( s3data[i].addr == nextaddr ) { /* existing chunk, grow it */ clist[currchunk].len += s3data[i].len; nextaddr += s3data[i].len; } else { /* New chunk */ (*ccnt)++; currchunk = *ccnt - 1; clist[currchunk].addr = s3data[i].addr; clist[currchunk].len = s3data[i].len; nextaddr = s3data[i].addr + s3data[i].len; /* Expand the chunk if there is a CRC record at */ /* their beginning bound */ for ( j = 0; j < ns3crc; j++) { if ( s3crc[j].dowrite && s3crc[j].addr == clist[currchunk].addr ) { clist[currchunk].addr -= 2; clist[currchunk].len += 2; } } } } /* We're currently assuming there aren't any overlapping chunks */ /* if this proves false, we'll need to add code to coalesce. */ /* Allocate buffer space for chunks */ for ( i = 0; i < *ccnt; i++) { clist[i].data = malloc(clist[i].len); if ( clist[i].data == NULL ) { fprintf(stderr, APPNAME": failed to allocate image space, exitting.\n"); exit(1); } memset(clist[i].data, 0, clist[i].len); } /* Display chunks */ if ( opt_verbose ) { for ( i = 0; i < *ccnt; i++) { printf("chunk[%d]: addr=0x%06lx len=%ld\n", i, clist[i].addr, clist[i].len); } } /* Copy srec data to chunks */ for ( i = 0; i < ns3data; i++) { s3start = s3data[i].addr; s3end = s3start + s3data[i].len - 1; for ( j = 0; j < *ccnt; j++) { cstart = clist[j].addr; cend = cstart + clist[j].len - 1; if ( s3start >= cstart && s3end <= cend ) { break; } } if ( ((UINT)j) >= (*ccnt) ) { fprintf(stderr,APPNAME ":s3rec(a=0x%06lx,l=%ld), no chunk match, exiting.\n", s3start, s3data[i].len); exit(1); } coffset = s3start - cstart; memcpy( clist[j].data + coffset, s3data[i].data, s3data[i].len); } return result; } /*---------------------------------------------------------------- * mkpda_crc * * Calculates the CRC16 for the given PDA and inserts the value * into the end record. * * Arguments: * pda ptr to the PDA data structure. * * Returns: * 0 - success * ~0 - failure (probably an errno) ----------------------------------------------------------------*/ int mkpda_crc( pda_t *pda) { int result = 0; UINT8 *p; UINT8 *lim; UINT16 crc = 0; p = pda->buf; /* pda->nrec-1 _better_ be the end record */ /* get ptr to last rec */ lim = (UINT8*)(pda->rec[pda->nrec - 1]); lim += sizeof(UINT16) * 2; /* increase to include len&code fields */ while (p < lim) { crc = (crc >> 8 ) ^ crc16tab[(crc & 0xff) ^ *p++]; } /* assign to endrec field */ pda->rec[pda->nrec - 1]->data.end_of_pda.crc = host2hfa384x_16(crc); if (opt_debug) { printf("%s: pdacrc=0x%04x\n", __FUNCTION__, crc); } return result; } /*---------------------------------------------------------------- * mkpdrlist * * Reads a raw PDA and builds an array of pdrec_t structures. * * Arguments: * pda buffer containing raw PDA bytes * pdrec ptr to an array of pdrec_t's. Will be filled on exit. * nrec ptr to a variable that will contain the count of PDRs * * Returns: * 0 - success * ~0 - failure (probably an errno) ----------------------------------------------------------------*/ int mkpdrlist( pda_t *pda) { int result = 0; UINT16 *pda16 = (UINT16*)pda->buf; int curroff; /* in 'words' */ pda->nrec = 0; curroff = 0; while ( curroff < (HFA384x_PDA_LEN_MAX / 2) && hfa384x2host_16(pda16[curroff + 1]) != HFA384x_PDR_END_OF_PDA ) { pda->rec[pda->nrec] = (hfa384x_pdrec_t*)&(pda16[curroff]); if (hfa384x2host_16(pda->rec[pda->nrec]->code) == HFA384x_PDR_NICID) { memcpy(&nicid, &pda->rec[pda->nrec]->data.nicid, sizeof(nicid)); nicid.id = hfa384x2host_16(nicid.id); nicid.variant = hfa384x2host_16(nicid.variant); nicid.major = hfa384x2host_16(nicid.major); nicid.minor = hfa384x2host_16(nicid.minor); } if (hfa384x2host_16(pda->rec[pda->nrec]->code) == HFA384x_PDR_MFISUPRANGE) { memcpy(&rfid, &pda->rec[pda->nrec]->data.mfisuprange, sizeof(rfid)); rfid.id = hfa384x2host_16(rfid.id); rfid.variant = hfa384x2host_16(rfid.variant); rfid.bottom = hfa384x2host_16(rfid.bottom); rfid.top = hfa384x2host_16(rfid.top); } if (hfa384x2host_16(pda->rec[pda->nrec]->code) == HFA384x_PDR_CFISUPRANGE) { memcpy(&macid, &pda->rec[pda->nrec]->data.cfisuprange, sizeof(macid)); macid.id = hfa384x2host_16(macid.id); macid.variant = hfa384x2host_16(macid.variant); macid.bottom = hfa384x2host_16(macid.bottom); macid.top = hfa384x2host_16(macid.top); } (pda->nrec)++; curroff += hfa384x2host_16(pda16[curroff]) + 1; } if ( curroff >= (HFA384x_PDA_LEN_MAX / 2) ) { fprintf(stderr, APPNAME ": no end record found or invalid lengths in " "PDR data, exiting. %x %d\n", curroff, pda->nrec); exit(1); } if (hfa384x2host_16(pda16[curroff + 1]) == HFA384x_PDR_END_OF_PDA ) { pda->rec[pda->nrec] = (hfa384x_pdrec_t*)&(pda16[curroff]); (pda->nrec)++; } return result; } /*---------------------------------------------------------------- * pda_write * * Builds a message containing the PDA in the given pda structure * and sends it to the device driver. The driver will (hopefully) * write the pda to the card flash. * * Arguments: * pda structure containing the PDA we wish to write to * the card. * * Returns: * 0 success * ~0 failure ----------------------------------------------------------------*/ int pda_write(pda_t *pda) { int result = 0; p80211msg_p2req_flashdl_state_t statemsg; p80211msg_p2req_flashdl_write_t writemsg; /* Initialize the messages */ memset(&statemsg, 0, sizeof(statemsg)); strcpy(statemsg.devname, devname); statemsg.msgcode = DIDmsg_p2req_flashdl_state; statemsg.msglen = sizeof(statemsg); statemsg.enable.did = DIDmsg_p2req_flashdl_state_enable; statemsg.resultcode.did = DIDmsg_p2req_flashdl_state_resultcode; statemsg.enable.status = P80211ENUM_msgitem_status_data_ok; statemsg.resultcode.status = P80211ENUM_msgitem_status_no_value; statemsg.enable.len = sizeof(UINT32); statemsg.resultcode.len = sizeof(UINT32); memset(&writemsg, 0, sizeof(writemsg)); strcpy(writemsg.devname, devname); writemsg.msgcode = DIDmsg_p2req_flashdl_write; writemsg.msglen = sizeof(writemsg); writemsg.addr.did = DIDmsg_p2req_flashdl_write_addr; writemsg.len.did = DIDmsg_p2req_flashdl_write_len; writemsg.data.did = DIDmsg_p2req_flashdl_write_data; writemsg.resultcode.did = DIDmsg_p2req_flashdl_write_resultcode; writemsg.addr.status = P80211ENUM_msgitem_status_data_ok; writemsg.len.status = P80211ENUM_msgitem_status_data_ok; writemsg.data.status = P80211ENUM_msgitem_status_data_ok; writemsg.resultcode.status = P80211ENUM_msgitem_status_no_value; writemsg.addr.len = sizeof(UINT32); writemsg.len.len = sizeof(UINT32); writemsg.data.len = WRITESIZE_MAX; writemsg.resultcode.len = sizeof(UINT32); /* Send flashdl_state(enable) */ if (opt_verbose) printf("Sending dlflash_state(enable) message.\n"); statemsg.enable.data = P80211ENUM_truth_true; if ( !opt_debug ) { result = do_ioctl((p80211msg_t*)&statemsg); if ( result ) { fprintf(stderr,APPNAME ": pda_write()->do_ioctl() failed w/ result=%d, " "aborting pda download\n", result); return result; } if ( statemsg.resultcode.data != P80211ENUM_resultcode_success ) { fprintf(stderr,APPNAME ": pda_write()->flashdl_state msg indicates failure, " "w/ resultcode=%ld, aborting pda download.\n", statemsg.resultcode.data); return 1; } } /* Send flashdl_write(pda) */ writemsg.addr.data = opt_pdaloc; writemsg.len.data = (((UINT8*)(pda->rec[pda->nrec - 1])) - pda->buf + 6); memcpy(writemsg.data.data, pda->buf, writemsg.len.data); if (opt_verbose) { printf("Sending dlflash_write, addr=%06lx len=%ld \n", writemsg.addr.data, writemsg.len.data); } if ( !opt_debug ) { result = do_ioctl((p80211msg_t*)&writemsg); if ( result ) { fprintf(stderr,APPNAME ": pda_write()->do_ioctl() failed w/ result=%d, " "aborting pda download\n", result); return result; } if ( writemsg.resultcode.data != P80211ENUM_resultcode_success ) { fprintf(stderr,APPNAME ": pda_write()->flashdl_write msg indicates failure, " "w/ resultcode=%ld, aborting pda download.\n", writemsg.resultcode.data); return 1; } } /* Send flashdl_state(disable) */ if (opt_verbose) printf("Sending dlflash_state(disable) message.\n"); statemsg.enable.data = P80211ENUM_truth_false; if ( !opt_debug ) { result = do_ioctl((p80211msg_t*)&statemsg); if ( result ) { fprintf(stderr,APPNAME ": pda_write()->do_ioctl() failed w/ result=%d, " "aborting pda download\n", result); return result; } if ( statemsg.resultcode.data != P80211ENUM_resultcode_success ) { fprintf(stderr,APPNAME ": pda_write()->flashdl_state msg indicates failure, " "w/ resultcode=%ld, aborting pda download.\n", statemsg.resultcode.data); return 1; } } return result; } /*---------------------------------------------------------------- * plugimage * * Plugs the given image using the given plug records from the given * PDA and filename. * * Arguments: * fchunk Array of image chunks * nfchunks Number of image chunks * s3plug Array of plug records * ns3plug Number of plug records * pda Current pda data * fname File the image data was read from * * Returns: * 0 success * ~0 failure ----------------------------------------------------------------*/ int plugimage( imgchunk_t *fchunk, UINT nfchunks, s3plugrec_t* s3plug, UINT ns3plug, pda_t *pda, char *fname) { int result = 0; int i; /* plug index */ int j; /* index of PDR or -1 if fname plug */ int c; /* chunk index */ UINT32 pstart; UINT32 pend; UINT32 cstart = 0; UINT32 cend; UINT32 chunkoff; UINT8 *src; UINT8 *dest; /* for each plug record */ for ( i = 0; i < ns3plug; i++) { pstart = s3plug[i].addr; pend = s3plug[i].addr + s3plug[i].len; /* find the matching PDR (or filename) */ if ( s3plug[i].itemcode != 0xffffffffUL ) { /* not filename */ for ( j = 0; j < pda->nrec; j++) { if ( s3plug[i].itemcode == hfa384x2host_16(pda->rec[j]->code) ) break; } } else { j = -1; } if ( j >= pda->nrec && j != -1 ) { /* if no matching PDR, fail */ fprintf(stderr, APPNAME ": warning: Failed to find PDR for " "plugrec 0x%04lx.\n", s3plug[i].itemcode); continue; /* and move on to the next PDR */ #if 0 /* MSM: They swear that unless it's the MAC address, * the serial number, or the TX calibration records, * then there's reasonable defaults in the f/w * image. Therefore, missing PDRs in the card * should only be a warning, not fatal. * TODO: add fatals for the PDRs mentioned above. */ result = 1; continue; #endif } /* Validate plug len against PDR len */ if ( j != -1 && s3plug[i].len < hfa384x2host_16(pda->rec[j]->len) ) { fprintf(stderr, APPNAME ": error: Plug vs. PDR len mismatch for " "plugrec 0x%04lx, abort plugging.\n", s3plug[i].itemcode); result = 1; continue; } /* Validate plug address against chunk data and identify chunk */ for ( c = 0; c < nfchunks; c++) { cstart = fchunk[c].addr; cend = fchunk[c].addr + fchunk[c].len; if ( pstart >= cstart && pend <= cend ) break; } if ( c >= nfchunks ) { fprintf(stderr, APPNAME ": error: Failed to find image chunk for " "plugrec 0x%04lx.\n", s3plug[i].itemcode); result = 1; continue; } /* Plug data */ chunkoff = pstart - cstart; dest = fchunk[c].data + chunkoff; if (opt_verbose) { printf("Plugging item 0x%04lx @ 0x%06lx, len=%ld, " "cnum=%d coff=0x%06lx\n", s3plug[i].itemcode, pstart, s3plug[i].len, c, chunkoff); } if ( j == -1 ) { /* plug the filename */ src = strrchr(fname, '/'); src = (src == NULL) ? (UINT8*)fname : src + 1; memset(dest, 0, s3plug[i].len); strncpy(dest, src, s3plug[i].len - 1); } else { /* plug a PDR */ memcpy( dest, &(pda->rec[j]->data), s3plug[i].len); } } return result; } /*---------------------------------------------------------------- * print_all_pdrs * * Dumps the contents of all the pdr lists to stdout. Assumes that * the pdrlists have 'been made'. See mkpdrlist(). * * Arguments: none * * Returns: * 0 - success * ~0 - failure (probably an errno) ----------------------------------------------------------------*/ void print_all_pdrs(pda_t *pda) { int i; int j; UINT16 *datap; UINT8 *offp; int end; int nwords; if ( opt_generate ) { for ( i = 0; i < pda->nrec; i++) { datap = (UINT16*)(pda->rec[i]); nwords = hfa384x2host_16(pda->rec[i]->len) +1; for ( j = 0; j < nwords; j++) { printf("0x%04x, ", hfa384x2host_16(datap[j])); } printf("\n"); } return; } printf("Current PDA:\n"); printf( " offset len code data\n" " ---------------------------------------------------\n"); /* 00000000 000 0x0000 0000 0000 0000 0000 0000.... */ /* 0000 0000 0000 0000 0000.... */ for ( i = 0; i < pda->nrec; i++) { offp = (UINT8*)(pda->rec[i]); printf(" %08d %03d 0x%04x ", offp - pda->buf, hfa384x2host_16(pda->rec[i]->len), hfa384x2host_16(pda->rec[i]->code)); datap = (UINT16*)&(pda->rec[i]->data.end_of_pda); nwords = hfa384x2host_16(pda->rec[i]->len) - 1; for ( j = 0; j < nwords; j++) { printf("%04x ", hfa384x2host_16(datap[j]) ); if ( (j % 8) == 7 && j < nwords - 1 ) { printf("\n "); } } printf("\n"); } if (opt_verbose) { printf("Raw PDA:\n"); datap = (UINT16*)pda->buf; end = (((UINT8*)pda->rec[pda->nrec - 1]) - pda->buf + 6) / 2; printf(" "); for ( i = 0; i < end; i++ ) { printf("%04x ", hfa384x2host_16(datap[i]) ); if ( (i % 16) == 15 ) { printf("\n "); } } printf("\n"); } } /*---------------------------------------------------------------- * read_cardpda * * Sends the command for the driver to read the pda from the card * named in the device variable. Upon success, the card pda is * stored in the "cardpda" variables. Note that the pda structure * is considered 'well formed' after this function. That means * that the nrecs is valid, the rec array has been set up, and there's * a valid PDAEND record in the raw PDA data. * * Arguments: none * * Returns: * 0 - success * ~0 - failure (probably an errno) ----------------------------------------------------------------*/ int read_cardpda(pda_t *pda, char *dev) { int result = 0; p80211msg_p2req_readpda_t msg; /* set up the msg */ msg.msgcode = DIDmsg_p2req_readpda; msg.msglen = sizeof(msg); strcpy(msg.devname, dev); msg.pda.did = DIDmsg_p2req_readpda_pda; msg.pda.len = HFA384x_PDA_LEN_MAX; msg.pda.status = P80211ENUM_msgitem_status_no_value; msg.resultcode.did = DIDmsg_p2req_readpda_resultcode; msg.resultcode.len = sizeof(UINT32); msg.resultcode.status = P80211ENUM_msgitem_status_no_value; if ( do_ioctl((p80211msg_t*)&msg) != 0 ) { /* do_ioctl prints an errno if appropriate */ result = -1; } else if ( msg.resultcode.data == P80211ENUM_resultcode_success ) { memcpy(pda->buf, msg.pda.data, HFA384x_PDA_LEN_MAX); result = mkpdrlist(pda); } else { /* resultcode must've been something other than success */ result = -1; } return result; } /*--------------------------------------------------------------- * merge_pda * Merge the given pdr records into the given pda. * New PDR's are added. * If a PDR already exists then the current PDR overwrites the existing one. * If the PDR has a length of 1 then it is removed from the PDA. ---------------------------------------------------------------*/ void merge_pda(pda_t *pda, UINT16 *pdword, int nwords) { int i = 0; int j = 0; UINT8 *delpdastart; UINT8 *mvpdastart; UINT16 pdrlen; UINT16 pdrcode; UINT mvlen; /* Now, merge into the pda */ /* note that all the words are in hfa384x order */ i = 0; while ( i < nwords ) { /* For each PDR in the new list */ pdrlen = hfa384x2host_16(pdword[i]); /* in words */ pdrcode = hfa384x2host_16(pdword[i+1]); if ( pdrlen > (HFA384x_PDR_LEN_MAX / 2) ) { fprintf(stderr,APPNAME": invalid pdr length (0x%04x) encountered (pdrcode=0x%04x), exiting.\n", pdrlen, pdrcode); exit(1); } for ( j = 0; j < pda->nrec; j++) { /* Find matching code in PDA */ if ( pdrcode == hfa384x2host_16(pda->rec[j]->code) ) { break; } } if ( pdrlen == 1 && j < pda->nrec ) { /* Remove the pdr from the PDA */ if (opt_verbose) { printf(" Removing PDR: code=%04x, len=%d\n", pdrcode, pdrlen); } delpdastart = (UINT8*)(pda->rec[j]); mvpdastart = delpdastart + ((hfa384x2host_16(pda->rec[j]->len) + 1) * sizeof(UINT16)); mvlen = HFA384x_PDA_LEN_MAX - (mvpdastart - pda->buf); memmove( delpdastart, mvpdastart, mvlen); pda->nrec = 0; mkpdrlist(pda); } else if ( j < pda->nrec ) { /* Replace the pdr in the PDA */ if (opt_verbose) { printf(" Replacing PDR: code=%04x, len=%d\n", pdrcode, pdrlen); } if ( pdrlen == hfa384x2host_16(pda->rec[j]->len) ) { /* just overwrite */ memcpy( pda->rec[j], &(pdword[i]), (pdrlen + 1)*sizeof(UINT16)); } else { fprintf( stderr, APPNAME ": Replacing pdrs where (newlen!=oldlen) not " "supported.\n"); exit(1); } } else { /* Add the pdr to the PDA */ UINT8 *endp = (UINT8*)(pda->rec[pda->nrec - 1]); if (opt_verbose) { printf(" Adding PDR: code=%04x, len=%d\n", pdrcode, pdrlen); } /* overwrite the existing end record and add a new one */ memcpy( endp, &(pdword[i]), (pdrlen + 1)*sizeof(UINT16)); pda->rec[pda->nrec] = (hfa384x_pdrec_t*) (endp + ((pdrlen+1) * sizeof(UINT16))); pda->rec[pda->nrec]->len = host2hfa384x_16(2); pda->rec[pda->nrec]->code = host2hfa384x_16(HFA384x_PDR_END_OF_PDA); pda->rec[pda->nrec]->data.end_of_pda.crc = 0; pda->nrec++; } i += pdrlen + 1; } } /*---------------------------------------------------------------- * read_filepda * * Reads a collection of PDRs from a file and merges them into the * current PDA data set maintained within this program. The * PDA data set may be empty or not. * * ASSUMED FILE FORMAT: * pdrline := [] * hexnum := [0x][[:hexdigit:]]{1-4} * sep := [,[:space:]][[:space:]]* * COMMENTS: * ANY DETECTED CHARACTER that doesn't match * [[:space:][:hexdigit:],x] indicates the start of a comment * that extends to EOL. Note the 'x', it never starts an element * so we really don't have to worry about it. * REMOVE RECORDS: * PDR items in the file that have a length of 1 indicate that * the given PDR should be removed from the PDA. If that * same item appears later in the file (or in a subsequent * file) then it will be added again. * * Arguments: none * * Returns: * 0 - success * ~0 - failure (probably an errno) ----------------------------------------------------------------*/ int read_filepda(pda_t *pda, char *pdrfname) { int result = 0; FILE *pdrfile; UINT16 pdword[HFA384x_PDA_LEN_MAX / sizeof(UINT16)]; UINT nwords = 0; char linebuf[PDAFILE_LINE_MAX]; char *currp = NULL; char *nextp = NULL; regex_t regex; regmatch_t regmatch; char ebuf[100]; /* Open the file */ pdrfile = fopen(pdrfname, "r"); if ( pdrfile == NULL ) { result=errno; perror(APPNAME); return result; } printf("Processing PDR file: %s\n", pdrfname); /* Read all the words, skipping over the comments etc. */ memset(linebuf, 0, PDAFILE_LINE_MAX); result = regcomp( ®ex, "[,[:blank:]][[:blank:]]*", 0); if ( result != 0 ) { regerror( result, ®ex, ebuf, sizeof(ebuf)); fprintf(stderr, APPNAME": failed to compile pda regexp err=%s.\n", ebuf); exit(1); } while ( fgets(linebuf, PDAFILE_LINE_MAX, pdrfile) != NULL) { currp = linebuf; nextp = NULL; pdword[nwords] = strtoul( currp, &nextp, 16); if ( currp == nextp ) { /* is there noting valid? */ continue; } else { pdword[nwords] = host2hfa384x_16(pdword[nwords]); nwords++; currp = nextp; } while ( regexec(®ex, currp, 1, ®match, 0) == 0 ) { currp += regmatch.rm_eo; if ( !isxdigit(*currp) ) { /* Assume comment and move to next line */ memset(linebuf, 0, PDAFILE_LINE_MAX); break; } pdword[nwords] = strtoul( currp, &nextp, 16); pdword[nwords] = host2hfa384x_16(pdword[nwords]); /* printf("pdword=%04x currp=\"%s\"\n", pdword[nwords], currp); */ nwords++; currp = nextp; } memset(linebuf, 0, PDAFILE_LINE_MAX); } /* Merge the records into the pda */ merge_pda(pda, pdword, nwords); return result; } /*---------------------------------------------------------------- * read_srecfile * * Reads the given srecord file and loads the records into the * s3xxx arrays. This function can be called repeatedly (once for * each of a set of files), if necessary. This function performs * no validation of the data except for the grossest of S-record * line format checks. Don't forget that these will be DOS files... * CR/LF at the end of each line. * * Here's the SREC format we're dealing with: * S[37]nnaaaaaaaaddd...dddcc * * nn - number of bytes starting with the address field * aaaaaaaa - address in readable (or big endian) format * dd....dd - 0-245 data bytes (two chars per byte) * cc - checksum * * The S7 record's (there should be only one) address value gets * saved in startaddr. It's the start execution address used * for RAM downloads. * * The S3 records have a collection of subformats indicated by the * value of aaaaaaaa: * 0xff000000 - Plug record, data field format: * xxxxxxxxaaaaaaaassssssss * x - PDR code number (little endian) * a - Address in load image to plug (little endian) * s - Length of plug data area (little endian) * * 0xff100000 - CRC16 generation record, data field format: * aaaaaaaassssssssbbbbbbbb * a - Start address for CRC calculation (little endian) * s - Length of data to calculate over (little endian) * b - Boolean, true=write crc, false=don't write * * 0xff200000 - Info record, data field format: * ssssttttdd..dd * s - Size in words (little endian) * t - Info type (little endian), see #defines and * s3inforec_t for details about types. * d - (s - 1) little endian words giving the contents of * the given info type. * * Arguments: * fname name of the s-record file to load * * Returns: * 0 - success * ~0 - failure (probably an errno) ----------------------------------------------------------------*/ int read_srecfile(char *fname) { FILE* f; int result = 0; char buf[SREC_LINE_MAX]; char tmpbuf[30]; s3datarec_t tmprec; int i; int line = 0; UINT16 *tmpinfo; printf("Reading S-record file %s...\n", fname); if ( strcmp("stdin", fname) == 0 ) { f = stdin; } else { f = fopen(fname, "r"); if ( f == NULL ) { result=errno; perror(APPNAME); return result; } } while ( fgets(buf, sizeof(buf), f) != NULL ) { line++; if ( buf[0] != 'S' ) { fprintf(stderr,APPNAME":%s:%d warning: No initial \'S\'\n", fname, line); fclose(f); return 1; } if ( buf[1] == '7' ) { /* S7 record, start address */ buf[12] = '\0'; startaddr = strtoul(buf+4, NULL, 16); if (opt_verbose) { printf( " S7 start addr, line=%d " " addr=0x%08lx\n", line, startaddr); } // break; continue; } else if ( buf[1] != '3') { fprintf(stderr,APPNAME":%s:%d warning: Unknown S-record detected.\n", fname, line); fclose(f); return 1; } /* Ok, it's an S3, parse and put it in the right array */ /* Record Length field (we only want datalen) */ memcpy(tmpbuf, buf+S3LEN_TXTOFFSET, S3LEN_TXTLEN); tmpbuf[S3LEN_TXTLEN] = '\0'; tmprec.len = strtoul( tmpbuf, NULL, 16) - 4 - 1; /* 4=addr, 1=cksum */ /* Address field */ memcpy(tmpbuf, buf+S3ADDR_TXTOFFSET, S3ADDR_TXTLEN); tmpbuf[S3ADDR_TXTLEN] = '\0'; tmprec.addr = strtoul( tmpbuf, NULL, 16); /* Checksum field */ tmprec.checksum = strtoul( buf+strlen(buf)-2, NULL, 16); switch( tmprec.addr ) { case S3ADDR_PLUG: memcpy(tmpbuf, buf+S3PLUG_ITEMCODE_TXTOFFSET, S3PLUG_ITEMCODE_TXTLEN); tmpbuf[S3PLUG_ITEMCODE_TXTLEN] = '\0'; s3plug[ns3plug].itemcode = strtoul(tmpbuf,NULL,16); s3plug[ns3plug].itemcode = bswap_32(s3plug[ns3plug].itemcode); memcpy(tmpbuf, buf+S3PLUG_ADDR_TXTOFFSET, S3PLUG_ADDR_TXTLEN); tmpbuf[S3PLUG_ADDR_TXTLEN] = '\0'; s3plug[ns3plug].addr = strtoul(tmpbuf,NULL,16); s3plug[ns3plug].addr = bswap_32(s3plug[ns3plug].addr); memcpy(tmpbuf, buf+S3PLUG_LEN_TXTOFFSET, S3PLUG_LEN_TXTLEN); tmpbuf[S3PLUG_LEN_TXTLEN] = '\0'; s3plug[ns3plug].len = strtoul(tmpbuf,NULL,16); s3plug[ns3plug].len = bswap_32(s3plug[ns3plug].len); if (opt_verbose) { printf( " S3 plugrec, line=%d " "itemcode=0x%04lx addr=0x%08lx len=%ld\n", line, s3plug[ns3plug].itemcode, s3plug[ns3plug].addr, s3plug[ns3plug].len); } ns3plug++; break; case S3ADDR_CRC: memcpy(tmpbuf, buf+S3CRC_ADDR_TXTOFFSET, S3CRC_ADDR_TXTLEN); tmpbuf[S3CRC_ADDR_TXTLEN] = '\0'; s3crc[ns3crc].addr = strtoul(tmpbuf,NULL,16); s3crc[ns3crc].addr = bswap_32(s3crc[ns3crc].addr); memcpy(tmpbuf, buf+S3CRC_LEN_TXTOFFSET, S3CRC_LEN_TXTLEN); tmpbuf[S3CRC_LEN_TXTLEN] = '\0'; s3crc[ns3crc].len = strtoul(tmpbuf,NULL,16); s3crc[ns3crc].len = bswap_32(s3crc[ns3crc].len); memcpy(tmpbuf, buf+S3CRC_DOWRITE_TXTOFFSET, S3CRC_DOWRITE_TXTLEN); tmpbuf[S3CRC_DOWRITE_TXTLEN] = '\0'; s3crc[ns3crc].dowrite = strtoul(tmpbuf,NULL,16); s3crc[ns3crc].dowrite = bswap_32(s3crc[ns3crc].dowrite); if (opt_verbose) { printf( " S3 crcrec, line=%d " "addr=0x%08lx len=%ld write=0x%08x\n", line, s3crc[ns3crc].addr, s3crc[ns3crc].len, s3crc[ns3crc].dowrite); } ns3crc++; break; case S3ADDR_INFO: memcpy(tmpbuf, buf+S3INFO_LEN_TXTOFFSET, S3INFO_LEN_TXTLEN); tmpbuf[S3INFO_LEN_TXTLEN] = '\0'; s3info[ns3info].len = strtoul(tmpbuf,NULL,16); s3info[ns3info].len = bswap_16(s3info[ns3info].len); memcpy(tmpbuf, buf+S3INFO_TYPE_TXTOFFSET, S3INFO_TYPE_TXTLEN); tmpbuf[S3INFO_TYPE_TXTLEN] = '\0'; s3info[ns3info].type = strtoul(tmpbuf,NULL,16); s3info[ns3info].type = bswap_16(s3info[ns3info].type); tmpinfo = (UINT16*)&(s3info[ns3info].info.version); for (i = 0; i < s3info[ns3info].len - 1; i++) { memcpy( tmpbuf, buf+S3INFO_DATA_TXTOFFSET+(i*4), 4); tmpbuf[4] = '\0'; tmpinfo[i] = strtoul(tmpbuf,NULL,16); tmpinfo[i] = bswap_16(tmpinfo[i]); } if (opt_verbose) { printf( " S3 inforec, line=%d " "len=0x%04x type=0x%04x\n", line, s3info[ns3info].len, s3info[ns3info].type); printf( " info="); for (i = 0; i < s3info[ns3info].len - 1; i++) { printf("%04x ", tmpinfo[i]); } printf("\n"); } ns3info++; break; default: /* Data record */ if (opt_verbose) { printf(" S3 datarec, line=%04d addr=0x%08lx len=%03ld\n", line, tmprec.addr, tmprec.len); } s3data[ns3data].addr = tmprec.addr; s3data[ns3data].len = tmprec.len; s3data[ns3data].checksum = tmprec.checksum; s3data[ns3data].data = malloc(tmprec.len); for ( i = 0; i < tmprec.len; i++) { memcpy(tmpbuf, buf+S3DATA_TXTOFFSET+(i*2), 2); tmpbuf[2] = '\0'; s3data[ns3data].data[i] = strtoul(tmpbuf, NULL, 16); } ns3data++; break; } } return result; } /*---------------------------------------------------------------- * str2macaddr * This function converts a character string that represents an * a 6 byte hex string to a 6 byte array. * The string format is: "xx:xx:xx:xx:xx:xx" * * Arguments: * a - a six byte array * s - character string representing a mac address * Returns: * 0 success * ~0 detected a format error ----------------------------------------------------------------*/ int str2macaddr( UINT8 *a, char *s ) { char *p; int i; UINT val; for ( i = 0; i < 5; i++) { /* loop over the number of :'s */ p = strchr( s, ':'); if ( p == NULL ) { return 1; } else { *p = '\0'; sscanf( s, "%x", &val); a[i] = (UINT8)val; s = p+1; } } sscanf( s, "%x", &val); a[i] = (UINT8)val; return 0; } /*---------------------------------------------------------------- * s3datarec_compare * * Comparison function for qsort(). * * Arguments: * p1 ptr to the first item * p2 ptr to the second item * Returns: * 0 items are equal * <0 p1 < p2 * >0 p1 > p2 ----------------------------------------------------------------*/ int s3datarec_compare(const void *p1, const void *p2) { const s3datarec_t *s1 = p1; const s3datarec_t *s2 = p2; if ( s1->addr == s2->addr ) return 0; if ( s1->addr < s2->addr ) return -1; return 1; } /*---------------------------------------------------------------- * usage * * This function displays the proper command line syntax of this * utility. * * Arguments: * none * * Returns: * nothing ----------------------------------------------------------------*/ void usage(void) { printf("\n%s : 802.11 frame dump utility\n", appname); printf(" usage: %s [option ...] devname\n\n", appname); printf(" where valid options are:\n\n" " options: (pnemonics in parentheses)\n" " GENERAL OPTIONS:\n" " -v (verbose) Show more status info during operation.\n" " -V (Version) Show version and exit\n" " -n (nowrite) Do all processing, including card PDA read, \n" " but do not write to card.\n" " -d (debug) Do all processing, excluding card PDA read, \n" " but do not write to card. A valid interface \n" " name is _not_ required for this mode.\n" " -s (status) Show CIS, PDA from card and exit\n" " -g (generate) Show the PDA in a format readable by this \n" " program. Useful for saving the existing PDA\n" " from a card.\n" "\n" " IMAGEFILE OPTIONS:\n" " -r (ram) Load SREC file to card RAM. This option may\n" " be specified multiple times. If the value \n" " is \"stdin\", the file will be read from \n" " stdin and the option may only be specified once.\n" " -f (flash) Load SREC file to card FLASH. This option may\n" " be specified multiple times. If the value \n" " is \"stdin\", the file will be read from \n" " stdin and the option may only be specified once.\n" "\n" " PDA OPTIONS:\n" " -a (addpdr) Add the PDRs from file to the PDA from card. This\n" " option may be specified multiple times.\n" " -p (pda) Replace the card PDA with the contents of file.\n" " -m (macaddr) Overwrite the MAC address PDR with the given \n" " value. ::= xx:xx:xx:xx:xx:xx, where \n" " xx is a two digit hex number.\n" " -S (Sernum) Overwrite the serial number PDR with the given\n" " string. String must be <= 12 characters, any\n" " extra will be truncated.\n" " -l (pdaloc) PDA location in card memory. Commonly values:\n" " HFA3841 ==> 0x003f0000\n" " HFA3842 ==> 0x007f0000\n" "\n" " argument:\n" " devname Linux device name (e.g. eth0, wlan0)\n" "\n" "EXAMPLES:\n" " Review card status:\n" " prism2dl -s wlan0\n" "\n" " Load a new PDA:\n" " prism2dl -p pdafile.txt wlan0\n" " or\n" " prism2dl -p pdafile.txt -a pda1.txt -a pda2.txt wlan0\n" "\n" " Note that the f/w images will most likely contain bogus plug info after\n" " rewriting the PDA by itself. It is generally recommended to reload the \n" " primage and secondary images at the same time as modifying the PDA.\n" "\n" " Load a FLASH image _and_ PDA:\n" " prism2dl -p pdafile.txt -f CIS.hex -f primary.hex -f secondary.hex wlan0\n" "\n" " Load a RAM image:\n" " prism2dl -a pda1.txt -r tertiary.hex\n" "\n" "Note: PDA records are additive starting with the records from the card\n" " OR the records from the -p specified file. -a specified file(s)\n" " overwrite, append, or remove records one at a time. If multiple\n" " files are specified using the -a option, the files are processed\n" " from left to right. This implies that a record removed from the\n" " current working PDA may then be added again by a record that\n" " appears after the \"remove\" record in the file set.\n\n"); } /*---------------------------------------------------------------- * writeimage * * Takes the chunks, builds p80211 messages and sends them down * to the driver for writing to the card. * * Arguments: * fchunk Array of image chunks * nfchunks Number of image chunks * isflash boolean indicating whether this is a * flash write or a ram write. * * Returns: * 0 success * ~0 failure ----------------------------------------------------------------*/ int writeimage(imgchunk_t *fchunk, UINT nfchunks, int isflash) { int result = 0; p80211msg_p2req_flashdl_state_t fstatemsg; p80211msg_p2req_flashdl_write_t fwritemsg; p80211msg_p2req_ramdl_state_t rstatemsg; p80211msg_p2req_ramdl_write_t rwritemsg; p80211msg_t *msgp; UINT32 resultcode; int i; int j; UINT nwrites; UINT32 curroff; UINT32 currlen; UINT32 currdaddr; /* Initialize the messages */ memset(&fstatemsg, 0, sizeof(fstatemsg)); strcpy(fstatemsg.devname, devname); fstatemsg.msgcode = DIDmsg_p2req_flashdl_state; fstatemsg.msglen = sizeof(fstatemsg); fstatemsg.enable.did = DIDmsg_p2req_flashdl_state_enable; fstatemsg.resultcode.did = DIDmsg_p2req_flashdl_state_resultcode; fstatemsg.enable.status = P80211ENUM_msgitem_status_data_ok; fstatemsg.resultcode.status = P80211ENUM_msgitem_status_no_value; fstatemsg.enable.len = sizeof(UINT32); fstatemsg.resultcode.len = sizeof(UINT32); memset(&fwritemsg, 0, sizeof(fwritemsg)); strcpy(fwritemsg.devname, devname); fwritemsg.msgcode = DIDmsg_p2req_flashdl_write; fwritemsg.msglen = sizeof(fwritemsg); fwritemsg.addr.did = DIDmsg_p2req_flashdl_write_addr; fwritemsg.len.did = DIDmsg_p2req_flashdl_write_len; fwritemsg.data.did = DIDmsg_p2req_flashdl_write_data; fwritemsg.resultcode.did = DIDmsg_p2req_flashdl_write_resultcode; fwritemsg.addr.status = P80211ENUM_msgitem_status_data_ok; fwritemsg.len.status = P80211ENUM_msgitem_status_data_ok; fwritemsg.data.status = P80211ENUM_msgitem_status_data_ok; fwritemsg.resultcode.status = P80211ENUM_msgitem_status_no_value; fwritemsg.addr.len = sizeof(UINT32); fwritemsg.len.len = sizeof(UINT32); fwritemsg.data.len = WRITESIZE_MAX; fwritemsg.resultcode.len = sizeof(UINT32); memset(&rstatemsg, 0, sizeof(rstatemsg)); strcpy(rstatemsg.devname, devname); rstatemsg.msgcode = DIDmsg_p2req_ramdl_state; rstatemsg.msglen = sizeof(rstatemsg); rstatemsg.enable.did = DIDmsg_p2req_ramdl_state_enable; rstatemsg.exeaddr.did = DIDmsg_p2req_ramdl_state_exeaddr; rstatemsg.resultcode.did = DIDmsg_p2req_ramdl_state_resultcode; rstatemsg.enable.status = P80211ENUM_msgitem_status_data_ok; rstatemsg.exeaddr.status = P80211ENUM_msgitem_status_data_ok; rstatemsg.resultcode.status = P80211ENUM_msgitem_status_no_value; rstatemsg.enable.len = sizeof(UINT32); rstatemsg.exeaddr.len = sizeof(UINT32); rstatemsg.resultcode.len = sizeof(UINT32); memset(&rwritemsg, 0, sizeof(rwritemsg)); strcpy(rwritemsg.devname, devname); rwritemsg.msgcode = DIDmsg_p2req_ramdl_write; rwritemsg.msglen = sizeof(rwritemsg); rwritemsg.addr.did = DIDmsg_p2req_ramdl_write_addr; rwritemsg.len.did = DIDmsg_p2req_ramdl_write_len; rwritemsg.data.did = DIDmsg_p2req_ramdl_write_data; rwritemsg.resultcode.did = DIDmsg_p2req_ramdl_write_resultcode; rwritemsg.addr.status = P80211ENUM_msgitem_status_data_ok; rwritemsg.len.status = P80211ENUM_msgitem_status_data_ok; rwritemsg.data.status = P80211ENUM_msgitem_status_data_ok; rwritemsg.resultcode.status = P80211ENUM_msgitem_status_no_value; rwritemsg.addr.len = sizeof(UINT32); rwritemsg.len.len = sizeof(UINT32); rwritemsg.data.len = WRITESIZE_MAX; rwritemsg.resultcode.len = sizeof(UINT32); /* Send xxx_state(enable) */ if (opt_verbose) printf("Sending dl_state(enable) message.\n"); if ( isflash ) { fstatemsg.enable.data = P80211ENUM_truth_true; } else { rstatemsg.enable.data = P80211ENUM_truth_true; rstatemsg.exeaddr.data = startaddr; } if ( !opt_debug ) { msgp = isflash ? (p80211msg_t*)&fstatemsg : (p80211msg_t*)&rstatemsg; result = do_ioctl(msgp); if ( result ) { fprintf(stderr,APPNAME ": writeimage()->do_ioctl() failed w/ result=%d, " "aborting download\n", result); return result; } resultcode = isflash ? fstatemsg.resultcode.data : rstatemsg.resultcode.data; if ( resultcode != P80211ENUM_resultcode_success ) { fprintf(stderr,APPNAME ": writeimage()->xxxdl_state msg indicates failure, " "w/ resultcode=%ld, aborting download.\n", resultcode); return 1; } } /* Now, loop through the data chunks and send WRITESIZE_MAX data */ for ( i = 0; i < nfchunks; i++) { #if 0 FILE *fp; char fname[80]; #endif nwrites = fchunk[i].len / WRITESIZE_MAX; nwrites += (fchunk[i].len % WRITESIZE_MAX) ? 1 : 0; curroff = 0; #if 0 sprintf(fname, "d%06lx.dat", fchunk[i].addr); fp = fopen( fname, "w"); #endif for ( j = 0; j < nwrites; j++) { currlen = (fchunk[i].len - (WRITESIZE_MAX * j)) > WRITESIZE_MAX ? WRITESIZE_MAX : (fchunk[i].len - (WRITESIZE_MAX * j)); curroff = j * WRITESIZE_MAX; currdaddr = fchunk[i].addr + curroff; /* Setup the message */ if ( isflash ) { fwritemsg.addr.data = currdaddr; fwritemsg.len.data = currlen; memcpy(fwritemsg.data.data, fchunk[i].data + curroff, currlen); #if 0 fwrite(fwritemsg.data.data, 1, currlen, fp); #endif } else { rwritemsg.addr.data = currdaddr; rwritemsg.len.data = currlen; memcpy(rwritemsg.data.data, fchunk[i].data + curroff, currlen); #if 0 fwrite(rwritemsg.data.data, 1, currlen, fp); #endif } /* Send flashdl_write(pda) */ if (opt_verbose) { printf("Sending xxxdl_write message addr=%06lx len=%ld.\n", currdaddr, currlen); } if ( opt_debug ) continue; msgp = isflash ? (p80211msg_t*)&fwritemsg : (p80211msg_t*)&rwritemsg; result = do_ioctl(msgp); /* Check the results */ if ( result ) { fprintf(stderr,APPNAME ": writeimage()->do_ioctl() failed w/ result=%d, " "aborting download\n", result); return result; } resultcode = isflash ? fstatemsg.resultcode.data : rstatemsg.resultcode.data; if ( resultcode != P80211ENUM_resultcode_success ) { fprintf(stderr,APPNAME ": writeimage()->xxxdl_write msg indicates failure, " "w/ resultcode=%ld, aborting download.\n", resultcode); return 1; } } #if 0 fclose(fp); #endif } /* Send xxx_state(disable) */ if (opt_verbose) printf("Sending dl_state(disable) message.\n"); if ( isflash ) { fstatemsg.enable.data = P80211ENUM_truth_false; } else { rstatemsg.enable.data = P80211ENUM_truth_false; rstatemsg.exeaddr.data = 0; } if ( opt_debug ) return result; msgp = isflash ? (p80211msg_t*)&fstatemsg : (p80211msg_t*)&rstatemsg; result = do_ioctl(msgp); if ( result ) { fprintf(stderr,APPNAME ": writeimage()->do_ioctl() failed w/ result=%d, " "aborting download\n", result); return result; } resultcode = isflash ? fstatemsg.resultcode.data : rstatemsg.resultcode.data; if ( resultcode != P80211ENUM_resultcode_success ) { fprintf(stderr,APPNAME ": writeimage()->xxxdl_state msg indicates failure, " "w/ resultcode=%ld, aborting download.\n", resultcode); return 1; } return result; } /*---------------------------------------------------------------- * dumpchunks * * Dumps the chunk info for each chunk of the current set to stdout. * * * Arguments: * fchunk Array of image chunks * nfchunks Number of image chunks * * Returns: * 0 success * ~0 failure ----------------------------------------------------------------*/ void dumpchunks( imgchunk_t *fchunk, UINT nfchunks) { int i; int j; for ( i = 0; i < nfchunks; i++) { printf("\nChunk %d: addr=0x%08lx len=%ld crc=%04hx\n", i, fchunk[i].addr, fchunk[i].len, fchunk[i].crc); printf("%08lx: ", fchunk[i].addr); for(j = 0; j < fchunk[i].len; j++) { printf("%02x ", fchunk[i].data[j]); if (((j+1) % 16) == 0) { printf("\n%08lx: ", fchunk[i].addr + j + 1); } } } printf("\n"); } int validate_identity(void) { int i; int result = 1; printf("NIC ID: %#x v%d.%d.%d\n", nicid.id, nicid.major, nicid.minor, nicid.variant); printf("MFI ID: %#x v%d %d->%d\n", rfid.id, rfid.variant, rfid.bottom, rfid.top); printf("CFI ID: %#x v%d %d->%d\n", macid.id, macid.variant, macid.bottom, macid.top); printf("PRI ID: %#x v%d %d->%d\n", priid.id, priid.variant, priid.bottom, priid.top); for (i = 0 ; i < ns3info ; i ++) { switch (s3info[i].type) { case 1: printf("Version: ID %#x %d.%d.%d\n", s3info[i].info.version.id, s3info[i].info.version.major, s3info[i].info.version.minor, s3info[i].info.version.variant); break; case 2: printf("Compat: Role %#x Id %#x v%d %d->%d\n", s3info[i].info.compat.role, s3info[i].info.compat.id, s3info[i].info.compat.variant, s3info[i].info.compat.bottom, s3info[i].info.compat.top); /* MAC compat range */ if ((s3info[i].info.compat.role == 1) && (s3info[i].info.compat.id == 2)) { if (s3info[i].info.compat.variant != macid.variant) { result = 2; } } /* PRI compat range */ if ((s3info[i].info.compat.role == 1) && (s3info[i].info.compat.id == 3)) { if ((s3info[i].info.compat.bottom > priid.top) || (s3info[i].info.compat.top < priid.bottom)){ result = 3; } } /* SEC compat range */ if ((s3info[i].info.compat.role == 1) && (s3info[i].info.compat.id == 4)) { } break; case 3: printf("Seq: %#x\n", s3info[i].info.buildseq); break; case 4: printf("Platform: ID %#x %d.%d.%d\n", s3info[i].info.version.id, s3info[i].info.version.major, s3info[i].info.version.minor, s3info[i].info.version.variant); if (nicid.id != s3info[i].info.version.id) continue; if (nicid.major != s3info[i].info.version.major) continue; if (nicid.minor != s3info[i].info.version.minor) continue; if ((nicid.variant != s3info[i].info.version.variant) && (nicid.id != 0x8008)) continue; if (result != 2) result = 0; break; case 0x8001: printf("name inforec len %d\n", s3info[i].len); break; default: printf("Unknown inforec type %d\n", s3info[i].type); } } // walk through return result; } linux-wlan-ng-0.2.9+dfsg/src/prism2/download/Makefile0000644000175000017500000000442711024763167022023 0ustar tormodtormod# src/prism2/download/Makefile # # build script for prism2 download utilities # # Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. # -------------------------------------------------------------------- # # linux-wlan # # 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. # # 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. # # -------------------------------------------------------------------- # # Inquiries regarding the linux-wlan Open Source project can be # made directly to: # # AbsoluteValue Systems Inc. # info@linux-wlan.com # http://www.linux-wlan.com # # -------------------------------------------------------------------- # # Portions of the development of this software were funded by # Intersil Corporation as part of PRISM(R) chipset product development. # # -------------------------------------------------------------------- -include ../../../config.mk CPPFLAGS= -I../../include -I../include -I$(LINUX_SRC)/include -D__LINUX_WLAN__ SRCS = prism2dl.c OBJS = prism2dl.o prism2dl: $(OBJS) $(CC) -g -o prism2dl $(OBJS) install: mkdir -p $(TARGET_INST_EXEDIR) cp prism2dl $(TARGET_INST_EXEDIR) clean: rm -f core core.* *.o .*.o *.s *.a .depend tmp_make *~ tags rm -f prism2dl for i in *_obj; do if [ -d $$i ]; then rm -fr $$i; fi; done linux-wlan-ng-0.2.9+dfsg/src/prism2/README.firmware0000644000175000017500000000200011024763201021215 0ustar tormodtormodThe following binary firmware files are (c) Conexant, and do not fall under the GPL or MPL. They are assumed to have the same license as their windows client drivers, ie everyone who bought a card that came with a windows driver already has a copy of and license to use the necessary firmware, albeit possibly an older version. These are bundled with linux-wlan-ng for convenience only, as many newer adapters (eg Prism 3 w/SSF) require a firmware download in order to function at all. Primary (Basic hardware functionality) firmware images: af010104.hex Prism 2.5/3 AMD Flash ak010104.hex Prism 2.5/3 SST Flash pm010102.hex Prism 3 Short Serial Flash Secondary (STA/Adhoc/HostAP mode) firmware images: r1010701.hex Prism 2 PCMCIA adapters rf010804.hex Prism 2.5/3 PCI/PCMCIA adapters ru010803.hex Prism 2/3 USB adapters Tertiary firmware images (Firmware-based AP mode) are not bundled, as that requires an explicit license from Conexant to use, with explicit limitations on redistribution. linux-wlan-ng-0.2.9+dfsg/src/prism2/include/0000755000175000017500000000000011026545443020165 5ustar tormodtormodlinux-wlan-ng-0.2.9+dfsg/src/prism2/include/prism2/0000755000175000017500000000000011026545443021401 5ustar tormodtormodlinux-wlan-ng-0.2.9+dfsg/src/prism2/include/prism2/prism2mgmt.h0000644000175000017500000001700611024763164023657 0ustar tormodtormod/* src/prism2/include/prism2/prism2mgmt.h * * Declares the mgmt command handler functions * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- * * This file contains the constants and data structures for interaction * with the hfa384x Wireless LAN (WLAN) Media Access Contoller (MAC). * The hfa384x is a portion of the Harris PRISM(tm) WLAN chipset. * * [Implementation and usage notes] * * [References] * CW10 Programmer's Manual v1.5 * IEEE 802.11 D10.0 * * -------------------------------------------------------------------- */ #ifndef _PRISM2MGMT_H #define _PRISM2MGMT_H /*=============================================================*/ /*------ Constants --------------------------------------------*/ /*=============================================================*/ /*------ Macros -----------------------------------------------*/ /*=============================================================*/ /*------ Types and their related constants --------------------*/ /*=============================================================*/ /*------ Static variable externs ------------------------------*/ #if (WLAN_HOSTIF != WLAN_USB) extern int prism2_bap_timeout; extern int prism2_irq_evread_max; #endif extern int prism2_debug; extern int prism2_reset_holdtime; extern int prism2_reset_settletime; /*=============================================================*/ /*--- Function Declarations -----------------------------------*/ /*=============================================================*/ UINT32 prism2sta_ifstate(wlandevice_t *wlandev, UINT32 ifstate); void prism2sta_ev_dtim(wlandevice_t *wlandev); void prism2sta_ev_infdrop(wlandevice_t *wlandev); void prism2sta_ev_info(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf); void prism2sta_ev_txexc(wlandevice_t *wlandev, UINT16 status); void prism2sta_ev_tx(wlandevice_t *wlandev, UINT16 status); void prism2sta_ev_rx(wlandevice_t *wlandev, struct sk_buff *skb); void prism2sta_ev_alloc(wlandevice_t *wlandev); int prism2mgmt_mibset_mibget(wlandevice_t *wlandev, void *msgp); int prism2mgmt_powermgmt(wlandevice_t *wlandev, void *msgp); int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp); int prism2mgmt_scan_results(wlandevice_t *wlandev, void *msgp); int prism2mgmt_join(wlandevice_t *wlandev, void *msgp); int prism2mgmt_p2_join(wlandevice_t *wlandev, void *msgp); int prism2mgmt_authenticate(wlandevice_t *wlandev, void *msgp); int prism2mgmt_deauthenticate(wlandevice_t *wlandev, void *msgp); int prism2mgmt_associate(wlandevice_t *wlandev, void *msgp); int prism2mgmt_reassociate(wlandevice_t *wlandev, void *msgp); int prism2mgmt_disassociate(wlandevice_t *wlandev, void *msgp); int prism2mgmt_reset(wlandevice_t *wlandev, void *msgp); int prism2mgmt_start(wlandevice_t *wlandev, void *msgp); int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp); int prism2mgmt_readpda(wlandevice_t *wlandev, void *msgp); int prism2mgmt_readcis(wlandevice_t *wlandev, void *msgp); int prism2mgmt_auxport_state(wlandevice_t *wlandev, void *msgp); int prism2mgmt_auxport_read(wlandevice_t *wlandev, void *msgp); int prism2mgmt_auxport_write(wlandevice_t *wlandev, void *msgp); int prism2mgmt_low_level(wlandevice_t *wlandev, void *msgp); int prism2mgmt_test_command(wlandevice_t *wlandev, void *msgp); int prism2mgmt_mmi_read(wlandevice_t *wlandev, void *msgp); int prism2mgmt_mmi_write(wlandevice_t *wlandev, void *msgp); int prism2mgmt_ramdl_state(wlandevice_t *wlandev, void *msgp); int prism2mgmt_ramdl_write(wlandevice_t *wlandev, void *msgp); int prism2mgmt_flashdl_state(wlandevice_t *wlandev, void *msgp); int prism2mgmt_flashdl_write(wlandevice_t *wlandev, void *msgp); int prism2mgmt_mm_state(wlandevice_t *wlandev, void *msgp); int prism2mgmt_dump_state(wlandevice_t *wlandev, void *msgp); int prism2mgmt_enable(wlandevice_t *wlandev, void *msgp); int prism2mgmt_channel_info(wlandevice_t *wlandev, void *msgp); int prism2mgmt_channel_info_results(wlandevice_t *wlandev, void *msgp); int prism2mgmt_autojoin(wlandevice_t *wlandev, void *msgp); /*--------------------------------------------------------------- * conversion functions going between wlan message data types and * Prism2 data types ---------------------------------------------------------------*/ /* byte area conversion functions*/ void prism2mgmt_pstr2bytearea(UINT8 *bytearea, p80211pstrd_t *pstr); void prism2mgmt_bytearea2pstr(UINT8 *bytearea, p80211pstrd_t *pstr, int len); /* byte string conversion functions*/ void prism2mgmt_pstr2bytestr(hfa384x_bytestr_t *bytestr, p80211pstrd_t *pstr); void prism2mgmt_bytestr2pstr(hfa384x_bytestr_t *bytestr, p80211pstrd_t *pstr); /* integer conversion functions */ void prism2mgmt_prism2int2p80211int(UINT16 *prism2int, UINT32 *wlanint); void prism2mgmt_p80211int2prism2int(UINT16 *prism2int, UINT32 *wlanint); /* enumerated integer conversion functions */ void prism2mgmt_prism2enum2p80211enum(UINT16 *prism2enum, UINT32 *wlanenum, UINT16 rid); void prism2mgmt_p80211enum2prism2enum(UINT16 *prism2enum, UINT32 *wlanenum, UINT16 rid); /* functions to convert a bit area to/from an Operational Rate Set */ void prism2mgmt_get_oprateset(UINT16 *rate, p80211pstrd_t *pstr); void prism2mgmt_set_oprateset(UINT16 *rate, p80211pstrd_t *pstr); /* functions to convert Group Addresses */ void prism2mgmt_get_grpaddr(UINT32 did, p80211pstrd_t *pstr, hfa384x_t *priv ); int prism2mgmt_set_grpaddr(UINT32 did, UINT8 *prism2buf, p80211pstrd_t *pstr, hfa384x_t *priv ); int prism2mgmt_get_grpaddr_index( UINT32 did ); void prism2sta_processing_defer(struct work_struct *data); void prism2sta_commsqual_defer(struct work_struct *data); void prism2sta_commsqual_timer(unsigned long data); /*=============================================================*/ /*--- Inline Function Definitions (if supported) --------------*/ /*=============================================================*/ #endif linux-wlan-ng-0.2.9+dfsg/src/prism2/include/prism2/hfa384x.h0000644000175000017500000032036211024763164022745 0ustar tormodtormod/* src/prism2/include/prism2/hfa384x.h * * Defines the constants and data structures for the hfa384x * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- * * [Implementation and usage notes] * * [References] * CW10 Programmer's Manual v1.5 * IEEE 802.11 D10.0 * * -------------------------------------------------------------------- */ #ifndef _HFA384x_H #define _HFA384x_H /*=============================================================*/ #define HFA384x_FIRMWARE_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) #define HFA384x_LEVEL_TO_dBm(v) (0x100 + (v) * 100 / 255 - 100) /*------ Constants --------------------------------------------*/ /*--- Mins & Maxs -----------------------------------*/ #define HFA384x_CMD_ALLOC_LEN_MIN ((UINT16)4) #define HFA384x_CMD_ALLOC_LEN_MAX ((UINT16)2400) #define HFA384x_BAP_DATALEN_MAX ((UINT16)4096) #define HFA384x_BAP_OFFSET_MAX ((UINT16)4096) #define HFA384x_PORTID_MAX ((UINT16)7) #define HFA384x_NUMPORTS_MAX ((UINT16)(HFA384x_PORTID_MAX+1)) #define HFA384x_PDR_LEN_MAX ((UINT16)512) /* in bytes, from EK */ #define HFA384x_PDA_RECS_MAX ((UINT16)200) /* a guess */ #define HFA384x_PDA_LEN_MAX ((UINT16)1024) /* in bytes, from EK */ #define HFA384x_SCANRESULT_MAX ((UINT16)31) #define HFA384x_HSCANRESULT_MAX ((UINT16)31) #define HFA384x_CHINFORESULT_MAX ((UINT16)16) #define HFA384x_DRVR_FIDSTACKLEN_MAX (10) #define HFA384x_DRVR_TXBUF_MAX (sizeof(hfa384x_tx_frame_t) + \ WLAN_DATA_MAXLEN - \ WLAN_WEP_IV_LEN - \ WLAN_WEP_ICV_LEN + 2) #define HFA384x_DRVR_MAGIC (0x4a2d) #define HFA384x_INFODATA_MAXLEN (sizeof(hfa384x_infodata_t)) #define HFA384x_INFOFRM_MAXLEN (sizeof(hfa384x_InfFrame_t)) #define HFA384x_RID_GUESSING_MAXLEN 2048 /* I'm not really sure */ #define HFA384x_RIDDATA_MAXLEN HFA384x_RID_GUESSING_MAXLEN #define HFA384x_USB_RWMEM_MAXLEN 2048 /*--- Support Constants -----------------------------*/ #define HFA384x_BAP_PROC ((UINT16)0) #define HFA384x_BAP_INT ((UINT16)1) #define HFA384x_PORTTYPE_IBSS ((UINT16)0) #define HFA384x_PORTTYPE_BSS ((UINT16)1) #define HFA384x_PORTTYPE_WDS ((UINT16)2) #define HFA384x_PORTTYPE_PSUEDOIBSS ((UINT16)3) #define HFA384x_PORTTYPE_HOSTAP ((UINT16)6) #define HFA384x_WEPFLAGS_PRIVINVOKED ((UINT16)BIT0) #define HFA384x_WEPFLAGS_EXCLUDE ((UINT16)BIT1) #define HFA384x_WEPFLAGS_DISABLE_TXCRYPT ((UINT16)BIT4) #define HFA384x_WEPFLAGS_DISABLE_RXCRYPT ((UINT16)BIT7) #define HFA384x_WEPFLAGS_DISALLOW_MIXED ((UINT16)BIT11) #define HFA384x_WEPFLAGS_IV_INTERVAL1 ((UINT16)0) #define HFA384x_WEPFLAGS_IV_INTERVAL10 ((UINT16)BIT5) #define HFA384x_WEPFLAGS_IV_INTERVAL50 ((UINT16)BIT6) #define HFA384x_WEPFLAGS_IV_INTERVAL100 ((UINT16)(BIT5 | BIT6)) #define HFA384x_WEPFLAGS_FIRMWARE_WPA ((UINT16)BIT8) #define HFA384x_WEPFLAGS_HOST_MIC ((UINT16)BIT9) #define HFA384x_ROAMMODE_FWSCAN_FWROAM ((UINT16)1) #define HFA384x_ROAMMODE_FWSCAN_HOSTROAM ((UINT16)2) #define HFA384x_ROAMMODE_HOSTSCAN_HOSTROAM ((UINT16)3) #define HFA384x_PORTSTATUS_DISABLED ((UINT16)1) #define HFA384x_PORTSTATUS_INITSRCH ((UINT16)2) #define HFA384x_PORTSTATUS_CONN_IBSS ((UINT16)3) #define HFA384x_PORTSTATUS_CONN_ESS ((UINT16)4) #define HFA384x_PORTSTATUS_OOR_ESS ((UINT16)5) #define HFA384x_PORTSTATUS_CONN_WDS ((UINT16)6) #define HFA384x_PORTSTATUS_HOSTAP ((UINT16)8) #define HFA384x_RATEBIT_1 ((UINT16)1) #define HFA384x_RATEBIT_2 ((UINT16)2) #define HFA384x_RATEBIT_5dot5 ((UINT16)4) #define HFA384x_RATEBIT_11 ((UINT16)8) /*--- Just some symbolic names for legibility -------*/ #define HFA384x_TXCMD_NORECL ((UINT16)0) #define HFA384x_TXCMD_RECL ((UINT16)1) /*--- MAC Internal memory constants and macros ------*/ /* masks and macros used to manipulate MAC internal memory addresses. */ /* MAC internal memory addresses are 23 bit quantities. The MAC uses * a paged address space where the upper 16 bits are the page number * and the lower 7 bits are the offset. There are various Host API * elements that require two 16-bit quantities to specify a MAC * internal memory address. Unfortunately, some of the API's use a * page/offset format where the offset value is JUST the lower seven * bits and the page is the remaining 16 bits. Some of the API's * assume that the 23 bit address has been split at the 16th bit. We * refer to these two formats as AUX format and CMD format. The * macros below help handle some of this. */ /* Handy constant */ #define HFA384x_ADDR_AUX_OFF_MAX ((UINT16)0x007f) /* Mask bits for discarding unwanted pieces in a flat address */ #define HFA384x_ADDR_FLAT_AUX_PAGE_MASK (0x007fff80) #define HFA384x_ADDR_FLAT_AUX_OFF_MASK (0x0000007f) #define HFA384x_ADDR_FLAT_CMD_PAGE_MASK (0xffff0000) #define HFA384x_ADDR_FLAT_CMD_OFF_MASK (0x0000ffff) /* Mask bits for discarding unwanted pieces in AUX format 16-bit address parts */ #define HFA384x_ADDR_AUX_PAGE_MASK (0xffff) #define HFA384x_ADDR_AUX_OFF_MASK (0x007f) /* Mask bits for discarding unwanted pieces in CMD format 16-bit address parts */ #define HFA384x_ADDR_CMD_PAGE_MASK (0x007f) #define HFA384x_ADDR_CMD_OFF_MASK (0xffff) /* Make a 32-bit flat address from AUX format 16-bit page and offset */ #define HFA384x_ADDR_AUX_MKFLAT(p,o) \ (((UINT32)(((UINT16)(p))&HFA384x_ADDR_AUX_PAGE_MASK)) <<7) | \ ((UINT32)(((UINT16)(o))&HFA384x_ADDR_AUX_OFF_MASK)) /* Make a 32-bit flat address from CMD format 16-bit page and offset */ #define HFA384x_ADDR_CMD_MKFLAT(p,o) \ (((UINT32)(((UINT16)(p))&HFA384x_ADDR_CMD_PAGE_MASK)) <<16) | \ ((UINT32)(((UINT16)(o))&HFA384x_ADDR_CMD_OFF_MASK)) /* Make AUX format offset and page from a 32-bit flat address */ #define HFA384x_ADDR_AUX_MKPAGE(f) \ ((UINT16)((((UINT32)(f))&HFA384x_ADDR_FLAT_AUX_PAGE_MASK)>>7)) #define HFA384x_ADDR_AUX_MKOFF(f) \ ((UINT16)(((UINT32)(f))&HFA384x_ADDR_FLAT_AUX_OFF_MASK)) /* Make CMD format offset and page from a 32-bit flat address */ #define HFA384x_ADDR_CMD_MKPAGE(f) \ ((UINT16)((((UINT32)(f))&HFA384x_ADDR_FLAT_CMD_PAGE_MASK)>>16)) #define HFA384x_ADDR_CMD_MKOFF(f) \ ((UINT16)(((UINT32)(f))&HFA384x_ADDR_FLAT_CMD_OFF_MASK)) /*--- Aux register masks/tests ----------------------*/ /* Some of the upper bits of the AUX offset register are used to */ /* select address space. */ #define HFA384x_AUX_CTL_EXTDS (0x00) #define HFA384x_AUX_CTL_NV (0x01) #define HFA384x_AUX_CTL_PHY (0x02) #define HFA384x_AUX_CTL_ICSRAM (0x03) /* Make AUX register offset and page values from a flat address */ #define HFA384x_AUX_MKOFF(f, c) \ (HFA384x_ADDR_AUX_MKOFF(f) | (((UINT16)(c))<<12)) #define HFA384x_AUX_MKPAGE(f) HFA384x_ADDR_AUX_MKPAGE(f) /*--- Controller Memory addresses -------------------*/ #define HFA3842_PDA_BASE (0x007f0000UL) #define HFA3841_PDA_BASE (0x003f0000UL) #define HFA3841_PDA_BOGUS_BASE (0x00390000UL) /*--- Driver Download states -----------------------*/ #define HFA384x_DLSTATE_DISABLED 0 #define HFA384x_DLSTATE_RAMENABLED 1 #define HFA384x_DLSTATE_FLASHENABLED 2 #define HFA384x_DLSTATE_FLASHWRITTEN 3 #define HFA384x_DLSTATE_FLASHWRITEPENDING 4 #define HFA384x_DLSTATE_GENESIS 5 /*--- Register I/O offsets --------------------------*/ #if ((WLAN_HOSTIF == WLAN_PCMCIA) || (WLAN_HOSTIF == WLAN_PLX)) #define HFA384x_CMD_OFF (0x00) #define HFA384x_PARAM0_OFF (0x02) #define HFA384x_PARAM1_OFF (0x04) #define HFA384x_PARAM2_OFF (0x06) #define HFA384x_STATUS_OFF (0x08) #define HFA384x_RESP0_OFF (0x0A) #define HFA384x_RESP1_OFF (0x0C) #define HFA384x_RESP2_OFF (0x0E) #define HFA384x_INFOFID_OFF (0x10) #define HFA384x_RXFID_OFF (0x20) #define HFA384x_ALLOCFID_OFF (0x22) #define HFA384x_TXCOMPLFID_OFF (0x24) #define HFA384x_SELECT0_OFF (0x18) #define HFA384x_OFFSET0_OFF (0x1C) #define HFA384x_DATA0_OFF (0x36) #define HFA384x_SELECT1_OFF (0x1A) #define HFA384x_OFFSET1_OFF (0x1E) #define HFA384x_DATA1_OFF (0x38) #define HFA384x_EVSTAT_OFF (0x30) #define HFA384x_INTEN_OFF (0x32) #define HFA384x_EVACK_OFF (0x34) #define HFA384x_CONTROL_OFF (0x14) #define HFA384x_SWSUPPORT0_OFF (0x28) #define HFA384x_SWSUPPORT1_OFF (0x2A) #define HFA384x_SWSUPPORT2_OFF (0x2C) #define HFA384x_AUXPAGE_OFF (0x3A) #define HFA384x_AUXOFFSET_OFF (0x3C) #define HFA384x_AUXDATA_OFF (0x3E) #elif (WLAN_HOSTIF == WLAN_PCI || WLAN_HOSTIF == WLAN_USB) #define HFA384x_CMD_OFF (0x00) #define HFA384x_PARAM0_OFF (0x04) #define HFA384x_PARAM1_OFF (0x08) #define HFA384x_PARAM2_OFF (0x0c) #define HFA384x_STATUS_OFF (0x10) #define HFA384x_RESP0_OFF (0x14) #define HFA384x_RESP1_OFF (0x18) #define HFA384x_RESP2_OFF (0x1c) #define HFA384x_INFOFID_OFF (0x20) #define HFA384x_RXFID_OFF (0x40) #define HFA384x_ALLOCFID_OFF (0x44) #define HFA384x_TXCOMPLFID_OFF (0x48) #define HFA384x_SELECT0_OFF (0x30) #define HFA384x_OFFSET0_OFF (0x38) #define HFA384x_DATA0_OFF (0x6c) #define HFA384x_SELECT1_OFF (0x34) #define HFA384x_OFFSET1_OFF (0x3c) #define HFA384x_DATA1_OFF (0x70) #define HFA384x_EVSTAT_OFF (0x60) #define HFA384x_INTEN_OFF (0x64) #define HFA384x_EVACK_OFF (0x68) #define HFA384x_CONTROL_OFF (0x28) #define HFA384x_SWSUPPORT0_OFF (0x50) #define HFA384x_SWSUPPORT1_OFF (0x54) #define HFA384x_SWSUPPORT2_OFF (0x58) #define HFA384x_AUXPAGE_OFF (0x74) #define HFA384x_AUXOFFSET_OFF (0x78) #define HFA384x_AUXDATA_OFF (0x7c) #define HFA384x_PCICOR_OFF (0x4c) #define HFA384x_PCIHCR_OFF (0x5c) #define HFA384x_PCI_M0_ADDRH_OFF (0x80) #define HFA384x_PCI_M0_ADDRL_OFF (0x84) #define HFA384x_PCI_M0_LEN_OFF (0x88) #define HFA384x_PCI_M0_CTL_OFF (0x8c) #define HFA384x_PCI_STATUS_OFF (0x98) #define HFA384x_PCI_M1_ADDRH_OFF (0xa0) #define HFA384x_PCI_M1_ADDRL_OFF (0xa4) #define HFA384x_PCI_M1_LEN_OFF (0xa8) #define HFA384x_PCI_M1_CTL_OFF (0xac) #endif /*--- Register Field Masks --------------------------*/ #define HFA384x_CMD_BUSY ((UINT16)BIT15) #define HFA384x_CMD_AINFO ((UINT16)(BIT14 | BIT13 | BIT12 | BIT11 | BIT10 | BIT9 | BIT8)) #define HFA384x_CMD_MACPORT ((UINT16)(BIT10 | BIT9 | BIT8)) #define HFA384x_CMD_RECL ((UINT16)BIT8) #define HFA384x_CMD_WRITE ((UINT16)BIT8) #define HFA384x_CMD_PROGMODE ((UINT16)(BIT9 | BIT8)) #define HFA384x_CMD_CMDCODE ((UINT16)(BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0)) #define HFA384x_STATUS_RESULT ((UINT16)(BIT14 | BIT13 | BIT12 | BIT11 | BIT10 | BIT9 | BIT8)) #define HFA384x_STATUS_CMDCODE ((UINT16)(BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0)) #define HFA384x_OFFSET_BUSY ((UINT16)BIT15) #define HFA384x_OFFSET_ERR ((UINT16)BIT14) #define HFA384x_OFFSET_DATAOFF ((UINT16)(BIT11 | BIT10 | BIT9 | BIT8 | BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1)) #define HFA384x_EVSTAT_TICK ((UINT16)BIT15) #define HFA384x_EVSTAT_WTERR ((UINT16)BIT14) #define HFA384x_EVSTAT_INFDROP ((UINT16)BIT13) #define HFA384x_EVSTAT_INFO ((UINT16)BIT7) #define HFA384x_EVSTAT_DTIM ((UINT16)BIT5) #define HFA384x_EVSTAT_CMD ((UINT16)BIT4) #define HFA384x_EVSTAT_ALLOC ((UINT16)BIT3) #define HFA384x_EVSTAT_TXEXC ((UINT16)BIT2) #define HFA384x_EVSTAT_TX ((UINT16)BIT1) #define HFA384x_EVSTAT_RX ((UINT16)BIT0) #define HFA384x_INT_BAP_OP (HFA384x_EVSTAT_INFO|HFA384x_EVSTAT_RX|HFA384x_EVSTAT_TX|HFA384x_EVSTAT_TXEXC) #define HFA384x_INT_NORMAL (HFA384x_EVSTAT_INFO|HFA384x_EVSTAT_RX|HFA384x_EVSTAT_TX|HFA384x_EVSTAT_TXEXC|HFA384x_EVSTAT_INFDROP|HFA384x_EVSTAT_ALLOC|HFA384x_EVSTAT_DTIM) #define HFA384x_INTEN_TICK ((UINT16)BIT15) #define HFA384x_INTEN_WTERR ((UINT16)BIT14) #define HFA384x_INTEN_INFDROP ((UINT16)BIT13) #define HFA384x_INTEN_INFO ((UINT16)BIT7) #define HFA384x_INTEN_DTIM ((UINT16)BIT5) #define HFA384x_INTEN_CMD ((UINT16)BIT4) #define HFA384x_INTEN_ALLOC ((UINT16)BIT3) #define HFA384x_INTEN_TXEXC ((UINT16)BIT2) #define HFA384x_INTEN_TX ((UINT16)BIT1) #define HFA384x_INTEN_RX ((UINT16)BIT0) #define HFA384x_EVACK_TICK ((UINT16)BIT15) #define HFA384x_EVACK_WTERR ((UINT16)BIT14) #define HFA384x_EVACK_INFDROP ((UINT16)BIT13) #define HFA384x_EVACK_INFO ((UINT16)BIT7) #define HFA384x_EVACK_DTIM ((UINT16)BIT5) #define HFA384x_EVACK_CMD ((UINT16)BIT4) #define HFA384x_EVACK_ALLOC ((UINT16)BIT3) #define HFA384x_EVACK_TXEXC ((UINT16)BIT2) #define HFA384x_EVACK_TX ((UINT16)BIT1) #define HFA384x_EVACK_RX ((UINT16)BIT0) #define HFA384x_CONTROL_AUXEN ((UINT16)(BIT15 | BIT14)) /*--- Command Code Constants --------------------------*/ /*--- Controller Commands --------------------------*/ #define HFA384x_CMDCODE_INIT ((UINT16)0x00) #define HFA384x_CMDCODE_ENABLE ((UINT16)0x01) #define HFA384x_CMDCODE_DISABLE ((UINT16)0x02) #define HFA384x_CMDCODE_DIAG ((UINT16)0x03) /*--- Buffer Mgmt Commands --------------------------*/ #define HFA384x_CMDCODE_ALLOC ((UINT16)0x0A) #define HFA384x_CMDCODE_TX ((UINT16)0x0B) #define HFA384x_CMDCODE_CLRPRST ((UINT16)0x12) /*--- Regulate Commands --------------------------*/ #define HFA384x_CMDCODE_NOTIFY ((UINT16)0x10) #define HFA384x_CMDCODE_INQ ((UINT16)0x11) /*--- Configure Commands --------------------------*/ #define HFA384x_CMDCODE_ACCESS ((UINT16)0x21) #define HFA384x_CMDCODE_DOWNLD ((UINT16)0x22) /*--- Debugging Commands -----------------------------*/ #define HFA384x_CMDCODE_MONITOR ((UINT16)(0x38)) #define HFA384x_MONITOR_ENABLE ((UINT16)(0x0b)) #define HFA384x_MONITOR_DISABLE ((UINT16)(0x0f)) /*--- Result Codes --------------------------*/ #define HFA384x_SUCCESS ((UINT16)(0x00)) #define HFA384x_CARD_FAIL ((UINT16)(0x01)) #define HFA384x_NO_BUFF ((UINT16)(0x05)) #define HFA384x_CMD_ERR ((UINT16)(0x7F)) /*--- Programming Modes -------------------------- MODE 0: Disable programming MODE 1: Enable volatile memory programming MODE 2: Enable non-volatile memory programming MODE 3: Program non-volatile memory section --------------------------------------------------*/ #define HFA384x_PROGMODE_DISABLE ((UINT16)0x00) #define HFA384x_PROGMODE_RAM ((UINT16)0x01) #define HFA384x_PROGMODE_NV ((UINT16)0x02) #define HFA384x_PROGMODE_NVWRITE ((UINT16)0x03) /*--- AUX register enable --------------------------*/ #define HFA384x_AUXPW0 ((UINT16)0xfe01) #define HFA384x_AUXPW1 ((UINT16)0xdc23) #define HFA384x_AUXPW2 ((UINT16)0xba45) #define HFA384x_CONTROL_AUX_ISDISABLED ((UINT16)0x0000) #define HFA384x_CONTROL_AUX_ISENABLED ((UINT16)0xc000) #define HFA384x_CONTROL_AUX_DOENABLE ((UINT16)0x8000) #define HFA384x_CONTROL_AUX_DODISABLE ((UINT16)0x4000) /*--- Record ID Constants --------------------------*/ /*-------------------------------------------------------------------- Configuration RIDs: Network Parameters, Static Configuration Entities --------------------------------------------------------------------*/ #define HFA384x_RID_CNFPORTTYPE ((UINT16)0xFC00) #define HFA384x_RID_CNFOWNMACADDR ((UINT16)0xFC01) #define HFA384x_RID_CNFDESIREDSSID ((UINT16)0xFC02) #define HFA384x_RID_CNFOWNCHANNEL ((UINT16)0xFC03) #define HFA384x_RID_CNFOWNSSID ((UINT16)0xFC04) #define HFA384x_RID_CNFOWNATIMWIN ((UINT16)0xFC05) #define HFA384x_RID_CNFSYSSCALE ((UINT16)0xFC06) #define HFA384x_RID_CNFMAXDATALEN ((UINT16)0xFC07) #define HFA384x_RID_CNFWDSADDR ((UINT16)0xFC08) #define HFA384x_RID_CNFPMENABLED ((UINT16)0xFC09) #define HFA384x_RID_CNFPMEPS ((UINT16)0xFC0A) #define HFA384x_RID_CNFMULTICASTRX ((UINT16)0xFC0B) #define HFA384x_RID_CNFMAXSLEEPDUR ((UINT16)0xFC0C) #define HFA384x_RID_CNFPMHOLDDUR ((UINT16)0xFC0D) #define HFA384x_RID_CNFOWNNAME ((UINT16)0xFC0E) #define HFA384x_RID_CNFOWNDTIMPER ((UINT16)0xFC10) #define HFA384x_RID_CNFWDSADDR1 ((UINT16)0xFC11) #define HFA384x_RID_CNFWDSADDR2 ((UINT16)0xFC12) #define HFA384x_RID_CNFWDSADDR3 ((UINT16)0xFC13) #define HFA384x_RID_CNFWDSADDR4 ((UINT16)0xFC14) #define HFA384x_RID_CNFWDSADDR5 ((UINT16)0xFC15) #define HFA384x_RID_CNFWDSADDR6 ((UINT16)0xFC16) #define HFA384x_RID_CNFMCASTPMBUFF ((UINT16)0xFC17) /*-------------------------------------------------------------------- Configuration RID lengths: Network Params, Static Config Entities This is the length of JUST the DATA part of the RID (does not include the len or code fields) --------------------------------------------------------------------*/ /* TODO: fill in the rest of these */ #define HFA384x_RID_CNFPORTTYPE_LEN ((UINT16)2) #define HFA384x_RID_CNFOWNMACADDR_LEN ((UINT16)6) #define HFA384x_RID_CNFDESIREDSSID_LEN ((UINT16)34) #define HFA384x_RID_CNFOWNCHANNEL_LEN ((UINT16)2) #define HFA384x_RID_CNFOWNSSID_LEN ((UINT16)34) #define HFA384x_RID_CNFOWNATIMWIN_LEN ((UINT16)2) #define HFA384x_RID_CNFSYSSCALE_LEN ((UINT16)0) #define HFA384x_RID_CNFMAXDATALEN_LEN ((UINT16)0) #define HFA384x_RID_CNFWDSADDR_LEN ((UINT16)6) #define HFA384x_RID_CNFPMENABLED_LEN ((UINT16)0) #define HFA384x_RID_CNFPMEPS_LEN ((UINT16)0) #define HFA384x_RID_CNFMULTICASTRX_LEN ((UINT16)0) #define HFA384x_RID_CNFMAXSLEEPDUR_LEN ((UINT16)0) #define HFA384x_RID_CNFPMHOLDDUR_LEN ((UINT16)0) #define HFA384x_RID_CNFOWNNAME_LEN ((UINT16)34) #define HFA384x_RID_CNFOWNDTIMPER_LEN ((UINT16)0) #define HFA384x_RID_CNFWDSADDR1_LEN ((UINT16)6) #define HFA384x_RID_CNFWDSADDR2_LEN ((UINT16)6) #define HFA384x_RID_CNFWDSADDR3_LEN ((UINT16)6) #define HFA384x_RID_CNFWDSADDR4_LEN ((UINT16)6) #define HFA384x_RID_CNFWDSADDR5_LEN ((UINT16)6) #define HFA384x_RID_CNFWDSADDR6_LEN ((UINT16)6) #define HFA384x_RID_CNFMCASTPMBUFF_LEN ((UINT16)0) #define HFA384x_RID_CNFAUTHENTICATION_LEN ((UINT16)sizeof(UINT16)) #define HFA384x_RID_CNFMAXSLEEPDUR_LEN ((UINT16)0) /*-------------------------------------------------------------------- Configuration RIDs: Network Parameters, Dynamic Configuration Entities --------------------------------------------------------------------*/ #define HFA384x_RID_GROUPADDR ((UINT16)0xFC80) #define HFA384x_RID_CREATEIBSS ((UINT16)0xFC81) #define HFA384x_RID_FRAGTHRESH ((UINT16)0xFC82) #define HFA384x_RID_RTSTHRESH ((UINT16)0xFC83) #define HFA384x_RID_TXRATECNTL ((UINT16)0xFC84) #define HFA384x_RID_PROMISCMODE ((UINT16)0xFC85) #define HFA384x_RID_FRAGTHRESH0 ((UINT16)0xFC90) #define HFA384x_RID_FRAGTHRESH1 ((UINT16)0xFC91) #define HFA384x_RID_FRAGTHRESH2 ((UINT16)0xFC92) #define HFA384x_RID_FRAGTHRESH3 ((UINT16)0xFC93) #define HFA384x_RID_FRAGTHRESH4 ((UINT16)0xFC94) #define HFA384x_RID_FRAGTHRESH5 ((UINT16)0xFC95) #define HFA384x_RID_FRAGTHRESH6 ((UINT16)0xFC96) #define HFA384x_RID_RTSTHRESH0 ((UINT16)0xFC97) #define HFA384x_RID_RTSTHRESH1 ((UINT16)0xFC98) #define HFA384x_RID_RTSTHRESH2 ((UINT16)0xFC99) #define HFA384x_RID_RTSTHRESH3 ((UINT16)0xFC9A) #define HFA384x_RID_RTSTHRESH4 ((UINT16)0xFC9B) #define HFA384x_RID_RTSTHRESH5 ((UINT16)0xFC9C) #define HFA384x_RID_RTSTHRESH6 ((UINT16)0xFC9D) #define HFA384x_RID_TXRATECNTL0 ((UINT16)0xFC9E) #define HFA384x_RID_TXRATECNTL1 ((UINT16)0xFC9F) #define HFA384x_RID_TXRATECNTL2 ((UINT16)0xFCA0) #define HFA384x_RID_TXRATECNTL3 ((UINT16)0xFCA1) #define HFA384x_RID_TXRATECNTL4 ((UINT16)0xFCA2) #define HFA384x_RID_TXRATECNTL5 ((UINT16)0xFCA3) #define HFA384x_RID_TXRATECNTL6 ((UINT16)0xFCA4) /*-------------------------------------------------------------------- Configuration RID Lengths: Network Param, Dynamic Config Entities This is the length of JUST the DATA part of the RID (does not include the len or code fields) --------------------------------------------------------------------*/ /* TODO: fill in the rest of these */ #define HFA384x_RID_GROUPADDR_LEN ((UINT16)16 * WLAN_ADDR_LEN) #define HFA384x_RID_CREATEIBSS_LEN ((UINT16)0) #define HFA384x_RID_FRAGTHRESH_LEN ((UINT16)0) #define HFA384x_RID_RTSTHRESH_LEN ((UINT16)0) #define HFA384x_RID_TXRATECNTL_LEN ((UINT16)4) #define HFA384x_RID_PROMISCMODE_LEN ((UINT16)2) #define HFA384x_RID_FRAGTHRESH0_LEN ((UINT16)0) #define HFA384x_RID_FRAGTHRESH1_LEN ((UINT16)0) #define HFA384x_RID_FRAGTHRESH2_LEN ((UINT16)0) #define HFA384x_RID_FRAGTHRESH3_LEN ((UINT16)0) #define HFA384x_RID_FRAGTHRESH4_LEN ((UINT16)0) #define HFA384x_RID_FRAGTHRESH5_LEN ((UINT16)0) #define HFA384x_RID_FRAGTHRESH6_LEN ((UINT16)0) #define HFA384x_RID_RTSTHRESH0_LEN ((UINT16)0) #define HFA384x_RID_RTSTHRESH1_LEN ((UINT16)0) #define HFA384x_RID_RTSTHRESH2_LEN ((UINT16)0) #define HFA384x_RID_RTSTHRESH3_LEN ((UINT16)0) #define HFA384x_RID_RTSTHRESH4_LEN ((UINT16)0) #define HFA384x_RID_RTSTHRESH5_LEN ((UINT16)0) #define HFA384x_RID_RTSTHRESH6_LEN ((UINT16)0) #define HFA384x_RID_TXRATECNTL0_LEN ((UINT16)0) #define HFA384x_RID_TXRATECNTL1_LEN ((UINT16)0) #define HFA384x_RID_TXRATECNTL2_LEN ((UINT16)0) #define HFA384x_RID_TXRATECNTL3_LEN ((UINT16)0) #define HFA384x_RID_TXRATECNTL4_LEN ((UINT16)0) #define HFA384x_RID_TXRATECNTL5_LEN ((UINT16)0) #define HFA384x_RID_TXRATECNTL6_LEN ((UINT16)0) /*-------------------------------------------------------------------- Configuration RIDs: Behavior Parameters --------------------------------------------------------------------*/ #define HFA384x_RID_ITICKTIME ((UINT16)0xFCE0) /*-------------------------------------------------------------------- Configuration RID Lengths: Behavior Parameters This is the length of JUST the DATA part of the RID (does not include the len or code fields) --------------------------------------------------------------------*/ #define HFA384x_RID_ITICKTIME_LEN ((UINT16)2) /*---------------------------------------------------------------------- Information RIDs: NIC Information --------------------------------------------------------------------*/ #define HFA384x_RID_MAXLOADTIME ((UINT16)0xFD00) #define HFA384x_RID_DOWNLOADBUFFER ((UINT16)0xFD01) #define HFA384x_RID_PRIIDENTITY ((UINT16)0xFD02) #define HFA384x_RID_PRISUPRANGE ((UINT16)0xFD03) #define HFA384x_RID_PRI_CFIACTRANGES ((UINT16)0xFD04) #define HFA384x_RID_NICSERIALNUMBER ((UINT16)0xFD0A) #define HFA384x_RID_NICIDENTITY ((UINT16)0xFD0B) #define HFA384x_RID_MFISUPRANGE ((UINT16)0xFD0C) #define HFA384x_RID_CFISUPRANGE ((UINT16)0xFD0D) #define HFA384x_RID_CHANNELLIST ((UINT16)0xFD10) #define HFA384x_RID_REGULATORYDOMAINS ((UINT16)0xFD11) #define HFA384x_RID_TEMPTYPE ((UINT16)0xFD12) #define HFA384x_RID_CIS ((UINT16)0xFD13) #define HFA384x_RID_STAIDENTITY ((UINT16)0xFD20) #define HFA384x_RID_STASUPRANGE ((UINT16)0xFD21) #define HFA384x_RID_STA_MFIACTRANGES ((UINT16)0xFD22) #define HFA384x_RID_STA_CFIACTRANGES ((UINT16)0xFD23) #define HFA384x_RID_BUILDSEQ ((UINT16)0xFFFE) #define HFA384x_RID_FWID ((UINT16)0xFFFF) /*---------------------------------------------------------------------- Information RID Lengths: NIC Information This is the length of JUST the DATA part of the RID (does not include the len or code fields) --------------------------------------------------------------------*/ #define HFA384x_RID_MAXLOADTIME_LEN ((UINT16)0) #define HFA384x_RID_DOWNLOADBUFFER_LEN ((UINT16)sizeof(hfa384x_downloadbuffer_t)) #define HFA384x_RID_PRIIDENTITY_LEN ((UINT16)8) #define HFA384x_RID_PRISUPRANGE_LEN ((UINT16)10) #define HFA384x_RID_CFIACTRANGES_LEN ((UINT16)10) #define HFA384x_RID_NICSERIALNUMBER_LEN ((UINT16)12) #define HFA384x_RID_NICIDENTITY_LEN ((UINT16)8) #define HFA384x_RID_MFISUPRANGE_LEN ((UINT16)10) #define HFA384x_RID_CFISUPRANGE_LEN ((UINT16)10) #define HFA384x_RID_CHANNELLIST_LEN ((UINT16)0) #define HFA384x_RID_REGULATORYDOMAINS_LEN ((UINT16)12) #define HFA384x_RID_TEMPTYPE_LEN ((UINT16)0) #define HFA384x_RID_CIS_LEN ((UINT16)480) #define HFA384x_RID_STAIDENTITY_LEN ((UINT16)8) #define HFA384x_RID_STASUPRANGE_LEN ((UINT16)10) #define HFA384x_RID_MFIACTRANGES_LEN ((UINT16)10) #define HFA384x_RID_CFIACTRANGES2_LEN ((UINT16)10) #define HFA384x_RID_BUILDSEQ_LEN ((UINT16)sizeof(hfa384x_BuildSeq_t)) #define HFA384x_RID_FWID_LEN ((UINT16)sizeof(hfa384x_FWID_t)) /*-------------------------------------------------------------------- Information RIDs: MAC Information --------------------------------------------------------------------*/ #define HFA384x_RID_PORTSTATUS ((UINT16)0xFD40) #define HFA384x_RID_CURRENTSSID ((UINT16)0xFD41) #define HFA384x_RID_CURRENTBSSID ((UINT16)0xFD42) #define HFA384x_RID_COMMSQUALITY ((UINT16)0xFD43) #define HFA384x_RID_CURRENTTXRATE ((UINT16)0xFD44) #define HFA384x_RID_CURRENTBCNINT ((UINT16)0xFD45) #define HFA384x_RID_CURRENTSCALETHRESH ((UINT16)0xFD46) #define HFA384x_RID_PROTOCOLRSPTIME ((UINT16)0xFD47) #define HFA384x_RID_SHORTRETRYLIMIT ((UINT16)0xFD48) #define HFA384x_RID_LONGRETRYLIMIT ((UINT16)0xFD49) #define HFA384x_RID_MAXTXLIFETIME ((UINT16)0xFD4A) #define HFA384x_RID_MAXRXLIFETIME ((UINT16)0xFD4B) #define HFA384x_RID_CFPOLLABLE ((UINT16)0xFD4C) #define HFA384x_RID_AUTHALGORITHMS ((UINT16)0xFD4D) #define HFA384x_RID_PRIVACYOPTIMP ((UINT16)0xFD4F) #define HFA384x_RID_DBMCOMMSQUALITY ((UINT16)0xFD51) #define HFA384x_RID_CURRENTTXRATE1 ((UINT16)0xFD80) #define HFA384x_RID_CURRENTTXRATE2 ((UINT16)0xFD81) #define HFA384x_RID_CURRENTTXRATE3 ((UINT16)0xFD82) #define HFA384x_RID_CURRENTTXRATE4 ((UINT16)0xFD83) #define HFA384x_RID_CURRENTTXRATE5 ((UINT16)0xFD84) #define HFA384x_RID_CURRENTTXRATE6 ((UINT16)0xFD85) #define HFA384x_RID_OWNMACADDRESS ((UINT16)0xFD86) // #define HFA384x_RID_PCFINFO ((UINT16)0xFD87) #define HFA384x_RID_SCANRESULTS ((UINT16)0xFD88) // NEW #define HFA384x_RID_HOSTSCANRESULTS ((UINT16)0xFD89) // NEW #define HFA384x_RID_AUTHENTICATIONUSED ((UINT16)0xFD8A) // NEW #define HFA384x_RID_ASSOCIATEFAILURE ((UINT16)0xFD8D) // 1.8.0 /*-------------------------------------------------------------------- Information RID Lengths: MAC Information This is the length of JUST the DATA part of the RID (does not include the len or code fields) --------------------------------------------------------------------*/ #define HFA384x_RID_PORTSTATUS_LEN ((UINT16)0) #define HFA384x_RID_CURRENTSSID_LEN ((UINT16)34) #define HFA384x_RID_CURRENTBSSID_LEN ((UINT16)WLAN_BSSID_LEN) #define HFA384x_RID_COMMSQUALITY_LEN ((UINT16)sizeof(hfa384x_commsquality_t)) #define HFA384x_RID_DBMCOMMSQUALITY_LEN ((UINT16)sizeof(hfa384x_dbmcommsquality_t)) #define HFA384x_RID_CURRENTTXRATE_LEN ((UINT16)0) #define HFA384x_RID_CURRENTBCNINT_LEN ((UINT16)0) #define HFA384x_RID_STACURSCALETHRESH_LEN ((UINT16)12) #define HFA384x_RID_APCURSCALETHRESH_LEN ((UINT16)6) #define HFA384x_RID_PROTOCOLRSPTIME_LEN ((UINT16)0) #define HFA384x_RID_SHORTRETRYLIMIT_LEN ((UINT16)0) #define HFA384x_RID_LONGRETRYLIMIT_LEN ((UINT16)0) #define HFA384x_RID_MAXTXLIFETIME_LEN ((UINT16)0) #define HFA384x_RID_MAXRXLIFETIME_LEN ((UINT16)0) #define HFA384x_RID_CFPOLLABLE_LEN ((UINT16)0) #define HFA384x_RID_AUTHALGORITHMS_LEN ((UINT16)4) #define HFA384x_RID_PRIVACYOPTIMP_LEN ((UINT16)0) #define HFA384x_RID_CURRENTTXRATE1_LEN ((UINT16)0) #define HFA384x_RID_CURRENTTXRATE2_LEN ((UINT16)0) #define HFA384x_RID_CURRENTTXRATE3_LEN ((UINT16)0) #define HFA384x_RID_CURRENTTXRATE4_LEN ((UINT16)0) #define HFA384x_RID_CURRENTTXRATE5_LEN ((UINT16)0) #define HFA384x_RID_CURRENTTXRATE6_LEN ((UINT16)0) #define HFA384x_RID_OWNMACADDRESS_LEN ((UINT16)6) #define HFA384x_RID_PCFINFO_LEN ((UINT16)6) #define HFA384x_RID_CNFAPPCFINFO_LEN ((UINT16)sizeof(hfa384x_PCFInfo_data_t)) #define HFA384x_RID_SCANREQUEST_LEN ((UINT16)sizeof(hfa384x_ScanRequest_data_t)) #define HFA384x_RID_JOINREQUEST_LEN ((UINT16)sizeof(hfa384x_JoinRequest_data_t)) #define HFA384x_RID_AUTHENTICATESTA_LEN ((UINT16)sizeof(hfa384x_authenticateStation_data_t)) #define HFA384x_RID_CHANNELINFOREQUEST_LEN ((UINT16)sizeof(hfa384x_ChannelInfoRequest_data_t)) /*-------------------------------------------------------------------- Information RIDs: Modem Information --------------------------------------------------------------------*/ #define HFA384x_RID_PHYTYPE ((UINT16)0xFDC0) #define HFA384x_RID_CURRENTCHANNEL ((UINT16)0xFDC1) #define HFA384x_RID_CURRENTPOWERSTATE ((UINT16)0xFDC2) #define HFA384x_RID_CCAMODE ((UINT16)0xFDC3) #define HFA384x_RID_SUPPORTEDDATARATES ((UINT16)0xFDC6) #define HFA384x_RID_LFOSTATUS ((UINT16)0xFDC7) // 1.7.1 /*-------------------------------------------------------------------- Information RID Lengths: Modem Information This is the length of JUST the DATA part of the RID (does not include the len or code fields) --------------------------------------------------------------------*/ #define HFA384x_RID_PHYTYPE_LEN ((UINT16)0) #define HFA384x_RID_CURRENTCHANNEL_LEN ((UINT16)0) #define HFA384x_RID_CURRENTPOWERSTATE_LEN ((UINT16)0) #define HFA384x_RID_CCAMODE_LEN ((UINT16)0) #define HFA384x_RID_SUPPORTEDDATARATES_LEN ((UINT16)10) /*-------------------------------------------------------------------- API ENHANCEMENTS (NOT ALREADY IMPLEMENTED) --------------------------------------------------------------------*/ #define HFA384x_RID_CNFWEPDEFAULTKEYID ((UINT16)0xFC23) #define HFA384x_RID_CNFWEPDEFAULTKEY0 ((UINT16)0xFC24) #define HFA384x_RID_CNFWEPDEFAULTKEY1 ((UINT16)0xFC25) #define HFA384x_RID_CNFWEPDEFAULTKEY2 ((UINT16)0xFC26) #define HFA384x_RID_CNFWEPDEFAULTKEY3 ((UINT16)0xFC27) #define HFA384x_RID_CNFWEPFLAGS ((UINT16)0xFC28) #define HFA384x_RID_CNFWEPKEYMAPTABLE ((UINT16)0xFC29) #define HFA384x_RID_CNFAUTHENTICATION ((UINT16)0xFC2A) #define HFA384x_RID_CNFMAXASSOCSTATIONS ((UINT16)0xFC2B) #define HFA384x_RID_CNFTXCONTROL ((UINT16)0xFC2C) #define HFA384x_RID_CNFROAMINGMODE ((UINT16)0xFC2D) #define HFA384x_RID_CNFHOSTAUTHASSOC ((UINT16)0xFC2E) #define HFA384x_RID_CNFRCVCRCERROR ((UINT16)0xFC30) // #define HFA384x_RID_CNFMMLIFE ((UINT16)0xFC31) #define HFA384x_RID_CNFALTRETRYCNT ((UINT16)0xFC32) #define HFA384x_RID_CNFAPBCNINT ((UINT16)0xFC33) #define HFA384x_RID_CNFAPPCFINFO ((UINT16)0xFC34) #define HFA384x_RID_CNFSTAPCFINFO ((UINT16)0xFC35) #define HFA384x_RID_CNFPRIORITYQUSAGE ((UINT16)0xFC37) #define HFA384x_RID_CNFTIMCTRL ((UINT16)0xFC40) #define HFA384x_RID_CNFTHIRTY2TALLY ((UINT16)0xFC42) #define HFA384x_RID_CNFENHSECURITY ((UINT16)0xFC43) #define HFA384x_RID_CNFDBMADJUST ((UINT16)0xFC46) // NEW #define HFA384x_RID_CNFWPADATA ((UINT16)0xFC48) // 1.7.0 #define HFA384x_RID_CNFPROPOGATIONDELAY ((UINT16)0xFC49) // 1.7.6 #define HFA384x_RID_CNFSHORTPREAMBLE ((UINT16)0xFCB0) #define HFA384x_RID_CNFEXCLONGPREAMBLE ((UINT16)0xFCB1) #define HFA384x_RID_CNFAUTHRSPTIMEOUT ((UINT16)0xFCB2) #define HFA384x_RID_CNFBASICRATES ((UINT16)0xFCB3) #define HFA384x_RID_CNFSUPPRATES ((UINT16)0xFCB4) #define HFA384x_RID_CNFFALLBACKCTRL ((UINT16)0xFCB5) // NEW #define HFA384x_RID_WEPKEYSTATUS ((UINT16)0xFCB6) // NEW #define HFA384x_RID_WEPKEYMAPINDEX ((UINT16)0xFCB7) // NEW #define HFA384x_RID_BROADCASTKEYID ((UINT16)0xFCB8) // NEW #define HFA384x_RID_ENTSECFLAGEYID ((UINT16)0xFCB9) // NEW #define HFA384x_RID_CNFPASSIVESCANCTRL ((UINT16)0xFCBA) // NEW STA #define HFA384x_RID_CNFWPAHANDLING ((UINT16)0xFCBB) // 1.7.0 #define HFA384x_RID_MDCCONTROL ((UINT16)0xFCBC) // 1.7.0/1.4.0 #define HFA384x_RID_MDCCOUNTRY ((UINT16)0xFCBD) // 1.7.0/1.4.0 #define HFA384x_RID_TXPOWERMAX ((UINT16)0xFCBE) // 1.7.0/1.4.0 #define HFA384x_RID_CNFLFOENBLED ((UINT16)0xFCBF) // 1.6.3 #define HFA384x_RID_CAPINFO ((UINT16)0xFCC0) // 1.7.0/1.3.7 #define HFA384x_RID_LISTENINTERVAL ((UINT16)0xFCC1) // 1.7.0/1.3.7 #define HFA384x_RID_DIVERSITYENABLED ((UINT16)0xFCC2) // 1.7.0/1.3.7 #define HFA384x_RID_LED_CONTROL ((UINT16)0xFCC4) // 1.7.6 #define HFA384x_RID_HFO_DELAY ((UINT16)0xFCC5) // 1.7.6 #define HFA384x_RID_DISSALOWEDBSSID ((UINT16)0xFCC6) // 1.8.0 #define HFA384x_RID_SCANREQUEST ((UINT16)0xFCE1) #define HFA384x_RID_JOINREQUEST ((UINT16)0xFCE2) #define HFA384x_RID_AUTHENTICATESTA ((UINT16)0xFCE3) #define HFA384x_RID_CHANNELINFOREQUEST ((UINT16)0xFCE4) #define HFA384x_RID_HOSTSCAN ((UINT16)0xFCE5) // NEW STA #define HFA384x_RID_ASSOCIATESTA ((UINT16)0xFCE6) #define HFA384x_RID_CNFWEPDEFAULTKEY_LEN ((UINT16)6) #define HFA384x_RID_CNFWEP128DEFAULTKEY_LEN ((UINT16)14) #define HFA384x_RID_CNFPRIOQUSAGE_LEN ((UINT16)4) /*-------------------------------------------------------------------- PD Record codes --------------------------------------------------------------------*/ #define HFA384x_PDR_PCB_PARTNUM ((UINT16)0x0001) #define HFA384x_PDR_PDAVER ((UINT16)0x0002) #define HFA384x_PDR_NIC_SERIAL ((UINT16)0x0003) #define HFA384x_PDR_MKK_MEASUREMENTS ((UINT16)0x0004) #define HFA384x_PDR_NIC_RAMSIZE ((UINT16)0x0005) #define HFA384x_PDR_MFISUPRANGE ((UINT16)0x0006) #define HFA384x_PDR_CFISUPRANGE ((UINT16)0x0007) #define HFA384x_PDR_NICID ((UINT16)0x0008) //#define HFA384x_PDR_REFDAC_MEASUREMENTS ((UINT16)0x0010) //#define HFA384x_PDR_VGDAC_MEASUREMENTS ((UINT16)0x0020) //#define HFA384x_PDR_LEVEL_COMP_MEASUREMENTS ((UINT16)0x0030) //#define HFA384x_PDR_MODEM_TRIMDAC_MEASUREMENTS ((UINT16)0x0040) //#define HFA384x_PDR_COREGA_HACK ((UINT16)0x00ff) #define HFA384x_PDR_MAC_ADDRESS ((UINT16)0x0101) //#define HFA384x_PDR_MKK_CALLNAME ((UINT16)0x0102) #define HFA384x_PDR_REGDOMAIN ((UINT16)0x0103) #define HFA384x_PDR_ALLOWED_CHANNEL ((UINT16)0x0104) #define HFA384x_PDR_DEFAULT_CHANNEL ((UINT16)0x0105) //#define HFA384x_PDR_PRIVACY_OPTION ((UINT16)0x0106) #define HFA384x_PDR_TEMPTYPE ((UINT16)0x0107) //#define HFA384x_PDR_REFDAC_SETUP ((UINT16)0x0110) //#define HFA384x_PDR_VGDAC_SETUP ((UINT16)0x0120) //#define HFA384x_PDR_LEVEL_COMP_SETUP ((UINT16)0x0130) //#define HFA384x_PDR_TRIMDAC_SETUP ((UINT16)0x0140) #define HFA384x_PDR_IFR_SETTING ((UINT16)0x0200) #define HFA384x_PDR_RFR_SETTING ((UINT16)0x0201) #define HFA384x_PDR_HFA3861_BASELINE ((UINT16)0x0202) #define HFA384x_PDR_HFA3861_SHADOW ((UINT16)0x0203) #define HFA384x_PDR_HFA3861_IFRF ((UINT16)0x0204) #define HFA384x_PDR_HFA3861_CHCALSP ((UINT16)0x0300) #define HFA384x_PDR_HFA3861_CHCALI ((UINT16)0x0301) #define HFA384x_PDR_MAX_TX_POWER ((UINT16)0x0302) #define HFA384x_PDR_MASTER_CHAN_LIST ((UINT16)0x0303) #define HFA384x_PDR_3842_NIC_CONFIG ((UINT16)0x0400) #define HFA384x_PDR_USB_ID ((UINT16)0x0401) #define HFA384x_PDR_PCI_ID ((UINT16)0x0402) #define HFA384x_PDR_PCI_IFCONF ((UINT16)0x0403) #define HFA384x_PDR_PCI_PMCONF ((UINT16)0x0404) #define HFA384x_PDR_RFENRGY ((UINT16)0x0406) #define HFA384x_PDR_USB_POWER_TYPE ((UINT16)0x0407) //#define HFA384x_PDR_UNKNOWN408 ((UINT16)0x0408) #define HFA384x_PDR_USB_MAX_POWER ((UINT16)0x0409) #define HFA384x_PDR_USB_MANUFACTURER ((UINT16)0x0410) #define HFA384x_PDR_USB_PRODUCT ((UINT16)0x0411) #define HFA384x_PDR_ANT_DIVERSITY ((UINT16)0x0412) #define HFA384x_PDR_HFO_DELAY ((UINT16)0x0413) #define HFA384x_PDR_SCALE_THRESH ((UINT16)0x0414) #define HFA384x_PDR_HFA3861_MANF_TESTSP ((UINT16)0x0900) #define HFA384x_PDR_HFA3861_MANF_TESTI ((UINT16)0x0901) #define HFA384x_PDR_END_OF_PDA ((UINT16)0x0000) /*=============================================================*/ /*------ Macros -----------------------------------------------*/ /*--- Register ID macros ------------------------*/ #define HFA384x_CMD HFA384x_CMD_OFF #define HFA384x_PARAM0 HFA384x_PARAM0_OFF #define HFA384x_PARAM1 HFA384x_PARAM1_OFF #define HFA384x_PARAM2 HFA384x_PARAM2_OFF #define HFA384x_STATUS HFA384x_STATUS_OFF #define HFA384x_RESP0 HFA384x_RESP0_OFF #define HFA384x_RESP1 HFA384x_RESP1_OFF #define HFA384x_RESP2 HFA384x_RESP2_OFF #define HFA384x_INFOFID HFA384x_INFOFID_OFF #define HFA384x_RXFID HFA384x_RXFID_OFF #define HFA384x_ALLOCFID HFA384x_ALLOCFID_OFF #define HFA384x_TXCOMPLFID HFA384x_TXCOMPLFID_OFF #define HFA384x_SELECT0 HFA384x_SELECT0_OFF #define HFA384x_OFFSET0 HFA384x_OFFSET0_OFF #define HFA384x_DATA0 HFA384x_DATA0_OFF #define HFA384x_SELECT1 HFA384x_SELECT1_OFF #define HFA384x_OFFSET1 HFA384x_OFFSET1_OFF #define HFA384x_DATA1 HFA384x_DATA1_OFF #define HFA384x_EVSTAT HFA384x_EVSTAT_OFF #define HFA384x_INTEN HFA384x_INTEN_OFF #define HFA384x_EVACK HFA384x_EVACK_OFF #define HFA384x_CONTROL HFA384x_CONTROL_OFF #define HFA384x_SWSUPPORT0 HFA384x_SWSUPPORT0_OFF #define HFA384x_SWSUPPORT1 HFA384x_SWSUPPORT1_OFF #define HFA384x_SWSUPPORT2 HFA384x_SWSUPPORT2_OFF #define HFA384x_AUXPAGE HFA384x_AUXPAGE_OFF #define HFA384x_AUXOFFSET HFA384x_AUXOFFSET_OFF #define HFA384x_AUXDATA HFA384x_AUXDATA_OFF #define HFA384x_PCICOR HFA384x_PCICOR_OFF #define HFA384x_PCIHCR HFA384x_PCIHCR_OFF /*--- Register Test/Get/Set Field macros ------------------------*/ #define HFA384x_CMD_ISBUSY(value) ((UINT16)(((UINT16)value) & HFA384x_CMD_BUSY)) #define HFA384x_CMD_AINFO_GET(value) ((UINT16)(((UINT16)(value) & HFA384x_CMD_AINFO) >> 8)) #define HFA384x_CMD_AINFO_SET(value) ((UINT16)((UINT16)(value) << 8)) #define HFA384x_CMD_MACPORT_GET(value) ((UINT16)(HFA384x_CMD_AINFO_GET((UINT16)(value) & HFA384x_CMD_MACPORT))) #define HFA384x_CMD_MACPORT_SET(value) ((UINT16)HFA384x_CMD_AINFO_SET(value)) #define HFA384x_CMD_ISRECL(value) ((UINT16)(HFA384x_CMD_AINFO_GET((UINT16)(value) & HFA384x_CMD_RECL))) #define HFA384x_CMD_RECL_SET(value) ((UINT16)HFA384x_CMD_AINFO_SET(value)) #define HFA384x_CMD_QOS_GET(value) ((UINT16((((UINT16)(value))&((UINT16)0x3000)) >> 12)) #define HFA384x_CMD_QOS_SET(value) ((UINT16)((((UINT16)(value)) << 12) & 0x3000)) #define HFA384x_CMD_ISWRITE(value) ((UINT16)(HFA384x_CMD_AINFO_GET((UINT16)(value) & HFA384x_CMD_WRITE))) #define HFA384x_CMD_WRITE_SET(value) ((UINT16)HFA384x_CMD_AINFO_SET((UINT16)value)) #define HFA384x_CMD_PROGMODE_GET(value) ((UINT16)(HFA384x_CMD_AINFO_GET((UINT16)(value) & HFA384x_CMD_PROGMODE))) #define HFA384x_CMD_PROGMODE_SET(value) ((UINT16)HFA384x_CMD_AINFO_SET((UINT16)value)) #define HFA384x_CMD_CMDCODE_GET(value) ((UINT16)(((UINT16)(value)) & HFA384x_CMD_CMDCODE)) #define HFA384x_CMD_CMDCODE_SET(value) ((UINT16)(value)) #define HFA384x_STATUS_RESULT_GET(value) ((UINT16)((((UINT16)(value)) & HFA384x_STATUS_RESULT) >> 8)) #define HFA384x_STATUS_RESULT_SET(value) (((UINT16)(value)) << 8) #define HFA384x_STATUS_CMDCODE_GET(value) (((UINT16)(value)) & HFA384x_STATUS_CMDCODE) #define HFA384x_STATUS_CMDCODE_SET(value) ((UINT16)(value)) #define HFA384x_OFFSET_ISBUSY(value) ((UINT16)(((UINT16)(value)) & HFA384x_OFFSET_BUSY)) #define HFA384x_OFFSET_ISERR(value) ((UINT16)(((UINT16)(value)) & HFA384x_OFFSET_ERR)) #define HFA384x_OFFSET_DATAOFF_GET(value) ((UINT16)(((UINT16)(value)) & HFA384x_OFFSET_DATAOFF)) #define HFA384x_OFFSET_DATAOFF_SET(value) ((UINT16)(value)) #define HFA384x_EVSTAT_ISTICK(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVSTAT_TICK)) #define HFA384x_EVSTAT_ISWTERR(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVSTAT_WTERR)) #define HFA384x_EVSTAT_ISINFDROP(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVSTAT_INFDROP)) #define HFA384x_EVSTAT_ISINFO(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVSTAT_INFO)) #define HFA384x_EVSTAT_ISDTIM(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVSTAT_DTIM)) #define HFA384x_EVSTAT_ISCMD(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVSTAT_CMD)) #define HFA384x_EVSTAT_ISALLOC(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVSTAT_ALLOC)) #define HFA384x_EVSTAT_ISTXEXC(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVSTAT_TXEXC)) #define HFA384x_EVSTAT_ISTX(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVSTAT_TX)) #define HFA384x_EVSTAT_ISRX(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVSTAT_RX)) #define HFA384x_EVSTAT_ISBAP_OP(value) ((UINT16)(((UINT16)(value)) & HFA384x_INT_BAP_OP)) #define HFA384x_INTEN_ISTICK(value) ((UINT16)(((UINT16)(value)) & HFA384x_INTEN_TICK)) #define HFA384x_INTEN_TICK_SET(value) ((UINT16)(((UINT16)(value)) << 15)) #define HFA384x_INTEN_ISWTERR(value) ((UINT16)(((UINT16)(value)) & HFA384x_INTEN_WTERR)) #define HFA384x_INTEN_WTERR_SET(value) ((UINT16)(((UINT16)(value)) << 14)) #define HFA384x_INTEN_ISINFDROP(value) ((UINT16)(((UINT16)(value)) & HFA384x_INTEN_INFDROP)) #define HFA384x_INTEN_INFDROP_SET(value) ((UINT16)(((UINT16)(value)) << 13)) #define HFA384x_INTEN_ISINFO(value) ((UINT16)(((UINT16)(value)) & HFA384x_INTEN_INFO)) #define HFA384x_INTEN_INFO_SET(value) ((UINT16)(((UINT16)(value)) << 7)) #define HFA384x_INTEN_ISDTIM(value) ((UINT16)(((UINT16)(value)) & HFA384x_INTEN_DTIM)) #define HFA384x_INTEN_DTIM_SET(value) ((UINT16)(((UINT16)(value)) << 5)) #define HFA384x_INTEN_ISCMD(value) ((UINT16)(((UINT16)(value)) & HFA384x_INTEN_CMD)) #define HFA384x_INTEN_CMD_SET(value) ((UINT16)(((UINT16)(value)) << 4)) #define HFA384x_INTEN_ISALLOC(value) ((UINT16)(((UINT16)(value)) & HFA384x_INTEN_ALLOC)) #define HFA384x_INTEN_ALLOC_SET(value) ((UINT16)(((UINT16)(value)) << 3)) #define HFA384x_INTEN_ISTXEXC(value) ((UINT16)(((UINT16)(value)) & HFA384x_INTEN_TXEXC)) #define HFA384x_INTEN_TXEXC_SET(value) ((UINT16)(((UINT16)(value)) << 2)) #define HFA384x_INTEN_ISTX(value) ((UINT16)(((UINT16)(value)) & HFA384x_INTEN_TX)) #define HFA384x_INTEN_TX_SET(value) ((UINT16)(((UINT16)(value)) << 1)) #define HFA384x_INTEN_ISRX(value) ((UINT16)(((UINT16)(value)) & HFA384x_INTEN_RX)) #define HFA384x_INTEN_RX_SET(value) ((UINT16)(((UINT16)(value)) << 0)) #define HFA384x_EVACK_ISTICK(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVACK_TICK)) #define HFA384x_EVACK_TICK_SET(value) ((UINT16)(((UINT16)(value)) << 15)) #define HFA384x_EVACK_ISWTERR(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVACK_WTERR)) #define HFA384x_EVACK_WTERR_SET(value) ((UINT16)(((UINT16)(value)) << 14)) #define HFA384x_EVACK_ISINFDROP(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVACK_INFDROP)) #define HFA384x_EVACK_INFDROP_SET(value) ((UINT16)(((UINT16)(value)) << 13)) #define HFA384x_EVACK_ISINFO(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVACK_INFO)) #define HFA384x_EVACK_INFO_SET(value) ((UINT16)(((UINT16)(value)) << 7)) #define HFA384x_EVACK_ISDTIM(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVACK_DTIM)) #define HFA384x_EVACK_DTIM_SET(value) ((UINT16)(((UINT16)(value)) << 5)) #define HFA384x_EVACK_ISCMD(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVACK_CMD)) #define HFA384x_EVACK_CMD_SET(value) ((UINT16)(((UINT16)(value)) << 4)) #define HFA384x_EVACK_ISALLOC(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVACK_ALLOC)) #define HFA384x_EVACK_ALLOC_SET(value) ((UINT16)(((UINT16)(value)) << 3)) #define HFA384x_EVACK_ISTXEXC(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVACK_TXEXC)) #define HFA384x_EVACK_TXEXC_SET(value) ((UINT16)(((UINT16)(value)) << 2)) #define HFA384x_EVACK_ISTX(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVACK_TX)) #define HFA384x_EVACK_TX_SET(value) ((UINT16)(((UINT16)(value)) << 1)) #define HFA384x_EVACK_ISRX(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVACK_RX)) #define HFA384x_EVACK_RX_SET(value) ((UINT16)(((UINT16)(value)) << 0)) #define HFA384x_CONTROL_AUXEN_SET(value) ((UINT16)(((UINT16)(value)) << 14)) #define HFA384x_CONTROL_AUXEN_GET(value) ((UINT16)(((UINT16)(value)) >> 14)) /* Byte Order */ #ifdef __KERNEL__ #define hfa384x2host_16(n) (__le16_to_cpu((UINT16)(n))) #define hfa384x2host_32(n) (__le32_to_cpu((UINT32)(n))) #define host2hfa384x_16(n) (__cpu_to_le16((UINT16)(n))) #define host2hfa384x_32(n) (__cpu_to_le32((UINT32)(n))) #endif /* Host Maintained State Info */ #define HFA384x_STATE_PREINIT 0 #define HFA384x_STATE_INIT 1 #define HFA384x_STATE_RUNNING 2 /*=============================================================*/ /*------ Types and their related constants --------------------*/ #define HFA384x_HOSTAUTHASSOC_HOSTAUTH BIT0 #define HFA384x_HOSTAUTHASSOC_HOSTASSOC BIT1 #define HFA384x_WHAHANDLING_DISABLED 0 #define HFA384x_WHAHANDLING_PASSTHROUGH BIT1 /*-------------------------------------------------------------*/ /* Commonly used basic types */ typedef struct hfa384x_bytestr { UINT16 len; UINT8 data[0]; } __WLAN_ATTRIB_PACK__ hfa384x_bytestr_t; typedef struct hfa384x_bytestr32 { UINT16 len; UINT8 data[32]; } __WLAN_ATTRIB_PACK__ hfa384x_bytestr32_t; /*-------------------------------------------------------------------- Configuration Record Structures: Network Parameters, Static Configuration Entities --------------------------------------------------------------------*/ /* Prototype structure: all configuration record structures start with these members */ typedef struct hfa384x_record { UINT16 reclen; UINT16 rid; } __WLAN_ATTRIB_PACK__ hfa384x_rec_t; typedef struct hfa384x_record16 { UINT16 reclen; UINT16 rid; UINT16 val; } __WLAN_ATTRIB_PACK__ hfa384x_rec16_t; typedef struct hfa384x_record32 { UINT16 reclen; UINT16 rid; UINT32 val; } __WLAN_ATTRIB_PACK__ hfa384x_rec32; /*-- Hardware/Firmware Component Information ----------*/ typedef struct hfa384x_compident { UINT16 id; UINT16 variant; UINT16 major; UINT16 minor; } __WLAN_ATTRIB_PACK__ hfa384x_compident_t; typedef struct hfa384x_caplevel { UINT16 role; UINT16 id; UINT16 variant; UINT16 bottom; UINT16 top; } __WLAN_ATTRIB_PACK__ hfa384x_caplevel_t; /*-- Configuration Record: cnfPortType --*/ typedef struct hfa384x_cnfPortType { UINT16 cnfPortType; } __WLAN_ATTRIB_PACK__ hfa384x_cnfPortType_t; /*-- Configuration Record: cnfOwnMACAddress --*/ typedef struct hfa384x_cnfOwnMACAddress { UINT8 cnfOwnMACAddress[6]; } __WLAN_ATTRIB_PACK__ hfa384x_cnfOwnMACAddress_t; /*-- Configuration Record: cnfDesiredSSID --*/ typedef struct hfa384x_cnfDesiredSSID { UINT8 cnfDesiredSSID[34]; } __WLAN_ATTRIB_PACK__ hfa384x_cnfDesiredSSID_t; /*-- Configuration Record: cnfOwnChannel --*/ typedef struct hfa384x_cnfOwnChannel { UINT16 cnfOwnChannel; } __WLAN_ATTRIB_PACK__ hfa384x_cnfOwnChannel_t; /*-- Configuration Record: cnfOwnSSID --*/ typedef struct hfa384x_cnfOwnSSID { UINT8 cnfOwnSSID[34]; } __WLAN_ATTRIB_PACK__ hfa384x_cnfOwnSSID_t; /*-- Configuration Record: cnfOwnATIMWindow --*/ typedef struct hfa384x_cnfOwnATIMWindow { UINT16 cnfOwnATIMWindow; } __WLAN_ATTRIB_PACK__ hfa384x_cnfOwnATIMWindow_t; /*-- Configuration Record: cnfSystemScale --*/ typedef struct hfa384x_cnfSystemScale { UINT16 cnfSystemScale; } __WLAN_ATTRIB_PACK__ hfa384x_cnfSystemScale_t; /*-- Configuration Record: cnfMaxDataLength --*/ typedef struct hfa384x_cnfMaxDataLength { UINT16 cnfMaxDataLength; } __WLAN_ATTRIB_PACK__ hfa384x_cnfMaxDataLength_t; /*-- Configuration Record: cnfWDSAddress --*/ typedef struct hfa384x_cnfWDSAddress { UINT8 cnfWDSAddress[6]; } __WLAN_ATTRIB_PACK__ hfa384x_cnfWDSAddress_t; /*-- Configuration Record: cnfPMEnabled --*/ typedef struct hfa384x_cnfPMEnabled { UINT16 cnfPMEnabled; } __WLAN_ATTRIB_PACK__ hfa384x_cnfPMEnabled_t; /*-- Configuration Record: cnfPMEPS --*/ typedef struct hfa384x_cnfPMEPS { UINT16 cnfPMEPS; } __WLAN_ATTRIB_PACK__ hfa384x_cnfPMEPS_t; /*-- Configuration Record: cnfMulticastReceive --*/ typedef struct hfa384x_cnfMulticastReceive { UINT16 cnfMulticastReceive; } __WLAN_ATTRIB_PACK__ hfa384x_cnfMulticastReceive_t; /*-- Configuration Record: cnfAuthentication --*/ #define HFA384x_CNFAUTHENTICATION_OPENSYSTEM 0x0001 #define HFA384x_CNFAUTHENTICATION_SHAREDKEY 0x0002 #define HFA384x_CNFAUTHENTICATION_LEAP 0x0004 /*-- Configuration Record: cnfMaxSleepDuration --*/ typedef struct hfa384x_cnfMaxSleepDuration { UINT16 cnfMaxSleepDuration; } __WLAN_ATTRIB_PACK__ hfa384x_cnfMaxSleepDuration_t; /*-- Configuration Record: cnfPMHoldoverDuration --*/ typedef struct hfa384x_cnfPMHoldoverDuration { UINT16 cnfPMHoldoverDuration; } __WLAN_ATTRIB_PACK__ hfa384x_cnfPMHoldoverDuration_t; /*-- Configuration Record: cnfOwnName --*/ typedef struct hfa384x_cnfOwnName { UINT8 cnfOwnName[34]; } __WLAN_ATTRIB_PACK__ hfa384x_cnfOwnName_t; /*-- Configuration Record: cnfOwnDTIMPeriod --*/ typedef struct hfa384x_cnfOwnDTIMPeriod { UINT16 cnfOwnDTIMPeriod; } __WLAN_ATTRIB_PACK__ hfa384x_cnfOwnDTIMPeriod_t; /*-- Configuration Record: cnfWDSAddress --*/ typedef struct hfa384x_cnfWDSAddressN { UINT8 cnfWDSAddress[6]; } __WLAN_ATTRIB_PACK__ hfa384x_cnfWDSAddressN_t; /*-- Configuration Record: cnfMulticastPMBuffering --*/ typedef struct hfa384x_cnfMulticastPMBuffering { UINT16 cnfMulticastPMBuffering; } __WLAN_ATTRIB_PACK__ hfa384x_cnfMulticastPMBuffering_t; /*-------------------------------------------------------------------- Configuration Record Structures: Network Parameters, Dynamic Configuration Entities --------------------------------------------------------------------*/ /*-- Configuration Record: GroupAddresses --*/ typedef struct hfa384x_GroupAddresses { UINT8 MACAddress[16][6]; } __WLAN_ATTRIB_PACK__ hfa384x_GroupAddresses_t; /*-- Configuration Record: CreateIBSS --*/ typedef struct hfa384x_CreateIBSS { UINT16 CreateIBSS; } __WLAN_ATTRIB_PACK__ hfa384x_CreateIBSS_t; #define HFA384x_CREATEIBSS_JOINCREATEIBSS 0 #define HFA384x_CREATEIBSS_JOINESS_JOINCREATEIBSS 1 #define HFA384x_CREATEIBSS_JOINIBSS 2 #define HFA384x_CREATEIBSS_JOINESS_JOINIBSS 3 /*-- Configuration Record: FragmentationThreshold --*/ typedef struct hfa384x_FragmentationThreshold { UINT16 FragmentationThreshold; } __WLAN_ATTRIB_PACK__ hfa384x_FragmentationThreshold_t; /*-- Configuration Record: RTSThreshold --*/ typedef struct hfa384x_RTSThreshold { UINT16 RTSThreshold; } __WLAN_ATTRIB_PACK__ hfa384x_RTSThreshold_t; /*-- Configuration Record: TxRateControl --*/ typedef struct hfa384x_TxRateControl { UINT16 TxRateControl; } __WLAN_ATTRIB_PACK__ hfa384x_TxRateControl_t; /*-- Configuration Record: PromiscuousMode --*/ typedef struct hfa384x_PromiscuousMode { UINT16 PromiscuousMode; } __WLAN_ATTRIB_PACK__ hfa384x_PromiscuousMode_t; /*-- Configuration Record: ScanRequest (data portion only) --*/ typedef struct hfa384x_ScanRequest_data { UINT16 channelList; UINT16 txRate; } __WLAN_ATTRIB_PACK__ hfa384x_ScanRequest_data_t; /*-- Configuration Record: HostScanRequest (data portion only) --*/ typedef struct hfa384x_HostScanRequest_data { UINT16 channelList; UINT16 txRate; hfa384x_bytestr32_t ssid; } __WLAN_ATTRIB_PACK__ hfa384x_HostScanRequest_data_t; /*-- Configuration Record: JoinRequest (data portion only) --*/ typedef struct hfa384x_JoinRequest_data { UINT8 bssid[WLAN_BSSID_LEN]; UINT16 channel; } __WLAN_ATTRIB_PACK__ hfa384x_JoinRequest_data_t; /*-- Configuration Record: authenticateStation (data portion only) --*/ typedef struct hfa384x_authenticateStation_data { UINT8 address[WLAN_ADDR_LEN]; UINT16 status; UINT16 algorithm; } __WLAN_ATTRIB_PACK__ hfa384x_authenticateStation_data_t; /*-- Configuration Record: associateStation (data portion only) --*/ typedef struct hfa384x_associateStation_data { UINT8 address[WLAN_ADDR_LEN]; UINT16 status; UINT16 type; } __WLAN_ATTRIB_PACK__ hfa384x_associateStation_data_t; /*-- Configuration Record: ChannelInfoRequest (data portion only) --*/ typedef struct hfa384x_ChannelInfoRequest_data { UINT16 channelList; UINT16 channelDwellTime; } __WLAN_ATTRIB_PACK__ hfa384x_ChannelInfoRequest_data_t; /*-- Configuration Record: WEPKeyMapping (data portion only) --*/ typedef struct hfa384x_WEPKeyMapping { UINT8 address[WLAN_ADDR_LEN]; UINT16 key_index; UINT8 key[16]; UINT8 mic_transmit_key[4]; UINT8 mic_receive_key[4]; } __WLAN_ATTRIB_PACK__ hfa384x_WEPKeyMapping_t; /*-- Configuration Record: WPAData (data portion only) --*/ typedef struct hfa384x_WPAData { UINT16 datalen; UINT8 data[0]; // max 80 } __WLAN_ATTRIB_PACK__ hfa384x_WPAData_t; /*-------------------------------------------------------------------- Configuration Record Structures: Behavior Parameters --------------------------------------------------------------------*/ /*-- Configuration Record: TickTime --*/ typedef struct hfa384x_TickTime { UINT16 TickTime; } __WLAN_ATTRIB_PACK__ hfa384x_TickTime_t; /*-------------------------------------------------------------------- Information Record Structures: NIC Information --------------------------------------------------------------------*/ /*-- Information Record: MaxLoadTime --*/ typedef struct hfa384x_MaxLoadTime { UINT16 MaxLoadTime; } __WLAN_ATTRIB_PACK__ hfa384x_MaxLoadTime_t; /*-- Information Record: DownLoadBuffer --*/ /* NOTE: The page and offset are in AUX format */ typedef struct hfa384x_downloadbuffer { UINT16 page; UINT16 offset; UINT16 len; } __WLAN_ATTRIB_PACK__ hfa384x_downloadbuffer_t; /*-- Information Record: PRIIdentity --*/ typedef struct hfa384x_PRIIdentity { UINT16 PRICompID; UINT16 PRIVariant; UINT16 PRIMajorVersion; UINT16 PRIMinorVersion; } __WLAN_ATTRIB_PACK__ hfa384x_PRIIdentity_t; /*-- Information Record: PRISupRange --*/ typedef struct hfa384x_PRISupRange { UINT16 PRIRole; UINT16 PRIID; UINT16 PRIVariant; UINT16 PRIBottom; UINT16 PRITop; } __WLAN_ATTRIB_PACK__ hfa384x_PRISupRange_t; /*-- Information Record: CFIActRanges --*/ typedef struct hfa384x_CFIActRanges { UINT16 CFIRole; UINT16 CFIID; UINT16 CFIVariant; UINT16 CFIBottom; UINT16 CFITop; } __WLAN_ATTRIB_PACK__ hfa384x_CFIActRanges_t; /*-- Information Record: NICSerialNumber --*/ typedef struct hfa384x_NICSerialNumber { UINT8 NICSerialNumber[12]; } __WLAN_ATTRIB_PACK__ hfa384x_NICSerialNumber_t; /*-- Information Record: NICIdentity --*/ typedef struct hfa384x_NICIdentity { UINT16 NICCompID; UINT16 NICVariant; UINT16 NICMajorVersion; UINT16 NICMinorVersion; } __WLAN_ATTRIB_PACK__ hfa384x_NICIdentity_t; /*-- Information Record: MFISupRange --*/ typedef struct hfa384x_MFISupRange { UINT16 MFIRole; UINT16 MFIID; UINT16 MFIVariant; UINT16 MFIBottom; UINT16 MFITop; } __WLAN_ATTRIB_PACK__ hfa384x_MFISupRange_t; /*-- Information Record: CFISupRange --*/ typedef struct hfa384x_CFISupRange { UINT16 CFIRole; UINT16 CFIID; UINT16 CFIVariant; UINT16 CFIBottom; UINT16 CFITop; } __WLAN_ATTRIB_PACK__ hfa384x_CFISupRange_t; /*-- Information Record: BUILDSEQ:BuildSeq --*/ typedef struct hfa384x_BuildSeq { UINT16 primary; UINT16 secondary; } __WLAN_ATTRIB_PACK__ hfa384x_BuildSeq_t; /*-- Information Record: FWID --*/ #define HFA384x_FWID_LEN 14 typedef struct hfa384x_FWID { UINT8 primary[HFA384x_FWID_LEN]; UINT8 secondary[HFA384x_FWID_LEN]; } __WLAN_ATTRIB_PACK__ hfa384x_FWID_t; /*-- Information Record: ChannelList --*/ typedef struct hfa384x_ChannelList { UINT16 ChannelList; } __WLAN_ATTRIB_PACK__ hfa384x_ChannelList_t; /*-- Information Record: RegulatoryDomains --*/ typedef struct hfa384x_RegulatoryDomains { UINT8 RegulatoryDomains[12]; } __WLAN_ATTRIB_PACK__ hfa384x_RegulatoryDomains_t; /*-- Information Record: TempType --*/ typedef struct hfa384x_TempType { UINT16 TempType; } __WLAN_ATTRIB_PACK__ hfa384x_TempType_t; /*-- Information Record: CIS --*/ typedef struct hfa384x_CIS { UINT8 CIS[480]; } __WLAN_ATTRIB_PACK__ hfa384x_CIS_t; /*-- Information Record: STAIdentity --*/ typedef struct hfa384x_STAIdentity { UINT16 STACompID; UINT16 STAVariant; UINT16 STAMajorVersion; UINT16 STAMinorVersion; } __WLAN_ATTRIB_PACK__ hfa384x_STAIdentity_t; /*-- Information Record: STASupRange --*/ typedef struct hfa384x_STASupRange { UINT16 STARole; UINT16 STAID; UINT16 STAVariant; UINT16 STABottom; UINT16 STATop; } __WLAN_ATTRIB_PACK__ hfa384x_STASupRange_t; /*-- Information Record: MFIActRanges --*/ typedef struct hfa384x_MFIActRanges { UINT16 MFIRole; UINT16 MFIID; UINT16 MFIVariant; UINT16 MFIBottom; UINT16 MFITop; } __WLAN_ATTRIB_PACK__ hfa384x_MFIActRanges_t; /*-------------------------------------------------------------------- Information Record Structures: NIC Information --------------------------------------------------------------------*/ /*-- Information Record: PortStatus --*/ typedef struct hfa384x_PortStatus { UINT16 PortStatus; } __WLAN_ATTRIB_PACK__ hfa384x_PortStatus_t; #define HFA384x_PSTATUS_DISABLED ((UINT16)1) #define HFA384x_PSTATUS_SEARCHING ((UINT16)2) #define HFA384x_PSTATUS_CONN_IBSS ((UINT16)3) #define HFA384x_PSTATUS_CONN_ESS ((UINT16)4) #define HFA384x_PSTATUS_OUTOFRANGE ((UINT16)5) #define HFA384x_PSTATUS_CONN_WDS ((UINT16)6) /*-- Information Record: CurrentSSID --*/ typedef struct hfa384x_CurrentSSID { UINT8 CurrentSSID[34]; } __WLAN_ATTRIB_PACK__ hfa384x_CurrentSSID_t; /*-- Information Record: CurrentBSSID --*/ typedef struct hfa384x_CurrentBSSID { UINT8 CurrentBSSID[6]; } __WLAN_ATTRIB_PACK__ hfa384x_CurrentBSSID_t; /*-- Information Record: commsquality --*/ typedef struct hfa384x_commsquality { UINT16 CQ_currBSS; UINT16 ASL_currBSS; UINT16 ANL_currFC; } __WLAN_ATTRIB_PACK__ hfa384x_commsquality_t; /*-- Information Record: dmbcommsquality --*/ typedef struct hfa384x_dbmcommsquality { UINT16 CQdbm_currBSS; UINT16 ASLdbm_currBSS; UINT16 ANLdbm_currFC; } __WLAN_ATTRIB_PACK__ hfa384x_dbmcommsquality_t; /*-- Information Record: CurrentTxRate --*/ typedef struct hfa384x_CurrentTxRate { UINT16 CurrentTxRate; } __WLAN_ATTRIB_PACK__ hfa384x_CurrentTxRate_t; /*-- Information Record: CurrentBeaconInterval --*/ typedef struct hfa384x_CurrentBeaconInterval { UINT16 CurrentBeaconInterval; } __WLAN_ATTRIB_PACK__ hfa384x_CurrentBeaconInterval_t; /*-- Information Record: CurrentScaleThresholds --*/ typedef struct hfa384x_CurrentScaleThresholds { UINT16 EnergyDetectThreshold; UINT16 CarrierDetectThreshold; UINT16 DeferDetectThreshold; UINT16 CellSearchThreshold; /* Stations only */ UINT16 DeadSpotThreshold; /* Stations only */ } __WLAN_ATTRIB_PACK__ hfa384x_CurrentScaleThresholds_t; /*-- Information Record: ProtocolRspTime --*/ typedef struct hfa384x_ProtocolRspTime { UINT16 ProtocolRspTime; } __WLAN_ATTRIB_PACK__ hfa384x_ProtocolRspTime_t; /*-- Information Record: ShortRetryLimit --*/ typedef struct hfa384x_ShortRetryLimit { UINT16 ShortRetryLimit; } __WLAN_ATTRIB_PACK__ hfa384x_ShortRetryLimit_t; /*-- Information Record: LongRetryLimit --*/ typedef struct hfa384x_LongRetryLimit { UINT16 LongRetryLimit; } __WLAN_ATTRIB_PACK__ hfa384x_LongRetryLimit_t; /*-- Information Record: MaxTransmitLifetime --*/ typedef struct hfa384x_MaxTransmitLifetime { UINT16 MaxTransmitLifetime; } __WLAN_ATTRIB_PACK__ hfa384x_MaxTransmitLifetime_t; /*-- Information Record: MaxReceiveLifetime --*/ typedef struct hfa384x_MaxReceiveLifetime { UINT16 MaxReceiveLifetime; } __WLAN_ATTRIB_PACK__ hfa384x_MaxReceiveLifetime_t; /*-- Information Record: CFPollable --*/ typedef struct hfa384x_CFPollable { UINT16 CFPollable; } __WLAN_ATTRIB_PACK__ hfa384x_CFPollable_t; /*-- Information Record: AuthenticationAlgorithms --*/ typedef struct hfa384x_AuthenticationAlgorithms { UINT16 AuthenticationType; UINT16 TypeEnabled; } __WLAN_ATTRIB_PACK__ hfa384x_AuthenticationAlgorithms_t; /*-- Information Record: AuthenticationAlgorithms (data only --*/ typedef struct hfa384x_AuthenticationAlgorithms_data { UINT16 AuthenticationType; UINT16 TypeEnabled; } __WLAN_ATTRIB_PACK__ hfa384x_AuthenticationAlgorithms_data_t; /*-- Information Record: PrivacyOptionImplemented --*/ typedef struct hfa384x_PrivacyOptionImplemented { UINT16 PrivacyOptionImplemented; } __WLAN_ATTRIB_PACK__ hfa384x_PrivacyOptionImplemented_t; /*-- Information Record: OwnMACAddress --*/ typedef struct hfa384x_OwnMACAddress { UINT8 OwnMACAddress[6]; } __WLAN_ATTRIB_PACK__ hfa384x_OwnMACAddress_t; /*-- Information Record: PCFInfo --*/ typedef struct hfa384x_PCFInfo { UINT16 MediumOccupancyLimit; UINT16 CFPPeriod; UINT16 CFPMaxDuration; UINT16 CFPFlags; } __WLAN_ATTRIB_PACK__ hfa384x_PCFInfo_t; /*-- Information Record: PCFInfo (data portion only) --*/ typedef struct hfa384x_PCFInfo_data { UINT16 MediumOccupancyLimit; UINT16 CFPPeriod; UINT16 CFPMaxDuration; UINT16 CFPFlags; } __WLAN_ATTRIB_PACK__ hfa384x_PCFInfo_data_t; /*-------------------------------------------------------------------- Information Record Structures: Modem Information Records --------------------------------------------------------------------*/ /*-- Information Record: PHYType --*/ typedef struct hfa384x_PHYType { UINT16 PHYType; } __WLAN_ATTRIB_PACK__ hfa384x_PHYType_t; /*-- Information Record: CurrentChannel --*/ typedef struct hfa384x_CurrentChannel { UINT16 CurrentChannel; } __WLAN_ATTRIB_PACK__ hfa384x_CurrentChannel_t; /*-- Information Record: CurrentPowerState --*/ typedef struct hfa384x_CurrentPowerState { UINT16 CurrentPowerState; } __WLAN_ATTRIB_PACK__ hfa384x_CurrentPowerState_t; /*-- Information Record: CCAMode --*/ typedef struct hfa384x_CCAMode { UINT16 CCAMode; } __WLAN_ATTRIB_PACK__ hfa384x_CCAMode_t; /*-- Information Record: SupportedDataRates --*/ typedef struct hfa384x_SupportedDataRates { UINT8 SupportedDataRates[10]; } __WLAN_ATTRIB_PACK__ hfa384x_SupportedDataRates_t; /*-- Information Record: LFOStatus --*/ typedef struct hfa384x_LFOStatus { UINT16 TestResults; UINT16 LFOResult; UINT16 VRHFOResult; } __WLAN_ATTRIB_PACK__ hfa384x_LFOStatus_t; #define HFA384x_TESTRESULT_ALLPASSED BIT0 #define HFA384x_TESTRESULT_LFO_FAIL BIT1 #define HFA384x_TESTRESULT_VR_HF0_FAIL BIT2 #define HFA384x_HOST_FIRM_COORDINATE BIT7 #define HFA384x_TESTRESULT_COORDINATE BIT15 /*-- Information Record: LEDControl --*/ typedef struct hfa384x_LEDControl { UINT16 searching_on; UINT16 searching_off; UINT16 assoc_on; UINT16 assoc_off; UINT16 activity; } __WLAN_ATTRIB_PACK__ hfa384x_LEDControl_t; /*-------------------------------------------------------------------- FRAME DESCRIPTORS AND FRAME STRUCTURES FRAME DESCRIPTORS: Offsets ---------------------------------------------------------------------- Control Info (offset 44-51) --------------------------------------------------------------------*/ #define HFA384x_FD_STATUS_OFF ((UINT16)0x44) #define HFA384x_FD_TIME_OFF ((UINT16)0x46) #define HFA384x_FD_SWSUPPORT_OFF ((UINT16)0x4A) #define HFA384x_FD_SILENCE_OFF ((UINT16)0x4A) #define HFA384x_FD_SIGNAL_OFF ((UINT16)0x4B) #define HFA384x_FD_RATE_OFF ((UINT16)0x4C) #define HFA384x_FD_RXFLOW_OFF ((UINT16)0x4D) #define HFA384x_FD_RESERVED_OFF ((UINT16)0x4E) #define HFA384x_FD_TXCONTROL_OFF ((UINT16)0x50) /*-------------------------------------------------------------------- 802.11 Header (offset 52-6B) --------------------------------------------------------------------*/ #define HFA384x_FD_FRAMECONTROL_OFF ((UINT16)0x52) #define HFA384x_FD_DURATIONID_OFF ((UINT16)0x54) #define HFA384x_FD_ADDRESS1_OFF ((UINT16)0x56) #define HFA384x_FD_ADDRESS2_OFF ((UINT16)0x5C) #define HFA384x_FD_ADDRESS3_OFF ((UINT16)0x62) #define HFA384x_FD_SEQCONTROL_OFF ((UINT16)0x68) #define HFA384x_FD_ADDRESS4_OFF ((UINT16)0x6A) #define HFA384x_FD_DATALEN_OFF ((UINT16)0x70) /*-------------------------------------------------------------------- 802.3 Header (offset 72-7F) --------------------------------------------------------------------*/ #define HFA384x_FD_DESTADDRESS_OFF ((UINT16)0x72) #define HFA384x_FD_SRCADDRESS_OFF ((UINT16)0x78) #define HFA384x_FD_DATALENGTH_OFF ((UINT16)0x7E) /*-------------------------------------------------------------------- FRAME STRUCTURES: Communication Frames ---------------------------------------------------------------------- Communication Frames: Transmit Frames --------------------------------------------------------------------*/ /*-- Communication Frame: Transmit Frame Structure --*/ typedef struct hfa384x_tx_frame { UINT16 status; UINT16 reserved1; UINT16 reserved2; UINT32 sw_support; UINT8 tx_retrycount; UINT8 tx_rate; UINT16 tx_control; /*-- 802.11 Header Information --*/ UINT16 frame_control; UINT16 duration_id; UINT8 address1[6]; UINT8 address2[6]; UINT8 address3[6]; UINT16 sequence_control; UINT8 address4[6]; UINT16 data_len; /* little endian format */ /*-- 802.3 Header Information --*/ UINT8 dest_addr[6]; UINT8 src_addr[6]; UINT16 data_length; /* big endian format */ } __WLAN_ATTRIB_PACK__ hfa384x_tx_frame_t; /*-------------------------------------------------------------------- Communication Frames: Field Masks for Transmit Frames --------------------------------------------------------------------*/ /*-- Status Field --*/ #define HFA384x_TXSTATUS_ACKERR ((UINT16)BIT5) #define HFA384x_TXSTATUS_FORMERR ((UINT16)BIT3) #define HFA384x_TXSTATUS_DISCON ((UINT16)BIT2) #define HFA384x_TXSTATUS_AGEDERR ((UINT16)BIT1) #define HFA384x_TXSTATUS_RETRYERR ((UINT16)BIT0) /*-- Transmit Control Field --*/ #define HFA384x_TX_CFPOLL ((UINT16)BIT12) #define HFA384x_TX_PRST ((UINT16)BIT11) #define HFA384x_TX_MACPORT ((UINT16)(BIT10 | BIT9 | BIT8)) #define HFA384x_TX_NOENCRYPT ((UINT16)BIT7) #define HFA384x_TX_RETRYSTRAT ((UINT16)(BIT6 | BIT5)) #define HFA384x_TX_STRUCTYPE ((UINT16)(BIT4 | BIT3)) #define HFA384x_TX_TXEX ((UINT16)BIT2) #define HFA384x_TX_TXOK ((UINT16)BIT1) /*-------------------------------------------------------------------- Communication Frames: Test/Get/Set Field Values for Transmit Frames --------------------------------------------------------------------*/ /*-- Status Field --*/ #define HFA384x_TXSTATUS_ISERROR(v) \ (((UINT16)(v))&\ (HFA384x_TXSTATUS_ACKERR|HFA384x_TXSTATUS_FORMERR|\ HFA384x_TXSTATUS_DISCON|HFA384x_TXSTATUS_AGEDERR|\ HFA384x_TXSTATUS_RETRYERR)) #define HFA384x_TXSTATUS_ISACKERR(v) ((UINT16)(((UINT16)(v)) & HFA384x_TXSTATUS_ACKERR)) #define HFA384x_TXSTATUS_ISFORMERR(v) ((UINT16)(((UINT16)(v)) & HFA384x_TXSTATUS_FORMERR)) #define HFA384x_TXSTATUS_ISDISCON(v) ((UINT16)(((UINT16)(v)) & HFA384x_TXSTATUS_DISCON)) #define HFA384x_TXSTATUS_ISAGEDERR(v) ((UINT16)(((UINT16)(v)) & HFA384x_TXSTATUS_AGEDERR)) #define HFA384x_TXSTATUS_ISRETRYERR(v) ((UINT16)(((UINT16)(v)) & HFA384x_TXSTATUS_RETRYERR)) #define HFA384x_TX_GET(v,m,s) ((((UINT16)(v))&((UINT16)(m)))>>((UINT16)(s))) #define HFA384x_TX_SET(v,m,s) ((((UINT16)(v))<<((UINT16)(s)))&((UINT16)(m))) #define HFA384x_TX_CFPOLL_GET(v) HFA384x_TX_GET(v, HFA384x_TX_CFPOLL,12) #define HFA384x_TX_CFPOLL_SET(v) HFA384x_TX_SET(v, HFA384x_TX_CFPOLL,12) #define HFA384x_TX_PRST_GET(v) HFA384x_TX_GET(v, HFA384x_TX_PRST,11) #define HFA384x_TX_PRST_SET(v) HFA384x_TX_SET(v, HFA384x_TX_PRST,11) #define HFA384x_TX_MACPORT_GET(v) HFA384x_TX_GET(v, HFA384x_TX_MACPORT, 8) #define HFA384x_TX_MACPORT_SET(v) HFA384x_TX_SET(v, HFA384x_TX_MACPORT, 8) #define HFA384x_TX_NOENCRYPT_GET(v) HFA384x_TX_GET(v, HFA384x_TX_NOENCRYPT, 7) #define HFA384x_TX_NOENCRYPT_SET(v) HFA384x_TX_SET(v, HFA384x_TX_NOENCRYPT, 7) #define HFA384x_TX_RETRYSTRAT_GET(v) HFA384x_TX_GET(v, HFA384x_TX_RETRYSTRAT, 5) #define HFA384x_TX_RETRYSTRAT_SET(v) HFA384x_TX_SET(v, HFA384x_TX_RETRYSTRAT, 5) #define HFA384x_TX_STRUCTYPE_GET(v) HFA384x_TX_GET(v, HFA384x_TX_STRUCTYPE, 3) #define HFA384x_TX_STRUCTYPE_SET(v) HFA384x_TX_SET(v, HFA384x_TX_STRUCTYPE, 3) #define HFA384x_TX_TXEX_GET(v) HFA384x_TX_GET(v, HFA384x_TX_TXEX, 2) #define HFA384x_TX_TXEX_SET(v) HFA384x_TX_SET(v, HFA384x_TX_TXEX, 2) #define HFA384x_TX_TXOK_GET(v) HFA384x_TX_GET(v, HFA384x_TX_TXOK, 1) #define HFA384x_TX_TXOK_SET(v) HFA384x_TX_SET(v, HFA384x_TX_TXOK, 1) /*-------------------------------------------------------------------- Communication Frames: Receive Frames --------------------------------------------------------------------*/ /*-- Communication Frame: Receive Frame Structure --*/ typedef struct hfa384x_rx_frame { /*-- MAC rx descriptor (hfa384x byte order) --*/ UINT16 status; UINT32 time; UINT8 silence; UINT8 signal; UINT8 rate; UINT8 rx_flow; UINT16 reserved1; UINT16 reserved2; /*-- 802.11 Header Information (802.11 byte order) --*/ UINT16 frame_control; UINT16 duration_id; UINT8 address1[6]; UINT8 address2[6]; UINT8 address3[6]; UINT16 sequence_control; UINT8 address4[6]; UINT16 data_len; /* hfa384x (little endian) format */ /*-- 802.3 Header Information --*/ UINT8 dest_addr[6]; UINT8 src_addr[6]; UINT16 data_length; /* IEEE? (big endian) format */ } __WLAN_ATTRIB_PACK__ hfa384x_rx_frame_t; /*-------------------------------------------------------------------- Communication Frames: Field Masks for Receive Frames --------------------------------------------------------------------*/ /*-- Offsets --------*/ #define HFA384x_RX_DATA_LEN_OFF ((UINT16)44) #define HFA384x_RX_80211HDR_OFF ((UINT16)14) #define HFA384x_RX_DATA_OFF ((UINT16)60) /*-- Status Fields --*/ #define HFA384x_RXSTATUS_MSGTYPE ((UINT16)(BIT15 | BIT14 | BIT13)) #define HFA384x_RXSTATUS_MACPORT ((UINT16)(BIT10 | BIT9 | BIT8)) #define HFA384x_RXSTATUS_UNDECR ((UINT16)BIT1) #define HFA384x_RXSTATUS_FCSERR ((UINT16)BIT0) /*-------------------------------------------------------------------- Communication Frames: Test/Get/Set Field Values for Receive Frames --------------------------------------------------------------------*/ #define HFA384x_RXSTATUS_MSGTYPE_GET(value) ((UINT16)((((UINT16)(value)) & HFA384x_RXSTATUS_MSGTYPE) >> 13)) #define HFA384x_RXSTATUS_MSGTYPE_SET(value) ((UINT16)(((UINT16)(value)) << 13)) #define HFA384x_RXSTATUS_MACPORT_GET(value) ((UINT16)((((UINT16)(value)) & HFA384x_RXSTATUS_MACPORT) >> 8)) #define HFA384x_RXSTATUS_MACPORT_SET(value) ((UINT16)(((UINT16)(value)) << 8)) #define HFA384x_RXSTATUS_ISUNDECR(value) ((UINT16)(((UINT16)(value)) & HFA384x_RXSTATUS_UNDECR)) #define HFA384x_RXSTATUS_ISFCSERR(value) ((UINT16)(((UINT16)(value)) & HFA384x_RXSTATUS_FCSERR)) /*-------------------------------------------------------------------- FRAME STRUCTURES: Information Types and Information Frame Structures ---------------------------------------------------------------------- Information Types --------------------------------------------------------------------*/ #define HFA384x_IT_HANDOVERADDR ((UINT16)0xF000UL) #define HFA384x_IT_HANDOVERDEAUTHADDRESS ((UINT16)0xF001UL)//AP 1.3.7 #define HFA384x_IT_COMMTALLIES ((UINT16)0xF100UL) #define HFA384x_IT_SCANRESULTS ((UINT16)0xF101UL) #define HFA384x_IT_CHINFORESULTS ((UINT16)0xF102UL) #define HFA384x_IT_HOSTSCANRESULTS ((UINT16)0xF103UL) #define HFA384x_IT_LINKSTATUS ((UINT16)0xF200UL) #define HFA384x_IT_ASSOCSTATUS ((UINT16)0xF201UL) #define HFA384x_IT_AUTHREQ ((UINT16)0xF202UL) #define HFA384x_IT_PSUSERCNT ((UINT16)0xF203UL) #define HFA384x_IT_KEYIDCHANGED ((UINT16)0xF204UL) #define HFA384x_IT_ASSOCREQ ((UINT16)0xF205UL) #define HFA384x_IT_MICFAILURE ((UINT16)0xF206UL) /*-------------------------------------------------------------------- Information Frames Structures ---------------------------------------------------------------------- Information Frames: Notification Frame Structures --------------------------------------------------------------------*/ /*-- Notification Frame,MAC Mgmt: Handover Address --*/ typedef struct hfa384x_HandoverAddr { UINT16 framelen; UINT16 infotype; UINT8 handover_addr[WLAN_BSSID_LEN]; } __WLAN_ATTRIB_PACK__ hfa384x_HandoverAddr_t; /*-- Inquiry Frame, Diagnose: Communication Tallies --*/ typedef struct hfa384x_CommTallies16 { UINT16 txunicastframes; UINT16 txmulticastframes; UINT16 txfragments; UINT16 txunicastoctets; UINT16 txmulticastoctets; UINT16 txdeferredtrans; UINT16 txsingleretryframes; UINT16 txmultipleretryframes; UINT16 txretrylimitexceeded; UINT16 txdiscards; UINT16 rxunicastframes; UINT16 rxmulticastframes; UINT16 rxfragments; UINT16 rxunicastoctets; UINT16 rxmulticastoctets; UINT16 rxfcserrors; UINT16 rxdiscardsnobuffer; UINT16 txdiscardswrongsa; UINT16 rxdiscardswepundecr; UINT16 rxmsginmsgfrag; UINT16 rxmsginbadmsgfrag; } __WLAN_ATTRIB_PACK__ hfa384x_CommTallies16_t; typedef struct hfa384x_CommTallies32 { UINT32 txunicastframes; UINT32 txmulticastframes; UINT32 txfragments; UINT32 txunicastoctets; UINT32 txmulticastoctets; UINT32 txdeferredtrans; UINT32 txsingleretryframes; UINT32 txmultipleretryframes; UINT32 txretrylimitexceeded; UINT32 txdiscards; UINT32 rxunicastframes; UINT32 rxmulticastframes; UINT32 rxfragments; UINT32 rxunicastoctets; UINT32 rxmulticastoctets; UINT32 rxfcserrors; UINT32 rxdiscardsnobuffer; UINT32 txdiscardswrongsa; UINT32 rxdiscardswepundecr; UINT32 rxmsginmsgfrag; UINT32 rxmsginbadmsgfrag; } __WLAN_ATTRIB_PACK__ hfa384x_CommTallies32_t; /*-- Inquiry Frame, Diagnose: Scan Results & Subfields--*/ typedef struct hfa384x_ScanResultSub { UINT16 chid; UINT16 anl; UINT16 sl; UINT8 bssid[WLAN_BSSID_LEN]; UINT16 bcnint; UINT16 capinfo; hfa384x_bytestr32_t ssid; UINT8 supprates[10]; /* 802.11 info element */ UINT16 proberesp_rate; } __WLAN_ATTRIB_PACK__ hfa384x_ScanResultSub_t; typedef struct hfa384x_ScanResult { UINT16 rsvd; UINT16 scanreason; hfa384x_ScanResultSub_t result[HFA384x_SCANRESULT_MAX]; } __WLAN_ATTRIB_PACK__ hfa384x_ScanResult_t; /*-- Inquiry Frame, Diagnose: ChInfo Results & Subfields--*/ typedef struct hfa384x_ChInfoResultSub { UINT16 chid; UINT16 anl; UINT16 pnl; UINT16 active; } __WLAN_ATTRIB_PACK__ hfa384x_ChInfoResultSub_t; #define HFA384x_CHINFORESULT_BSSACTIVE BIT0 #define HFA384x_CHINFORESULT_PCFACTIVE BIT1 typedef struct hfa384x_ChInfoResult { UINT16 scanchannels; hfa384x_ChInfoResultSub_t result[HFA384x_CHINFORESULT_MAX]; } __WLAN_ATTRIB_PACK__ hfa384x_ChInfoResult_t; /*-- Inquiry Frame, Diagnose: Host Scan Results & Subfields--*/ typedef struct hfa384x_HScanResultSub { UINT16 chid; UINT16 anl; UINT16 sl; UINT8 bssid[WLAN_BSSID_LEN]; UINT16 bcnint; UINT16 capinfo; hfa384x_bytestr32_t ssid; UINT8 supprates[10]; /* 802.11 info element */ UINT16 proberesp_rate; UINT16 atim; } __WLAN_ATTRIB_PACK__ hfa384x_HScanResultSub_t; typedef struct hfa384x_HScanResult { UINT16 nresult; UINT16 rsvd; hfa384x_HScanResultSub_t result[HFA384x_HSCANRESULT_MAX]; } __WLAN_ATTRIB_PACK__ hfa384x_HScanResult_t; /*-- Unsolicited Frame, MAC Mgmt: LinkStatus --*/ #define HFA384x_LINK_NOTCONNECTED ((UINT16)0) #define HFA384x_LINK_CONNECTED ((UINT16)1) #define HFA384x_LINK_DISCONNECTED ((UINT16)2) #define HFA384x_LINK_AP_CHANGE ((UINT16)3) #define HFA384x_LINK_AP_OUTOFRANGE ((UINT16)4) #define HFA384x_LINK_AP_INRANGE ((UINT16)5) #define HFA384x_LINK_ASSOCFAIL ((UINT16)6) typedef struct hfa384x_LinkStatus { UINT16 linkstatus; } __WLAN_ATTRIB_PACK__ hfa384x_LinkStatus_t; /*-- Unsolicited Frame, MAC Mgmt: AssociationStatus (--*/ #define HFA384x_ASSOCSTATUS_STAASSOC ((UINT16)1) #define HFA384x_ASSOCSTATUS_REASSOC ((UINT16)2) #define HFA384x_ASSOCSTATUS_DISASSOC ((UINT16)3) #define HFA384x_ASSOCSTATUS_ASSOCFAIL ((UINT16)4) #define HFA384x_ASSOCSTATUS_AUTHFAIL ((UINT16)5) typedef struct hfa384x_AssocStatus { UINT16 assocstatus; UINT8 sta_addr[WLAN_ADDR_LEN]; /* old_ap_addr is only valid if assocstatus == 2 */ UINT8 old_ap_addr[WLAN_ADDR_LEN]; UINT16 reason; UINT16 reserved; } __WLAN_ATTRIB_PACK__ hfa384x_AssocStatus_t; /*-- Unsolicited Frame, MAC Mgmt: AuthRequest (AP Only) --*/ typedef struct hfa384x_AuthRequest { UINT8 sta_addr[WLAN_ADDR_LEN]; UINT16 algorithm; } __WLAN_ATTRIB_PACK__ hfa384x_AuthReq_t; /*-- Unsolicited Frame, MAC Mgmt: AssocRequest (AP Only) --*/ typedef struct hfa384x_AssocRequest { UINT8 sta_addr[WLAN_ADDR_LEN]; UINT16 type; UINT8 wpa_data[80]; } __WLAN_ATTRIB_PACK__ hfa384x_AssocReq_t; #define HFA384x_ASSOCREQ_TYPE_ASSOC 0 #define HFA384x_ASSOCREQ_TYPE_REASSOC 1 /*-- Unsolicited Frame, MAC Mgmt: MIC Failure (AP Only) --*/ typedef struct hfa384x_MicFailure { UINT8 sender[WLAN_ADDR_LEN]; UINT8 dest[WLAN_ADDR_LEN]; } __WLAN_ATTRIB_PACK__ hfa384x_MicFailure_t; /*-- Unsolicited Frame, MAC Mgmt: PSUserCount (AP Only) --*/ typedef struct hfa384x_PSUserCount { UINT16 usercnt; } __WLAN_ATTRIB_PACK__ hfa384x_PSUserCount_t; typedef struct hfa384x_KeyIDChanged { UINT8 sta_addr[WLAN_ADDR_LEN]; UINT16 keyid; } __WLAN_ATTRIB_PACK__ hfa384x_KeyIDChanged_t; /*-- Collection of all Inf frames ---------------*/ typedef union hfa384x_infodata { hfa384x_CommTallies16_t commtallies16; hfa384x_CommTallies32_t commtallies32; hfa384x_ScanResult_t scanresult; hfa384x_ChInfoResult_t chinforesult; hfa384x_HScanResult_t hscanresult; hfa384x_LinkStatus_t linkstatus; hfa384x_AssocStatus_t assocstatus; hfa384x_AuthReq_t authreq; hfa384x_PSUserCount_t psusercnt; hfa384x_KeyIDChanged_t keyidchanged; } __WLAN_ATTRIB_PACK__ hfa384x_infodata_t; typedef struct hfa384x_InfFrame { UINT16 framelen; UINT16 infotype; hfa384x_infodata_t info; } __WLAN_ATTRIB_PACK__ hfa384x_InfFrame_t; #if (WLAN_HOSTIF == WLAN_USB) /*-------------------------------------------------------------------- USB Packet structures and constants. --------------------------------------------------------------------*/ /* Should be sent to the ctrlout endpoint */ #define HFA384x_USB_ENBULKIN 6 /* Should be sent to the bulkout endpoint */ #define HFA384x_USB_TXFRM 0 #define HFA384x_USB_CMDREQ 1 #define HFA384x_USB_WRIDREQ 2 #define HFA384x_USB_RRIDREQ 3 #define HFA384x_USB_WMEMREQ 4 #define HFA384x_USB_RMEMREQ 5 /* Received from the bulkin endpoint */ #define HFA384x_USB_ISFRM(a) (!((a) & 0x8000)) #define HFA384x_USB_ISTXFRM(a) (((a) & 0x9000) == 0x1000) #define HFA384x_USB_ISRXFRM(a) (!((a) & 0x9000)) #define HFA384x_USB_INFOFRM 0x8000 #define HFA384x_USB_CMDRESP 0x8001 #define HFA384x_USB_WRIDRESP 0x8002 #define HFA384x_USB_RRIDRESP 0x8003 #define HFA384x_USB_WMEMRESP 0x8004 #define HFA384x_USB_RMEMRESP 0x8005 #define HFA384x_USB_BUFAVAIL 0x8006 #define HFA384x_USB_ERROR 0x8007 /*------------------------------------*/ /* Request (bulk OUT) packet contents */ typedef struct hfa384x_usb_txfrm { hfa384x_tx_frame_t desc; UINT8 data[WLAN_DATA_MAXLEN]; } __WLAN_ATTRIB_PACK__ hfa384x_usb_txfrm_t; typedef struct hfa384x_usb_cmdreq { UINT16 type; UINT16 cmd; UINT16 parm0; UINT16 parm1; UINT16 parm2; UINT8 pad[54]; } __WLAN_ATTRIB_PACK__ hfa384x_usb_cmdreq_t; typedef struct hfa384x_usb_wridreq { UINT16 type; UINT16 frmlen; UINT16 rid; UINT8 data[HFA384x_RIDDATA_MAXLEN]; } __WLAN_ATTRIB_PACK__ hfa384x_usb_wridreq_t; typedef struct hfa384x_usb_rridreq { UINT16 type; UINT16 frmlen; UINT16 rid; UINT8 pad[58]; } __WLAN_ATTRIB_PACK__ hfa384x_usb_rridreq_t; typedef struct hfa384x_usb_wmemreq { UINT16 type; UINT16 frmlen; UINT16 offset; UINT16 page; UINT8 data[HFA384x_USB_RWMEM_MAXLEN]; } __WLAN_ATTRIB_PACK__ hfa384x_usb_wmemreq_t; typedef struct hfa384x_usb_rmemreq { UINT16 type; UINT16 frmlen; UINT16 offset; UINT16 page; UINT8 pad[56]; } __WLAN_ATTRIB_PACK__ hfa384x_usb_rmemreq_t; /*------------------------------------*/ /* Response (bulk IN) packet contents */ typedef struct hfa384x_usb_rxfrm { hfa384x_rx_frame_t desc; UINT8 data[WLAN_DATA_MAXLEN]; } __WLAN_ATTRIB_PACK__ hfa384x_usb_rxfrm_t; typedef struct hfa384x_usb_infofrm { UINT16 type; hfa384x_InfFrame_t info; } __WLAN_ATTRIB_PACK__ hfa384x_usb_infofrm_t; typedef struct hfa384x_usb_statusresp { UINT16 type; UINT16 status; UINT16 resp0; UINT16 resp1; UINT16 resp2; } __WLAN_ATTRIB_PACK__ hfa384x_usb_cmdresp_t; typedef hfa384x_usb_cmdresp_t hfa384x_usb_wridresp_t; typedef struct hfa384x_usb_rridresp { UINT16 type; UINT16 frmlen; UINT16 rid; UINT8 data[HFA384x_RIDDATA_MAXLEN]; } __WLAN_ATTRIB_PACK__ hfa384x_usb_rridresp_t; typedef hfa384x_usb_cmdresp_t hfa384x_usb_wmemresp_t; typedef struct hfa384x_usb_rmemresp { UINT16 type; UINT16 frmlen; UINT8 data[HFA384x_USB_RWMEM_MAXLEN]; } __WLAN_ATTRIB_PACK__ hfa384x_usb_rmemresp_t; typedef struct hfa384x_usb_bufavail { UINT16 type; UINT16 frmlen; } __WLAN_ATTRIB_PACK__ hfa384x_usb_bufavail_t; typedef struct hfa384x_usb_error { UINT16 type; UINT16 errortype; } __WLAN_ATTRIB_PACK__ hfa384x_usb_error_t; /*----------------------------------------------------------*/ /* Unions for packaging all the known packet types together */ typedef union hfa384x_usbout { UINT16 type; hfa384x_usb_txfrm_t txfrm; hfa384x_usb_cmdreq_t cmdreq; hfa384x_usb_wridreq_t wridreq; hfa384x_usb_rridreq_t rridreq; hfa384x_usb_wmemreq_t wmemreq; hfa384x_usb_rmemreq_t rmemreq; } __WLAN_ATTRIB_PACK__ hfa384x_usbout_t; typedef union hfa384x_usbin { UINT16 type; hfa384x_usb_rxfrm_t rxfrm; hfa384x_usb_txfrm_t txfrm; hfa384x_usb_infofrm_t infofrm; hfa384x_usb_cmdresp_t cmdresp; hfa384x_usb_wridresp_t wridresp; hfa384x_usb_rridresp_t rridresp; hfa384x_usb_wmemresp_t wmemresp; hfa384x_usb_rmemresp_t rmemresp; hfa384x_usb_bufavail_t bufavail; hfa384x_usb_error_t usberror; UINT8 boguspad[3000]; } __WLAN_ATTRIB_PACK__ hfa384x_usbin_t; #endif /* WLAN_USB */ /*-------------------------------------------------------------------- PD record structures. --------------------------------------------------------------------*/ typedef struct hfa384x_pdr_pcb_partnum { UINT8 num[8]; } __WLAN_ATTRIB_PACK__ hfa384x_pdr_pcb_partnum_t; typedef struct hfa384x_pdr_pcb_tracenum { UINT8 num[8]; } __WLAN_ATTRIB_PACK__ hfa384x_pdr_pcb_tracenum_t; typedef struct hfa384x_pdr_nic_serial { UINT8 num[12]; } __WLAN_ATTRIB_PACK__ hfa384x_pdr_nic_serial_t; typedef struct hfa384x_pdr_mkk_measurements { double carrier_freq; double occupied_band; double power_density; double tx_spur_f1; double tx_spur_f2; double tx_spur_f3; double tx_spur_f4; double tx_spur_l1; double tx_spur_l2; double tx_spur_l3; double tx_spur_l4; double rx_spur_f1; double rx_spur_f2; double rx_spur_l1; double rx_spur_l2; } __WLAN_ATTRIB_PACK__ hfa384x_pdr_mkk_measurements_t; typedef struct hfa384x_pdr_nic_ramsize { UINT8 size[12]; /* units of KB */ } __WLAN_ATTRIB_PACK__ hfa384x_pdr_nic_ramsize_t; typedef struct hfa384x_pdr_mfisuprange { UINT16 id; UINT16 variant; UINT16 bottom; UINT16 top; } __WLAN_ATTRIB_PACK__ hfa384x_pdr_mfisuprange_t; typedef struct hfa384x_pdr_cfisuprange { UINT16 id; UINT16 variant; UINT16 bottom; UINT16 top; } __WLAN_ATTRIB_PACK__ hfa384x_pdr_cfisuprange_t; typedef struct hfa384x_pdr_nicid { UINT16 id; UINT16 variant; UINT16 major; UINT16 minor; } __WLAN_ATTRIB_PACK__ hfa384x_pdr_nicid_t; typedef struct hfa384x_pdr_refdac_measurements { UINT16 value[0]; } __WLAN_ATTRIB_PACK__ hfa384x_pdr_refdac_measurements_t; typedef struct hfa384x_pdr_vgdac_measurements { UINT16 value[0]; } __WLAN_ATTRIB_PACK__ hfa384x_pdr_vgdac_measurements_t; typedef struct hfa384x_pdr_level_comp_measurements { UINT16 value[0]; } __WLAN_ATTRIB_PACK__ hfa384x_pdr_level_compc_measurements_t; typedef struct hfa384x_pdr_mac_address { UINT8 addr[6]; } __WLAN_ATTRIB_PACK__ hfa384x_pdr_mac_address_t; typedef struct hfa384x_pdr_mkk_callname { UINT8 callname[8]; } __WLAN_ATTRIB_PACK__ hfa384x_pdr_mkk_callname_t; typedef struct hfa384x_pdr_regdomain { UINT16 numdomains; UINT16 domain[5]; } __WLAN_ATTRIB_PACK__ hfa384x_pdr_regdomain_t; typedef struct hfa384x_pdr_allowed_channel { UINT16 ch_bitmap; } __WLAN_ATTRIB_PACK__ hfa384x_pdr_allowed_channel_t; typedef struct hfa384x_pdr_default_channel { UINT16 channel; } __WLAN_ATTRIB_PACK__ hfa384x_pdr_default_channel_t; typedef struct hfa384x_pdr_privacy_option { UINT16 available; } __WLAN_ATTRIB_PACK__ hfa384x_pdr_privacy_option_t; typedef struct hfa384x_pdr_temptype { UINT16 type; } __WLAN_ATTRIB_PACK__ hfa384x_pdr_temptype_t; typedef struct hfa384x_pdr_refdac_setup { UINT16 ch_value[14]; } __WLAN_ATTRIB_PACK__ hfa384x_pdr_refdac_setup_t; typedef struct hfa384x_pdr_vgdac_setup { UINT16 ch_value[14]; } __WLAN_ATTRIB_PACK__ hfa384x_pdr_vgdac_setup_t; typedef struct hfa384x_pdr_level_comp_setup { UINT16 ch_value[14]; } __WLAN_ATTRIB_PACK__ hfa384x_pdr_level_comp_setup_t; typedef struct hfa384x_pdr_trimdac_setup { UINT16 trimidac; UINT16 trimqdac; } __WLAN_ATTRIB_PACK__ hfa384x_pdr_trimdac_setup_t; typedef struct hfa384x_pdr_ifr_setting { UINT16 value[3]; } __WLAN_ATTRIB_PACK__ hfa384x_pdr_ifr_setting_t; typedef struct hfa384x_pdr_rfr_setting { UINT16 value[3]; } __WLAN_ATTRIB_PACK__ hfa384x_pdr_rfr_setting_t; typedef struct hfa384x_pdr_hfa3861_baseline { UINT16 value[50]; } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_baseline_t; typedef struct hfa384x_pdr_hfa3861_shadow { UINT32 value[32]; } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_shadow_t; typedef struct hfa384x_pdr_hfa3861_ifrf { UINT32 value[20]; } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_ifrf_t; typedef struct hfa384x_pdr_hfa3861_chcalsp { UINT16 value[14]; } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_chcalsp_t; typedef struct hfa384x_pdr_hfa3861_chcali { UINT16 value[17]; } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_chcali_t; typedef struct hfa384x_pdr_hfa3861_nic_config { UINT16 config_bitmap; } __WLAN_ATTRIB_PACK__ hfa384x_pdr_nic_config_t; typedef struct hfa384x_pdr_hfo_delay { UINT8 hfo_delay; } __WLAN_ATTRIB_PACK__ hfa384x_hfo_delay_t; typedef struct hfa384x_pdr_hfa3861_manf_testsp { UINT16 value[30]; } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_manf_testsp_t; typedef struct hfa384x_pdr_hfa3861_manf_testi { UINT16 value[30]; } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_manf_testi_t; typedef struct hfa384x_end_of_pda { UINT16 crc; } __WLAN_ATTRIB_PACK__ hfa384x_pdr_end_of_pda_t; typedef struct hfa384x_pdrec { UINT16 len; /* in words */ UINT16 code; union pdr { hfa384x_pdr_pcb_partnum_t pcb_partnum; hfa384x_pdr_pcb_tracenum_t pcb_tracenum; hfa384x_pdr_nic_serial_t nic_serial; hfa384x_pdr_mkk_measurements_t mkk_measurements; hfa384x_pdr_nic_ramsize_t nic_ramsize; hfa384x_pdr_mfisuprange_t mfisuprange; hfa384x_pdr_cfisuprange_t cfisuprange; hfa384x_pdr_nicid_t nicid; hfa384x_pdr_refdac_measurements_t refdac_measurements; hfa384x_pdr_vgdac_measurements_t vgdac_measurements; hfa384x_pdr_level_compc_measurements_t level_compc_measurements; hfa384x_pdr_mac_address_t mac_address; hfa384x_pdr_mkk_callname_t mkk_callname; hfa384x_pdr_regdomain_t regdomain; hfa384x_pdr_allowed_channel_t allowed_channel; hfa384x_pdr_default_channel_t default_channel; hfa384x_pdr_privacy_option_t privacy_option; hfa384x_pdr_temptype_t temptype; hfa384x_pdr_refdac_setup_t refdac_setup; hfa384x_pdr_vgdac_setup_t vgdac_setup; hfa384x_pdr_level_comp_setup_t level_comp_setup; hfa384x_pdr_trimdac_setup_t trimdac_setup; hfa384x_pdr_ifr_setting_t ifr_setting; hfa384x_pdr_rfr_setting_t rfr_setting; hfa384x_pdr_hfa3861_baseline_t hfa3861_baseline; hfa384x_pdr_hfa3861_shadow_t hfa3861_shadow; hfa384x_pdr_hfa3861_ifrf_t hfa3861_ifrf; hfa384x_pdr_hfa3861_chcalsp_t hfa3861_chcalsp; hfa384x_pdr_hfa3861_chcali_t hfa3861_chcali; hfa384x_pdr_nic_config_t nic_config; hfa384x_hfo_delay_t hfo_delay; hfa384x_pdr_hfa3861_manf_testsp_t hfa3861_manf_testsp; hfa384x_pdr_hfa3861_manf_testi_t hfa3861_manf_testi; hfa384x_pdr_end_of_pda_t end_of_pda; } data; } __WLAN_ATTRIB_PACK__ hfa384x_pdrec_t; #ifdef __KERNEL__ /*-------------------------------------------------------------------- --- MAC state structure, argument to all functions -- --- Also, a collection of support types -- --------------------------------------------------------------------*/ typedef struct hfa384x_statusresult { UINT16 status; UINT16 resp0; UINT16 resp1; UINT16 resp2; } hfa384x_cmdresult_t; #if (WLAN_HOSTIF == WLAN_USB) /* USB Control Exchange (CTLX): * A queue of the structure below is maintained for all of the * Request/Response type USB packets supported by Prism2. */ /* The following hfa384x_* structures are arguments to * the usercb() for the different CTLX types. */ typedef hfa384x_cmdresult_t hfa384x_wridresult_t; typedef hfa384x_cmdresult_t hfa384x_wmemresult_t; typedef struct hfa384x_rridresult { UINT16 rid; const void *riddata; UINT riddata_len; } hfa384x_rridresult_t; enum ctlx_state { CTLX_START = 0, /* Start state, not queued */ CTLX_COMPLETE, /* CTLX successfully completed */ CTLX_REQ_FAILED, /* OUT URB completed w/ error */ CTLX_PENDING, /* Queued, data valid */ CTLX_REQ_SUBMITTED, /* OUT URB submitted */ CTLX_REQ_COMPLETE, /* OUT URB complete */ CTLX_RESP_COMPLETE /* IN URB received */ }; typedef enum ctlx_state CTLX_STATE; struct hfa384x_usbctlx; struct hfa384x; typedef void (*ctlx_cmdcb_t)( struct hfa384x*, const struct hfa384x_usbctlx* ); typedef void (*ctlx_usercb_t)( struct hfa384x *hw, void *ctlxresult, void *usercb_data); typedef struct hfa384x_usbctlx { struct list_head list; size_t outbufsize; hfa384x_usbout_t outbuf; /* pkt buf for OUT */ hfa384x_usbin_t inbuf; /* pkt buf for IN(a copy) */ CTLX_STATE state; /* Tracks running state */ struct completion done; volatile int reapable; /* Food for the reaper task */ ctlx_cmdcb_t cmdcb; /* Async command callback */ ctlx_usercb_t usercb; /* Async user callback, */ void *usercb_data; /* at CTLX completion */ int variant; /* Identifies cmd variant */ } hfa384x_usbctlx_t; typedef struct hfa384x_usbctlxq { spinlock_t lock; struct list_head pending; struct list_head active; struct list_head completing; struct list_head reapable; } hfa384x_usbctlxq_t; #endif typedef struct hfa484x_metacmd { UINT16 cmd; UINT16 parm0; UINT16 parm1; UINT16 parm2; #if 0 //XXX cmd irq stuff UINT16 bulkid; /* what RID/FID to copy down. */ int bulklen; /* how much to copy from BAP */ char *bulkdata; /* And to where? */ #endif hfa384x_cmdresult_t result; } hfa384x_metacmd_t; #define MAX_PRISM2_GRP_ADDR 16 #define MAX_GRP_ADDR 32 #define WLAN_COMMENT_MAX 80 /* Max. length of user comment string. */ #define MM_SAT_PCF (BIT14) #define MM_GCSD_PCF (BIT15) #define MM_GCSD_PCF_EB (BIT14 | BIT15) #define WLAN_STATE_STOPPED 0 /* Network is not active. */ #define WLAN_STATE_STARTED 1 /* Network has been started. */ #define WLAN_AUTH_MAX 60 /* Max. # of authenticated stations. */ #define WLAN_ACCESS_MAX 60 /* Max. # of stations in an access list. */ #define WLAN_ACCESS_NONE 0 /* No stations may be authenticated. */ #define WLAN_ACCESS_ALL 1 /* All stations may be authenticated. */ #define WLAN_ACCESS_ALLOW 2 /* Authenticate only "allowed" stations. */ #define WLAN_ACCESS_DENY 3 /* Do not authenticate "denied" stations. */ /* XXX These are going away ASAP */ typedef struct prism2sta_authlist { UINT cnt; UINT8 addr[WLAN_AUTH_MAX][WLAN_ADDR_LEN]; UINT8 assoc[WLAN_AUTH_MAX]; } prism2sta_authlist_t; typedef struct prism2sta_accesslist { UINT modify; UINT cnt; UINT8 addr[WLAN_ACCESS_MAX][WLAN_ADDR_LEN]; UINT cnt1; UINT8 addr1[WLAN_ACCESS_MAX][WLAN_ADDR_LEN]; } prism2sta_accesslist_t; typedef struct hfa384x { #if (WLAN_HOSTIF != WLAN_USB) /* Resource config */ UINT32 iobase; char __iomem *membase; UINT32 irq; #else /* USB support data */ struct usb_device *usb; struct urb rx_urb; struct sk_buff *rx_urb_skb; struct urb tx_urb; struct urb ctlx_urb; hfa384x_usbout_t txbuff; hfa384x_usbctlxq_t ctlxq; struct timer_list reqtimer; struct timer_list resptimer; struct timer_list throttle; struct tasklet_struct reaper_bh; struct tasklet_struct completion_bh; struct work_struct usb_work; unsigned long usb_flags; #define THROTTLE_RX 0 #define THROTTLE_TX 1 #define WORK_RX_HALT 2 #define WORK_TX_HALT 3 #define WORK_RX_RESUME 4 #define WORK_TX_RESUME 5 unsigned short req_timer_done:1; unsigned short resp_timer_done:1; int endp_in; int endp_out; #endif /* !USB */ #if (WLAN_HOSTIF == WLAN_PCMCIA) #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16) struct pcmcia_device *pdev; #else dev_link_t *link; #endif dev_node_t node; #endif int sniff_fcs; int sniff_channel; int sniff_truncate; int sniffhdr; wait_queue_head_t cmdq; /* wait queue itself */ /* Controller state */ UINT32 state; UINT32 isap; UINT8 port_enabled[HFA384x_NUMPORTS_MAX]; #if (WLAN_HOSTIF != WLAN_USB) UINT auxen; UINT isram16; #endif /* !USB */ /* Download support */ UINT dlstate; hfa384x_downloadbuffer_t bufinfo; UINT16 dltimeout; #if (WLAN_HOSTIF != WLAN_USB) spinlock_t cmdlock; volatile int cmdflag; /* wait queue flag */ hfa384x_metacmd_t *cmddata; /* for our async callback */ /* BAP support */ spinlock_t baplock; struct tasklet_struct bap_tasklet; /* MAC buffer ids */ UINT16 txfid_head; UINT16 txfid_tail; UINT txfid_N; UINT16 txfid_queue[HFA384x_DRVR_FIDSTACKLEN_MAX]; UINT16 infofid; struct semaphore infofid_sem; #endif /* !USB */ int scanflag; /* to signal scan comlete */ int join_ap; /* are we joined to a specific ap */ int join_retries; /* number of join retries till we fail */ hfa384x_JoinRequest_data_t joinreq; /* join request saved data */ wlandevice_t *wlandev; /* Timer to allow for the deferred processing of linkstatus messages */ struct work_struct link_bh; struct work_struct commsqual_bh; hfa384x_commsquality_t qual; struct timer_list commsqual_timer; UINT16 link_status; UINT16 link_status_new; struct sk_buff_head authq; /* And here we have stuff that used to be in priv */ /* State variables */ UINT presniff_port_type; UINT16 presniff_wepflags; UINT32 dot11_desired_bss_type; int ap; /* AP flag: 0 - Station, 1 - Access Point. */ int dbmadjust; /* Group Addresses - right now, there are up to a total of MAX_GRP_ADDR group addresses */ UINT8 dot11_grp_addr[MAX_GRP_ADDR][WLAN_ADDR_LEN]; UINT dot11_grpcnt; /* Component Identities */ hfa384x_compident_t ident_nic; hfa384x_compident_t ident_pri_fw; hfa384x_compident_t ident_sta_fw; hfa384x_compident_t ident_ap_fw; UINT16 mm_mods; /* Supplier compatibility ranges */ hfa384x_caplevel_t cap_sup_mfi; hfa384x_caplevel_t cap_sup_cfi; hfa384x_caplevel_t cap_sup_pri; hfa384x_caplevel_t cap_sup_sta; hfa384x_caplevel_t cap_sup_ap; /* Actor compatibility ranges */ hfa384x_caplevel_t cap_act_pri_cfi; /* pri f/w to controller interface */ hfa384x_caplevel_t cap_act_sta_cfi; /* sta f/w to controller interface */ hfa384x_caplevel_t cap_act_sta_mfi; /* sta f/w to modem interface */ hfa384x_caplevel_t cap_act_ap_cfi; /* ap f/w to controller interface */ hfa384x_caplevel_t cap_act_ap_mfi; /* ap f/w to modem interface */ UINT32 psusercount; /* Power save user count. */ hfa384x_CommTallies32_t tallies; /* Communication tallies. */ UINT8 comment[WLAN_COMMENT_MAX+1]; /* User comment */ /* Channel Info request results (AP only) */ struct { atomic_t done; UINT8 count; hfa384x_ChInfoResult_t results; } channel_info; hfa384x_InfFrame_t *scanresults; prism2sta_authlist_t authlist; /* Authenticated station list. */ UINT accessmode; /* Access mode. */ prism2sta_accesslist_t allow; /* Allowed station list. */ prism2sta_accesslist_t deny; /* Denied station list. */ } hfa384x_t; /*=============================================================*/ /*--- Function Declarations -----------------------------------*/ /*=============================================================*/ #if (WLAN_HOSTIF == WLAN_USB) void hfa384x_create( hfa384x_t *hw, struct usb_device *usb); #else void hfa384x_create( hfa384x_t *hw, UINT irq, UINT32 iobase, UINT8 __iomem *membase); #endif void hfa384x_destroy(hfa384x_t *hw); irqreturn_t hfa384x_interrupt(int irq, void *dev_id PT_REGS); int hfa384x_corereset( hfa384x_t *hw, int holdtime, int settletime, int genesis); int hfa384x_drvr_chinforesults( hfa384x_t *hw); int hfa384x_drvr_commtallies( hfa384x_t *hw); int hfa384x_drvr_disable(hfa384x_t *hw, UINT16 macport); int hfa384x_drvr_enable(hfa384x_t *hw, UINT16 macport); int hfa384x_drvr_flashdl_enable(hfa384x_t *hw); int hfa384x_drvr_flashdl_disable(hfa384x_t *hw); int hfa384x_drvr_flashdl_write(hfa384x_t *hw, UINT32 daddr, void* buf, UINT32 len); int hfa384x_drvr_getconfig(hfa384x_t *hw, UINT16 rid, void *buf, UINT16 len); int hfa384x_drvr_handover( hfa384x_t *hw, UINT8 *addr); int hfa384x_drvr_hostscanresults( hfa384x_t *hw); int hfa384x_drvr_low_level(hfa384x_t *hw, hfa384x_metacmd_t *cmd); int hfa384x_drvr_mmi_read(hfa384x_t *hw, UINT32 address, UINT32 *result); int hfa384x_drvr_mmi_write(hfa384x_t *hw, UINT32 address, UINT32 data); int hfa384x_drvr_ramdl_enable(hfa384x_t *hw, UINT32 exeaddr); int hfa384x_drvr_ramdl_disable(hfa384x_t *hw); int hfa384x_drvr_ramdl_write(hfa384x_t *hw, UINT32 daddr, void* buf, UINT32 len); int hfa384x_drvr_readpda(hfa384x_t *hw, void *buf, UINT len); int hfa384x_drvr_scanresults( hfa384x_t *hw); int hfa384x_drvr_setconfig(hfa384x_t *hw, UINT16 rid, void *buf, UINT16 len); static inline int hfa384x_drvr_getconfig16(hfa384x_t *hw, UINT16 rid, void *val) { int result = 0; result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(UINT16)); if ( result == 0 ) { *((UINT16*)val) = hfa384x2host_16(*((UINT16*)val)); } return result; } static inline int hfa384x_drvr_getconfig32(hfa384x_t *hw, UINT16 rid, void *val) { int result = 0; result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(UINT32)); if ( result == 0 ) { *((UINT32*)val) = hfa384x2host_32(*((UINT32*)val)); } return result; } static inline int hfa384x_drvr_setconfig16(hfa384x_t *hw, UINT16 rid, UINT16 val) { UINT16 value = host2hfa384x_16(val); return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(value)); } static inline int hfa384x_drvr_setconfig32(hfa384x_t *hw, UINT16 rid, UINT32 val) { UINT32 value = host2hfa384x_32(val); return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(value)); } #if (WLAN_HOSTIF == WLAN_USB) int hfa384x_drvr_getconfig_async(hfa384x_t *hw, UINT16 rid, ctlx_usercb_t usercb, void *usercb_data); int hfa384x_drvr_setconfig_async(hfa384x_t *hw, UINT16 rid, void *buf, UINT16 len, ctlx_usercb_t usercb, void *usercb_data); #else static inline int hfa384x_drvr_setconfig_async(hfa384x_t *hw, UINT16 rid, void *buf, UINT16 len, void *ptr1, void *ptr2) { (void)ptr1; (void)ptr2; return hfa384x_drvr_setconfig(hw, rid, buf, len); } #endif static inline int hfa384x_drvr_setconfig16_async(hfa384x_t *hw, UINT16 rid, UINT16 val) { UINT16 value = host2hfa384x_16(val); return hfa384x_drvr_setconfig_async(hw, rid, &value, sizeof(value), NULL , NULL); } static inline int hfa384x_drvr_setconfig32_async(hfa384x_t *hw, UINT16 rid, UINT32 val) { UINT32 value = host2hfa384x_32(val); return hfa384x_drvr_setconfig_async(hw, rid, &value, sizeof(value), NULL , NULL); } int hfa384x_drvr_start(hfa384x_t *hw); int hfa384x_drvr_stop(hfa384x_t *hw); int hfa384x_drvr_txframe(hfa384x_t *hw, struct sk_buff *skb, p80211_hdr_t *p80211_hdr, p80211_metawep_t *p80211_wep); void hfa384x_tx_timeout(wlandevice_t *wlandev); int hfa384x_cmd_initialize(hfa384x_t *hw); int hfa384x_cmd_enable(hfa384x_t *hw, UINT16 macport); int hfa384x_cmd_disable(hfa384x_t *hw, UINT16 macport); int hfa384x_cmd_diagnose(hfa384x_t *hw); int hfa384x_cmd_allocate(hfa384x_t *hw, UINT16 len); int hfa384x_cmd_transmit(hfa384x_t *hw, UINT16 reclaim, UINT16 qos, UINT16 fid); int hfa384x_cmd_clearpersist(hfa384x_t *hw, UINT16 fid); int hfa384x_cmd_notify(hfa384x_t *hw, UINT16 reclaim, UINT16 fid, void *buf, UINT16 len); int hfa384x_cmd_inquire(hfa384x_t *hw, UINT16 fid); int hfa384x_cmd_access(hfa384x_t *hw, UINT16 write, UINT16 rid, void *buf, UINT16 len); int hfa384x_cmd_monitor(hfa384x_t *hw, UINT16 enable); int hfa384x_cmd_download( hfa384x_t *hw, UINT16 mode, UINT16 lowaddr, UINT16 highaddr, UINT16 codelen); int hfa384x_cmd_aux_enable(hfa384x_t *hw, int force); int hfa384x_cmd_aux_disable(hfa384x_t *hw); int hfa384x_copy_from_bap( hfa384x_t *hw, UINT16 bap, UINT16 id, UINT16 offset, void *buf, UINT len); int hfa384x_copy_to_bap( hfa384x_t *hw, UINT16 bap, UINT16 id, UINT16 offset, void *buf, UINT len); void hfa384x_copy_from_aux( hfa384x_t *hw, UINT32 cardaddr, UINT32 auxctl, void *buf, UINT len); void hfa384x_copy_to_aux( hfa384x_t *hw, UINT32 cardaddr, UINT32 auxctl, void *buf, UINT len); #if (WLAN_HOSTIF != WLAN_USB) /* HFA384x is a LITTLE ENDIAN part. the get/setreg functions implicitly byte-swap the data to LE. the _noswap variants do not perform a byte-swap on the data. */ static inline UINT16 __hfa384x_getreg(hfa384x_t *hw, UINT reg); static inline void __hfa384x_setreg(hfa384x_t *hw, UINT16 val, UINT reg); static inline UINT16 __hfa384x_getreg_noswap(hfa384x_t *hw, UINT reg); static inline void __hfa384x_setreg_noswap(hfa384x_t *hw, UINT16 val, UINT reg); #ifdef REVERSE_ENDIAN #define hfa384x_getreg __hfa384x_getreg_noswap #define hfa384x_setreg __hfa384x_setreg_noswap #define hfa384x_getreg_noswap __hfa384x_getreg #define hfa384x_setreg_noswap __hfa384x_setreg #else #define hfa384x_getreg __hfa384x_getreg #define hfa384x_setreg __hfa384x_setreg #define hfa384x_getreg_noswap __hfa384x_getreg_noswap #define hfa384x_setreg_noswap __hfa384x_setreg_noswap #endif /*---------------------------------------------------------------- * hfa384x_getreg * * Retrieve the value of one of the MAC registers. Done here * because different PRISM2 MAC parts use different buses and such. * NOTE: This function returns the value in HOST ORDER!!!!!! * * Arguments: * hw MAC part structure * reg Register identifier (offset for I/O based i/f) * * Returns: * Value from the register in HOST ORDER!!!! ----------------------------------------------------------------*/ static inline UINT16 __hfa384x_getreg(hfa384x_t *hw, UINT reg) { /* printk(KERN_DEBUG "Reading from 0x%0x\n", hw->membase + reg); */ #if ((WLAN_HOSTIF == WLAN_PCMCIA) || (WLAN_HOSTIF == WLAN_PLX)) return wlan_inw_le16_to_cpu(hw->iobase+reg); #elif (WLAN_HOSTIF == WLAN_PCI) return __le16_to_cpu(readw(hw->membase + reg)); #endif } /*---------------------------------------------------------------- * hfa384x_setreg * * Set the value of one of the MAC registers. Done here * because different PRISM2 MAC parts use different buses and such. * NOTE: This function assumes the value is in HOST ORDER!!!!!! * * Arguments: * hw MAC part structure * val Value, in HOST ORDER!!, to put in the register * reg Register identifier (offset for I/O based i/f) * * Returns: * Nothing ----------------------------------------------------------------*/ static inline void __hfa384x_setreg(hfa384x_t *hw, UINT16 val, UINT reg) { #if ((WLAN_HOSTIF == WLAN_PCMCIA) || (WLAN_HOSTIF == WLAN_PLX)) wlan_outw_cpu_to_le16( val, hw->iobase + reg); return; #elif (WLAN_HOSTIF == WLAN_PCI) writew(__cpu_to_le16(val), hw->membase + reg); return; #endif } /*---------------------------------------------------------------- * hfa384x_getreg_noswap * * Retrieve the value of one of the MAC registers. Done here * because different PRISM2 MAC parts use different buses and such. * * Arguments: * hw MAC part structure * reg Register identifier (offset for I/O based i/f) * * Returns: * Value from the register. ----------------------------------------------------------------*/ static inline UINT16 __hfa384x_getreg_noswap(hfa384x_t *hw, UINT reg) { #if ((WLAN_HOSTIF == WLAN_PCMCIA) || (WLAN_HOSTIF == WLAN_PLX)) return wlan_inw(hw->iobase+reg); #elif (WLAN_HOSTIF == WLAN_PCI) return readw(hw->membase + reg); #endif } /*---------------------------------------------------------------- * hfa384x_setreg_noswap * * Set the value of one of the MAC registers. Done here * because different PRISM2 MAC parts use different buses and such. * * Arguments: * hw MAC part structure * val Value to put in the register * reg Register identifier (offset for I/O based i/f) * * Returns: * Nothing ----------------------------------------------------------------*/ static inline void __hfa384x_setreg_noswap(hfa384x_t *hw, UINT16 val, UINT reg) { #if ((WLAN_HOSTIF == WLAN_PCMCIA) || (WLAN_HOSTIF == WLAN_PLX)) wlan_outw( val, hw->iobase + reg); return; #elif (WLAN_HOSTIF == WLAN_PCI) writew(val, hw->membase + reg); return; #endif } static inline void hfa384x_events_all(hfa384x_t *hw) { hfa384x_setreg(hw, HFA384x_INT_NORMAL #ifdef CMD_IRQ | HFA384x_INTEN_CMD_SET(1) #endif , HFA384x_INTEN); } static inline void hfa384x_events_nobap(hfa384x_t *hw) { hfa384x_setreg(hw, (HFA384x_INT_NORMAL & ~HFA384x_INT_BAP_OP) #ifdef CMD_IRQ | HFA384x_INTEN_CMD_SET(1) #endif , HFA384x_INTEN); } #endif /* WLAN_HOSTIF != WLAN_USB */ #endif /* __KERNEL__ */ #endif /* _HFA384x_H */ linux-wlan-ng-0.2.9+dfsg/src/prism2/ridlist/0000755000175000017500000000000011026545443020214 5ustar tormodtormodlinux-wlan-ng-0.2.9+dfsg/src/prism2/ridlist/ridlist.dat0000644000175000017500000002202611024763172022361 0ustar tormodtormodF101:ScanResults::::PRO:: F102:ChannelInfoResults::::PRO:: F200:LinkStatus::::API:: F201:AssociationStatus::::API:: F202:AuthenticationRequest::::API:: F203:PowerSaveUserCount::::API:: FC00:cnfPortType::::PRO:: FC03:cnfOwnChannel::::PRO:: FC04:cnfOwnSSID IBSS::::PRO:: FC05:cnfOwnATIMWindow::::PRO:: FC06:cnfSystemScale::::PRO:: FC07:cnfMaxDataLength::::PRO:: FC08:cnfWDSAddress::::PRO:: FC0A:cnfPMEPS::::PRO:: FC0B:cnfMulticastReceive::::PRO:: FC0C:cnfMaxSleepDuration::::PRO:: FC0D:cnfPMHoldoverDuration::::PRO:: FC0E:cnfOwnName::::PRO:: FC11:cnfWDSAddress1::::PRO:: FC12:cnfWDSAddress2::::PRO:: FC13:cnfWDSAddress3::::PRO:: FC14:cnfWDSAddress4::::PRO:: FC15:cnfWDSAddress5::::PRO:: FC16:cnfWDSAddress6::::PRO:: FC17:cnfMulticastPMBuffering::::PRO:: FC29:cnfWEPKeyMappingTable::::API:: FC2A:cnfAuthentication::::API:: FC2B:cnfMaxAssociatedStations::::API:: FC2C:cnfTxControl::::API:: FC2D:cnfRoamingMode::::API:: FC2E:cnfHostAuthentication::::API:: FC30:cnfRcvCrcError::::API:: FC31:cnfMMLife::::API:: FC32:cnfAltRetryCnt::::API:: FC33:cnfBeaconInterval::::API:: FC34:cnfAPPCFInfo::::API:: FC35:cnfSTAPCFInfo::::API:: FC81:CreateIBSS::::PRO:: FC90:FragmentationThreshold0::::PRO:: FC91:FragmentationThreshold1::::PRO:: FC92:FragmentationThreshold2::::PRO:: FC93:FragmentationThreshold3::::PRO:: FC94:FragmentationThreshold4::::PRO:: FC95:FragmentationThreshold5::::PRO:: FC96:FragmentationThreshold6::::PRO:: FC97:RTSThreshold0::::PRO:: FC98:RTSThreshold1::::PRO:: FC99:RTSThreshold2::::PRO:: FC9A:RTSThreshold3::::PRO:: FC9B:RTSThreshold4::::PRO:: FC9C:RTSThreshold5::::PRO:: FC9D:RTSThreshold6::::PRO:: FC9E:TxRateControl0::::API:: FC9F:TxRateControl1::::API:: FCA0:TxRateControl2::::API:: FCA1:TxRateControl3::::API:: FCA2:TxRateControl4::::API:: FCA3:TxRateControl5::::API:: FCA4:TxRateControl6::::API:: FCB0:cnfShortPreamble::::API:: FCB1:cnfExcludeLongPreamble::::API:: FCB3:cnfBasicRates::::API:: FCB4:cnfSupportedRates::::PRO:: FCE0:TickTime::::PRO:: FCE1:ScanRequest::::API:: FCE2:JoinRequest::::API:: FCE3:authenticateStation::::API:: FCE4:ChannelInfoRequest::::API:: FD00:MaxLoadTime::::PRO:: FD01:DownloadBuffer::::PRO:: FD02:PRIIdentity::::PRO:: FD03:PRISupRange::::PRO:: FD04:CFIActRanges::::PRO:: FD0A:NICSerialNumber::::PRO:: FD0B:NICIdentity::::PRO:: FD0C:MFISupRange::::PRO:: FD0D:CFISupRange::::PRO:: FD10:ChannelList::::PRO:: FD11:RegulatoryDomains::::PRO:: FD13:CIS::::PRO:: FD20:STAIdentity::::PRO:: FD21:STASupRange::::PRO:: FD22:MFIActRanges::::PRO:: FD23:CFIActRanges::::PRO:: FD40:PortStatus::::PRO:: FD41:CurrentSSID::::PRO:: FD42:CurrentBSSID::::PRO:: FD43:CommsQuality::::PRO:: FD44:CurrentTxRate::::PRO:: FD46:CurrentScaleThresholds::::PRO:: FD80:CurrentTxRate1::::PRO:: FD81:CurrentTxRate2::::PRO:: FD82:CurrentTxRate3::::PRO:: FD83:CurrentTxRate4::::PRO:: FD84:CurrentTxRate5::::PRO:: FD85:CurrentTxRate6::::PRO:: FDC2:CurrentPowerState::::PRO:: FDC6:SupportedDataRates::::PRO:: ::::dot11ACKFailureCount:PRO:: ::::dot11AntennaListIndex:PRO:: ::::dot11AuthenticateFailStation:PRO:R [3]: ::::dot11AuthenticateFailStatus:PRO:R [3]: ::::dot11AuthenticationAlgorithm2:PRO:: ::::dot11AuthenticationAlgorithm3:PRO:: ::::dot11AuthenticationAlgorithm4:PRO:: ::::dot11AuthenticationAlgorithm5:PRO:: ::::dot11AuthenticationAlgorithm6:PRO:: ::::dot11AuthenticationAlgorithmsEnable2:PRO:: ::::dot11AuthenticationAlgorithmsEnable3:PRO:: ::::dot11AuthenticationAlgorithmsEnable4:PRO:: ::::dot11AuthenticationAlgorithmsEnable5:PRO:: ::::dot11AuthenticationAlgorithmsEnable6:PRO:: ::::dot11CCAModeSupported:PRO:: ::::dot11CCAWatchdogCountMax:PRO:: ::::dot11CCAWatchdogCountMin:PRO:: ::::dot11CCAWatchdogTimerMax:PRO:: ::::dot11CCAWatchdogTimerMin:PRO:: ::::dot11ChannelAgilityEnabled:PRO:: ::::dot11ChannelAgilityPresent:PRO:: ::::dot11CurrentChannelNumber:PRO:: ::::dot11CurrentDwellTime:PRO:: ::::dot11CurrentIndex:PRO:: ::::dot11CurrentPattern:PRO:: ::::dot11CurrentRegDomain:PRO:: ::::dot11CurrentRxAntenna:PRO:: ::::dot11CurrentSet:PRO:: ::::dot11CurrentTxAntenna:PRO:: ::::dot11CurrentTxPowerLevel:PRO:: ::::dot11DeauthenticateReason:PRO:R [3]: ::::dot11DeauthenticateStation:PRO:R [3]: ::::dot11DesiredBSSType:PRO:R/W [3]: ::::dot11DisassociateReason:PRO:R [3]: ::::dot11DisassociateStation:PRO:R [3]: ::::dot11DiversitySelectionRx:PRO:: ::::dot11DiversitySupport:PRO:: ::::dot11EDThreshold:PRO:: ::::dot11FCSErrorCount:PRO:: ::::dot11FailedCount:PRO:: ::::dot11FrameDuplicateCount:PRO:: ::::dot11HopTime:PRO:: ::::dot11ManufacturerID:PRO:: ::::dot11MaxDwellTime:PRO:: ::::dot11MulticastReceivedFrameCount:PRO:: ::::dot11MulticastTransmittedFrameCount:PRO:: ::::dot11MultipleRetryCount:PRO:: ::::dot11NumberSupportedPowerLevels:PRO:: ::::dot11PBCCOptionImplemented:PRO:: ::::dot11ProductID:PRO:: ::::dot11RTSFailureCount:PRO:: ::::dot11RTSSuccessCount:PRO:: ::::dot11ReceivedFragmentCount:PRO:: ::::dot11RegDomainsSupportIndex:PRO:: ::::dot11RegDomainsSupportValue:PRO:: ::::dot11RetryCount:PRO:: ::::dot11ShortPreambleOptionImplemented:PRO:: ::::dot11SupportedDataRatesRxIndex:PRO:: ::::dot11SupportedDataRatesRxValue:PRO:: ::::dot11SupportedDataRatesTxIndex:PRO:: ::::dot11SupportedDataRatesTxValue:PRO:: ::::dot11SupportedRxAntenna:PRO:: ::::dot11SupportedTxAntenna:PRO:: ::::dot11TransmittedFragmentCount:PRO:: ::::dot11TransmittedFrameCount:PRO:: ::::dot11TxPowerLevel1:PRO:: ::::dot11TxPowerLevel2:PRO:: ::::dot11TxPowerLevel3:PRO:: ::::dot11TxPowerLevel4:PRO:: ::::dot11TxPowerLevel5:PRO:: ::::dot11TxPowerLevel6:PRO:: ::::dot11TxPowerLevel7:PRO:: ::::dot11TxPowerLevel8:PRO:: ::::dot11WEPExcludedCount:PRO:: ::::dot11WEPICVErrorCount:PRO:: ::::dot11WEPKeyMappingAddress:PRO:: ::::dot11WEPKeyMappingIndex:PRO:: ::::dot11WEPKeyMappingLength:PRO:: ::::dot11WEPKeyMappingValue:PRO:: ::::dot11WEPKeyMappingWEPOn:PRO:: ::::dot11WEPUndecryptableCount:PRO:: FC85:PromiscuousMode:X::dot11Address1-32:PRO:R/W [2]: FC80:GroupAddresses:X::dot11Address10:PRO:R/W [1]: FC80:GroupAddresses:X::dot11Address11:PRO:R/W [1]: FC80:GroupAddresses:X::dot11Address12:PRO:R/W [1]: FC80:GroupAddresses:X::dot11Address13:PRO:R/W [1]: FC80:GroupAddresses:X::dot11Address14:PRO:R/W [1]: FC80:GroupAddresses:X::dot11Address15:PRO:R/W [1]: FC80:GroupAddresses:X::dot11Address16:PRO:R/W [1]: FC80:GroupAddresses:X::dot11Address17:PRO:R/W [1]: FC80:GroupAddresses:X::dot11Address18:PRO:R/W [1]: FC80:GroupAddresses:X::dot11Address19:PRO:R/W [1]: FC80:GroupAddresses:X::dot11Address1:PRO:R/W [1]: FC80:GroupAddresses:X::dot11Address20:PRO:R/W [1]: FC80:GroupAddresses:X::dot11Address21:PRO:R/W [1]: FC80:GroupAddresses:X::dot11Address22:PRO:R/W [1]: FC80:GroupAddresses:X::dot11Address23:PRO:R/W [1]: FC80:GroupAddresses:X::dot11Address24:PRO:R/W [1]: FC80:GroupAddresses:X::dot11Address25:PRO:R/W [1]: FC80:GroupAddresses:X::dot11Address26:PRO:R/W [1]: FC80:GroupAddresses:X::dot11Address27:PRO:R/W [1]: FC80:GroupAddresses:X::dot11Address28:PRO:R/W [1]: FC80:GroupAddresses:X::dot11Address29:PRO:R/W [1]: FC80:GroupAddresses:X::dot11Address2:PRO:R/W [1]: FC80:GroupAddresses:X::dot11Address30:PRO:R/W [1]: FC80:GroupAddresses:X::dot11Address31:PRO:R/W [1]: FC80:GroupAddresses:X::dot11Address32:PRO:R/W [1]: FC80:GroupAddresses:X::dot11Address3:PRO:R/W [1]: FC80:GroupAddresses:X::dot11Address4:PRO:R/W [1]: FC80:GroupAddresses:X::dot11Address5:PRO:R/W [1]: FC80:GroupAddresses:X::dot11Address6:PRO:R/W [1]: FC80:GroupAddresses:X::dot11Address7:PRO:R/W [1]: FC80:GroupAddresses:X::dot11Address8:PRO:R/W [1]: FC80:GroupAddresses:X::dot11Address9:PRO:R/W [1]: FC01:cnfOwnMACAddress:X::dot11StationID:PRO:R/W: FC02:cnfDesiredSSID:X::dot11DesiredSSID:PRO:R/W: FC09:cnfPMEnabled:X::dot11PowerManagementMode:PRO:R/W: FC10:cnfOwnDTIMPeriod::X:dot11DTIMPeriod:API:R/W: FC23:cnfWEPDefaultKeyID:X:X:dot11WEPDefaultKeyID:API:R/W: FC24:cnfDefaultKey0:X:X:dot11WEPDefaultKey0:API:R/W: FC25:cnfDefaultKey1:X:X:dot11WEPDefaultKey1:API:R/W: FC26:cnfDefaultKey2:X:X:dot11WEPDefaultKey2:API:R/W: FC27:cnfDefaultKey3:X:X:dot11WEPDefaultKey3:API:R/W: FC28:cnfWEPFlags:X:X:dot11ExcludeUnencrypted:API:R/W: FC28:cnfWEPFlags:X:X:dot11PrivacyInvoked:API:R/W: FC82:FragmentationThreshold:X::dot11FragmentationThreshold:PRO:R/W: FC83:RTSThreshold:X::dot11RTSThreshold:PRO:R/W: FC84:TxRateControl:X::dot11OperationalRateSet:API:R/W: FD45:CurrentBeaconInterval:X:X:dot11BeaconPeriod:PRO:R/W: FD4D:AuthenticationAlgorithms:X:X:dot11AuthenticationAlgorithm1:PRO:R/W: FD4D:AuthenticationAlgorithms:X:X:dot11AuthenticationAlgorithmsEnable1:PRO:R/W: FD86:OwnMACAddress::X:dot11MACAddress:PRO:R/W: FCB2:cnfAuthenticationRspTO:X::dot11AuthenticationResponseTimeOut:API:R: FD12:TempType:X:X:dot11TempType:PRO:R: FD47:ProtocolRspTime:X:X:dot11AssociationResponseTimeOut:PRO:R: FD48:ShortRetryLimit:X:X:dot11ShortRetryLimit:PRO:R: FD49:LongRetryLimit:X:X:dot11LongRetryLimit:PRO:R: FD4A:MaxTransmitLifetime:::dot11MaxTransmitMSDULifetime:PRO:R: FD4B:MaxReceiveLifetime:::dot11MaxReceiveLifetime:PRO:R: FD4C:CFPollable:X::dot11CFPollable:PRO:R: FD4F:PrivacyOptionImplemented:::dot11PrivacyOptionImplemented:PRO:R: FD87:PCFInfo::X:dot11CFPMaxDuration:PRO:R: FD87:PCFInfo::X:dot11CFPPeriod:PRO:R: FD87:PCFInfo::X:dot11MediumOccupancyLimit:PRO:R: FDC0:PHYType:X:X:dot11PHYType:PRO:R: FDC1:CurrentChannel:X:X:dot11CurrentChannel:PRO:R: FDC3:CCAMode:X:X:dot11CurrentCCAMode:PRO:R: linux-wlan-ng-0.2.9+dfsg/src/prism2/ridlist/Makefile0000644000175000017500000000657211024763172021665 0ustar tormodtormod# src/prism2/ridlist/Makefile # # Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. # -------------------------------------------------------------------- # # linux-wlan # # 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. # # 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. # # -------------------------------------------------------------------- # # Inquiries regarding the linux-wlan Open Source project can be # made directly to: # # AbsoluteValue Systems Inc. # info@linux-wlan.com # http://www.linux-wlan.com # # -------------------------------------------------------------------- # # Portions of the development of this software were funded by # Intersil Corporation as part of PRISM(R) chipset product development. # # -------------------------------------------------------------------- -include ../../../config.mk # Implicit rules to handle the separate obj dirs OBJ_DIR=obj $(OBJ_DIR)/%.o : ../../shared/%.c $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ $(OBJ_DIR)/%.o : %.c $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ # Preprocessor Options CPPFLAGS= -I../../include -I$(LINUX_SRC)/include \ -D__LINUX_WLAN__ -D__I386__ # Source and obj and target definitions SHSRC= ../../shared/p80211types.c \ ../../shared/p80211metamsg.c \ ../../shared/p80211metamib.c \ ../../shared/p80211meta.c SHOBJ= $(OBJ_DIR)/p80211types.o \ $(OBJ_DIR)/p80211metamsg.o \ $(OBJ_DIR)/p80211metamib.o \ $(OBJ_DIR)/p80211meta.o MKRIDLIST_SRC= $(SHSRC) \ mkridlist.c MKRIDLIST_OBJ= $(SHOBJ) \ $(OBJ_DIR)/mkridlist.o MKMIBLIST_SRC= $(SHSRC) \ mkmiblist.c MKMIBLIST_OBJ= $(SHOBJ) \ $(OBJ_DIR)/mkmiblist.o # Rules all : dirs dirs : mkdir -p $(OBJ_DIR) mkridlist: $(MKRIDLIST_OBJ) ridlist.dat $(CC) -o $@ $(MKRIDLIST_OBJ) sort -t : -k 1 ridlist.dat > ridlist-rid.sort ./mkridlist ridlist-rid.sort ridlist-rid mv ridlist-rid.html ../../../doc/prism2 mv ridlist-rid.txt ../../../doc/prism2 sort -t : -k 5 ridlist.dat > ridlist-mib.sort ./mkridlist ridlist-mib.sort ridlist-mib mv ridlist-mib.html ../../../doc/prism2 mv ridlist-mib.txt ../../../doc/prism2 mkmiblist: $(MKMIBLIST_OBJ) ridlist.dat $(CC) -o $@ $(MKMIBLIST_OBJ) cut -f 1,2,5 -d : ridlist.dat | sort -t : -k 3 > miblist.sort ./mkmiblist miblist.sort miblist install: echo "Nothing to do" clean: rm -f .depend rm -f core core.* *.o .*.o *.s *.a *.sort tmp_make *~ tags rm -fr $(OBJ_DIR) rm -f mkridlist linux-wlan-ng-0.2.9+dfsg/src/prism2/ridlist/mkridlist.c0000644000175000017500000002244711024763172022372 0ustar tormodtormod/* src/prism2/ridlits/mkridlist.c * * Generates an HTML and text file version of the PRISM2 to MibItem * Name Mapping List * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- */ #include #include #include #include #include #include #include #include #define BUFF_LEN (256) int main(int argc, char **argv) { FILE *data_fptr; FILE *html_fptr; FILE *txt_fptr; char buff[BUFF_LEN + 2]; char ifname[BUFF_LEN + 2]; char ofname1[BUFF_LEN + 2]; char ofname2[BUFF_LEN + 2]; char *cptr; char *nptr; if ( argc < 3 ) { fprintf(stderr, "usage:\n"); fprintf(stderr, " mkridlist < ofilename\n"); fprintf(stderr, " ifilename - name of input file with extension\n"); fprintf(stderr, " ofilename - name of output file w/o extension\n"); exit(0); } sprintf( ifname, "%s", argv[1] ); sprintf( ofname1, "%s.html", argv[2] ); sprintf( ofname2, "%s.txt", argv[2] ); if ( (data_fptr = fopen(ifname, "r")) == NULL ) { fprintf(stderr, "Failed to open ridlist.dat\n"); exit(0); } if ( (html_fptr = fopen(ofname1, "w")) == NULL ) { fprintf(stderr, "Failed to open %s\n", ofname1); fclose(data_fptr); exit(0); } if ( (txt_fptr = fopen(ofname2, "w")) == NULL ) { fprintf(stderr, "Failed to open %s\n", ofname2); fclose(html_fptr); fclose(data_fptr); exit(0); } /* write HTML tags */ fprintf(html_fptr, "\n"); fprintf(html_fptr, "\n"); fprintf(html_fptr, "\t802.11 to PRISM2 RID Mapping List\n"); fprintf(html_fptr, "\n"); fprintf(html_fptr, "\n"); fprintf(html_fptr, "

\n"); fprintf(html_fptr, "doc/prism2/%s
Copyright" " (C) 2000 AbsoluteValue Software, Inc." " All Rights Reserved.
\n", ofname1); fprintf(html_fptr, "

\n"); fprintf(html_fptr, "

\n"); fprintf(html_fptr, "
API - The document source for this RID is the API Enhancements Document\n"); fprintf(html_fptr, "

\n"); fprintf(html_fptr, "

\n"); fprintf(html_fptr, "
PRO - The document source for this RID is the CW10 Programmer's Manual\n"); fprintf(html_fptr, "

\n"); fprintf(html_fptr, "

\n"); fprintf(html_fptr, "
[1] - read mode is implemented internally within the driver\n"); fprintf(html_fptr, "

\n"); fprintf(html_fptr, "

\n"); fprintf(html_fptr, "
[2] - This RID is implemented internally in the driver" " during implementation of the Group Addresses RID (0xFC80)\n"); fprintf(html_fptr, "

\n"); fprintf(html_fptr, "

\n"); fprintf(html_fptr, "
[3] - This RID is implemented internally in the driver\n"); fprintf(html_fptr, "

\n"); fprintf(html_fptr, "

\n"); fprintf(html_fptr, "
\n"); fprintf(html_fptr, "

\n"); fprintf(html_fptr, "

\n"); fprintf(html_fptr, "

\n"); fprintf(html_fptr, "\n"); fprintf(html_fptr, "\t\n"); fprintf(html_fptr, "\t\t\n"); /* get and print RID value */ nptr = strchr( cptr, ':' ); *nptr = '\0'; fprintf(txt_fptr, "%-6.6s | ", cptr); if ( strlen( cptr) != 0 ) { fprintf(html_fptr, "\t\t
PRISM2
RID
VALUE
\n"); fprintf(html_fptr, "\t\t
PRISM2
RID
NAME
\n"); fprintf(html_fptr, "\t\t
STA\n"); fprintf(html_fptr, "\t\tAP\n"); fprintf(html_fptr, "\t\t802.11 MibItem Name\n"); fprintf(html_fptr, "\t\tDoc
Src
\n"); fprintf(html_fptr, "\t\t
Implemented?\n"); /* write text file column headings */ fprintf(txt_fptr, "doc/prism2/%s\n", ofname2); fprintf(txt_fptr, " Copyright (C) 2000 AbsoluteValue Software, Inc." " All Rights Reserved.\n\n\n"); fprintf(txt_fptr, "\nAPI - The document source for this RID is the API Enhancements Document\n"); fprintf(txt_fptr, "\nPRO - The document source for this RID is the CW10 Programmer's Manual\n"); fprintf(txt_fptr, "\n[1] - read mode is implemented internally within the driver\n"); fprintf(txt_fptr, "\n[2] - This RID is implemented internally in the driver" " during implementation of the Group Addresses RID (0xFC80)\n"); fprintf(txt_fptr, "\n[3] - This RID is implemented internally in the driver\n"); fprintf(txt_fptr, "\n"); fprintf(txt_fptr, "======" "===" "====================" "===" "===" "===" "===" "===" "=====================================" "===" "===" "===" "=============\n"); fprintf(txt_fptr, "%-6.6s | %-20.20s | %-3.3s | %-3.3s | %-37.37s | %-3.3s | %s\n", "PRISM2", "PRISM2", " ", " ", " ", " ", " "); fprintf(txt_fptr, "%-6.6s | %-20.20s | %-3.3s | %-3.3s | %-37.37s | %-3.3s | %s\n", "RID", "RID", " ", " ", " ", "Doc", " "); fprintf(txt_fptr, "%-6.6s | %-20.20s | %-3.3s | %-3.3s | %-37.37s | %-3.3s | %s\n", "VALUE", "NAME", "STA", "AP", "MibItem NAME", "Src", "Implemented?"); fprintf(txt_fptr, "======" "===" "====================" "===" "===" "===" "===" "===" "=====================================" "===" "===" "===" "=============\n"); /* read the data file and produce HTML and text output */ while ( fgets( buff, BUFF_LEN + 1, data_fptr) != NULL ) { cptr = buff; fprintf(html_fptr, "\t
%s\n", cptr); } else { fprintf(html_fptr, "\t\t
   
\n"); } cptr = nptr + 1; /* get and print RID name */ nptr = strchr( cptr, ':' ); *nptr = '\0'; fprintf(txt_fptr, "%-20.20s | ", cptr); if ( strlen( cptr) != 0 ) { fprintf(html_fptr, "\t\t
%s\n", cptr); } else { fprintf(html_fptr, "\t\t
   
\n"); } cptr = nptr + 1; /* get and print STA */ nptr = strchr( cptr, ':' ); *nptr = '\0'; fprintf(txt_fptr, "%-3.3s | ", cptr); if ( strlen( cptr) != 0 ) { fprintf(html_fptr, "\t\t
%s\n", cptr); } else { fprintf(html_fptr, "\t\t
   
\n"); } cptr = nptr + 1; /* get and print AP */ nptr = strchr( cptr, ':' ); *nptr = '\0'; fprintf(txt_fptr, "%-3.3s | ", cptr); if ( strlen( cptr) != 0 ) { fprintf(html_fptr, "\t\t
%s\n", cptr); } else { fprintf(html_fptr, "\t\t
   
\n"); } cptr = nptr + 1; /* get and print MibItem Name */ nptr = strchr( cptr, ':' ); *nptr = '\0'; fprintf(txt_fptr, "%-37.37s | ", cptr); if ( strlen( cptr) != 0 ) { fprintf(html_fptr, "\t\t
%s\n", cptr); } else { fprintf(html_fptr, "\t\t
   
\n"); } cptr = nptr + 1; /* get and print Document Source */ nptr = strchr( cptr, ':' ); *nptr = '\0'; fprintf(txt_fptr, "%-3.3s | ", cptr); if ( strlen( cptr) != 0 ) { fprintf(html_fptr, "\t\t
%s\n", cptr); } else { fprintf(html_fptr, "\t\t
   
\n"); } cptr = nptr + 1; /* get and print Implemented */ nptr = strchr( cptr, ':' ); *nptr = '\0'; fprintf(txt_fptr, "%s\n", cptr); fprintf(txt_fptr, "------" "---" "--------------------" "---" "---" "---" "---" "---" "-------------------------------------" "---" "---" "---" "-------------\n"); if ( strlen( cptr) != 0 ) { fprintf(html_fptr, "\t\t
%s\n", cptr); } else { fprintf(html_fptr, "\t\t
   
\n"); } } fprintf(html_fptr, "
\n"); fprintf(html_fptr, "
\n"); fprintf(html_fptr, "\n"); fprintf(html_fptr, "\n"); fclose(txt_fptr); fclose(data_fptr); fclose(html_fptr); return 0; } linux-wlan-ng-0.2.9+dfsg/src/prism2/ridlist/mkmiblist.c0000644000175000017500000001043611024763172022356 0ustar tormodtormod/* src/prism2/ridlist/mkmiblist.c * * Generates a variation of the PRISM2 to MibItem Name Mapping List * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- */ #include #include #include #include #include #include #include #include #define BUFF_LEN (256) int main(int argc, char **argv) { FILE *data_fptr; FILE *txt_fptr; char buff[BUFF_LEN + 2]; char ifname[BUFF_LEN + 2]; char ofname1[BUFF_LEN + 2]; char *cptr; char *nptr; if ( argc < 3 ) { fprintf(stderr, "usage:\n"); fprintf(stderr, " mkridlist < ofilename\n"); fprintf(stderr, " ifilename - name of input file with extension\n"); fprintf(stderr, " ofilename - name of output file w/o extension\n"); exit(0); } sprintf( ifname, "%s", argv[1] ); sprintf( ofname1, "%s.txt", argv[2] ); if ( (data_fptr = fopen(ifname, "r")) == NULL ) { fprintf(stderr, "Failed to open ridlist.dat\n"); exit(0); } if ( (txt_fptr = fopen(ofname1, "w")) == NULL ) { fprintf(stderr, "Failed to open %s\n", ofname1); fclose(data_fptr); exit(0); } /* write text file column headings */ fprintf(txt_fptr, "src/prism2/ridlist/%s\n", ofname1); fprintf(txt_fptr, " Copyright (C) 2000 AbsoluteValue Software, Inc." " All Rights Reserved.\n\n"); fprintf(txt_fptr, "======" "===" "====================" "===" "=====================================\n"); fprintf(txt_fptr, "%-6.6s | %-20.20s | %s\n", "PRISM2", "PRISM2", " " ); fprintf(txt_fptr, "%-6.6s | %-20.20s | %s\n", "RID", "RID", " "); fprintf(txt_fptr, "%-6.6s | %-20.20s | %s\n", "VALUE", "NAME", "MibItem NAME"); fprintf(txt_fptr, "======" "===" "====================" "===" "=====================================\n"); /* read the data file and produce HTML and text output */ while ( fgets( buff, BUFF_LEN + 1, data_fptr) != NULL ) { if ( buff[strlen(buff) - 1] == '\n' ) { buff[strlen(buff) - 1] = '\0'; } cptr = buff; /* get and print RID value */ nptr = strchr( cptr, ':' ); *nptr = '\0'; fprintf(txt_fptr, "%-6.6s | ", cptr); cptr = nptr + 1; /* get and print RID name */ nptr = strchr( cptr, ':' ); *nptr = '\0'; fprintf(txt_fptr, "%-20.20s | ", cptr); cptr = nptr + 1; /* get and print MibItem Name */ fprintf(txt_fptr, "%-37.37s\n", cptr); fprintf(txt_fptr, "------" "---" "--------------------" "---" "-------------------------------------\n"); } fclose(txt_fptr); fclose(data_fptr); return 0; } linux-wlan-ng-0.2.9+dfsg/src/prism2/Makefile0000644000175000017500000000522711024763201020200 0ustar tormodtormod# src/prism2/Makefile # # Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. # -------------------------------------------------------------------- # # linux-wlan # # 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. # # 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. # # -------------------------------------------------------------------- # # Inquiries regarding the linux-wlan Open Source project can be # made directly to: # # AbsoluteValue Systems Inc. # info@linux-wlan.com # http://www.linux-wlan.com # # -------------------------------------------------------------------- # # Portions of the development of this software were funded by # Intersil Corporation as part of PRISM(R) chipset product development. # # -------------------------------------------------------------------- -include ../../config.mk DIRS=driver ridlist download ifneq ($(wildcard *.addon),) DIRS+=`cat *.addon` endif all: set -e; for d in $(DIRS); do $(MAKE) -C $$d ; done clean: set -e; for d in $(DIRS); do $(MAKE) -C $$d clean ; done rm -f core core.* *.o .*.o *.s *.a .depend tmp_make *~ tags for i in *_obj; do if [ -d $$i ]; then rm -fr $$i; fi; done install-firmware: mkdir -p $(TARGET_ROOT_ON_HOST)/etc/wlan cp shared.prism2 $(TARGET_ROOT_ON_HOST)/etc/wlan mkdir -p $(TARGET_ROOT_ON_HOST)$(FIRMWARE_DIR) cp *pda $(TARGET_ROOT_ON_HOST)$(FIRMWARE_DIR) for x in *.hex ; do \ if [ -f "$$x" ] ; then \ cp $$x $(TARGET_ROOT_ON_HOST)$(FIRMWARE_DIR)/prism2_`echo $$x | cut -c1-2`.hex ; \ fi; \ done install-recursive: set -e; for d in $(DIRS); do $(MAKE) -C $$d install ; done install: install-firmware install-recursive ctags: ctags -R linux-wlan-ng-0.2.9+dfsg/src/prism2/shared.prism20000644000175000017500000000742711024763201021150 0ustar tormodtormod# etc/wlan/shared.NSD # # Copyright (C) 2002 AbsoluteValue Systems, Inc. All Rights Reserved. # -------------------------------------------------------------------- # # linux-wlan # # 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. # # 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. # # -------------------------------------------------------------------- # # Inquiries regarding the linux-wlan Open Source project can be # made directly to: # # AbsoluteValue Systems Inc. # info@linux-wlan.com # http://www.linux-wlan.com # # -------------------------------------------------------------------- # This file contains NSD specific shell routines called from the # global shell routines found in linux-wlan/etc. # -------------------------------------------------------------------- PRISM2DL=/sbin/prism2dl prism2_fwload () { # $1 == wlandev # Perform NSD specific actions for loading f/w if [ ! -x $PRISM2DL ]; then $ECHO $PRISM2DL not found, aborting firmware download. return 0 fi # figure out hwtype initnichw="0007" # pci, 1x16 SRAM source_procfile /proc/net/p80211/$1/nsd cp $FIRMWARE_DIR/prism2_ssf.pda /tmp echo "2 0400 $initnichw" >> /tmp/prism2_ssf.pda oldhw=$initnichw # figure out firmware image and dump it over. $WLANCTL $1 lnxreq_ifstate ifstate=disable $WLANCTL $1 lnxreq_ifstate ifstate=fwload HARDWARE=`$PRISM2DL -s $1 | grep 0x0008 | cut -c26-29` case "$HARDWARE" in 8002|8003|8004|8008) # (3841) $PRISM2DL -r $FIRMWARE_DIR/prism2_r1.hex $1 ;; 800a|800b|8012|8016|801a|8021) # AMD Parallel Flash (3842) $PRISM2DL -r $FIRMWARE_DIR/prism2_af.hex -r $FIRMWARE_DIR/prism2_rf.hex $1 ;; 800c|8013|8017|801b|8022) # SST Parallel Flash (3842) $PRISM2DL -r $FIRMWARE_DIR/prism2_ak.hex -r $FIRMWARE_DIR/prism2_rf.hex $1 ;; 800e|8015|8019|801d|8024) # AT24C08 Small Serial Flash (3842) $PRISM2DL -r $FIRMWARE_DIR/prism2_pm.hex -r $FIRMWARE_DIR/prism2_rf.hex $1 ;; 800d|800e|8014|8015|8019|801c|801d|8023|8024) $PRISM2DL -r $FIRMWARE_DIR/prism2_rf.hex $1 ;; 800a|800f|8010|8011|801e|801f|8020|8025|8026|8027) # USB $PRISM2DL -r $FIRMWARE_DIR/prism2_ru.hex $1 ;; *) $ECHO "Unknown prism2 hardware type $HARDWARE ($hwtype), assuming SSF" $PRISM2DL -p /tmp/prism2_ssf.pda -r $FIRMWARE_DIR/prism2_pm.hex $1 # double-check the hwtype source_procfile /proc/net/p80211/$1/nsd # if it doesn't line up, fix the PDA and try again. if [ ! "$initnichw" = "$oldhw" ] ; then cp $FIRMWARE_DIR/prism2_ssf.pda /tmp echo "2 0400 $initnichw" >> /tmp/prism2_ssf.pda $PRISM2DL -p /tmp/prism2_ssf.pda -r $FIRMWARE_DIR/prism2_pm.hex $1 fi $PRISM2DL -r $FIRMWARE_DIR/prism2_pm.hex -r $FIRMWARE_DIR/prism2_rf.hex $1 ;; esac return $? } prism2_mibset () { # $1 == wlandev # Global (always performed) NSD specific MIB settings. return 0 } linux-wlan-ng-0.2.9+dfsg/src/prism2/driver/0000755000175000017500000000000011026545443020035 5ustar tormodtormodlinux-wlan-ng-0.2.9+dfsg/src/prism2/driver/hfa384x_usb.c0000644000175000017500000037510211024763177022253 0ustar tormodtormod/* src/prism2/driver/hfa384x_usb.c * * Functions that talk to the USB variantof the Intersil hfa384x MAC * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- * * This file implements functions that correspond to the prism2/hfa384x * 802.11 MAC hardware and firmware host interface. * * The functions can be considered to represent several levels of * abstraction. The lowest level functions are simply C-callable wrappers * around the register accesses. The next higher level represents C-callable * prism2 API functions that match the Intersil documentation as closely * as is reasonable. The next higher layer implements common sequences * of invokations of the API layer (e.g. write to bap, followed by cmd). * * Common sequences: * hfa384x_drvr_xxx Highest level abstractions provided by the * hfa384x code. They are driver defined wrappers * for common sequences. These functions generally * use the services of the lower levels. * * hfa384x_drvr_xxxconfig An example of the drvr level abstraction. These * functions are wrappers for the RID get/set * sequence. They call copy_[to|from]_bap() and * cmd_access(). These functions operate on the * RIDs and buffers without validation. The caller * is responsible for that. * * API wrapper functions: * hfa384x_cmd_xxx functions that provide access to the f/w commands. * The function arguments correspond to each command * argument, even command arguments that get packed * into single registers. These functions _just_ * issue the command by setting the cmd/parm regs * & reading the status/resp regs. Additional * activities required to fully use a command * (read/write from/to bap, get/set int status etc.) * are implemented separately. Think of these as * C-callable prism2 commands. * * Lowest Layer Functions: * hfa384x_docmd_xxx These functions implement the sequence required * to issue any prism2 command. Primarily used by the * hfa384x_cmd_xxx functions. * * hfa384x_bap_xxx BAP read/write access functions. * Note: we usually use BAP0 for non-interrupt context * and BAP1 for interrupt context. * * hfa384x_dl_xxx download related functions. * * Driver State Issues: * Note that there are two pairs of functions that manage the * 'initialized' and 'running' states of the hw/MAC combo. The four * functions are create(), destroy(), start(), and stop(). create() * sets up the data structures required to support the hfa384x_* * functions and destroy() cleans them up. The start() function gets * the actual hardware running and enables the interrupts. The stop() * function shuts the hardware down. The sequence should be: * create() * start() * . * . Do interesting things w/ the hardware * . * stop() * destroy() * * Note that destroy() can be called without calling stop() first. * -------------------------------------------------------------------- */ /*================================================================*/ /* System Includes */ #define WLAN_DBVAR prism2_debug #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if (WLAN_HOSTIF != WLAN_USB) #error "This file is specific to USB" #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) static int wait_for_completion_interruptible(struct completion *x) { int ret = 0; might_sleep(); spin_lock_irq(&x->wait.lock); if (!x->done) { DECLARE_WAITQUEUE(wait, current); wait.flags |= WQ_FLAG_EXCLUSIVE; __add_wait_queue_tail(&x->wait, &wait); do { if (signal_pending(current)) { ret = -ERESTARTSYS; __remove_wait_queue(&x->wait, &wait); goto out; } __set_current_state(TASK_INTERRUPTIBLE); spin_unlock_irq(&x->wait.lock); schedule(); spin_lock_irq(&x->wait.lock); } while (!x->done); __remove_wait_queue(&x->wait, &wait); } x->done--; out: spin_unlock_irq(&x->wait.lock); return ret; } #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,69) static void usb_init_urb(struct urb *urb) { memset(urb, 0, sizeof(*urb)); #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) /* tune me! */ urb->count = (atomic_t)ATOMIC_INIT(1); #endif spin_lock_init(&urb->lock); } #endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) /* tune me! */ # define SUBMIT_URB(u,f) usb_submit_urb(u,f) #else # define SUBMIT_URB(u,f) usb_submit_urb(u) #endif /*================================================================*/ /* Project Includes */ #include #include #include #include #include #include #include #include #include #include #include /*================================================================*/ /* Local Constants */ enum cmd_mode { DOWAIT = 0, DOASYNC }; typedef enum cmd_mode CMD_MODE; #define THROTTLE_JIFFIES (HZ/8) /*================================================================*/ /* Local Macros */ #define ROUNDUP64(a) (((a)+63)&~63) /*================================================================*/ /* Local Types */ /*================================================================*/ /* Local Static Definitions */ extern int prism2_debug; /*================================================================*/ /* Local Function Declarations */ #ifdef DEBUG_USB static void dbprint_urb(struct urb* urb); #endif static void hfa384x_int_rxmonitor( wlandevice_t *wlandev, hfa384x_usb_rxfrm_t *rxfrm); static void hfa384x_usb_defer(struct work_struct *data); static int submit_rx_urb(hfa384x_t *hw, gfp_t flags); static int submit_tx_urb(hfa384x_t *hw, struct urb *tx_urb, gfp_t flags); /*---------------------------------------------------*/ /* Callbacks */ #ifdef URB_ONLY_CALLBACK static void hfa384x_usbout_callback(struct urb *urb); static void hfa384x_ctlxout_callback(struct urb *urb); static void hfa384x_usbin_callback(struct urb *urb); #else static void hfa384x_usbout_callback(struct urb *urb, struct pt_regs *regs); static void hfa384x_ctlxout_callback(struct urb *urb, struct pt_regs *regs); static void hfa384x_usbin_callback(struct urb *urb, struct pt_regs *regs); #endif static void hfa384x_usbin_txcompl(wlandevice_t *wlandev, hfa384x_usbin_t *usbin); static void hfa384x_usbin_rx(wlandevice_t *wlandev, struct sk_buff *skb); static void hfa384x_usbin_info(wlandevice_t *wlandev, hfa384x_usbin_t *usbin); static void hfa384x_usbout_tx(wlandevice_t *wlandev, hfa384x_usbout_t *usbout); static void hfa384x_usbin_ctlx(hfa384x_t *hw, hfa384x_usbin_t *usbin, int urb_status); /*---------------------------------------------------*/ /* Functions to support the prism2 usb command queue */ static void hfa384x_usbctlxq_run(hfa384x_t *hw); static void hfa384x_usbctlx_reqtimerfn(unsigned long data); static void hfa384x_usbctlx_resptimerfn(unsigned long data); static void hfa384x_usb_throttlefn(unsigned long data); static void hfa384x_usbctlx_completion_task(unsigned long data); static void hfa384x_usbctlx_reaper_task(unsigned long data); static int hfa384x_usbctlx_submit(hfa384x_t *hw, hfa384x_usbctlx_t *ctlx); static void unlocked_usbctlx_complete(hfa384x_t *hw, hfa384x_usbctlx_t *ctlx); struct usbctlx_completor { int (*complete)(struct usbctlx_completor*); }; typedef struct usbctlx_completor usbctlx_completor_t; static int hfa384x_usbctlx_complete_sync(hfa384x_t *hw, hfa384x_usbctlx_t *ctlx, usbctlx_completor_t *completor); static int unlocked_usbctlx_cancel_async(hfa384x_t *hw, hfa384x_usbctlx_t *ctlx); static void hfa384x_cb_status(hfa384x_t *hw, const hfa384x_usbctlx_t *ctlx); static void hfa384x_cb_rrid(hfa384x_t *hw, const hfa384x_usbctlx_t *ctlx); static int usbctlx_get_status(const hfa384x_usb_cmdresp_t *cmdresp, hfa384x_cmdresult_t *result); static void usbctlx_get_rridresult(const hfa384x_usb_rridresp_t *rridresp, hfa384x_rridresult_t *result); /*---------------------------------------------------*/ /* Low level req/resp CTLX formatters and submitters */ static int hfa384x_docmd( hfa384x_t *hw, CMD_MODE mode, hfa384x_metacmd_t *cmd, ctlx_cmdcb_t cmdcb, ctlx_usercb_t usercb, void *usercb_data); static int hfa384x_dorrid( hfa384x_t *hw, CMD_MODE mode, UINT16 rid, void *riddata, UINT riddatalen, ctlx_cmdcb_t cmdcb, ctlx_usercb_t usercb, void *usercb_data); static int hfa384x_dowrid( hfa384x_t *hw, CMD_MODE mode, UINT16 rid, void *riddata, UINT riddatalen, ctlx_cmdcb_t cmdcb, ctlx_usercb_t usercb, void *usercb_data); static int hfa384x_dormem( hfa384x_t *hw, CMD_MODE mode, UINT16 page, UINT16 offset, void *data, UINT len, ctlx_cmdcb_t cmdcb, ctlx_usercb_t usercb, void *usercb_data); static int hfa384x_dowmem( hfa384x_t *hw, CMD_MODE mode, UINT16 page, UINT16 offset, void *data, UINT len, ctlx_cmdcb_t cmdcb, ctlx_usercb_t usercb, void *usercb_data); static int hfa384x_isgood_pdrcode(UINT16 pdrcode); /*================================================================*/ /* Function Definitions */ static inline const char* ctlxstr(CTLX_STATE s) { static const char* ctlx_str[] = { "Initial state", "Complete", "Request failed", "Request pending", "Request packet submitted", "Request packet completed", "Response packet completed" }; return ctlx_str[s]; }; static inline hfa384x_usbctlx_t* get_active_ctlx(hfa384x_t *hw) { return list_entry(hw->ctlxq.active.next, hfa384x_usbctlx_t, list); } #ifdef DEBUG_USB void dbprint_urb(struct urb* urb) { WLAN_LOG_DEBUG(3,"urb->pipe=0x%08x\n", urb->pipe); WLAN_LOG_DEBUG(3,"urb->status=0x%08x\n", urb->status); WLAN_LOG_DEBUG(3,"urb->transfer_flags=0x%08x\n", urb->transfer_flags); WLAN_LOG_DEBUG(3,"urb->transfer_buffer=0x%08x\n", (UINT)urb->transfer_buffer); WLAN_LOG_DEBUG(3,"urb->transfer_buffer_length=0x%08x\n", urb->transfer_buffer_length); WLAN_LOG_DEBUG(3,"urb->actual_length=0x%08x\n", urb->actual_length); WLAN_LOG_DEBUG(3,"urb->bandwidth=0x%08x\n", urb->bandwidth); WLAN_LOG_DEBUG(3,"urb->setup_packet(ctl)=0x%08x\n", (UINT)urb->setup_packet); WLAN_LOG_DEBUG(3,"urb->start_frame(iso/irq)=0x%08x\n", urb->start_frame); WLAN_LOG_DEBUG(3,"urb->interval(irq)=0x%08x\n", urb->interval); WLAN_LOG_DEBUG(3,"urb->error_count(iso)=0x%08x\n", urb->error_count); WLAN_LOG_DEBUG(3,"urb->timeout=0x%08x\n", urb->timeout); WLAN_LOG_DEBUG(3,"urb->context=0x%08x\n", (UINT)urb->context); WLAN_LOG_DEBUG(3,"urb->complete=0x%08x\n", (UINT)urb->complete); } #endif /*---------------------------------------------------------------- * submit_rx_urb * * Listen for input data on the BULK-IN pipe. If the pipe has * stalled then schedule it to be reset. * * Arguments: * hw device struct * memflags memory allocation flags * * Returns: * error code from submission * * Call context: * Any ----------------------------------------------------------------*/ static int submit_rx_urb(hfa384x_t *hw, gfp_t memflags) { struct sk_buff *skb; int result; DBFENTER; skb = dev_alloc_skb(sizeof(hfa384x_usbin_t)); if (skb == NULL) { result = -ENOMEM; goto done; } /* Post the IN urb */ usb_fill_bulk_urb(&hw->rx_urb, hw->usb, hw->endp_in, skb->data, sizeof(hfa384x_usbin_t), hfa384x_usbin_callback, hw->wlandev); hw->rx_urb_skb = skb; result = -ENOLINK; if ( !hw->wlandev->hwremoved && !test_bit(WORK_RX_HALT, &hw->usb_flags)) { result = SUBMIT_URB(&hw->rx_urb, memflags); /* Check whether we need to reset the RX pipe */ if (result == -EPIPE) { WLAN_LOG_WARNING("%s rx pipe stalled: requesting reset\n", hw->wlandev->netdev->name); if ( !test_and_set_bit(WORK_RX_HALT, &hw->usb_flags) ) schedule_work(&hw->usb_work); } } /* Don't leak memory if anything should go wrong */ if (result != 0) { dev_kfree_skb(skb); hw->rx_urb_skb = NULL; } done: DBFEXIT; return result; } /*---------------------------------------------------------------- * submit_tx_urb * * Prepares and submits the URB of transmitted data. If the * submission fails then it will schedule the output pipe to * be reset. * * Arguments: * hw device struct * tx_urb URB of data for tranmission * memflags memory allocation flags * * Returns: * error code from submission * * Call context: * Any ----------------------------------------------------------------*/ static int submit_tx_urb(hfa384x_t *hw, struct urb *tx_urb, gfp_t memflags) { struct net_device *netdev = hw->wlandev->netdev; int result; DBFENTER; result = -ENOLINK; if ( netif_running(netdev) ) { if ( !hw->wlandev->hwremoved && !test_bit(WORK_TX_HALT, &hw->usb_flags) ) { result = SUBMIT_URB(tx_urb, memflags); /* Test whether we need to reset the TX pipe */ if (result == -EPIPE) { WLAN_LOG_WARNING("%s tx pipe stalled: requesting reset\n", netdev->name); set_bit(WORK_TX_HALT, &hw->usb_flags); schedule_work(&hw->usb_work); } else if (result == 0) { netif_stop_queue(netdev); } } } DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa394x_usb_defer * * There are some things that the USB stack cannot do while * in interrupt context, so we arrange this function to run * in process context. * * Arguments: * hw device structure * * Returns: * nothing * * Call context: * process (by design) ----------------------------------------------------------------*/ static void hfa384x_usb_defer(struct work_struct *data) { hfa384x_t *hw = container_of(data, struct hfa384x, usb_work); struct net_device *netdev = hw->wlandev->netdev; DBFENTER; /* Don't bother trying to reset anything if the plug * has been pulled ... */ if ( hw->wlandev->hwremoved ) { DBFEXIT; return; } /* Reception has stopped: try to reset the input pipe */ if (test_bit(WORK_RX_HALT, &hw->usb_flags)) { int ret; usb_kill_urb(&hw->rx_urb); /* Cannot be holding spinlock! */ ret = usb_clear_halt(hw->usb, hw->endp_in); if (ret != 0) { printk(KERN_ERR "Failed to clear rx pipe for %s: err=%d\n", netdev->name, ret); } else { printk(KERN_INFO "%s rx pipe reset complete.\n", netdev->name); clear_bit(WORK_RX_HALT, &hw->usb_flags); set_bit(WORK_RX_RESUME, &hw->usb_flags); } } /* Resume receiving data back from the device. */ if ( test_bit(WORK_RX_RESUME, &hw->usb_flags) ) { int ret; ret = submit_rx_urb(hw, GFP_KERNEL); if (ret != 0) { printk(KERN_ERR "Failed to resume %s rx pipe.\n", netdev->name); } else { clear_bit(WORK_RX_RESUME, &hw->usb_flags); } } /* Transmission has stopped: try to reset the output pipe */ if (test_bit(WORK_TX_HALT, &hw->usb_flags)) { int ret; usb_kill_urb(&hw->tx_urb); ret = usb_clear_halt(hw->usb, hw->endp_out); if (ret != 0) { printk(KERN_ERR "Failed to clear tx pipe for %s: err=%d\n", netdev->name, ret); } else { printk(KERN_INFO "%s tx pipe reset complete.\n", netdev->name); clear_bit(WORK_TX_HALT, &hw->usb_flags); set_bit(WORK_TX_RESUME, &hw->usb_flags); /* Stopping the BULK-OUT pipe also blocked * us from sending any more CTLX URBs, so * we need to re-run our queue ... */ hfa384x_usbctlxq_run(hw); } } /* Resume transmitting. */ if ( test_and_clear_bit(WORK_TX_RESUME, &hw->usb_flags) ) { p80211netdev_wake_queue(hw->wlandev); } DBFEXIT; } /*---------------------------------------------------------------- * hfa384x_create * * Sets up the hfa384x_t data structure for use. Note this * does _not_ intialize the actual hardware, just the data structures * we use to keep track of its state. * * Arguments: * hw device structure * irq device irq number * iobase i/o base address for register access * membase memory base address for register access * * Returns: * nothing * * Side effects: * * Call context: * process ----------------------------------------------------------------*/ void hfa384x_create( hfa384x_t *hw, struct usb_device *usb) { DBFENTER; memset(hw, 0, sizeof(hfa384x_t)); hw->usb = usb; /* set up the endpoints */ hw->endp_in = usb_rcvbulkpipe(usb, 1); hw->endp_out = usb_sndbulkpipe(usb, 2); /* Set up the waitq */ init_waitqueue_head(&hw->cmdq); /* Initialize the command queue */ spin_lock_init(&hw->ctlxq.lock); INIT_LIST_HEAD(&hw->ctlxq.pending); INIT_LIST_HEAD(&hw->ctlxq.active); INIT_LIST_HEAD(&hw->ctlxq.completing); INIT_LIST_HEAD(&hw->ctlxq.reapable); /* Initialize the authentication queue */ skb_queue_head_init(&hw->authq); tasklet_init(&hw->reaper_bh, hfa384x_usbctlx_reaper_task, (unsigned long)hw); tasklet_init(&hw->completion_bh, hfa384x_usbctlx_completion_task, (unsigned long)hw); INIT_WORK2(&hw->link_bh, prism2sta_processing_defer); INIT_WORK2(&hw->usb_work, hfa384x_usb_defer); init_timer(&hw->throttle); hw->throttle.function = hfa384x_usb_throttlefn; hw->throttle.data = (unsigned long)hw; init_timer(&hw->resptimer); hw->resptimer.function = hfa384x_usbctlx_resptimerfn; hw->resptimer.data = (unsigned long)hw; init_timer(&hw->reqtimer); hw->reqtimer.function = hfa384x_usbctlx_reqtimerfn; hw->reqtimer.data = (unsigned long)hw; usb_init_urb(&hw->rx_urb); usb_init_urb(&hw->tx_urb); usb_init_urb(&hw->ctlx_urb); hw->link_status = HFA384x_LINK_NOTCONNECTED; hw->state = HFA384x_STATE_INIT; INIT_WORK2(&hw->commsqual_bh, prism2sta_commsqual_defer); init_timer(&hw->commsqual_timer); hw->commsqual_timer.data = (unsigned long) hw; hw->commsqual_timer.function = prism2sta_commsqual_timer; DBFEXIT; } /*---------------------------------------------------------------- * hfa384x_destroy * * Partner to hfa384x_create(). This function cleans up the hw * structure so that it can be freed by the caller using a simple * kfree. Currently, this function is just a placeholder. If, at some * point in the future, an hw in the 'shutdown' state requires a 'deep' * kfree, this is where it should be done. Note that if this function * is called on a _running_ hw structure, the drvr_stop() function is * called. * * Arguments: * hw device structure * * Returns: * nothing, this function is not allowed to fail. * * Side effects: * * Call context: * process ----------------------------------------------------------------*/ void hfa384x_destroy( hfa384x_t *hw) { struct sk_buff *skb; DBFENTER; if ( hw->state == HFA384x_STATE_RUNNING ) { hfa384x_drvr_stop(hw); } hw->state = HFA384x_STATE_PREINIT; if (hw->scanresults) { kfree(hw->scanresults); hw->scanresults = NULL; } /* Now to clean out the auth queue */ while ( (skb = skb_dequeue(&hw->authq)) ) { dev_kfree_skb(skb); } DBFEXIT; } /*---------------------------------------------------------------- */ static hfa384x_usbctlx_t* usbctlx_alloc(void) { hfa384x_usbctlx_t *ctlx; ctlx = kmalloc(sizeof(*ctlx), in_interrupt() ? GFP_ATOMIC : GFP_KERNEL); if (ctlx != NULL) { memset(ctlx, 0, sizeof(*ctlx)); init_completion(&ctlx->done); } return ctlx; } /*---------------------------------------------------------------- * ----------------------------------------------------------------*/ static int usbctlx_get_status(const hfa384x_usb_cmdresp_t *cmdresp, hfa384x_cmdresult_t *result) { DBFENTER; result->status = hfa384x2host_16(cmdresp->status); result->resp0 = hfa384x2host_16(cmdresp->resp0); result->resp1 = hfa384x2host_16(cmdresp->resp1); result->resp2 = hfa384x2host_16(cmdresp->resp2); WLAN_LOG_DEBUG(4, "cmdresult:status=0x%04x " "resp0=0x%04x resp1=0x%04x resp2=0x%04x\n", result->status, result->resp0, result->resp1, result->resp2); DBFEXIT; return (result->status & HFA384x_STATUS_RESULT); } static void usbctlx_get_rridresult(const hfa384x_usb_rridresp_t *rridresp, hfa384x_rridresult_t *result) { DBFENTER; result->rid = hfa384x2host_16(rridresp->rid); result->riddata = rridresp->data; result->riddata_len = ((hfa384x2host_16(rridresp->frmlen) - 1) * 2); DBFEXIT; } /*---------------------------------------------------------------- * Completor object: * This completor must be passed to hfa384x_usbctlx_complete_sync() * when processing a CTLX that returns a hfa384x_cmdresult_t structure. ----------------------------------------------------------------*/ struct usbctlx_cmd_completor { usbctlx_completor_t head; const hfa384x_usb_cmdresp_t *cmdresp; hfa384x_cmdresult_t *result; }; typedef struct usbctlx_cmd_completor usbctlx_cmd_completor_t; static int usbctlx_cmd_completor_fn(usbctlx_completor_t *head) { usbctlx_cmd_completor_t *complete = (usbctlx_cmd_completor_t*)head; return usbctlx_get_status(complete->cmdresp, complete->result); } static inline usbctlx_completor_t* init_cmd_completor(usbctlx_cmd_completor_t *completor, const hfa384x_usb_cmdresp_t *cmdresp, hfa384x_cmdresult_t *result) { completor->head.complete = usbctlx_cmd_completor_fn; completor->cmdresp = cmdresp; completor->result = result; return &(completor->head); } /*---------------------------------------------------------------- * Completor object: * This completor must be passed to hfa384x_usbctlx_complete_sync() * when processing a CTLX that reads a RID. ----------------------------------------------------------------*/ struct usbctlx_rrid_completor { usbctlx_completor_t head; const hfa384x_usb_rridresp_t *rridresp; void *riddata; UINT riddatalen; }; typedef struct usbctlx_rrid_completor usbctlx_rrid_completor_t; static int usbctlx_rrid_completor_fn(usbctlx_completor_t *head) { usbctlx_rrid_completor_t *complete = (usbctlx_rrid_completor_t*)head; hfa384x_rridresult_t rridresult; usbctlx_get_rridresult(complete->rridresp, &rridresult); /* Validate the length, note body len calculation in bytes */ if ( rridresult.riddata_len != complete->riddatalen ) { WLAN_LOG_WARNING( "RID len mismatch, rid=0x%04x hlen=%d fwlen=%d\n", rridresult.rid, complete->riddatalen, rridresult.riddata_len); return -ENODATA; } memcpy(complete->riddata, rridresult.riddata, complete->riddatalen); return 0; } static inline usbctlx_completor_t* init_rrid_completor(usbctlx_rrid_completor_t *completor, const hfa384x_usb_rridresp_t *rridresp, void *riddata, UINT riddatalen) { completor->head.complete = usbctlx_rrid_completor_fn; completor->rridresp = rridresp; completor->riddata = riddata; completor->riddatalen = riddatalen; return &(completor->head); } /*---------------------------------------------------------------- * Completor object: * Interprets the results of a synchronous RID-write ----------------------------------------------------------------*/ typedef usbctlx_cmd_completor_t usbctlx_wrid_completor_t; #define init_wrid_completor init_cmd_completor /*---------------------------------------------------------------- * Completor object: * Interprets the results of a synchronous memory-write ----------------------------------------------------------------*/ typedef usbctlx_cmd_completor_t usbctlx_wmem_completor_t; #define init_wmem_completor init_cmd_completor /*---------------------------------------------------------------- * Completor object: * Interprets the results of a synchronous memory-read ----------------------------------------------------------------*/ struct usbctlx_rmem_completor { usbctlx_completor_t head; const hfa384x_usb_rmemresp_t *rmemresp; void *data; UINT len; }; typedef struct usbctlx_rmem_completor usbctlx_rmem_completor_t; static int usbctlx_rmem_completor_fn(usbctlx_completor_t *head) { usbctlx_rmem_completor_t *complete = (usbctlx_rmem_completor_t*)head; WLAN_LOG_DEBUG(4,"rmemresp:len=%d\n", complete->rmemresp->frmlen); memcpy(complete->data, complete->rmemresp->data, complete->len); return 0; } static inline usbctlx_completor_t* init_rmem_completor(usbctlx_rmem_completor_t *completor, hfa384x_usb_rmemresp_t *rmemresp, void *data, UINT len) { completor->head.complete = usbctlx_rmem_completor_fn; completor->rmemresp = rmemresp; completor->data = data; completor->len = len; return &(completor->head); } /*---------------------------------------------------------------- * hfa384x_cb_status * * Ctlx_complete handler for async CMD type control exchanges. * mark the hw struct as such. * * Note: If the handling is changed here, it should probably be * changed in docmd as well. * * Arguments: * hw hw struct * ctlx completed CTLX * * Returns: * nothing * * Side effects: * * Call context: * interrupt ----------------------------------------------------------------*/ static void hfa384x_cb_status(hfa384x_t *hw, const hfa384x_usbctlx_t *ctlx) { DBFENTER; if ( ctlx->usercb != NULL ) { hfa384x_cmdresult_t cmdresult; if (ctlx->state != CTLX_COMPLETE) { memset(&cmdresult, 0, sizeof(cmdresult)); cmdresult.status = HFA384x_STATUS_RESULT_SET(HFA384x_CMD_ERR); } else { usbctlx_get_status(&ctlx->inbuf.cmdresp, &cmdresult); } ctlx->usercb(hw, &cmdresult, ctlx->usercb_data); } DBFEXIT; } /*---------------------------------------------------------------- * hfa384x_cb_rrid * * CTLX completion handler for async RRID type control exchanges. * * Note: If the handling is changed here, it should probably be * changed in dorrid as well. * * Arguments: * hw hw struct * ctlx completed CTLX * * Returns: * nothing * * Side effects: * * Call context: * interrupt ----------------------------------------------------------------*/ static void hfa384x_cb_rrid(hfa384x_t *hw, const hfa384x_usbctlx_t *ctlx) { DBFENTER; if ( ctlx->usercb != NULL ) { hfa384x_rridresult_t rridresult; if (ctlx->state != CTLX_COMPLETE) { memset(&rridresult, 0, sizeof(rridresult)); rridresult.rid = hfa384x2host_16(ctlx->outbuf.rridreq.rid); } else { usbctlx_get_rridresult(&ctlx->inbuf.rridresp, &rridresult); } ctlx->usercb(hw, &rridresult, ctlx->usercb_data); } DBFEXIT; } static inline int hfa384x_docmd_wait(hfa384x_t *hw, hfa384x_metacmd_t *cmd) { return hfa384x_docmd(hw, DOWAIT, cmd, NULL, NULL, NULL); } static inline int hfa384x_docmd_async(hfa384x_t *hw, hfa384x_metacmd_t *cmd, ctlx_cmdcb_t cmdcb, ctlx_usercb_t usercb, void *usercb_data) { return hfa384x_docmd(hw, DOASYNC, cmd, cmdcb, usercb, usercb_data); } static inline int hfa384x_dorrid_wait(hfa384x_t *hw, UINT16 rid, void *riddata, UINT riddatalen) { return hfa384x_dorrid(hw, DOWAIT, rid, riddata, riddatalen, NULL, NULL, NULL); } static inline int hfa384x_dorrid_async(hfa384x_t *hw, UINT16 rid, void *riddata, UINT riddatalen, ctlx_cmdcb_t cmdcb, ctlx_usercb_t usercb, void *usercb_data) { return hfa384x_dorrid(hw, DOASYNC, rid, riddata, riddatalen, cmdcb, usercb, usercb_data); } static inline int hfa384x_dowrid_wait(hfa384x_t *hw, UINT16 rid, void *riddata, UINT riddatalen) { return hfa384x_dowrid(hw, DOWAIT, rid, riddata, riddatalen, NULL, NULL, NULL); } static inline int hfa384x_dowrid_async(hfa384x_t *hw, UINT16 rid, void *riddata, UINT riddatalen, ctlx_cmdcb_t cmdcb, ctlx_usercb_t usercb, void *usercb_data) { return hfa384x_dowrid(hw, DOASYNC, rid, riddata, riddatalen, cmdcb, usercb, usercb_data); } static inline int hfa384x_dormem_wait(hfa384x_t *hw, UINT16 page, UINT16 offset, void *data, UINT len) { return hfa384x_dormem(hw, DOWAIT, page, offset, data, len, NULL, NULL, NULL); } static inline int hfa384x_dormem_async(hfa384x_t *hw, UINT16 page, UINT16 offset, void *data, UINT len, ctlx_cmdcb_t cmdcb, ctlx_usercb_t usercb, void *usercb_data) { return hfa384x_dormem(hw, DOASYNC, page, offset, data, len, cmdcb, usercb, usercb_data); } static inline int hfa384x_dowmem_wait( hfa384x_t *hw, UINT16 page, UINT16 offset, void *data, UINT len) { return hfa384x_dowmem(hw, DOWAIT, page, offset, data, len, NULL, NULL, NULL); } static inline int hfa384x_dowmem_async( hfa384x_t *hw, UINT16 page, UINT16 offset, void *data, UINT len, ctlx_cmdcb_t cmdcb, ctlx_usercb_t usercb, void *usercb_data) { return hfa384x_dowmem(hw, DOASYNC, page, offset, data, len, cmdcb, usercb, usercb_data); } /*---------------------------------------------------------------- * hfa384x_cmd_initialize * * Issues the initialize command and sets the hw->state based * on the result. * * Arguments: * hw device structure * * Returns: * 0 success * >0 f/w reported error - f/w status code * <0 driver reported error * * Side effects: * * Call context: * process ----------------------------------------------------------------*/ int hfa384x_cmd_initialize(hfa384x_t *hw) { int result = 0; int i; hfa384x_metacmd_t cmd; DBFENTER; cmd.cmd = HFA384x_CMDCODE_INIT; cmd.parm0 = 0; cmd.parm1 = 0; cmd.parm2 = 0; result = hfa384x_docmd_wait(hw, &cmd); WLAN_LOG_DEBUG(3,"cmdresp.init: " "status=0x%04x, resp0=0x%04x, " "resp1=0x%04x, resp2=0x%04x\n", cmd.result.status, cmd.result.resp0, cmd.result.resp1, cmd.result.resp2); if ( result == 0 ) { for ( i = 0; i < HFA384x_NUMPORTS_MAX; i++) { hw->port_enabled[i] = 0; } } hw->link_status = HFA384x_LINK_NOTCONNECTED; DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_cmd_disable * * Issues the disable command to stop communications on one of * the MACs 'ports'. * * Arguments: * hw device structure * macport MAC port number (host order) * * Returns: * 0 success * >0 f/w reported failure - f/w status code * <0 driver reported error (timeout|bad arg) * * Side effects: * * Call context: * process ----------------------------------------------------------------*/ int hfa384x_cmd_disable(hfa384x_t *hw, UINT16 macport) { int result = 0; hfa384x_metacmd_t cmd; DBFENTER; cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_DISABLE) | HFA384x_CMD_MACPORT_SET(macport); cmd.parm0 = 0; cmd.parm1 = 0; cmd.parm2 = 0; result = hfa384x_docmd_wait(hw, &cmd); DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_cmd_enable * * Issues the enable command to enable communications on one of * the MACs 'ports'. * * Arguments: * hw device structure * macport MAC port number * * Returns: * 0 success * >0 f/w reported failure - f/w status code * <0 driver reported error (timeout|bad arg) * * Side effects: * * Call context: * process ----------------------------------------------------------------*/ int hfa384x_cmd_enable(hfa384x_t *hw, UINT16 macport) { int result = 0; hfa384x_metacmd_t cmd; DBFENTER; cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_ENABLE) | HFA384x_CMD_MACPORT_SET(macport); cmd.parm0 = 0; cmd.parm1 = 0; cmd.parm2 = 0; result = hfa384x_docmd_wait(hw, &cmd); DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_cmd_notify * * Sends an info frame to the firmware to alter the behavior * of the f/w asynch processes. Can only be called when the MAC * is in the enabled state. * * Arguments: * hw device structure * reclaim [0|1] indicates whether the given FID will * be handed back (via Alloc event) for reuse. * (host order) * fid FID of buffer containing the frame that was * previously copied to MAC memory via the bap. * (host order) * * Returns: * 0 success * >0 f/w reported failure - f/w status code * <0 driver reported error (timeout|bad arg) * * Side effects: * hw->resp0 will contain the FID being used by async notify * process. If reclaim==0, resp0 will be the same as the fid * argument. If reclaim==1, resp0 will be the different. * * Call context: * process ----------------------------------------------------------------*/ int hfa384x_cmd_notify(hfa384x_t *hw, UINT16 reclaim, UINT16 fid, void *buf, UINT16 len) { #if 0 int result = 0; UINT16 cmd; DBFENTER; cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_NOTIFY) | HFA384x_CMD_RECL_SET(reclaim); result = hfa384x_docmd_wait(hw, cmd); DBFEXIT; return result; #endif return 0; } #if 0 /*---------------------------------------------------------------- * hfa384x_cmd_inquiry * * Requests an info frame from the firmware. The info frame will * be delivered asynchronously via the Info event. * * Arguments: * hw device structure * fid FID of the info frame requested. (host order) * * Returns: * 0 success * >0 f/w reported failure - f/w status code * <0 driver reported error (timeout|bad arg) * * Side effects: * * Call context: * process ----------------------------------------------------------------*/ int hfa384x_cmd_inquiry(hfa384x_t *hw, UINT16 fid) { int result = 0; hfa384x_metacmd_t cmd; DBFENTER; cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_INQ); cmd.parm0 = 0; cmd.parm1 = 0; cmd.parm2 = 0; result = hfa384x_docmd_wait(hw, &cmd); DBFEXIT; return result; } #endif /*---------------------------------------------------------------- * hfa384x_cmd_monitor * * Enables the 'monitor mode' of the MAC. Here's the description of * monitor mode that I've received thus far: * * "The "monitor mode" of operation is that the MAC passes all * frames for which the PLCP checks are correct. All received * MPDUs are passed to the host with MAC Port = 7, with a * receive status of good, FCS error, or undecryptable. Passing * certain MPDUs is a violation of the 802.11 standard, but useful * for a debugging tool." Normal communication is not possible * while monitor mode is enabled. * * Arguments: * hw device structure * enable a code (0x0b|0x0f) that enables/disables * monitor mode. (host order) * * Returns: * 0 success * >0 f/w reported failure - f/w status code * <0 driver reported error (timeout|bad arg) * * Side effects: * * Call context: * process ----------------------------------------------------------------*/ int hfa384x_cmd_monitor(hfa384x_t *hw, UINT16 enable) { int result = 0; hfa384x_metacmd_t cmd; DBFENTER; cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) | HFA384x_CMD_AINFO_SET(enable); cmd.parm0 = 0; cmd.parm1 = 0; cmd.parm2 = 0; result = hfa384x_docmd_wait(hw, &cmd); DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_cmd_download * * Sets the controls for the MAC controller code/data download * process. The arguments set the mode and address associated * with a download. Note that the aux registers should be enabled * prior to setting one of the download enable modes. * * Arguments: * hw device structure * mode 0 - Disable programming and begin code exec * 1 - Enable volatile mem programming * 2 - Enable non-volatile mem programming * 3 - Program non-volatile section from NV download * buffer. * (host order) * lowaddr * highaddr For mode 1, sets the high & low order bits of * the "destination address". This address will be * the execution start address when download is * subsequently disabled. * For mode 2, sets the high & low order bits of * the destination in NV ram. * For modes 0 & 3, should be zero. (host order) * NOTE: these are CMD format. * codelen Length of the data to write in mode 2, * zero otherwise. (host order) * * Returns: * 0 success * >0 f/w reported failure - f/w status code * <0 driver reported error (timeout|bad arg) * * Side effects: * * Call context: * process ----------------------------------------------------------------*/ int hfa384x_cmd_download(hfa384x_t *hw, UINT16 mode, UINT16 lowaddr, UINT16 highaddr, UINT16 codelen) { int result = 0; hfa384x_metacmd_t cmd; DBFENTER; WLAN_LOG_DEBUG(5, "mode=%d, lowaddr=0x%04x, highaddr=0x%04x, codelen=%d\n", mode, lowaddr, highaddr, codelen); cmd.cmd = (HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_DOWNLD) | HFA384x_CMD_PROGMODE_SET(mode)); cmd.parm0 = lowaddr; cmd.parm1 = highaddr; cmd.parm2 = codelen; result = hfa384x_docmd_wait(hw, &cmd); DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_copy_from_aux * * Copies a collection of bytes from the controller memory. The * Auxiliary port MUST be enabled prior to calling this function. * We _might_ be in a download state. * * Arguments: * hw device structure * cardaddr address in hfa384x data space to read * auxctl address space select * buf ptr to destination host buffer * len length of data to transfer (in bytes) * * Returns: * nothing * * Side effects: * buf contains the data copied * * Call context: * process * interrupt ----------------------------------------------------------------*/ void hfa384x_copy_from_aux( hfa384x_t *hw, UINT32 cardaddr, UINT32 auxctl, void *buf, UINT len) { DBFENTER; WLAN_LOG_ERROR("not used in USB.\n"); DBFEXIT; } /*---------------------------------------------------------------- * hfa384x_copy_to_aux * * Copies a collection of bytes to the controller memory. The * Auxiliary port MUST be enabled prior to calling this function. * We _might_ be in a download state. * * Arguments: * hw device structure * cardaddr address in hfa384x data space to read * auxctl address space select * buf ptr to destination host buffer * len length of data to transfer (in bytes) * * Returns: * nothing * * Side effects: * Controller memory now contains a copy of buf * * Call context: * process * interrupt ----------------------------------------------------------------*/ void hfa384x_copy_to_aux( hfa384x_t *hw, UINT32 cardaddr, UINT32 auxctl, void *buf, UINT len) { DBFENTER; WLAN_LOG_ERROR("not used in USB.\n"); DBFEXIT; } /*---------------------------------------------------------------- * hfa384x_corereset * * Perform a reset of the hfa38xx MAC core. We assume that the hw * structure is in its "created" state. That is, it is initialized * with proper values. Note that if a reset is done after the * device has been active for awhile, the caller might have to clean * up some leftover cruft in the hw structure. * * Arguments: * hw device structure * holdtime how long (in ms) to hold the reset * settletime how long (in ms) to wait after releasing * the reset * * Returns: * nothing * * Side effects: * * Call context: * process ----------------------------------------------------------------*/ int hfa384x_corereset(hfa384x_t *hw, int holdtime, int settletime, int genesis) { #if 0 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) struct usb_device *parent = hw->usb->parent; int i; int port = -1; #endif #endif int result = 0; #define P2_USB_RT_PORT (USB_TYPE_CLASS | USB_RECIP_OTHER) #define P2_USB_FEAT_RESET 4 #define P2_USB_FEAT_C_RESET 20 DBFENTER; #if 0 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) /* Find the hub port */ for ( i = 0; i < parent->maxchild; i++) { if (parent->children[i] == hw->usb) { port = i; break; } } if (port < 0) return -ENOENT; /* Set and clear the reset */ usb_control_msg(parent, usb_sndctrlpipe(parent, 0), USB_REQ_SET_FEATURE, P2_USB_RT_PORT, P2_USB_FEAT_RESET, port+1, NULL, 0, 1*HZ); wait_ms(holdtime); usb_control_msg(parent, usb_sndctrlpipe(parent, 0), USB_REQ_CLEAR_FEATURE, P2_USB_RT_PORT, P2_USB_FEAT_C_RESET, port+1, NULL, 0, 1*HZ); wait_ms(settletime); /* Set the device address */ result=usb_set_address(hw->usb); if (result < 0) { WLAN_LOG_ERROR("reset_usbdev: Dev not accepting address, " "result=%d\n", result); clear_bit(hw->usb->devnum, &hw->usb->bus->devmap.devicemap); hw->usb->devnum = -1; goto done; } /* Let the address settle */ wait_ms(20); /* Assume we're reusing the original descriptor data */ /* Set the configuration. */ WLAN_LOG_DEBUG(3, "Setting Configuration %d\n", hw->usb->config[0].bConfigurationValue); result=usb_set_configuration(hw->usb, hw->usb->config[0].bConfigurationValue); if ( result ) { WLAN_LOG_ERROR("usb_set_configuration() failed, result=%d.\n", result); goto done; } /* Let the configuration settle */ wait_ms(20); done: #else result=usb_reset_device(hw->usb); if(result<0) { WLAN_LOG_ERROR("usb_reset_device() failed, result=%d.\n",result); } #endif #endif result=usb_reset_device(hw->usb); if(result<0) { WLAN_LOG_ERROR("usb_reset_device() failed, result=%d.\n",result); } DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_usbctlx_complete_sync * * Waits for a synchronous CTLX object to complete, * and then handles the response. * * Arguments: * hw device structure * ctlx CTLX ptr * completor functor object to decide what to * do with the CTLX's result. * * Returns: * 0 Success * -ERESTARTSYS Interrupted by a signal * -EIO CTLX failed * -ENODEV Adapter was unplugged * ??? Result from completor * * Side effects: * * Call context: * process ----------------------------------------------------------------*/ static int hfa384x_usbctlx_complete_sync(hfa384x_t *hw, hfa384x_usbctlx_t *ctlx, usbctlx_completor_t *completor) { unsigned long flags; int result; DBFENTER; result = wait_for_completion_interruptible(&ctlx->done); spin_lock_irqsave(&hw->ctlxq.lock, flags); /* * We can only handle the CTLX if the USB disconnect * function has not run yet ... */ cleanup: if ( hw->wlandev->hwremoved ) { spin_unlock_irqrestore(&hw->ctlxq.lock, flags); result = -ENODEV; } else if ( result != 0 ) { int runqueue = 0; /* * We were probably interrupted, so delete * this CTLX asynchronously, kill the timers * and the URB, and then start the next * pending CTLX. * * NOTE: We can only delete the timers and * the URB if this CTLX is active. */ if (ctlx == get_active_ctlx(hw)) { spin_unlock_irqrestore(&hw->ctlxq.lock, flags); del_singleshot_timer_sync(&hw->reqtimer); del_singleshot_timer_sync(&hw->resptimer); hw->req_timer_done = 1; hw->resp_timer_done = 1; usb_kill_urb(&hw->ctlx_urb); spin_lock_irqsave(&hw->ctlxq.lock, flags); runqueue = 1; /* * This scenario is so unlikely that I'm * happy with a grubby "goto" solution ... */ if ( hw->wlandev->hwremoved ) goto cleanup; } /* * The completion task will send this CTLX * to the reaper the next time it runs. We * are no longer in a hurry. */ ctlx->reapable = 1; ctlx->state = CTLX_REQ_FAILED; list_move_tail(&ctlx->list, &hw->ctlxq.completing); spin_unlock_irqrestore(&hw->ctlxq.lock, flags); if (runqueue) hfa384x_usbctlxq_run(hw); } else { if (ctlx->state == CTLX_COMPLETE) { result = completor->complete(completor); } else { WLAN_LOG_WARNING("CTLX[%d] error: state(%s)\n", hfa384x2host_16(ctlx->outbuf.type), ctlxstr(ctlx->state)); result = -EIO; } list_del(&ctlx->list); spin_unlock_irqrestore(&hw->ctlxq.lock, flags); kfree(ctlx); } DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_docmd * * Constructs a command CTLX and submits it. * * NOTE: Any changes to the 'post-submit' code in this function * need to be carried over to hfa384x_cbcmd() since the handling * is virtually identical. * * Arguments: * hw device structure * mode DOWAIT or DOASYNC * cmd cmd structure. Includes all arguments and result * data points. All in host order. in host order * cmdcb command-specific callback * usercb user callback for async calls, NULL for DOWAIT calls * usercb_data user supplied data pointer for async calls, NULL * for DOASYNC calls * * Returns: * 0 success * -EIO CTLX failure * -ERESTARTSYS Awakened on signal * >0 command indicated error, Status and Resp0-2 are * in hw structure. * * Side effects: * * * Call context: * process ----------------------------------------------------------------*/ static int hfa384x_docmd( hfa384x_t *hw, CMD_MODE mode, hfa384x_metacmd_t *cmd, ctlx_cmdcb_t cmdcb, ctlx_usercb_t usercb, void *usercb_data) { int result; hfa384x_usbctlx_t *ctlx; DBFENTER; ctlx = usbctlx_alloc(); if ( ctlx == NULL ) { result = -ENOMEM; goto done; } /* Initialize the command */ ctlx->outbuf.cmdreq.type = host2hfa384x_16(HFA384x_USB_CMDREQ); ctlx->outbuf.cmdreq.cmd = host2hfa384x_16(cmd->cmd); ctlx->outbuf.cmdreq.parm0 = host2hfa384x_16(cmd->parm0); ctlx->outbuf.cmdreq.parm1 = host2hfa384x_16(cmd->parm1); ctlx->outbuf.cmdreq.parm2 = host2hfa384x_16(cmd->parm2); ctlx->outbufsize = sizeof(ctlx->outbuf.cmdreq); WLAN_LOG_DEBUG(4, "cmdreq: cmd=0x%04x " "parm0=0x%04x parm1=0x%04x parm2=0x%04x\n", cmd->cmd, cmd->parm0, cmd->parm1, cmd->parm2); ctlx->reapable = mode; ctlx->cmdcb = cmdcb; ctlx->usercb = usercb; ctlx->usercb_data = usercb_data; result = hfa384x_usbctlx_submit(hw, ctlx); if (result != 0) { kfree(ctlx); } else if (mode == DOWAIT) { usbctlx_cmd_completor_t completor; result = hfa384x_usbctlx_complete_sync( hw, ctlx, init_cmd_completor(&completor, &ctlx->inbuf.cmdresp, &cmd->result) ); } done: DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_dorrid * * Constructs a read rid CTLX and issues it. * * NOTE: Any changes to the 'post-submit' code in this function * need to be carried over to hfa384x_cbrrid() since the handling * is virtually identical. * * Arguments: * hw device structure * mode DOWAIT or DOASYNC * rid Read RID number (host order) * riddata Caller supplied buffer that MAC formatted RID.data * record will be written to for DOWAIT calls. Should * be NULL for DOASYNC calls. * riddatalen Buffer length for DOWAIT calls. Zero for DOASYNC calls. * cmdcb command callback for async calls, NULL for DOWAIT calls * usercb user callback for async calls, NULL for DOWAIT calls * usercb_data user supplied data pointer for async calls, NULL * for DOWAIT calls * * Returns: * 0 success * -EIO CTLX failure * -ERESTARTSYS Awakened on signal * -ENODATA riddatalen != macdatalen * >0 command indicated error, Status and Resp0-2 are * in hw structure. * * Side effects: * * Call context: * interrupt (DOASYNC) * process (DOWAIT or DOASYNC) ----------------------------------------------------------------*/ static int hfa384x_dorrid( hfa384x_t *hw, CMD_MODE mode, UINT16 rid, void *riddata, UINT riddatalen, ctlx_cmdcb_t cmdcb, ctlx_usercb_t usercb, void *usercb_data) { int result; hfa384x_usbctlx_t *ctlx; DBFENTER; ctlx = usbctlx_alloc(); if ( ctlx == NULL ) { result = -ENOMEM; goto done; } /* Initialize the command */ ctlx->outbuf.rridreq.type = host2hfa384x_16(HFA384x_USB_RRIDREQ); ctlx->outbuf.rridreq.frmlen = host2hfa384x_16(sizeof(ctlx->outbuf.rridreq.rid)); ctlx->outbuf.rridreq.rid = host2hfa384x_16(rid); ctlx->outbufsize = sizeof(ctlx->outbuf.rridreq); ctlx->reapable = mode; ctlx->cmdcb = cmdcb; ctlx->usercb = usercb; ctlx->usercb_data = usercb_data; /* Submit the CTLX */ result = hfa384x_usbctlx_submit(hw, ctlx); if (result != 0) { kfree(ctlx); } else if (mode == DOWAIT) { usbctlx_rrid_completor_t completor; result = hfa384x_usbctlx_complete_sync( hw, ctlx, init_rrid_completor(&completor, &ctlx->inbuf.rridresp, riddata, riddatalen) ); } done: DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_dowrid * * Constructs a write rid CTLX and issues it. * * NOTE: Any changes to the 'post-submit' code in this function * need to be carried over to hfa384x_cbwrid() since the handling * is virtually identical. * * Arguments: * hw device structure * CMD_MODE DOWAIT or DOASYNC * rid RID code * riddata Data portion of RID formatted for MAC * riddatalen Length of the data portion in bytes * cmdcb command callback for async calls, NULL for DOWAIT calls * usercb user callback for async calls, NULL for DOWAIT calls * usercb_data user supplied data pointer for async calls * * Returns: * 0 success * -ETIMEDOUT timed out waiting for register ready or * command completion * >0 command indicated error, Status and Resp0-2 are * in hw structure. * * Side effects: * * Call context: * interrupt (DOASYNC) * process (DOWAIT or DOASYNC) ----------------------------------------------------------------*/ static int hfa384x_dowrid( hfa384x_t *hw, CMD_MODE mode, UINT16 rid, void *riddata, UINT riddatalen, ctlx_cmdcb_t cmdcb, ctlx_usercb_t usercb, void *usercb_data) { int result; hfa384x_usbctlx_t *ctlx; DBFENTER; ctlx = usbctlx_alloc(); if ( ctlx == NULL ) { result = -ENOMEM; goto done; } /* Initialize the command */ ctlx->outbuf.wridreq.type = host2hfa384x_16(HFA384x_USB_WRIDREQ); ctlx->outbuf.wridreq.frmlen = host2hfa384x_16( (sizeof(ctlx->outbuf.wridreq.rid) + riddatalen + 1) / 2); ctlx->outbuf.wridreq.rid = host2hfa384x_16(rid); memcpy(ctlx->outbuf.wridreq.data, riddata, riddatalen); ctlx->outbufsize = sizeof(ctlx->outbuf.wridreq.type) + sizeof(ctlx->outbuf.wridreq.frmlen) + sizeof(ctlx->outbuf.wridreq.rid) + riddatalen; ctlx->reapable = mode; ctlx->cmdcb = cmdcb; ctlx->usercb = usercb; ctlx->usercb_data = usercb_data; /* Submit the CTLX */ result = hfa384x_usbctlx_submit(hw, ctlx); if (result != 0) { kfree(ctlx); } else if (mode == DOWAIT) { usbctlx_wrid_completor_t completor; hfa384x_cmdresult_t wridresult; result = hfa384x_usbctlx_complete_sync( hw, ctlx, init_wrid_completor(&completor, &ctlx->inbuf.wridresp, &wridresult) ); } done: DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_dormem * * Constructs a readmem CTLX and issues it. * * NOTE: Any changes to the 'post-submit' code in this function * need to be carried over to hfa384x_cbrmem() since the handling * is virtually identical. * * Arguments: * hw device structure * mode DOWAIT or DOASYNC * page MAC address space page (CMD format) * offset MAC address space offset * data Ptr to data buffer to receive read * len Length of the data to read (max == 2048) * cmdcb command callback for async calls, NULL for DOWAIT calls * usercb user callback for async calls, NULL for DOWAIT calls * usercb_data user supplied data pointer for async calls * * Returns: * 0 success * -ETIMEDOUT timed out waiting for register ready or * command completion * >0 command indicated error, Status and Resp0-2 are * in hw structure. * * Side effects: * * Call context: * interrupt (DOASYNC) * process (DOWAIT or DOASYNC) ----------------------------------------------------------------*/ static int hfa384x_dormem( hfa384x_t *hw, CMD_MODE mode, UINT16 page, UINT16 offset, void *data, UINT len, ctlx_cmdcb_t cmdcb, ctlx_usercb_t usercb, void *usercb_data) { int result; hfa384x_usbctlx_t *ctlx; DBFENTER; ctlx = usbctlx_alloc(); if ( ctlx == NULL ) { result = -ENOMEM; goto done; } /* Initialize the command */ ctlx->outbuf.rmemreq.type = host2hfa384x_16(HFA384x_USB_RMEMREQ); ctlx->outbuf.rmemreq.frmlen = host2hfa384x_16( sizeof(ctlx->outbuf.rmemreq.offset) + sizeof(ctlx->outbuf.rmemreq.page) + len); ctlx->outbuf.rmemreq.offset = host2hfa384x_16(offset); ctlx->outbuf.rmemreq.page = host2hfa384x_16(page); ctlx->outbufsize = sizeof(ctlx->outbuf.rmemreq); WLAN_LOG_DEBUG(4, "type=0x%04x frmlen=%d offset=0x%04x page=0x%04x\n", ctlx->outbuf.rmemreq.type, ctlx->outbuf.rmemreq.frmlen, ctlx->outbuf.rmemreq.offset, ctlx->outbuf.rmemreq.page); WLAN_LOG_DEBUG(4,"pktsize=%zd\n", ROUNDUP64(sizeof(ctlx->outbuf.rmemreq))); ctlx->reapable = mode; ctlx->cmdcb = cmdcb; ctlx->usercb = usercb; ctlx->usercb_data = usercb_data; result = hfa384x_usbctlx_submit(hw, ctlx); if (result != 0) { kfree(ctlx); } else if ( mode == DOWAIT ) { usbctlx_rmem_completor_t completor; result = hfa384x_usbctlx_complete_sync( hw, ctlx, init_rmem_completor(&completor, &ctlx->inbuf.rmemresp, data, len) ); } done: DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_dowmem * * Constructs a writemem CTLX and issues it. * * NOTE: Any changes to the 'post-submit' code in this function * need to be carried over to hfa384x_cbwmem() since the handling * is virtually identical. * * Arguments: * hw device structure * mode DOWAIT or DOASYNC * page MAC address space page (CMD format) * offset MAC address space offset * data Ptr to data buffer containing write data * len Length of the data to read (max == 2048) * cmdcb command callback for async calls, NULL for DOWAIT calls * usercb user callback for async calls, NULL for DOWAIT calls * usercb_data user supplied data pointer for async calls. * * Returns: * 0 success * -ETIMEDOUT timed out waiting for register ready or * command completion * >0 command indicated error, Status and Resp0-2 are * in hw structure. * * Side effects: * * Call context: * interrupt (DOWAIT) * process (DOWAIT or DOASYNC) ----------------------------------------------------------------*/ static int hfa384x_dowmem( hfa384x_t *hw, CMD_MODE mode, UINT16 page, UINT16 offset, void *data, UINT len, ctlx_cmdcb_t cmdcb, ctlx_usercb_t usercb, void *usercb_data) { int result; hfa384x_usbctlx_t *ctlx; DBFENTER; WLAN_LOG_DEBUG(5, "page=0x%04x offset=0x%04x len=%d\n", page,offset,len); ctlx = usbctlx_alloc(); if ( ctlx == NULL ) { result = -ENOMEM; goto done; } /* Initialize the command */ ctlx->outbuf.wmemreq.type = host2hfa384x_16(HFA384x_USB_WMEMREQ); ctlx->outbuf.wmemreq.frmlen = host2hfa384x_16( sizeof(ctlx->outbuf.wmemreq.offset) + sizeof(ctlx->outbuf.wmemreq.page) + len); ctlx->outbuf.wmemreq.offset = host2hfa384x_16(offset); ctlx->outbuf.wmemreq.page = host2hfa384x_16(page); memcpy(ctlx->outbuf.wmemreq.data, data, len); ctlx->outbufsize = sizeof(ctlx->outbuf.wmemreq.type) + sizeof(ctlx->outbuf.wmemreq.frmlen) + sizeof(ctlx->outbuf.wmemreq.offset) + sizeof(ctlx->outbuf.wmemreq.page) + len; ctlx->reapable = mode; ctlx->cmdcb = cmdcb; ctlx->usercb = usercb; ctlx->usercb_data = usercb_data; result = hfa384x_usbctlx_submit(hw, ctlx); if (result != 0) { kfree(ctlx); } else if ( mode == DOWAIT ) { usbctlx_wmem_completor_t completor; hfa384x_cmdresult_t wmemresult; result = hfa384x_usbctlx_complete_sync( hw, ctlx, init_wmem_completor(&completor, &ctlx->inbuf.wmemresp, &wmemresult) ); } done: DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_drvr_commtallies * * Send a commtallies inquiry to the MAC. Note that this is an async * call that will result in an info frame arriving sometime later. * * Arguments: * hw device structure * * Returns: * zero success. * * Side effects: * * Call context: * process ----------------------------------------------------------------*/ int hfa384x_drvr_commtallies( hfa384x_t *hw ) { hfa384x_metacmd_t cmd; DBFENTER; cmd.cmd = HFA384x_CMDCODE_INQ; cmd.parm0 = HFA384x_IT_COMMTALLIES; cmd.parm1 = 0; cmd.parm2 = 0; hfa384x_docmd_async(hw, &cmd, NULL, NULL, NULL); DBFEXIT; return 0; } /*---------------------------------------------------------------- * hfa384x_drvr_disable * * Issues the disable command to stop communications on one of * the MACs 'ports'. Only macport 0 is valid for stations. * APs may also disable macports 1-6. Only ports that have been * previously enabled may be disabled. * * Arguments: * hw device structure * macport MAC port number (host order) * * Returns: * 0 success * >0 f/w reported failure - f/w status code * <0 driver reported error (timeout|bad arg) * * Side effects: * * Call context: * process ----------------------------------------------------------------*/ int hfa384x_drvr_disable(hfa384x_t *hw, UINT16 macport) { int result = 0; DBFENTER; if ((!hw->isap && macport != 0) || (hw->isap && !(macport <= HFA384x_PORTID_MAX)) || !(hw->port_enabled[macport]) ){ result = -EINVAL; } else { result = hfa384x_cmd_disable(hw, macport); if ( result == 0 ) { hw->port_enabled[macport] = 0; } } DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_drvr_enable * * Issues the enable command to enable communications on one of * the MACs 'ports'. Only macport 0 is valid for stations. * APs may also enable macports 1-6. Only ports that are currently * disabled may be enabled. * * Arguments: * hw device structure * macport MAC port number * * Returns: * 0 success * >0 f/w reported failure - f/w status code * <0 driver reported error (timeout|bad arg) * * Side effects: * * Call context: * process ----------------------------------------------------------------*/ int hfa384x_drvr_enable(hfa384x_t *hw, UINT16 macport) { int result = 0; DBFENTER; if ((!hw->isap && macport != 0) || (hw->isap && !(macport <= HFA384x_PORTID_MAX)) || (hw->port_enabled[macport]) ){ result = -EINVAL; } else { result = hfa384x_cmd_enable(hw, macport); if ( result == 0 ) { hw->port_enabled[macport] = 1; } } DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_drvr_flashdl_enable * * Begins the flash download state. Checks to see that we're not * already in a download state and that a port isn't enabled. * Sets the download state and retrieves the flash download * buffer location, buffer size, and timeout length. * * Arguments: * hw device structure * * Returns: * 0 success * >0 f/w reported error - f/w status code * <0 driver reported error * * Side effects: * * Call context: * process ----------------------------------------------------------------*/ int hfa384x_drvr_flashdl_enable(hfa384x_t *hw) { int result = 0; int i; DBFENTER; /* Check that a port isn't active */ for ( i = 0; i < HFA384x_PORTID_MAX; i++) { if ( hw->port_enabled[i] ) { WLAN_LOG_DEBUG(1,"called when port enabled.\n"); return -EINVAL; } } /* Check that we're not already in a download state */ if ( hw->dlstate != HFA384x_DLSTATE_DISABLED ) { return -EINVAL; } /* Retrieve the buffer loc&size and timeout */ if ( (result = hfa384x_drvr_getconfig(hw, HFA384x_RID_DOWNLOADBUFFER, &(hw->bufinfo), sizeof(hw->bufinfo))) ) { return result; } hw->bufinfo.page = hfa384x2host_16(hw->bufinfo.page); hw->bufinfo.offset = hfa384x2host_16(hw->bufinfo.offset); hw->bufinfo.len = hfa384x2host_16(hw->bufinfo.len); if ( (result = hfa384x_drvr_getconfig16(hw, HFA384x_RID_MAXLOADTIME, &(hw->dltimeout))) ) { return result; } hw->dltimeout = hfa384x2host_16(hw->dltimeout); WLAN_LOG_DEBUG(1,"flashdl_enable\n"); hw->dlstate = HFA384x_DLSTATE_FLASHENABLED; DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_drvr_flashdl_disable * * Ends the flash download state. Note that this will cause the MAC * firmware to restart. * * Arguments: * hw device structure * * Returns: * 0 success * >0 f/w reported error - f/w status code * <0 driver reported error * * Side effects: * * Call context: * process ----------------------------------------------------------------*/ int hfa384x_drvr_flashdl_disable(hfa384x_t *hw) { DBFENTER; /* Check that we're already in the download state */ if ( hw->dlstate != HFA384x_DLSTATE_FLASHENABLED ) { return -EINVAL; } WLAN_LOG_DEBUG(1,"flashdl_enable\n"); /* There isn't much we can do at this point, so I don't */ /* bother w/ the return value */ hfa384x_cmd_download(hw, HFA384x_PROGMODE_DISABLE, 0, 0 , 0); hw->dlstate = HFA384x_DLSTATE_DISABLED; DBFEXIT; return 0; } /*---------------------------------------------------------------- * hfa384x_drvr_flashdl_write * * Performs a FLASH download of a chunk of data. First checks to see * that we're in the FLASH download state, then sets the download * mode, uses the aux functions to 1) copy the data to the flash * buffer, 2) sets the download 'write flash' mode, 3) readback and * compare. Lather rinse, repeat as many times an necessary to get * all the given data into flash. * When all data has been written using this function (possibly * repeatedly), call drvr_flashdl_disable() to end the download state * and restart the MAC. * * Arguments: * hw device structure * daddr Card address to write to. (host order) * buf Ptr to data to write. * len Length of data (host order). * * Returns: * 0 success * >0 f/w reported error - f/w status code * <0 driver reported error * * Side effects: * * Call context: * process ----------------------------------------------------------------*/ int hfa384x_drvr_flashdl_write( hfa384x_t *hw, UINT32 daddr, void *buf, UINT32 len) { int result = 0; UINT32 dlbufaddr; int nburns; UINT32 burnlen; UINT32 burndaddr; UINT16 burnlo; UINT16 burnhi; int nwrites; UINT8 *writebuf; UINT16 writepage; UINT16 writeoffset; UINT32 writelen; int i; int j; DBFENTER; WLAN_LOG_DEBUG(5,"daddr=0x%08x len=%d\n", daddr, len); /* Check that we're in the flash download state */ if ( hw->dlstate != HFA384x_DLSTATE_FLASHENABLED ) { return -EINVAL; } WLAN_LOG_INFO("Download %d bytes to flash @0x%06x\n", len, daddr); /* Convert to flat address for arithmetic */ /* NOTE: dlbuffer RID stores the address in AUX format */ dlbufaddr = HFA384x_ADDR_AUX_MKFLAT( hw->bufinfo.page, hw->bufinfo.offset); WLAN_LOG_DEBUG(5, "dlbuf.page=0x%04x dlbuf.offset=0x%04x dlbufaddr=0x%08x\n", hw->bufinfo.page, hw->bufinfo.offset, dlbufaddr); #if 0 WLAN_LOG_WARNING("dlbuf@0x%06lx len=%d to=%d\n", dlbufaddr, hw->bufinfo.len, hw->dltimeout); #endif /* Calculations to determine how many fills of the dlbuffer to do * and how many USB wmemreq's to do for each fill. At this point * in time, the dlbuffer size and the wmemreq size are the same. * Therefore, nwrites should always be 1. The extra complexity * here is a hedge against future changes. */ /* Figure out how many times to do the flash programming */ nburns = len / hw->bufinfo.len; nburns += (len % hw->bufinfo.len) ? 1 : 0; /* For each flash program cycle, how many USB wmemreq's are needed? */ nwrites = hw->bufinfo.len / HFA384x_USB_RWMEM_MAXLEN; nwrites += (hw->bufinfo.len % HFA384x_USB_RWMEM_MAXLEN) ? 1 : 0; /* For each burn */ for ( i = 0; i < nburns; i++) { /* Get the dest address and len */ burnlen = (len - (hw->bufinfo.len * i)) > hw->bufinfo.len ? hw->bufinfo.len : (len - (hw->bufinfo.len * i)); burndaddr = daddr + (hw->bufinfo.len * i); burnlo = HFA384x_ADDR_CMD_MKOFF(burndaddr); burnhi = HFA384x_ADDR_CMD_MKPAGE(burndaddr); WLAN_LOG_INFO("Writing %d bytes to flash @0x%06x\n", burnlen, burndaddr); /* Set the download mode */ result = hfa384x_cmd_download(hw, HFA384x_PROGMODE_NV, burnlo, burnhi, burnlen); if ( result ) { WLAN_LOG_ERROR("download(NV,lo=%x,hi=%x,len=%x) " "cmd failed, result=%d. Aborting d/l\n", burnlo, burnhi, burnlen, result); goto exit_proc; } /* copy the data to the flash download buffer */ for ( j=0; j < nwrites; j++) { writebuf = buf + (i*hw->bufinfo.len) + (j*HFA384x_USB_RWMEM_MAXLEN); writepage = HFA384x_ADDR_CMD_MKPAGE( dlbufaddr + (j*HFA384x_USB_RWMEM_MAXLEN)); writeoffset = HFA384x_ADDR_CMD_MKOFF( dlbufaddr + (j*HFA384x_USB_RWMEM_MAXLEN)); writelen = burnlen-(j*HFA384x_USB_RWMEM_MAXLEN); writelen = writelen > HFA384x_USB_RWMEM_MAXLEN ? HFA384x_USB_RWMEM_MAXLEN : writelen; result = hfa384x_dowmem_wait( hw, writepage, writeoffset, writebuf, writelen ); #if 0 Comment out for debugging, assume the write was successful. if (result) { WLAN_LOG_ERROR( "Write to dl buffer failed, " "result=0x%04x. Aborting.\n", result); goto exit_proc; } #endif } /* set the download 'write flash' mode */ result = hfa384x_cmd_download(hw, HFA384x_PROGMODE_NVWRITE, 0,0,0); if ( result ) { WLAN_LOG_ERROR( "download(NVWRITE,lo=%x,hi=%x,len=%x) " "cmd failed, result=%d. Aborting d/l\n", burnlo, burnhi, burnlen, result); goto exit_proc; } /* TODO: We really should do a readback and compare. */ } exit_proc: /* Leave the firmware in the 'post-prog' mode. flashdl_disable will */ /* actually disable programming mode. Remember, that will cause the */ /* the firmware to effectively reset itself. */ DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_drvr_getconfig * * Performs the sequence necessary to read a config/info item. * * Arguments: * hw device structure * rid config/info record id (host order) * buf host side record buffer. Upon return it will * contain the body portion of the record (minus the * RID and len). * len buffer length (in bytes, should match record length) * * Returns: * 0 success * >0 f/w reported error - f/w status code * <0 driver reported error * -ENODATA length mismatch between argument and retrieved * record. * * Side effects: * * Call context: * process ----------------------------------------------------------------*/ int hfa384x_drvr_getconfig(hfa384x_t *hw, UINT16 rid, void *buf, UINT16 len) { int result; DBFENTER; result = hfa384x_dorrid_wait(hw, rid, buf, len); DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_drvr_getconfig_async * * Performs the sequence necessary to perform an async read of * of a config/info item. * * Arguments: * hw device structure * rid config/info record id (host order) * buf host side record buffer. Upon return it will * contain the body portion of the record (minus the * RID and len). * len buffer length (in bytes, should match record length) * cbfn caller supplied callback, called when the command * is done (successful or not). * cbfndata pointer to some caller supplied data that will be * passed in as an argument to the cbfn. * * Returns: * nothing the cbfn gets a status argument identifying if * any errors occur. * Side effects: * Queues an hfa384x_usbcmd_t for subsequent execution. * * Call context: * Any ----------------------------------------------------------------*/ int hfa384x_drvr_getconfig_async( hfa384x_t *hw, UINT16 rid, ctlx_usercb_t usercb, void *usercb_data) { return hfa384x_dorrid_async(hw, rid, NULL, 0, hfa384x_cb_rrid, usercb, usercb_data); } /*---------------------------------------------------------------- * hfa384x_drvr_setconfig_async * * Performs the sequence necessary to write a config/info item. * * Arguments: * hw device structure * rid config/info record id (in host order) * buf host side record buffer * len buffer length (in bytes) * usercb completion callback * usercb_data completion callback argument * * Returns: * 0 success * >0 f/w reported error - f/w status code * <0 driver reported error * * Side effects: * * Call context: * process ----------------------------------------------------------------*/ int hfa384x_drvr_setconfig_async( hfa384x_t *hw, UINT16 rid, void *buf, UINT16 len, ctlx_usercb_t usercb, void *usercb_data) { return hfa384x_dowrid_async(hw, rid, buf, len, hfa384x_cb_status, usercb, usercb_data); } /*---------------------------------------------------------------- * hfa384x_drvr_handover * * Sends a handover notification to the MAC. * * Arguments: * hw device structure * addr address of station that's left * * Returns: * zero success. * -ERESTARTSYS received signal while waiting for semaphore. * -EIO failed to write to bap, or failed in cmd. * * Side effects: * * Call context: * process ----------------------------------------------------------------*/ int hfa384x_drvr_handover( hfa384x_t *hw, UINT8 *addr) { DBFENTER; WLAN_LOG_ERROR("Not currently supported in USB!\n"); DBFEXIT; return -EIO; } /*---------------------------------------------------------------- * hfa384x_drvr_low_level * * Write test commands to the card. Some test commands don't make * sense without prior set-up. For example, continous TX isn't very * useful until you set the channel. That functionality should be * * Side effects: * * Call context: * process thread * -----------------------------------------------------------------*/ int hfa384x_drvr_low_level(hfa384x_t *hw, hfa384x_metacmd_t *cmd) { int result; DBFENTER; /* Do i need a host2hfa... conversion ? */ result = hfa384x_docmd_wait(hw, cmd); DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_drvr_mmi_read * * Read mmi registers. mmi is intersil-speak for the baseband * processor registers. * * Arguments: * hw device structure * register The test register to be accessed (must be even #). * * Returns: * 0 success * >0 f/w reported error - f/w status code * <0 driver reported error * * Side effects: * * Call context: * process ----------------------------------------------------------------*/ int hfa384x_drvr_mmi_read(hfa384x_t *hw, UINT32 addr, UINT32 *resp) { #if 0 int result = 0; UINT16 cmd_code = (UINT16) 0x30; UINT16 param = (UINT16) addr; DBFENTER; /* Do i need a host2hfa... conversion ? */ result = hfa384x_docmd_wait(hw, cmd_code); DBFEXIT; return result; #endif return 0; } /*---------------------------------------------------------------- * hfa384x_drvr_mmi_write * * Read mmi registers. mmi is intersil-speak for the baseband * processor registers. * * Arguments: * hw device structure * addr The test register to be accessed (must be even #). * data The data value to write to the register. * * Returns: * 0 success * >0 f/w reported error - f/w status code * <0 driver reported error * * Side effects: * * Call context: * process ----------------------------------------------------------------*/ int hfa384x_drvr_mmi_write(hfa384x_t *hw, UINT32 addr, UINT32 data) { #if 0 int result = 0; UINT16 cmd_code = (UINT16) 0x31; UINT16 param0 = (UINT16) addr; UINT16 param1 = (UINT16) data; DBFENTER; WLAN_LOG_DEBUG(1,"mmi write : addr = 0x%08lx\n", addr); WLAN_LOG_DEBUG(1,"mmi write : data = 0x%08lx\n", data); /* Do i need a host2hfa... conversion ? */ result = hfa384x_docmd_wait(hw, cmd_code); DBFEXIT; return result; #endif return 0; } /*---------------------------------------------------------------- * hfa384x_drvr_ramdl_disable * * Ends the ram download state. * * Arguments: * hw device structure * * Returns: * 0 success * >0 f/w reported error - f/w status code * <0 driver reported error * * Side effects: * * Call context: * process ----------------------------------------------------------------*/ int hfa384x_drvr_ramdl_disable(hfa384x_t *hw) { DBFENTER; /* Check that we're already in the download state */ if ( hw->dlstate != HFA384x_DLSTATE_RAMENABLED ) { return -EINVAL; } WLAN_LOG_DEBUG(3,"ramdl_disable()\n"); /* There isn't much we can do at this point, so I don't */ /* bother w/ the return value */ hfa384x_cmd_download(hw, HFA384x_PROGMODE_DISABLE, 0, 0 , 0); hw->dlstate = HFA384x_DLSTATE_DISABLED; DBFEXIT; return 0; } /*---------------------------------------------------------------- * hfa384x_drvr_ramdl_enable * * Begins the ram download state. Checks to see that we're not * already in a download state and that a port isn't enabled. * Sets the download state and calls cmd_download with the * ENABLE_VOLATILE subcommand and the exeaddr argument. * * Arguments: * hw device structure * exeaddr the card execution address that will be * jumped to when ramdl_disable() is called * (host order). * * Returns: * 0 success * >0 f/w reported error - f/w status code * <0 driver reported error * * Side effects: * * Call context: * process ----------------------------------------------------------------*/ int hfa384x_drvr_ramdl_enable(hfa384x_t *hw, UINT32 exeaddr) { int result = 0; UINT16 lowaddr; UINT16 hiaddr; int i; DBFENTER; /* Check that a port isn't active */ for ( i = 0; i < HFA384x_PORTID_MAX; i++) { if ( hw->port_enabled[i] ) { WLAN_LOG_ERROR( "Can't download with a macport enabled.\n"); return -EINVAL; } } /* Check that we're not already in a download state */ if ( hw->dlstate != HFA384x_DLSTATE_DISABLED ) { WLAN_LOG_ERROR( "Download state not disabled.\n"); return -EINVAL; } WLAN_LOG_DEBUG(3,"ramdl_enable, exeaddr=0x%08x\n", exeaddr); /* Call the download(1,addr) function */ lowaddr = HFA384x_ADDR_CMD_MKOFF(exeaddr); hiaddr = HFA384x_ADDR_CMD_MKPAGE(exeaddr); result = hfa384x_cmd_download(hw, HFA384x_PROGMODE_RAM, lowaddr, hiaddr, 0); if ( result == 0) { /* Set the download state */ hw->dlstate = HFA384x_DLSTATE_RAMENABLED; } else { WLAN_LOG_DEBUG(1, "cmd_download(0x%04x, 0x%04x) failed, result=%d.\n", lowaddr, hiaddr, result); } DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_drvr_ramdl_write * * Performs a RAM download of a chunk of data. First checks to see * that we're in the RAM download state, then uses the [read|write]mem USB * commands to 1) copy the data, 2) readback and compare. The download * state is unaffected. When all data has been written using * this function, call drvr_ramdl_disable() to end the download state * and restart the MAC. * * Arguments: * hw device structure * daddr Card address to write to. (host order) * buf Ptr to data to write. * len Length of data (host order). * * Returns: * 0 success * >0 f/w reported error - f/w status code * <0 driver reported error * * Side effects: * * Call context: * process ----------------------------------------------------------------*/ int hfa384x_drvr_ramdl_write(hfa384x_t *hw, UINT32 daddr, void* buf, UINT32 len) { int result = 0; int nwrites; UINT8 *data = buf; int i; UINT32 curraddr; UINT16 currpage; UINT16 curroffset; UINT16 currlen; DBFENTER; /* Check that we're in the ram download state */ if ( hw->dlstate != HFA384x_DLSTATE_RAMENABLED ) { return -EINVAL; } WLAN_LOG_INFO("Writing %d bytes to ram @0x%06x\n", len, daddr); /* How many dowmem calls? */ nwrites = len / HFA384x_USB_RWMEM_MAXLEN; nwrites += len % HFA384x_USB_RWMEM_MAXLEN ? 1 : 0; /* Do blocking wmem's */ for(i=0; i < nwrites; i++) { /* make address args */ curraddr = daddr + (i * HFA384x_USB_RWMEM_MAXLEN); currpage = HFA384x_ADDR_CMD_MKPAGE(curraddr); curroffset = HFA384x_ADDR_CMD_MKOFF(curraddr); currlen = len - (i * HFA384x_USB_RWMEM_MAXLEN); if ( currlen > HFA384x_USB_RWMEM_MAXLEN) { currlen = HFA384x_USB_RWMEM_MAXLEN; } /* Do blocking ctlx */ result = hfa384x_dowmem_wait( hw, currpage, curroffset, data + (i*HFA384x_USB_RWMEM_MAXLEN), currlen ); if (result) break; /* TODO: We really should have a readback. */ } DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_drvr_readpda * * Performs the sequence to read the PDA space. Note there is no * drvr_writepda() function. Writing a PDA is * generally implemented by a calling component via calls to * cmd_download and writing to the flash download buffer via the * aux regs. * * Arguments: * hw device structure * buf buffer to store PDA in * len buffer length * * Returns: * 0 success * >0 f/w reported error - f/w status code * <0 driver reported error * -ETIMEOUT timout waiting for the cmd regs to become * available, or waiting for the control reg * to indicate the Aux port is enabled. * -ENODATA the buffer does NOT contain a valid PDA. * Either the card PDA is bad, or the auxdata * reads are giving us garbage. * * Side effects: * * Call context: * process or non-card interrupt. ----------------------------------------------------------------*/ int hfa384x_drvr_readpda(hfa384x_t *hw, void *buf, UINT len) { int result = 0; UINT16 *pda = buf; int pdaok = 0; int morepdrs = 1; int currpdr = 0; /* word offset of the current pdr */ size_t i; UINT16 pdrlen; /* pdr length in bytes, host order */ UINT16 pdrcode; /* pdr code, host order */ UINT16 currpage; UINT16 curroffset; struct pdaloc { UINT32 cardaddr; UINT16 auxctl; } pdaloc[] = { { HFA3842_PDA_BASE, 0}, { HFA3841_PDA_BASE, 0}, { HFA3841_PDA_BOGUS_BASE, 0} }; DBFENTER; /* Read the pda from each known address. */ for ( i = 0; i < ARRAY_SIZE(pdaloc); i++) { /* Make address */ currpage = HFA384x_ADDR_CMD_MKPAGE(pdaloc[i].cardaddr); curroffset = HFA384x_ADDR_CMD_MKOFF(pdaloc[i].cardaddr); result = hfa384x_dormem_wait(hw, currpage, curroffset, buf, len); /* units of bytes */ if (result) { WLAN_LOG_WARNING( "Read from index %zd failed, continuing\n", i ); continue; } /* Test for garbage */ pdaok = 1; /* initially assume good */ morepdrs = 1; while ( pdaok && morepdrs ) { pdrlen = hfa384x2host_16(pda[currpdr]) * 2; pdrcode = hfa384x2host_16(pda[currpdr+1]); /* Test the record length */ if ( pdrlen > HFA384x_PDR_LEN_MAX || pdrlen == 0) { WLAN_LOG_ERROR("pdrlen invalid=%d\n", pdrlen); pdaok = 0; break; } /* Test the code */ if ( !hfa384x_isgood_pdrcode(pdrcode) ) { WLAN_LOG_ERROR("pdrcode invalid=%d\n", pdrcode); pdaok = 0; break; } /* Test for completion */ if ( pdrcode == HFA384x_PDR_END_OF_PDA) { morepdrs = 0; } /* Move to the next pdr (if necessary) */ if ( morepdrs ) { /* note the access to pda[], need words here */ currpdr += hfa384x2host_16(pda[currpdr]) + 1; } } if ( pdaok ) { WLAN_LOG_INFO( "PDA Read from 0x%08x in %s space.\n", pdaloc[i].cardaddr, pdaloc[i].auxctl == 0 ? "EXTDS" : pdaloc[i].auxctl == 1 ? "NV" : pdaloc[i].auxctl == 2 ? "PHY" : pdaloc[i].auxctl == 3 ? "ICSRAM" : ""); break; } } result = pdaok ? 0 : -ENODATA; if ( result ) { WLAN_LOG_DEBUG(3,"Failure: pda is not okay\n"); } DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_drvr_setconfig * * Performs the sequence necessary to write a config/info item. * * Arguments: * hw device structure * rid config/info record id (in host order) * buf host side record buffer * len buffer length (in bytes) * * Returns: * 0 success * >0 f/w reported error - f/w status code * <0 driver reported error * * Side effects: * * Call context: * process ----------------------------------------------------------------*/ int hfa384x_drvr_setconfig(hfa384x_t *hw, UINT16 rid, void *buf, UINT16 len) { return hfa384x_dowrid_wait(hw, rid, buf, len); } /*---------------------------------------------------------------- * hfa384x_drvr_start * * Issues the MAC initialize command, sets up some data structures, * and enables the interrupts. After this function completes, the * low-level stuff should be ready for any/all commands. * * Arguments: * hw device structure * Returns: * 0 success * >0 f/w reported error - f/w status code * <0 driver reported error * * Side effects: * * Call context: * process ----------------------------------------------------------------*/ int hfa384x_drvr_start(hfa384x_t *hw) { int result, result1, result2; u16 status; DBFENTER; might_sleep(); /* Clear endpoint stalls - but only do this if the endpoint * is showing a stall status. Some prism2 cards seem to behave * badly if a clear_halt is called when the endpoint is already * ok */ result = usb_get_status(hw->usb, USB_RECIP_ENDPOINT, hw->endp_in, &status); if (result < 0) { WLAN_LOG_ERROR( "Cannot get bulk in endpoint status.\n"); goto done; } if ((status == 1) && usb_clear_halt(hw->usb, hw->endp_in)) { WLAN_LOG_ERROR( "Failed to reset bulk in endpoint.\n"); } result = usb_get_status(hw->usb, USB_RECIP_ENDPOINT, hw->endp_out, &status); if (result < 0) { WLAN_LOG_ERROR( "Cannot get bulk out endpoint status.\n"); goto done; } if ((status == 1) && usb_clear_halt(hw->usb, hw->endp_out)) { WLAN_LOG_ERROR( "Failed to reset bulk out endpoint.\n"); } /* Synchronous unlink, in case we're trying to restart the driver */ usb_kill_urb(&hw->rx_urb); /* Post the IN urb */ result = submit_rx_urb(hw, GFP_KERNEL); if (result != 0) { WLAN_LOG_ERROR( "Fatal, failed to submit RX URB, result=%d\n", result); goto done; } /* Call initialize twice, with a 1 second sleep in between. * This is a nasty work-around since many prism2 cards seem to * need time to settle after an init from cold. The second * call to initialize in theory is not necessary - but we call * it anyway as a double insurance policy: * 1) If the first init should fail, the second may well succeed * and the card can still be used * 2) It helps ensures all is well with the card after the first * init and settle time. */ result1 = hfa384x_cmd_initialize(hw); msleep(1000); result = result2 = hfa384x_cmd_initialize(hw); if (result1 != 0) { if (result2 != 0) { WLAN_LOG_ERROR( "cmd_initialize() failed on two attempts, results %d and %d\n", result1, result2); usb_kill_urb(&hw->rx_urb); goto done; } else { WLAN_LOG_DEBUG(0, "First cmd_initialize() failed (result %d),\n", result1); WLAN_LOG_DEBUG(0, "but second attempt succeeded. All should be ok\n"); } } else if (result2 != 0) { WLAN_LOG_WARNING( "First cmd_initialize() succeeded, but second attempt failed (result=%d)\n", result2); WLAN_LOG_WARNING("Most likely the card will be functional\n"); goto done; } hw->state = HFA384x_STATE_RUNNING; done: DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_drvr_stop * * Shuts down the MAC to the point where it is safe to unload the * driver. Any subsystem that may be holding a data or function * ptr into the driver must be cleared/deinitialized. * * Arguments: * hw device structure * Returns: * 0 success * >0 f/w reported error - f/w status code * <0 driver reported error * * Side effects: * * Call context: * process ----------------------------------------------------------------*/ int hfa384x_drvr_stop(hfa384x_t *hw) { int result = 0; int i; DBFENTER; might_sleep(); /* There's no need for spinlocks here. The USB "disconnect" * function sets this "removed" flag and then calls us. */ if ( !hw->wlandev->hwremoved ) { /* Call initialize to leave the MAC in its 'reset' state */ hfa384x_cmd_initialize(hw); /* Cancel the rxurb */ usb_kill_urb(&hw->rx_urb); } hw->link_status = HFA384x_LINK_NOTCONNECTED; hw->state = HFA384x_STATE_INIT; del_timer_sync(&hw->commsqual_timer); /* Clear all the port status */ for ( i = 0; i < HFA384x_NUMPORTS_MAX; i++) { hw->port_enabled[i] = 0; } DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_drvr_txframe * * Takes a frame from prism2sta and queues it for transmission. * * Arguments: * hw device structure * skb packet buffer struct. Contains an 802.11 * data frame. * p80211_hdr points to the 802.11 header for the packet. * Returns: * 0 Success and more buffs available * 1 Success but no more buffs * 2 Allocation failure * 4 Buffer full or queue busy * * Side effects: * * Call context: * interrupt ----------------------------------------------------------------*/ int hfa384x_drvr_txframe(hfa384x_t *hw, struct sk_buff *skb, p80211_hdr_t *p80211_hdr, p80211_metawep_t *p80211_wep) { int usbpktlen = sizeof(hfa384x_tx_frame_t); int result; int ret; char *ptr; DBFENTER; if (hw->tx_urb.status == -EINPROGRESS) { WLAN_LOG_WARNING("TX URB already in use\n"); result = 3; goto exit; } /* Build Tx frame structure */ /* Set up the control field */ memset(&hw->txbuff.txfrm.desc, 0, sizeof(hw->txbuff.txfrm.desc)); /* Setup the usb type field */ hw->txbuff.type = host2hfa384x_16(HFA384x_USB_TXFRM); /* Set up the sw_support field to identify this frame */ hw->txbuff.txfrm.desc.sw_support = 0x0123; /* Tx complete and Tx exception disable per dleach. Might be causing * buf depletion */ //#define DOEXC SLP -- doboth breaks horribly under load, doexc less so. #if defined(DOBOTH) hw->txbuff.txfrm.desc.tx_control = HFA384x_TX_MACPORT_SET(0) | HFA384x_TX_STRUCTYPE_SET(1) | HFA384x_TX_TXEX_SET(1) | HFA384x_TX_TXOK_SET(1); #elif defined(DOEXC) hw->txbuff.txfrm.desc.tx_control = HFA384x_TX_MACPORT_SET(0) | HFA384x_TX_STRUCTYPE_SET(1) | HFA384x_TX_TXEX_SET(1) | HFA384x_TX_TXOK_SET(0); #else hw->txbuff.txfrm.desc.tx_control = HFA384x_TX_MACPORT_SET(0) | HFA384x_TX_STRUCTYPE_SET(1) | HFA384x_TX_TXEX_SET(0) | HFA384x_TX_TXOK_SET(0); #endif hw->txbuff.txfrm.desc.tx_control = host2hfa384x_16(hw->txbuff.txfrm.desc.tx_control); /* copy the header over to the txdesc */ memcpy(&(hw->txbuff.txfrm.desc.frame_control), p80211_hdr, sizeof(p80211_hdr_t)); /* if we're using host WEP, increase size by IV+ICV */ if (p80211_wep->data) { hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len+8); // hw->txbuff.txfrm.desc.tx_control |= HFA384x_TX_NOENCRYPT_SET(1); usbpktlen+=8; } else { hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len); } usbpktlen += skb->len; /* copy over the WEP IV if we are using host WEP */ ptr = hw->txbuff.txfrm.data; if (p80211_wep->data) { memcpy(ptr, p80211_wep->iv, sizeof(p80211_wep->iv)); ptr+= sizeof(p80211_wep->iv); memcpy(ptr, p80211_wep->data, skb->len); } else { memcpy(ptr, skb->data, skb->len); } /* copy over the packet data */ ptr+= skb->len; /* copy over the WEP ICV if we are using host WEP */ if (p80211_wep->data) { memcpy(ptr, p80211_wep->icv, sizeof(p80211_wep->icv)); } /* Send the USB packet */ usb_fill_bulk_urb( &(hw->tx_urb), hw->usb, hw->endp_out, &(hw->txbuff), ROUNDUP64(usbpktlen), hfa384x_usbout_callback, hw->wlandev ); hw->tx_urb.transfer_flags |= USB_QUEUE_BULK; result = 1; ret = submit_tx_urb(hw, &hw->tx_urb, GFP_ATOMIC); if ( ret != 0 ) { WLAN_LOG_ERROR( "submit_tx_urb() failed, error=%d\n", ret); result = 3; } exit: DBFEXIT; return result; } void hfa384x_tx_timeout(wlandevice_t *wlandev) { hfa384x_t *hw = wlandev->priv; unsigned long flags; DBFENTER; spin_lock_irqsave(&hw->ctlxq.lock, flags); if ( !hw->wlandev->hwremoved && /* Note the bitwise OR, not the logical OR. */ ( !test_and_set_bit(WORK_TX_HALT, &hw->usb_flags) | !test_and_set_bit(WORK_RX_HALT, &hw->usb_flags) ) ) { schedule_work(&hw->usb_work); } spin_unlock_irqrestore(&hw->ctlxq.lock, flags); DBFEXIT; } /*---------------------------------------------------------------- * hfa384x_usbctlx_reaper_task * * Tasklet to delete dead CTLX objects * * Arguments: * data ptr to a hfa384x_t * * Returns: * * Call context: * Interrupt ----------------------------------------------------------------*/ static void hfa384x_usbctlx_reaper_task(unsigned long data) { hfa384x_t *hw = (hfa384x_t*)data; struct list_head *entry; struct list_head *temp; unsigned long flags; DBFENTER; spin_lock_irqsave(&hw->ctlxq.lock, flags); /* This list is guaranteed to be empty if someone * has unplugged the adapter. */ list_for_each_safe(entry, temp, &hw->ctlxq.reapable) { hfa384x_usbctlx_t *ctlx; ctlx = list_entry(entry, hfa384x_usbctlx_t, list); list_del(&ctlx->list); kfree(ctlx); } spin_unlock_irqrestore(&hw->ctlxq.lock, flags); DBFEXIT; } /*---------------------------------------------------------------- * hfa384x_usbctlx_completion_task * * Tasklet to call completion handlers for returned CTLXs * * Arguments: * data ptr to hfa384x_t * * Returns: * Nothing * * Call context: * Interrupt ----------------------------------------------------------------*/ static void hfa384x_usbctlx_completion_task(unsigned long data) { hfa384x_t *hw = (hfa384x_t*)data; struct list_head *entry; struct list_head *temp; unsigned long flags; int reap = 0; DBFENTER; spin_lock_irqsave(&hw->ctlxq.lock, flags); /* This list is guaranteed to be empty if someone * has unplugged the adapter ... */ list_for_each_safe(entry, temp, &hw->ctlxq.completing) { hfa384x_usbctlx_t *ctlx; ctlx = list_entry(entry, hfa384x_usbctlx_t, list); /* Call the completion function that this * command was assigned, assuming it has one. */ if ( ctlx->cmdcb != NULL ) { spin_unlock_irqrestore(&hw->ctlxq.lock, flags); ctlx->cmdcb(hw, ctlx); spin_lock_irqsave(&hw->ctlxq.lock, flags); /* Make sure we don't try and complete * this CTLX more than once! */ ctlx->cmdcb = NULL; /* Did someone yank the adapter out * while our list was (briefly) unlocked? */ if ( hw->wlandev->hwremoved ) { reap = 0; break; } } /* * "Reapable" CTLXs are ones which don't have any * threads waiting for them to die. Hence they must * be delivered to The Reaper! */ if ( ctlx->reapable ) { /* Move the CTLX off the "completing" list (hopefully) * on to the "reapable" list where the reaper task * can find it. And "reapable" means that this CTLX * isn't sitting on a wait-queue somewhere. */ list_move_tail(&ctlx->list, &hw->ctlxq.reapable); reap = 1; } complete(&ctlx->done); } spin_unlock_irqrestore(&hw->ctlxq.lock, flags); if (reap) tasklet_schedule(&hw->reaper_bh); DBFEXIT; } /*---------------------------------------------------------------- * unlocked_usbctlx_cancel_async * * Mark the CTLX dead asynchronously, and ensure that the * next command on the queue is run afterwards. * * Arguments: * hw ptr to the hfa384x_t structure * ctlx ptr to a CTLX structure * * Returns: * 0 the CTLX's URB is inactive * -EINPROGRESS the URB is currently being unlinked * * Call context: * Either process or interrupt, but presumably interrupt ----------------------------------------------------------------*/ static int unlocked_usbctlx_cancel_async(hfa384x_t *hw, hfa384x_usbctlx_t *ctlx) { int ret; DBFENTER; /* * Try to delete the URB containing our request packet. * If we succeed, then its completion handler will be * called with a status of -ECONNRESET. */ hw->ctlx_urb.transfer_flags |= URB_ASYNC_UNLINK; ret = usb_unlink_urb(&hw->ctlx_urb); if (ret != -EINPROGRESS) { /* * The OUT URB had either already completed * or was still in the pending queue, so the * URB's completion function will not be called. * We will have to complete the CTLX ourselves. */ ctlx->state = CTLX_REQ_FAILED; unlocked_usbctlx_complete(hw, ctlx); ret = 0; } DBFEXIT; return ret; } /*---------------------------------------------------------------- * unlocked_usbctlx_complete * * A CTLX has completed. It may have been successful, it may not * have been. At this point, the CTLX should be quiescent. The URBs * aren't active and the timers should have been stopped. * * The CTLX is migrated to the "completing" queue, and the completing * tasklet is scheduled. * * Arguments: * hw ptr to a hfa384x_t structure * ctlx ptr to a ctlx structure * * Returns: * nothing * * Side effects: * * Call context: * Either, assume interrupt ----------------------------------------------------------------*/ static void unlocked_usbctlx_complete(hfa384x_t *hw, hfa384x_usbctlx_t *ctlx) { DBFENTER; /* Timers have been stopped, and ctlx should be in * a terminal state. Retire it from the "active" * queue. */ list_move_tail(&ctlx->list, &hw->ctlxq.completing); tasklet_schedule(&hw->completion_bh); switch (ctlx->state) { case CTLX_COMPLETE: case CTLX_REQ_FAILED: /* This are the correct terminating states. */ break; default: WLAN_LOG_ERROR("CTLX[%d] not in a terminating state(%s)\n", hfa384x2host_16(ctlx->outbuf.type), ctlxstr(ctlx->state)); break; } /* switch */ DBFEXIT; } /*---------------------------------------------------------------- * hfa384x_usbctlxq_run * * Checks to see if the head item is running. If not, starts it. * * Arguments: * hw ptr to hfa384x_t * * Returns: * nothing * * Side effects: * * Call context: * any ----------------------------------------------------------------*/ static void hfa384x_usbctlxq_run(hfa384x_t *hw) { unsigned long flags; DBFENTER; /* acquire lock */ spin_lock_irqsave(&hw->ctlxq.lock, flags); /* Only one active CTLX at any one time, because there's no * other (reliable) way to match the response URB to the * correct CTLX. * * Don't touch any of these CTLXs if the hardware * has been removed or the USB subsystem is stalled. */ if ( !list_empty(&hw->ctlxq.active) || test_bit(WORK_TX_HALT, &hw->usb_flags) || hw->wlandev->hwremoved ) goto unlock; while ( !list_empty(&hw->ctlxq.pending) ) { hfa384x_usbctlx_t *head; int result; /* This is the first pending command */ head = list_entry(hw->ctlxq.pending.next, hfa384x_usbctlx_t, list); /* We need to split this off to avoid a race condition */ list_move_tail(&head->list, &hw->ctlxq.active); /* Fill the out packet */ usb_fill_bulk_urb( &(hw->ctlx_urb), hw->usb, hw->endp_out, &(head->outbuf), ROUNDUP64(head->outbufsize), hfa384x_ctlxout_callback, hw); hw->ctlx_urb.transfer_flags |= USB_QUEUE_BULK; /* Now submit the URB and update the CTLX's state */ if ((result = SUBMIT_URB(&hw->ctlx_urb, GFP_ATOMIC)) == 0) { /* This CTLX is now running on the active queue */ head->state = CTLX_REQ_SUBMITTED; /* Start the OUT wait timer */ hw->req_timer_done = 0; hw->reqtimer.expires = jiffies + HZ; add_timer(&hw->reqtimer); /* Start the IN wait timer */ hw->resp_timer_done = 0; hw->resptimer.expires = jiffies + 2*HZ; add_timer(&hw->resptimer); break; } if (result == -EPIPE) { /* The OUT pipe needs resetting, so put * this CTLX back in the "pending" queue * and schedule a reset ... */ WLAN_LOG_WARNING("%s tx pipe stalled: requesting reset\n", hw->wlandev->netdev->name); list_move(&head->list, &hw->ctlxq.pending); set_bit(WORK_TX_HALT, &hw->usb_flags); schedule_work(&hw->usb_work); break; } if (result == -ESHUTDOWN) { WLAN_LOG_WARNING("%s urb shutdown!\n", hw->wlandev->netdev->name); break; } WLAN_LOG_ERROR("Failed to submit CTLX[%d]: error=%d\n", hfa384x2host_16(head->outbuf.type), result); unlocked_usbctlx_complete(hw, head); } /* while */ unlock: spin_unlock_irqrestore(&hw->ctlxq.lock, flags); DBFEXIT; } /*---------------------------------------------------------------- * hfa384x_usbin_callback * * Callback for URBs on the BULKIN endpoint. * * Arguments: * urb ptr to the completed urb * * Returns: * nothing * * Side effects: * * Call context: * interrupt ----------------------------------------------------------------*/ #ifdef URB_ONLY_CALLBACK static void hfa384x_usbin_callback(struct urb *urb) #else static void hfa384x_usbin_callback(struct urb *urb, struct pt_regs *regs) #endif { wlandevice_t *wlandev = urb->context; hfa384x_t *hw; hfa384x_usbin_t *usbin = (hfa384x_usbin_t *) urb->transfer_buffer; struct sk_buff *skb = NULL; int result; int urb_status; UINT16 type; enum USBIN_ACTION { HANDLE, RESUBMIT, ABORT } action; DBFENTER; if ( !wlandev || !wlandev->netdev || wlandev->hwremoved ) goto exit; hw = wlandev->priv; if (!hw) goto exit; skb = hw->rx_urb_skb; if (!skb || (skb->data != urb->transfer_buffer)) { BUG(); } hw->rx_urb_skb = NULL; /* Check for error conditions within the URB */ switch (urb->status) { case 0: action = HANDLE; /* Check for short packet */ if ( urb->actual_length == 0 ) { ++(wlandev->linux_stats.rx_errors); ++(wlandev->linux_stats.rx_length_errors); action = RESUBMIT; } break; case -EPIPE: WLAN_LOG_WARNING("%s rx pipe stalled: requesting reset\n", wlandev->netdev->name); if ( !test_and_set_bit(WORK_RX_HALT, &hw->usb_flags) ) schedule_work(&hw->usb_work); ++(wlandev->linux_stats.rx_errors); action = ABORT; break; case -EILSEQ: case -ETIMEDOUT: case -EPROTO: if ( !test_and_set_bit(THROTTLE_RX, &hw->usb_flags) && !timer_pending(&hw->throttle) ) { mod_timer(&hw->throttle, jiffies + THROTTLE_JIFFIES); } ++(wlandev->linux_stats.rx_errors); action = ABORT; break; case -EOVERFLOW: ++(wlandev->linux_stats.rx_over_errors); action = RESUBMIT; break; case -ENODEV: case -ESHUTDOWN: WLAN_LOG_DEBUG(3,"status=%d, device removed.\n", urb->status); action = ABORT; break; case -ENOENT: case -ECONNRESET: WLAN_LOG_DEBUG(3,"status=%d, urb explicitly unlinked.\n", urb->status); action = ABORT; break; default: WLAN_LOG_DEBUG(3,"urb status=%d, transfer flags=0x%x\n", urb->status, urb->transfer_flags); ++(wlandev->linux_stats.rx_errors); action = RESUBMIT; break; } urb_status = urb->status; if (action != ABORT) { /* Repost the RX URB */ result = submit_rx_urb(hw, GFP_ATOMIC); if (result != 0) { WLAN_LOG_ERROR( "Fatal, failed to resubmit rx_urb. error=%d\n", result); } } /* Handle any USB-IN packet */ /* Note: the check of the sw_support field, the type field doesn't * have bit 12 set like the docs suggest. */ type = hfa384x2host_16(usbin->type); if (HFA384x_USB_ISRXFRM(type)) { if (action == HANDLE) { if (usbin->txfrm.desc.sw_support == 0x0123) { hfa384x_usbin_txcompl(wlandev, usbin); } else { skb_put(skb, sizeof(*usbin)); hfa384x_usbin_rx(wlandev, skb); skb = NULL; } } goto exit; } if (HFA384x_USB_ISTXFRM(type)) { if (action == HANDLE) hfa384x_usbin_txcompl(wlandev, usbin); goto exit; } switch (type) { case HFA384x_USB_INFOFRM: if (action == ABORT) goto exit; if (action == HANDLE) hfa384x_usbin_info(wlandev, usbin); break; case HFA384x_USB_CMDRESP: case HFA384x_USB_WRIDRESP: case HFA384x_USB_RRIDRESP: case HFA384x_USB_WMEMRESP: case HFA384x_USB_RMEMRESP: /* ALWAYS, ALWAYS, ALWAYS handle this CTLX!!!! */ hfa384x_usbin_ctlx(hw, usbin, urb_status); break; case HFA384x_USB_BUFAVAIL: WLAN_LOG_DEBUG(3,"Received BUFAVAIL packet, frmlen=%d\n", usbin->bufavail.frmlen); break; case HFA384x_USB_ERROR: WLAN_LOG_DEBUG(3,"Received USB_ERROR packet, errortype=%d\n", usbin->usberror.errortype); break; default: WLAN_LOG_DEBUG(3,"Unrecognized USBIN packet, type=%x, status=%d\n", usbin->type, urb_status); break; } /* switch */ exit: if (skb) dev_kfree_skb(skb); DBFEXIT; } /*---------------------------------------------------------------- * hfa384x_usbin_ctlx * * We've received a URB containing a Prism2 "response" message. * This message needs to be matched up with a CTLX on the active * queue and our state updated accordingly. * * Arguments: * hw ptr to hfa384x_t * usbin ptr to USB IN packet * urb_status status of this Bulk-In URB * * Returns: * nothing * * Side effects: * * Call context: * interrupt ----------------------------------------------------------------*/ static void hfa384x_usbin_ctlx(hfa384x_t *hw, hfa384x_usbin_t *usbin, int urb_status) { hfa384x_usbctlx_t *ctlx; int run_queue = 0; unsigned long flags; DBFENTER; retry: spin_lock_irqsave(&hw->ctlxq.lock, flags); /* There can be only one CTLX on the active queue * at any one time, and this is the CTLX that the * timers are waiting for. */ if ( list_empty(&hw->ctlxq.active) ) { goto unlock; } /* Remove the "response timeout". It's possible that * we are already too late, and that the timeout is * already running. And that's just too bad for us, * because we could lose our CTLX from the active * queue here ... */ if (del_timer(&hw->resptimer) == 0) { if (hw->resp_timer_done == 0) { spin_unlock_irqrestore(&hw->ctlxq.lock, flags); goto retry; } } else { hw->resp_timer_done = 1; } ctlx = get_active_ctlx(hw); if (urb_status != 0) { /* * Bad CTLX, so get rid of it. But we only * remove it from the active queue if we're no * longer expecting the OUT URB to complete. */ if (unlocked_usbctlx_cancel_async(hw, ctlx) == 0) run_queue = 1; } else { const UINT16 intype = (usbin->type&~host2hfa384x_16(0x8000)); /* * Check that our message is what we're expecting ... */ if (ctlx->outbuf.type != intype) { WLAN_LOG_WARNING("Expected IN[%d], received IN[%d] - ignored.\n", hfa384x2host_16(ctlx->outbuf.type), hfa384x2host_16(intype)); goto unlock; } /* This URB has succeeded, so grab the data ... */ memcpy(&ctlx->inbuf, usbin, sizeof(ctlx->inbuf)); switch (ctlx->state) { case CTLX_REQ_SUBMITTED: /* * We have received our response URB before * our request has been acknowledged. Odd, * but our OUT URB is still alive... */ WLAN_LOG_DEBUG(0, "Causality violation: please reboot Universe, or email linux-wlan-devel@lists.linux-wlan.com\n"); ctlx->state = CTLX_RESP_COMPLETE; break; case CTLX_REQ_COMPLETE: /* * This is the usual path: our request * has already been acknowledged, and * now we have received the reply too. */ ctlx->state = CTLX_COMPLETE; unlocked_usbctlx_complete(hw, ctlx); run_queue = 1; break; default: /* * Throw this CTLX away ... */ WLAN_LOG_ERROR("Matched IN URB, CTLX[%d] in invalid state(%s)." " Discarded.\n", hfa384x2host_16(ctlx->outbuf.type), ctlxstr(ctlx->state)); if (unlocked_usbctlx_cancel_async(hw, ctlx) == 0) run_queue = 1; break; } /* switch */ } unlock: spin_unlock_irqrestore(&hw->ctlxq.lock, flags); if (run_queue) hfa384x_usbctlxq_run(hw); DBFEXIT; } /*---------------------------------------------------------------- * hfa384x_usbin_txcompl * * At this point we have the results of a previous transmit. * * Arguments: * wlandev wlan device * usbin ptr to the usb transfer buffer * * Returns: * nothing * * Side effects: * * Call context: * interrupt ----------------------------------------------------------------*/ static void hfa384x_usbin_txcompl(wlandevice_t *wlandev, hfa384x_usbin_t *usbin) { UINT16 status; DBFENTER; status = hfa384x2host_16(usbin->type); /* yeah I know it says type...*/ /* Was there an error? */ if (HFA384x_TXSTATUS_ISERROR(status)) { prism2sta_ev_txexc(wlandev, status); } else { prism2sta_ev_tx(wlandev, status); } // prism2sta_ev_alloc(wlandev); DBFEXIT; } /*---------------------------------------------------------------- * hfa384x_usbin_rx * * At this point we have a successful received a rx frame packet. * * Arguments: * wlandev wlan device * usbin ptr to the usb transfer buffer * * Returns: * nothing * * Side effects: * * Call context: * interrupt ----------------------------------------------------------------*/ static void hfa384x_usbin_rx(wlandevice_t *wlandev, struct sk_buff *skb) { hfa384x_usbin_t *usbin = (hfa384x_usbin_t *) skb->data; hfa384x_t *hw = wlandev->priv; int hdrlen; p80211_rxmeta_t *rxmeta; UINT16 data_len; UINT16 fc; DBFENTER; /* Byte order convert once up front. */ usbin->rxfrm.desc.status = hfa384x2host_16(usbin->rxfrm.desc.status); usbin->rxfrm.desc.time = hfa384x2host_32(usbin->rxfrm.desc.time); /* Now handle frame based on port# */ switch( HFA384x_RXSTATUS_MACPORT_GET(usbin->rxfrm.desc.status) ) { case 0: fc = ieee2host16(usbin->rxfrm.desc.frame_control); /* If exclude and we receive an unencrypted, drop it */ if ( (wlandev->hostwep & HOSTWEP_EXCLUDEUNENCRYPTED) && !WLAN_GET_FC_ISWEP(fc)){ goto done; } data_len = hfa384x2host_16(usbin->rxfrm.desc.data_len); /* How much header data do we have? */ hdrlen = p80211_headerlen(fc); /* Pull off the descriptor */ skb_pull(skb, sizeof(hfa384x_rx_frame_t)); /* Now shunt the header block up against the data block * with an "overlapping" copy */ memmove(skb_push(skb, hdrlen), &usbin->rxfrm.desc.frame_control, hdrlen); skb->dev = wlandev->netdev; skb->dev->last_rx = jiffies; /* And set the frame length properly */ skb_trim(skb, data_len + hdrlen); /* The prism2 series does not return the CRC */ memset(skb_put(skb, WLAN_CRC_LEN), 0xff, WLAN_CRC_LEN); skb_reset_mac_header(skb); /* Attach the rxmeta, set some stuff */ p80211skb_rxmeta_attach(wlandev, skb); rxmeta = P80211SKB_RXMETA(skb); rxmeta->mactime = usbin->rxfrm.desc.time; rxmeta->rxrate = usbin->rxfrm.desc.rate; rxmeta->signal = usbin->rxfrm.desc.signal - hw->dbmadjust; rxmeta->noise = usbin->rxfrm.desc.silence - hw->dbmadjust; prism2sta_ev_rx(wlandev, skb); break; case 7: if ( ! HFA384x_RXSTATUS_ISFCSERR(usbin->rxfrm.desc.status) ) { /* Copy to wlansnif skb */ hfa384x_int_rxmonitor( wlandev, &usbin->rxfrm); dev_kfree_skb(skb); } else { WLAN_LOG_DEBUG(3,"Received monitor frame: FCSerr set\n"); } break; default: WLAN_LOG_WARNING("Received frame on unsupported port=%d\n", HFA384x_RXSTATUS_MACPORT_GET(usbin->rxfrm.desc.status) ); goto done; break; } done: DBFEXIT; return; } /*---------------------------------------------------------------- * hfa384x_int_rxmonitor * * Helper function for int_rx. Handles monitor frames. * Note that this function allocates space for the FCS and sets it * to 0xffffffff. The hfa384x doesn't give us the FCS value but the * higher layers expect it. 0xffffffff is used as a flag to indicate * the FCS is bogus. * * Arguments: * wlandev wlan device structure * rxfrm rx descriptor read from card in int_rx * * Returns: * nothing * * Side effects: * Allocates an skb and passes it up via the PF_PACKET interface. * Call context: * interrupt ----------------------------------------------------------------*/ static void hfa384x_int_rxmonitor( wlandevice_t *wlandev, hfa384x_usb_rxfrm_t *rxfrm) { hfa384x_rx_frame_t *rxdesc = &(rxfrm->desc); UINT hdrlen = 0; UINT datalen = 0; UINT skblen = 0; p80211msg_lnxind_wlansniffrm_t *msg; UINT8 *datap; UINT16 fc; struct sk_buff *skb; hfa384x_t *hw = wlandev->priv; DBFENTER; /* Don't forget the status, time, and data_len fields are in host order */ /* Figure out how big the frame is */ fc = ieee2host16(rxdesc->frame_control); hdrlen = p80211_headerlen(fc); datalen = hfa384x2host_16(rxdesc->data_len); /* Allocate an ind message+framesize skb */ skblen = sizeof(p80211msg_lnxind_wlansniffrm_t) + hdrlen + datalen + WLAN_CRC_LEN; /* sanity check the length */ if ( skblen > (sizeof(p80211msg_lnxind_wlansniffrm_t) + WLAN_HDR_A4_LEN + WLAN_DATA_MAXLEN + WLAN_CRC_LEN) ) { WLAN_LOG_DEBUG(1, "overlen frm: len=%zd\n", skblen - sizeof(p80211msg_lnxind_wlansniffrm_t)); } if ( (skb = dev_alloc_skb(skblen)) == NULL ) { WLAN_LOG_ERROR("alloc_skb failed trying to allocate %d bytes\n", skblen); return; } /* only prepend the prism header if in the right mode */ if ((wlandev->netdev->type == ARPHRD_IEEE80211_PRISM) && (hw->sniffhdr == 0)) { datap = skb_put(skb, sizeof(p80211msg_lnxind_wlansniffrm_t)); msg = (p80211msg_lnxind_wlansniffrm_t*) datap; /* Initialize the message members */ msg->msgcode = DIDmsg_lnxind_wlansniffrm; msg->msglen = sizeof(p80211msg_lnxind_wlansniffrm_t); strcpy(msg->devname, wlandev->name); msg->hosttime.did = DIDmsg_lnxind_wlansniffrm_hosttime; msg->hosttime.status = 0; msg->hosttime.len = 4; msg->hosttime.data = jiffies; msg->mactime.did = DIDmsg_lnxind_wlansniffrm_mactime; msg->mactime.status = 0; msg->mactime.len = 4; msg->mactime.data = rxdesc->time; msg->channel.did = DIDmsg_lnxind_wlansniffrm_channel; msg->channel.status = 0; msg->channel.len = 4; msg->channel.data = hw->sniff_channel; msg->rssi.did = DIDmsg_lnxind_wlansniffrm_rssi; msg->rssi.status = P80211ENUM_msgitem_status_no_value; msg->rssi.len = 4; msg->rssi.data = 0; msg->sq.did = DIDmsg_lnxind_wlansniffrm_sq; msg->sq.status = P80211ENUM_msgitem_status_no_value; msg->sq.len = 4; msg->sq.data = 0; msg->signal.did = DIDmsg_lnxind_wlansniffrm_signal; msg->signal.status = 0; msg->signal.len = 4; msg->signal.data = rxdesc->signal; msg->noise.did = DIDmsg_lnxind_wlansniffrm_noise; msg->noise.status = 0; msg->noise.len = 4; msg->noise.data = rxdesc->silence; msg->rate.did = DIDmsg_lnxind_wlansniffrm_rate; msg->rate.status = 0; msg->rate.len = 4; msg->rate.data = rxdesc->rate / 5; /* set to 802.11 units */ msg->istx.did = DIDmsg_lnxind_wlansniffrm_istx; msg->istx.status = 0; msg->istx.len = 4; msg->istx.data = P80211ENUM_truth_false; msg->frmlen.did = DIDmsg_lnxind_wlansniffrm_frmlen; msg->frmlen.status = 0; msg->frmlen.len = 4; msg->frmlen.data = hdrlen + datalen + WLAN_CRC_LEN; } else if ((wlandev->netdev->type == ARPHRD_IEEE80211_PRISM) && (hw->sniffhdr != 0)) { p80211_caphdr_t *caphdr; /* The NEW header format! */ datap = skb_put(skb, sizeof(p80211_caphdr_t)); caphdr = (p80211_caphdr_t*) datap; caphdr->version = htonl(P80211CAPTURE_VERSION); caphdr->length = htonl(sizeof(p80211_caphdr_t)); caphdr->mactime = __cpu_to_be64(rxdesc->time) * 1000; caphdr->hosttime = __cpu_to_be64(jiffies); caphdr->phytype = htonl(4); /* dss_dot11_b */ caphdr->channel = htonl(hw->sniff_channel); caphdr->datarate = htonl(rxdesc->rate); caphdr->antenna = htonl(0); /* unknown */ caphdr->priority = htonl(0); /* unknown */ caphdr->ssi_type = htonl(3); /* rssi_raw */ caphdr->ssi_signal = htonl(rxdesc->signal); caphdr->ssi_noise = htonl(rxdesc->silence); caphdr->preamble = htonl(0); /* unknown */ caphdr->encoding = htonl(1); /* cck */ } /* Copy the 802.11 header to the skb (ctl frames may be less than a full header) */ datap = skb_put(skb, hdrlen); memcpy( datap, &(rxdesc->frame_control), hdrlen); /* If any, copy the data from the card to the skb */ if ( datalen > 0 ) { datap = skb_put(skb, datalen); memcpy(datap, rxfrm->data, datalen); /* check for unencrypted stuff if WEP bit set. */ if (*(datap - hdrlen + 1) & 0x40) // wep set if ((*(datap) == 0xaa) && (*(datap+1) == 0xaa)) *(datap - hdrlen + 1) &= 0xbf; // clear wep; it's the 802.2 header! } if (hw->sniff_fcs) { /* Set the FCS */ datap = skb_put(skb, WLAN_CRC_LEN); memset( datap, 0xff, WLAN_CRC_LEN); } /* pass it back up */ prism2sta_ev_rx(wlandev, skb); DBFEXIT; return; } /*---------------------------------------------------------------- * hfa384x_usbin_info * * At this point we have a successful received a Prism2 info frame. * * Arguments: * wlandev wlan device * usbin ptr to the usb transfer buffer * * Returns: * nothing * * Side effects: * * Call context: * interrupt ----------------------------------------------------------------*/ static void hfa384x_usbin_info(wlandevice_t *wlandev, hfa384x_usbin_t *usbin) { DBFENTER; usbin->infofrm.info.framelen = hfa384x2host_16(usbin->infofrm.info.framelen); prism2sta_ev_info(wlandev, &usbin->infofrm.info); DBFEXIT; } /*---------------------------------------------------------------- * hfa384x_usbout_callback * * Callback for URBs on the BULKOUT endpoint. * * Arguments: * urb ptr to the completed urb * * Returns: * nothing * * Side effects: * * Call context: * interrupt ----------------------------------------------------------------*/ #ifdef URB_ONLY_CALLBACK static void hfa384x_usbout_callback(struct urb *urb) #else static void hfa384x_usbout_callback(struct urb *urb, struct pt_regs *regs) #endif { wlandevice_t *wlandev = urb->context; hfa384x_usbout_t *usbout = urb->transfer_buffer; DBFENTER; #ifdef DEBUG_USB dbprint_urb(urb); #endif if ( wlandev && wlandev->netdev ) { switch(urb->status) { case 0: hfa384x_usbout_tx(wlandev, usbout); break; case -EPIPE: { hfa384x_t *hw = wlandev->priv; WLAN_LOG_WARNING("%s tx pipe stalled: requesting reset\n", wlandev->netdev->name); if ( !test_and_set_bit(WORK_TX_HALT, &hw->usb_flags) ) schedule_work(&hw->usb_work); ++(wlandev->linux_stats.tx_errors); break; } case -EPROTO: case -ETIMEDOUT: case -EILSEQ: { hfa384x_t *hw = wlandev->priv; if ( !test_and_set_bit(THROTTLE_TX, &hw->usb_flags) && !timer_pending(&hw->throttle) ) { mod_timer(&hw->throttle, jiffies + THROTTLE_JIFFIES); } ++(wlandev->linux_stats.tx_errors); netif_stop_queue(wlandev->netdev); break; } case -ENOENT: case -ESHUTDOWN: /* Ignorable errors */ break; default: WLAN_LOG_INFO("unknown urb->status=%d\n", urb->status); ++(wlandev->linux_stats.tx_errors); break; } /* switch */ } DBFEXIT; } /*---------------------------------------------------------------- * hfa384x_ctlxout_callback * * Callback for control data on the BULKOUT endpoint. * * Arguments: * urb ptr to the completed urb * * Returns: * nothing * * Side effects: * * Call context: * interrupt ----------------------------------------------------------------*/ #ifdef URB_ONLY_CALLBACK static void hfa384x_ctlxout_callback(struct urb *urb) #else static void hfa384x_ctlxout_callback(struct urb *urb, struct pt_regs *regs) #endif { hfa384x_t *hw = urb->context; int delete_resptimer = 0; int timer_ok = 1; int run_queue = 0; hfa384x_usbctlx_t *ctlx; unsigned long flags; DBFENTER; WLAN_LOG_DEBUG(3,"urb->status=%d\n", urb->status); #ifdef DEBUG_USB dbprint_urb(urb); #endif if ( (urb->status == -ESHUTDOWN) || (urb->status == -ENODEV) || (hw == NULL) ) goto done; retry: spin_lock_irqsave(&hw->ctlxq.lock, flags); /* * Only one CTLX at a time on the "active" list, and * none at all if we are unplugged. However, we can * rely on the disconnect function to clean everything * up if someone unplugged the adapter. */ if ( list_empty(&hw->ctlxq.active) ) { spin_unlock_irqrestore(&hw->ctlxq.lock, flags); goto done; } /* * Having something on the "active" queue means * that we have timers to worry about ... */ if (del_timer(&hw->reqtimer) == 0) { if (hw->req_timer_done == 0) { /* * This timer was actually running while we * were trying to delete it. Let it terminate * gracefully instead. */ spin_unlock_irqrestore(&hw->ctlxq.lock, flags); goto retry; } } else { hw->req_timer_done = 1; } ctlx = get_active_ctlx(hw); if ( urb->status == 0 ) { /* Request portion of a CTLX is successful */ switch ( ctlx->state ) { case CTLX_REQ_SUBMITTED: /* This OUT-ACK received before IN */ ctlx->state = CTLX_REQ_COMPLETE; break; case CTLX_RESP_COMPLETE: /* IN already received before this OUT-ACK, * so this command must now be complete. */ ctlx->state = CTLX_COMPLETE; unlocked_usbctlx_complete(hw, ctlx); run_queue = 1; break; default: /* This is NOT a valid CTLX "success" state! */ WLAN_LOG_ERROR( "Illegal CTLX[%d] success state(%s, %d) in OUT URB\n", hfa384x2host_16(ctlx->outbuf.type), ctlxstr(ctlx->state), urb->status); break; } /* switch */ } else { /* If the pipe has stalled then we need to reset it */ if ( (urb->status == -EPIPE) && !test_and_set_bit(WORK_TX_HALT, &hw->usb_flags) ) { WLAN_LOG_WARNING("%s tx pipe stalled: requesting reset\n", hw->wlandev->netdev->name); schedule_work(&hw->usb_work); } /* If someone cancels the OUT URB then its status * should be either -ECONNRESET or -ENOENT. */ ctlx->state = CTLX_REQ_FAILED; unlocked_usbctlx_complete(hw, ctlx); delete_resptimer = 1; run_queue = 1; } delresp: if (delete_resptimer) { if ((timer_ok = del_timer(&hw->resptimer)) != 0) { hw->resp_timer_done = 1; } } spin_unlock_irqrestore(&hw->ctlxq.lock, flags); if ( !timer_ok && (hw->resp_timer_done == 0) ) { spin_lock_irqsave(&hw->ctlxq.lock, flags); goto delresp; } if (run_queue) hfa384x_usbctlxq_run(hw); done: DBFEXIT; } /*---------------------------------------------------------------- * hfa384x_usbctlx_reqtimerfn * * Timer response function for CTLX request timeouts. If this * function is called, it means that the callback for the OUT * URB containing a Prism2.x XXX_Request was never called. * * Arguments: * data a ptr to the hfa384x_t * * Returns: * nothing * * Side effects: * * Call context: * interrupt ----------------------------------------------------------------*/ static void hfa384x_usbctlx_reqtimerfn(unsigned long data) { hfa384x_t *hw = (hfa384x_t*)data; unsigned long flags; DBFENTER; spin_lock_irqsave(&hw->ctlxq.lock, flags); hw->req_timer_done = 1; /* Removing the hardware automatically empties * the active list ... */ if ( !list_empty(&hw->ctlxq.active) ) { /* * We must ensure that our URB is removed from * the system, if it hasn't already expired. */ hw->ctlx_urb.transfer_flags |= URB_ASYNC_UNLINK; if (usb_unlink_urb(&hw->ctlx_urb) == -EINPROGRESS) { hfa384x_usbctlx_t *ctlx = get_active_ctlx(hw); ctlx->state = CTLX_REQ_FAILED; /* This URB was active, but has now been * cancelled. It will now have a status of * -ECONNRESET in the callback function. * * We are cancelling this CTLX, so we're * not going to need to wait for a response. * The URB's callback function will check * that this timer is truly dead. */ if (del_timer(&hw->resptimer) != 0) hw->resp_timer_done = 1; } } spin_unlock_irqrestore(&hw->ctlxq.lock, flags); DBFEXIT; } /*---------------------------------------------------------------- * hfa384x_usbctlx_resptimerfn * * Timer response function for CTLX response timeouts. If this * function is called, it means that the callback for the IN * URB containing a Prism2.x XXX_Response was never called. * * Arguments: * data a ptr to the hfa384x_t * * Returns: * nothing * * Side effects: * * Call context: * interrupt ----------------------------------------------------------------*/ static void hfa384x_usbctlx_resptimerfn(unsigned long data) { hfa384x_t *hw = (hfa384x_t*)data; unsigned long flags; DBFENTER; spin_lock_irqsave(&hw->ctlxq.lock, flags); hw->resp_timer_done = 1; /* The active list will be empty if the * adapter has been unplugged ... */ if ( !list_empty(&hw->ctlxq.active) ) { hfa384x_usbctlx_t *ctlx = get_active_ctlx(hw); if ( unlocked_usbctlx_cancel_async(hw, ctlx) == 0 ) { spin_unlock_irqrestore(&hw->ctlxq.lock, flags); hfa384x_usbctlxq_run(hw); goto done; } } spin_unlock_irqrestore(&hw->ctlxq.lock, flags); done: DBFEXIT; } /*---------------------------------------------------------------- * hfa384x_usb_throttlefn * * * Arguments: * data ptr to hw * * Returns: * Nothing * * Side effects: * * Call context: * Interrupt ----------------------------------------------------------------*/ static void hfa384x_usb_throttlefn(unsigned long data) { hfa384x_t *hw = (hfa384x_t*)data; unsigned long flags; DBFENTER; spin_lock_irqsave(&hw->ctlxq.lock, flags); /* * We need to check BOTH the RX and the TX throttle controls, * so we use the bitwise OR instead of the logical OR. */ WLAN_LOG_DEBUG(3, "flags=0x%lx\n", hw->usb_flags); if ( !hw->wlandev->hwremoved && ( (test_and_clear_bit(THROTTLE_RX, &hw->usb_flags) && !test_and_set_bit(WORK_RX_RESUME, &hw->usb_flags)) | (test_and_clear_bit(THROTTLE_TX, &hw->usb_flags) && !test_and_set_bit(WORK_TX_RESUME, &hw->usb_flags)) ) ) { schedule_work(&hw->usb_work); } spin_unlock_irqrestore(&hw->ctlxq.lock, flags); DBFEXIT; } /*---------------------------------------------------------------- * hfa384x_usbctlx_submit * * Called from the doxxx functions to submit a CTLX to the queue * * Arguments: * hw ptr to the hw struct * ctlx ctlx structure to enqueue * * Returns: * -ENODEV if the adapter is unplugged * 0 * * Side effects: * * Call context: * process or interrupt ----------------------------------------------------------------*/ static int hfa384x_usbctlx_submit( hfa384x_t *hw, hfa384x_usbctlx_t *ctlx) { unsigned long flags; int ret; DBFENTER; spin_lock_irqsave(&hw->ctlxq.lock, flags); if (hw->wlandev->hwremoved) { spin_unlock_irqrestore(&hw->ctlxq.lock, flags); ret = -ENODEV; } else { ctlx->state = CTLX_PENDING; list_add_tail(&ctlx->list, &hw->ctlxq.pending); spin_unlock_irqrestore(&hw->ctlxq.lock, flags); hfa384x_usbctlxq_run(hw); ret = 0; } DBFEXIT; return ret; } /*---------------------------------------------------------------- * hfa384x_usbout_tx * * At this point we have finished a send of a frame. Mark the URB * as available and call ev_alloc to notify higher layers we're * ready for more. * * Arguments: * wlandev wlan device * usbout ptr to the usb transfer buffer * * Returns: * nothing * * Side effects: * * Call context: * interrupt ----------------------------------------------------------------*/ static void hfa384x_usbout_tx(wlandevice_t *wlandev, hfa384x_usbout_t *usbout) { DBFENTER; prism2sta_ev_alloc(wlandev); DBFEXIT; } /*---------------------------------------------------------------- * hfa384x_isgood_pdrcore * * Quick check of PDR codes. * * Arguments: * pdrcode PDR code number (host order) * * Returns: * zero not good. * one is good. * * Side effects: * * Call context: ----------------------------------------------------------------*/ static int hfa384x_isgood_pdrcode(UINT16 pdrcode) { switch(pdrcode) { case HFA384x_PDR_END_OF_PDA: case HFA384x_PDR_PCB_PARTNUM: case HFA384x_PDR_PDAVER: case HFA384x_PDR_NIC_SERIAL: case HFA384x_PDR_MKK_MEASUREMENTS: case HFA384x_PDR_NIC_RAMSIZE: case HFA384x_PDR_MFISUPRANGE: case HFA384x_PDR_CFISUPRANGE: case HFA384x_PDR_NICID: case HFA384x_PDR_MAC_ADDRESS: case HFA384x_PDR_REGDOMAIN: case HFA384x_PDR_ALLOWED_CHANNEL: case HFA384x_PDR_DEFAULT_CHANNEL: case HFA384x_PDR_TEMPTYPE: case HFA384x_PDR_IFR_SETTING: case HFA384x_PDR_RFR_SETTING: case HFA384x_PDR_HFA3861_BASELINE: case HFA384x_PDR_HFA3861_SHADOW: case HFA384x_PDR_HFA3861_IFRF: case HFA384x_PDR_HFA3861_CHCALSP: case HFA384x_PDR_HFA3861_CHCALI: case HFA384x_PDR_3842_NIC_CONFIG: case HFA384x_PDR_USB_ID: case HFA384x_PDR_PCI_ID: case HFA384x_PDR_PCI_IFCONF: case HFA384x_PDR_PCI_PMCONF: case HFA384x_PDR_RFENRGY: case HFA384x_PDR_HFA3861_MANF_TESTSP: case HFA384x_PDR_HFA3861_MANF_TESTI: /* code is OK */ return 1; break; default: if ( pdrcode < 0x1000 ) { /* code is OK, but we don't know exactly what it is */ WLAN_LOG_DEBUG(3, "Encountered unknown PDR#=0x%04x, " "assuming it's ok.\n", pdrcode); return 1; } else { /* bad code */ WLAN_LOG_DEBUG(3, "Encountered unknown PDR#=0x%04x, " "(>=0x1000), assuming it's bad.\n", pdrcode); return 0; } break; } return 0; /* avoid compiler warnings */ } linux-wlan-ng-0.2.9+dfsg/src/prism2/driver/prism2_cs.c0000644000175000017500000013364311024763177022120 0ustar tormodtormod#define WLAN_HOSTIF WLAN_PCMCIA #include "hfa384x.c" #include "prism2mgmt.c" #include "prism2mib.c" #include "prism2sta.c" #if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,4,21) ) #if (WLAN_CPU_FAMILY == WLAN_Ix86) #ifndef CONFIG_ISA #warning "You may need to enable ISA support in your kernel." #endif #endif #endif #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11) ) static u_int irq_mask = 0xdeb8; /* Interrupt mask */ static int irq_list[4] = { -1 }; /* Interrupt list */ #endif static u_int prism2_ignorevcc=1; /* Boolean, if set, we * ignore what the Vcc * is set to and what the CIS * says. */ module_param( prism2_ignorevcc, int, 0644); #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11) ) #if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,9)) static int numlist = 4; module_param_array(irq_list, int, numlist, 0444); #else module_param_array(irq_list, int, NULL, 0444); #endif module_param( irq_mask, int, 0644); #endif #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15) static int prism2_cs_suspend(struct pcmcia_device *pdev); static int prism2_cs_resume(struct pcmcia_device *pdev); static void prism2_cs_remove(struct pcmcia_device *pdev); static int prism2_cs_probe(struct pcmcia_device *pdev); #else dev_link_t *prism2sta_attach(void); static void prism2sta_detach(dev_link_t *link); static void prism2sta_config(dev_link_t *link); static void prism2sta_release(u_long arg); static int prism2sta_event (event_t event, int priority, event_callback_args_t *args); static dev_link_t *dev_list = NULL; /* head of instance list */ #endif #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,68)) /*---------------------------------------------------------------- * cs_error * * Utility function to print card services error messages. * * Arguments: * handle client handle identifying this CS client * func CS function number that generated the error * ret CS function return code * * Returns: * nothing * Side effects: * * Call context: * process thread * interrupt ----------------------------------------------------------------*/ static void cs_error(client_handle_t handle, int func, int ret) { #if (defined(CS_RELEASE_CODE) && (CS_RELEASE_CODE < 0x2911)) CardServices(ReportError, dev_info, (void *)func, (void *)ret); #else error_info_t err = { func, ret }; pcmcia_report_error(handle, &err); #endif } #else // kernel_version #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12) static struct pcmcia_device_id prism2_cs_ids[] = { PCMCIA_DEVICE_PROD_ID12("INTERSIL", "HFA384x/IEEE", 0x74c5e40d, 0xdb472a18), // Intersil PRISM2 Reference Design 11Mb/s 802.11b WLAN Card PCMCIA_DEVICE_MANF_CARD(0x0138, 0x0002), // Compaq WL100/200 11Mb/s 802.11b WLAN Card PCMCIA_DEVICE_MANF_CARD(0x028a, 0x0002), // Compaq iPaq HNW-100 11Mb/s 802.11b WLAN Card PCMCIA_DEVICE_MANF_CARD(0x0250, 0x0002), // Samsung SWL2000-N 11Mb/s 802.11b WLAN Card PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0002), // Z-Com XI300 11Mb/s 802.11b WLAN Card PCMCIA_DEVICE_PROD_ID12("ZoomAir 11Mbps High", "Rate wireless Networking", 0x273fe3db, 0x32a1eaee), // ZoomAir 4100 11Mb/s 802.11b WLAN Card PCMCIA_DEVICE_PROD_ID123("Instant Wireless ", " Network PC CARD", "Version 01.02", 0x11d901af, 0x6e9bd926, 0x4b74baa0), // Linksys WPC11 11Mbps 802.11b WLAN Card PCMCIA_DEVICE_PROD_ID123("Addtron", "AWP-100 Wireless PCMCIA", "Version 01.02", 0xe6ec52ce, 0x8649af2, 0x4b74baa0), // Addtron AWP-100 11Mbps 802.11b WLAN Card PCMCIA_DEVICE_PROD_ID123("D", "Link DWL-650 11Mbps WLAN Card", "Version 01.02", 0x71b18589, 0xb6f1b0ab, 0x4b74baa0), // D-Link DWL-650 11Mbps 802.11b WLAN Card PCMCIA_DEVICE_PROD_ID123("SMC", "SMC2632W", "Version 01.02", 0xc4f8b18b, 0x474a1f2a, 0x4b74baa0), // SMC 2632W 11Mbps 802.11b WLAN Card PCMCIA_DEVICE_PROD_ID1234("Intersil", "PRISM 2_5 PCMCIA ADAPTER", "ISL37300P", "Eval-RevA", 0x4b801a17, 0x6345a0bf, 0xc9049a39, 0xc23adc0e), // BroMax Freeport 11Mbps 802.11b WLAN Card (Prism 2.5) PCMCIA_DEVICE_PROD_ID123("U.S. Robotics", "IEEE 802.11b PC-CARD", "Version 01.02", 0xc7b8df9d, 0x1700d087, 0x4b74baa0), // U.S. Robotics IEEE 802.11b PC-CARD PCMCIA_DEVICE_PROD_ID12("Digital Data Communications", "WPC-0100", 0xfdd73470, 0xe0b6f146), // Level-One WPC-0100 PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1612), // Bromax OEM 11Mbps 802.11b WLAN Card (Prism 2.5) PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1613), // Bromax OEM 11Mbps 802.11b WLAN Card (Prism 3) PCMCIA_DEVICE_PROD_ID12("corega K.K.", "Wireless LAN PCC-11", 0x5261440f, 0xa6405584), // corega K.K. Wireless LAN PCC-11 PCMCIA_DEVICE_PROD_ID12("corega K.K.", "Wireless LAN PCCA-11", 0x5261440f, 0xdf6115f9), // corega K.K. Wireless LAN PCCA-11 PCMCIA_DEVICE_MANF_CARD(0xc001, 0x0008), // CONTEC FLEXSCAN/FX-DDS110-PCC PCMCIA_DEVICE_PROD_ID12("PLANEX", "GeoWave/GW-NS110", 0x209f40ab, 0x46263178), // PLANEX GeoWave/GW-NS110 PCMCIA_DEVICE_PROD_ID123("OEM", "PRISM2 IEEE 802.11 PC-Card", "Version 01.02", 0xfea54c90, 0x48f2bdd6, 0x4b74baa0), // Ambicom WL1100 11Mbps 802.11b WLAN Card PCMCIA_DEVICE_PROD_ID123("LeArtery", "SYNCBYAIR 11Mbps Wireless LAN PC Card", "Version 01.02", 0x7e3b326a, 0x49893e92, 0x4b74baa0), // LeArtery SYNCBYAIR 11Mbps 802.11b WLAN Card PCMCIA_DEVICE_MANF_CARD(0x01ff, 0x0008), // Intermec MobileLAN 11Mbps 802.11b WLAN Card PCMCIA_DEVICE_PROD_ID123("NETGEAR MA401 Wireless PC", "Card", "Version 01.00", 0xa37434e9, 0x9762e8f1, 0xa57adb8c), // NETGEAR MA401 11Mbps 802.11 WLAN Card PCMCIA_DEVICE_PROD_ID1234("Intersil", "PRISM Freedom PCMCIA Adapter", "ISL37100P", "Eval-RevA", 0x4b801a17, 0xf222ec2d, 0x630d52b2, 0xc23adc0e), // Intersil PRISM Freedom 11mbps 802.11 WLAN Card PCMCIA_DEVICE_PROD_ID123("OTC", "Wireless AirEZY 2411-PCC WLAN Card", "Version 01.02", 0x4ac44287, 0x235a6bed, 0x4b74baa0), // OTC Wireless AirEZY 2411-PCC 11Mbps 802.11 WLAN Card PCMCIA_DEVICE_PROD_ID1234("802.11", "11Mbps Wireless LAN Card", "v08C1", "" , 0xb67a610e, 0x655aa7b7, 0x264b451a, 0x0), // Dynalink L11HDT 11Mbps 802.11 WLAN Card PCMCIA_DEVICE_MANF_CARD(0xc250, 0x0002), // Dynalink L11HDT 11Mbps 802.11 WLAN Card PCMCIA_DEVICE_PROD_ID12("PROXIM", "RangeLAN-DS/LAN PC CARD", 0xc6536a5e, 0x3f35797d), // PROXIM RangeLAN-DS/LAN PC CARD PCMCIA_DEVICE_PROD_ID1234("ACTIONTEC", "PRISM Wireless LAN PC Card", "0381", "RevA", 0x393089da, 0xa71e69d5, 0x90471fa9, 0x57a66194), // ACTIONTEC PRISM Wireless LAN PC Card PCMCIA_DEVICE_MANF_CARD(0x1668, 0x0101), // ACTIONTEC PRISM Wireless LAN PC Card PCMCIA_DEVICE_PROD_ID12("3Com", "3CRWE737A AirConnect Wireless LAN PC Card", 0x41240e5b, 0x56010af3), // 3Com AirConnect 3CRWE737A PCMCIA_DEVICE_PROD_ID12("3Com", "3CRWE777A AirConnect Wireless LAN PCI Card" , 0x41240e5b, 0xafc7c33e), // 3Com AirConnect 3CRWE777A PCMCIA_DEVICE_PROD_ID12("ASUS", "802_11b_PC_CARD_25", 0x78fc06ee, 0xdb9aa842), // ASUS WL-100 802.11b WLAN PC Card PCMCIA_DEVICE_PROD_ID12("ASUS", "802_11B_CF_CARD_25", 0x78fc06ee, 0x45a50c1e), // ASUS WL-110 802.11b WLAN CF Card PCMCIA_DEVICE_PROD_ID12("BUFFALO", "WLI-CF-S11G", 0x2decece3, 0x82067c18), // BUFFALO WLI-CF-S11G 802.11b WLAN Card PCMCIA_DEVICE_PROD_ID1234("The Linksys Group, Inc.", "Wireless Network CF Card", "ISL37300P", "RevA", 0xa5f472c2, 0x9c05598d, 0xc9049a39, 0x57a66194), // Linksys WCF11 11Mbps 802.11b WLAN Card (Prism 2.5) PCMCIA_DEVICE_PROD_ID1234("Linksys", "Wireless CompactFlash Card", "", "", 0x733cc81, 0xc52f395, 0x0, 0x0), // Linksys WCF12 11Mbps 802.11b WLAN Card (Prism 3) PCMCIA_DEVICE_MANF_CARD(0x028a, 0x0673), // Linksys WCF12 11Mbps 802.11b WLAN Card (Prism 3) PCMCIA_DEVICE_PROD_ID1234("NETGEAR MA401RA Wireless PC", "Card", "ISL37300P", "Eval-RevA", 0x306467f, 0x9762e8f1, 0xc9049a39, 0xc23adc0e), // NETGEAR MA401RA 11Mbps 802.11 WLAN Card PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0005), // D-Link DCF-660W 11Mbps 802.11b WLAN Card PCMCIA_DEVICE_MANF_CARD(0x02d2, 0x0001), // Microsoft Wireless Notebook Adapter MN-520 PCMCIA_DEVICE_MANF_CARD(0x0089, 0x0002), // AnyPoint(TM) Wireless II PC Card PCMCIA_DEVICE_PROD_ID1234("D", "Link DRC-650 11Mbps WLAN Card", "Version 01.02", "" , 0x71b18589, 0xf144e3ac, 0x4b74baa0, 0x0), // D-Link DRC-650 802.11b WLAN Card PCMCIA_DEVICE_MANF_CARD(0x9005, 0x0021), // Adaptec AWN-8030 PCMCIA_DEVICE_MANF_CARD(0x000b, 0x7110), // D-Link DWL-650 rev P 802.11b WLAN card // PCMCIA_DEVICE_PROD_ID1234("D-Link", "DWL-650 Wireless PC Card RevP", "ISL37101P-10", "A3", 0x1a424a1c, 0x6ea57632, 0xdd97a26b, 0x56b21f52), // D-Link DWL-650 rev P 802.11b WLAN card PCMCIA_DEVICE_PROD_ID123("INTERSIL", "I-GATE 11M PC Card / PC Card plus", "Version 01.02", 0x74c5e40d, 0x8304ff77, 0x4b74baa0), // I-Gate 11M PC Card PCMCIA_DEVICE_PROD_ID1234("BENQ", "AWL100 PCMCIA ADAPTER", "ISL37300P", "Eval-RevA", 0x35dadc74, 0x1f7fedb, 0xc9049a39, 0xc23adc0e), // benQ AWL100 802.11b WLAN Card PCMCIA_DEVICE_MANF_CARD(0x000b, 0x7300), // benQ AWL100 802.11b WLAN Card // PCMCIA_DEVICE_PROD_ID1("INTERSIL", 0x74c5e40d), // Intersil Prism 2 card // PCMCIA_DEVICE_MANF_CARD(0x0156, 0x0002), // Intersil Prism 2 card PCMCIA_DEVICE_NULL }; MODULE_DEVICE_TABLE(pcmcia, prism2_cs_ids); #endif static struct pcmcia_driver prism2_cs_driver = { .drv = { .name = "prism2_cs", }, .owner = THIS_MODULE, #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15) .suspend = prism2_cs_suspend, .resume = prism2_cs_resume, .remove = prism2_cs_remove, .probe = prism2_cs_probe, .id_table = prism2_cs_ids, #else .attach = prism2sta_attach, .detach = prism2sta_detach, #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12) .id_table = prism2_cs_ids, .event = prism2sta_event, #endif // > 2.6.12 #endif // <= 2.6.15 }; #endif /* kernel_version */ #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15) #define CS_CHECK(fn, ret) \ do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) #define CFG_CHECK(fn, retf) \ do { int ret = (retf); \ if (ret != 0) { \ WLAN_LOG_DEBUG(1, "CardServices(" #fn ") returned %d\n", ret); \ cs_error(pdev, fn, ret); \ goto next_entry; \ } \ } while (0) static void prism2_cs_remove(struct pcmcia_device *pdev) { struct wlandevice *wlandev; #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) dev_link_t *link = dev_to_instance(pdev); #endif DBFENTER; #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16) wlandev = pdev->priv; #else wlandev = link->priv; #endif if (wlandev) { p80211netdev_hwremoved(wlandev); unregister_wlandev(wlandev); wlan_unsetup(wlandev); if (wlandev->priv) { hfa384x_t *hw = wlandev->priv; wlandev->priv = NULL; if (hw) { hfa384x_destroy(hw); kfree(hw); } } kfree(wlandev); } #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16) pdev->priv = NULL; pcmcia_disable_device(pdev); #else if (link->state & DEV_CONFIG) { if (link->win) pcmcia_release_window(link->win); pcmcia_release_configuration(link->handle); if (link->io.NumPorts1) pcmcia_release_io(link->handle, &link->io); if (link->irq.AssignedIRQ) pcmcia_release_irq(link->handle, &link->irq); link->state &= ~DEV_CONFIG; } link->priv = NULL; kfree(link); #endif DBFEXIT; return; } static int prism2_cs_suspend(struct pcmcia_device *pdev) { struct wlandevice *wlandev; #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) dev_link_t *link = dev_to_instance(pdev); #endif DBFENTER; #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16) wlandev = pdev->priv; prism2sta_ifstate(wlandev, P80211ENUM_ifstate_disable); #else wlandev = link->priv; link->state |= DEV_SUSPEND; if (link->state & DEV_CONFIG) { prism2sta_ifstate(wlandev, P80211ENUM_ifstate_disable); pcmcia_release_configuration(link->handle); } #endif DBFEXIT; return 0; } static int prism2_cs_resume(struct pcmcia_device *pdev) { struct wlandevice *wlandev; #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) dev_link_t *link = dev_to_instance(pdev); #endif DBFENTER; #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16) wlandev = pdev->priv; // XXX do something here? #else wlandev = link->priv; link->state &= ~DEV_SUSPEND; if (link->state & DEV_CONFIG) { pcmcia_request_configuration(link->handle, &link->conf); // XXX do something here? } #endif DBFEXIT; return 0; } static int prism2_cs_probe(struct pcmcia_device *pdev) { int rval = 0; struct wlandevice *wlandev = NULL; hfa384x_t *hw = NULL; config_info_t socketconf; cisparse_t *parse = NULL; tuple_t tuple; uint8_t buf[64]; int last_fn, last_ret; cistpl_cftable_entry_t dflt = { 0 }; #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) dev_link_t *link; #endif DBFENTER; #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16) /* Set up interrupt type */ pdev->conf.IntType = INT_MEMORY_AND_IO; #else link = kmalloc(sizeof(dev_link_t), GFP_KERNEL); if (link == NULL) return -ENOMEM; memset(link, 0, sizeof(dev_link_t)); link->conf.Vcc = 33; link->conf.IntType = INT_MEMORY_AND_IO; link->handle = pdev; pdev->instance = link; link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; #endif // VCC crap? parse = kmalloc(sizeof(cisparse_t), GFP_KERNEL); wlandev = create_wlan(); if (!wlandev || !parse) { WLAN_LOG_ERROR("%s: Memory allocation failure.\n", dev_info); rval = -EIO; goto failed; } hw = wlandev->priv; if ( wlan_setup(wlandev) != 0 ) { WLAN_LOG_ERROR("%s: wlan_setup() failed.\n", dev_info); rval = -EIO; goto failed; } /* Initialize the hw struct for now */ hfa384x_create(hw, 0, 0, NULL); hw->wlandev = wlandev; #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16) hw->pdev = pdev; pdev->priv = wlandev; #else hw->link = link; link->priv = wlandev; #endif tuple.DesiredTuple = CISTPL_CONFIG; tuple.Attributes = 0; tuple.TupleData = buf; tuple.TupleDataMax = sizeof(buf); tuple.TupleOffset = 0; CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(pdev, &tuple)); CS_CHECK(GetTupleData, pcmcia_get_tuple_data(pdev, &tuple)); CS_CHECK(ParseTuple, pcmcia_parse_tuple(pdev, &tuple, parse)); #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16) pdev->conf.ConfigBase = parse->config.base; pdev->conf.Present = parse->config.rmask[0]; #else link->conf.ConfigBase = parse->config.base; link->conf.Present = parse->config.rmask[0]; link->conf.Vcc = socketconf.Vcc; #endif CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(pdev, &socketconf)); tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(pdev, &tuple)); for (;;) { cistpl_cftable_entry_t *cfg = &(parse->cftable_entry); CFG_CHECK(GetTupleData, pcmcia_get_tuple_data(pdev, &tuple)); CFG_CHECK(ParseTuple, pcmcia_parse_tuple(pdev, &tuple, parse)); if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg; if (cfg->index == 0) goto next_entry; #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16) pdev->conf.ConfigIndex = cfg->index; #else link->conf.ConfigIndex = cfg->index; #endif /* Does this card need audio output? */ if (cfg->flags & CISTPL_CFTABLE_AUDIO) { #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16) pdev->conf.Attributes |= CONF_ENABLE_SPKR; pdev->conf.Status = CCSR_AUDIO_ENA; #else link->conf.Attributes |= CONF_ENABLE_SPKR; link->conf.Status = CCSR_AUDIO_ENA; #endif } /* Use power settings for Vcc and Vpp if present */ /* Note that the CIS values need to be rescaled */ if (cfg->vcc.present & (1 << CISTPL_POWER_VNOM)) { if (socketconf.Vcc != cfg->vcc.param[CISTPL_POWER_VNOM] / 10000 && !prism2_ignorevcc) { WLAN_LOG_DEBUG(1, " Vcc mismatch - skipping" " this entry\n"); goto next_entry; } } else if (dflt.vcc.present & (1 << CISTPL_POWER_VNOM)) { if (socketconf.Vcc != dflt.vcc.param[CISTPL_POWER_VNOM] / 10000 && !prism2_ignorevcc) { WLAN_LOG_DEBUG(1, " Vcc (default) mismatch " "- skipping this entry\n"); goto next_entry; } } if (cfg->vpp1.present & (1 << CISTPL_POWER_VNOM)) { #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16) pdev->conf.Vpp = cfg->vpp1.param[CISTPL_POWER_VNOM] / 10000; #else link->conf.Vpp1 = link->conf.Vpp2 = cfg->vpp1.param[CISTPL_POWER_VNOM] / 10000; #endif } else if (dflt.vpp1.present & (1 << CISTPL_POWER_VNOM)) { #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16) pdev->conf.Vpp = dflt.vpp1.param[CISTPL_POWER_VNOM] / 10000; #else link->conf.Vpp1 = link->conf.Vpp2 = dflt.vpp1.param[CISTPL_POWER_VNOM] / 10000; #endif } /* Do we need to allocate an interrupt? */ /* HACK: due to a bad CIS....we ALWAYS need an interrupt */ /* if (cfg->irq.IRQInfo1 || dflt.irq.IRQInfo1) */ #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16) pdev->conf.Attributes |= CONF_ENABLE_IRQ; #else link->conf.Attributes |= CONF_ENABLE_IRQ; #endif /* IO window settings */ #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16) pdev->io.NumPorts1 = pdev->io.NumPorts2 = 0; if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) { cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io; pdev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; if (!(io->flags & CISTPL_IO_8BIT)) pdev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; if (!(io->flags & CISTPL_IO_16BIT)) pdev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; pdev->io.BasePort1 = io->win[0].base; if ( pdev->io.BasePort1 != 0 ) { WLAN_LOG_WARNING( "Brain damaged CIS: hard coded iobase=" "0x%x, try letting pcmcia_cs decide...\n", pdev->io.BasePort1 ); pdev->io.BasePort1 = 0; } pdev->io.NumPorts1 = io->win[0].len; if (io->nwin > 1) { pdev->io.Attributes2 = pdev->io.Attributes1; pdev->io.BasePort2 = io->win[1].base; pdev->io.NumPorts2 = io->win[1].len; } } /* This reserves IO space but doesn't actually enable it */ CFG_CHECK(RequestIO, pcmcia_request_io(pdev, &pdev->io)); #else link->io.NumPorts1 = link->io.NumPorts2 = 0; if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) { cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io; link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; if (!(io->flags & CISTPL_IO_8BIT)) link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; if (!(io->flags & CISTPL_IO_16BIT)) link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; link->io.BasePort1 = io->win[0].base; if ( link->io.BasePort1 != 0 ) { WLAN_LOG_WARNING( "Brain damaged CIS: hard coded iobase=" "0x%x, try letting pcmcia_cs decide...\n", link->io.BasePort1 ); link->io.BasePort1 = 0; } link->io.NumPorts1 = io->win[0].len; if (io->nwin > 1) { link->io.Attributes2 = link->io.Attributes1; link->io.BasePort2 = io->win[1].base; link->io.NumPorts2 = io->win[1].len; } } /* This reserves IO space but doesn't actually enable it */ CFG_CHECK(RequestIO, pcmcia_request_io(pdev, &link->io)); #endif /* If we got this far, we're cool! */ break; next_entry: if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg; CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(pdev, &tuple)); } /* Let pcmcia know the device name */ #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16) pdev->dev_node = &hw->node; #else link->dev = &hw->node; #endif /* Register the network device and get assigned a name */ SET_MODULE_OWNER(wlandev->netdev); SET_NETDEV_DEV(wlandev->netdev, &handle_to_dev(pdev)); /* Allocate an interrupt line. Note that this does not assign a */ /* handler to the interrupt, unless the 'Handler' member of the */ /* irq structure is initialized. */ #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16) if (pdev->conf.Attributes & CONF_ENABLE_IRQ) { pdev->irq.IRQInfo1 = IRQ_LEVEL_ID; pdev->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT; pdev->irq.Handler = hfa384x_interrupt; pdev->irq.Instance = wlandev; CS_CHECK(RequestIRQ, pcmcia_request_irq(pdev, &pdev->irq)); } #else if (link->conf.Attributes & CONF_ENABLE_IRQ) { link->irq.IRQInfo1 = IRQ_LEVEL_ID; link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT; link->irq.Handler = hfa384x_interrupt; link->irq.Instance = wlandev; CS_CHECK(RequestIRQ, pcmcia_request_irq(pdev, &link->irq)); } #endif /* This actually configures the PCMCIA socket -- setting up */ /* the I/O windows and the interrupt mapping, and putting the */ /* card and host interface into "Memory and IO" mode. */ #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16) CS_CHECK(RequestConfiguration, pcmcia_request_configuration(pdev, &pdev->conf)); #else CS_CHECK(RequestConfiguration, pcmcia_request_configuration(pdev, &link->conf)); #endif /* Fill the netdevice with this info */ #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16) wlandev->netdev->irq = pdev->irq.AssignedIRQ; wlandev->netdev->base_addr = pdev->io.BasePort1; #else wlandev->netdev->irq = link->irq.AssignedIRQ; wlandev->netdev->base_addr = link->io.BasePort1; #endif /* And the rest of the hw structure */ hw->irq = wlandev->netdev->irq; hw->iobase = wlandev->netdev->base_addr; #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) link->state |= DEV_CONFIG; link->state &= ~DEV_CONFIG_PENDING; #endif /* And now we're done! */ wlandev->msdstate = WLAN_MSD_HWPRESENT; if (register_wlandev(wlandev) != 0) { WLAN_LOG_NOTICE("prism2sta_cs: register_wlandev() failed.\n"); goto failed; } strcpy(hw->node.dev_name, wlandev->name); if (wlan_wext_write) prism2sta_ifstate(wlandev, P80211ENUM_ifstate_enable); goto done; cs_failed: cs_error(pdev, last_fn, last_ret); failed: // wlandev, hw, etc etc.. #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16) pdev->priv = NULL; #else pdev->instance = NULL; if (link) { link->priv = NULL; kfree(link); } #endif if (wlandev) { wlan_unsetup(wlandev); if (wlandev->priv) { hw = wlandev->priv; wlandev->priv = NULL; if (hw) { hfa384x_destroy(hw); kfree(hw); } } kfree(wlandev); } done: if (parse) kfree(parse); p80211_allow_ioctls(wlandev); DBFEXIT; return rval; } #else // <= 2.6.15 #define CS_CHECK(fn, ret) \ do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) #define CFG_CHECK(fn, retf) \ do { int ret = (retf); \ if (ret != 0) { \ WLAN_LOG_DEBUG(1, "CardServices(" #fn ") returned %d\n", ret); \ cs_error(link->handle, fn, ret); \ goto next_entry; \ } \ } while (0) /*---------------------------------------------------------------- * prism2sta_attach * * Half of the attach/detach pair. Creates and registers a device * instance with Card Services. In this case, it also creates the * wlandev structure and device private structure. These are * linked to the device instance via its priv member. * * Arguments: * none * * Returns: * A valid ptr to dev_link_t on success, NULL otherwise * * Side effects: * * * Call context: * process thread (insmod/init_module/register_pccard_driver) ----------------------------------------------------------------*/ dev_link_t *prism2sta_attach(void) { client_reg_t client_reg; int result; dev_link_t *link = NULL; wlandevice_t *wlandev = NULL; hfa384x_t *hw = NULL; DBFENTER; /* Alloc our structures */ link = kmalloc(sizeof(struct dev_link_t), GFP_KERNEL); if (!link || ((wlandev = create_wlan()) == NULL)) { WLAN_LOG_ERROR("%s: Memory allocation failure.\n", dev_info); result = -EIO; goto failed; } hw = wlandev->priv; /* Clear all the structs */ memset(link, 0, sizeof(struct dev_link_t)); if ( wlan_setup(wlandev) != 0 ) { WLAN_LOG_ERROR("%s: wlan_setup() failed.\n", dev_info); result = -EIO; goto failed; } /* Initialize the hw struct for now */ hfa384x_create(hw, 0, 0, NULL); hw->wlandev = wlandev; /* Initialize the PC card device object. */ #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)) init_timer(&link->release); link->release.function = &prism2sta_release; link->release.data = (u_long)link; #endif link->conf.IntType = INT_MEMORY_AND_IO; link->priv = wlandev; #if (defined(CS_RELEASE_CODE) && (CS_RELEASE_CODE < 0x2911)) link->irq.Instance = wlandev; #endif /* Link in to the list of devices managed by this driver */ link->next = dev_list; dev_list = link; /* Register with Card Services */ client_reg.dev_info = &dev_info; #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11) ) client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE; #endif #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13) ) client_reg.EventMask = CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL | CS_EVENT_RESET_REQUEST | CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET | CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME; client_reg.event_handler = &prism2sta_event; #endif client_reg.Version = 0x0210; client_reg.event_callback_args.client_data = link; result = pcmcia_register_client(&link->handle, &client_reg); if (result != 0) { cs_error(link->handle, RegisterClient, result); prism2sta_detach(link); return NULL; } goto done; failed: if (link) kfree(link); if (wlandev) kfree(wlandev); if (hw) kfree(hw); link = NULL; done: DBFEXIT; return link; } /*---------------------------------------------------------------- * prism2sta_detach * * Remove one of the device instances managed by this driver. * Search the list for the given instance, * check our flags for a waiting timer'd release call * call release * Deregister the instance with Card Services * (netdevice) unregister the network device. * unlink the instance from the list * free the link, priv, and priv->priv memory * Note: the dev_list variable is a driver scoped static used to * maintain a list of device instances managed by this * driver. * * Arguments: * link ptr to the instance to detach * * Returns: * nothing * * Side effects: * the link structure is gone, the netdevice is gone * * Call context: * Might be interrupt, don't block. ----------------------------------------------------------------*/ void prism2sta_detach(dev_link_t *link) { dev_link_t **linkp; wlandevice_t *wlandev; hfa384x_t *hw; DBFENTER; /* Locate prev device structure */ for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next) { if (*linkp == link) break; } if (*linkp != NULL) { #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) unsigned long flags; /* Get rid of any timer'd release call */ save_flags(flags); cli(); #endif #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)) if (link->state & DEV_RELEASE_PENDING) { del_timer_sync(&link->release); link->state &= ~DEV_RELEASE_PENDING; } #endif #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) restore_flags(flags); #endif /* If link says we're still config'd, call release */ if (link->state & DEV_CONFIG) { prism2sta_release((u_long)link); if (link->state & DEV_STALE_CONFIG) { link->state |= DEV_STALE_LINK; return; } } /* Tell Card Services we're not around any more */ if (link->handle) { pcmcia_deregister_client(link->handle); } /* Unlink device structure, free bits */ *linkp = link->next; if ( link->priv != NULL ) { wlandev = (wlandevice_t*)link->priv; p80211netdev_hwremoved(wlandev); if (link->dev != NULL) { unregister_wlandev(wlandev); } wlan_unsetup(wlandev); if (wlandev->priv) { hw = wlandev->priv; wlandev->priv = NULL; if (hw) { hfa384x_destroy(hw); kfree(hw); } } link->priv = NULL; kfree(wlandev); } kfree(link); } DBFEXIT; return; } /*---------------------------------------------------------------- * prism2sta_config * * Half of the config/release pair. Usually called in response to * a card insertion event. At this point, we _know_ there's some * physical device present. That means we can start poking around * at the CIS and at any device specific config data we want. * * Note the gotos and the macros. I recoded this once without * them, and it got incredibly ugly. It's actually simpler with * them. * * Arguments: * link the dev_link_t structure created in attach that * represents this device instance. * * Returns: * nothing * * Side effects: * Resources (irq, io, mem) are allocated * The pcmcia dev_link->node->name is set * (For netcards) The device structure is finished and, * most importantly, registered. This means that there * is now a _named_ device that can be configured from * userland. * * Call context: * May be called from a timer. Don't block! ----------------------------------------------------------------*/ #define CS_CHECK(fn, ret) \ do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) #define CFG_CHECK(fn, retf) \ do { int ret = (retf); \ if (ret != 0) { \ WLAN_LOG_DEBUG(1, "CardServices(" #fn ") returned %d\n", ret); \ cs_error(link->handle, fn, ret); \ goto next_entry; \ } \ } while (0) void prism2sta_config(dev_link_t *link) { client_handle_t handle; wlandevice_t *wlandev; hfa384x_t *hw; int last_fn; int last_ret; tuple_t tuple; cisparse_t parse; config_info_t socketconf; UINT8 buf[64]; int minVcc = 0; int maxVcc = 0; cistpl_cftable_entry_t dflt = { 0 }; DBFENTER; handle = link->handle; wlandev = (wlandevice_t*)link->priv; hw = wlandev->priv; /* Collect the config register info */ tuple.DesiredTuple = CISTPL_CONFIG; tuple.Attributes = 0; tuple.TupleData = buf; tuple.TupleDataMax = sizeof(buf); tuple.TupleOffset = 0; CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); link->conf.ConfigBase = parse.config.base; link->conf.Present = parse.config.rmask[0]; /* Configure card */ link->state |= DEV_CONFIG; /* Acquire the current socket config (need Vcc setting) */ CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(handle, &socketconf)); /* Loop through the config table entries until we find one that works */ /* Assumes a complete and valid CIS */ tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); while (1) { cistpl_cftable_entry_t *cfg = &(parse.cftable_entry); CFG_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); CFG_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); if (cfg->index == 0) goto next_entry; link->conf.ConfigIndex = cfg->index; /* Lets print out the Vcc that the controller+pcmcia-cs set * for us, cause that's what we're going to use. */ WLAN_LOG_DEBUG(1,"Initial Vcc=%d/10v\n", socketconf.Vcc); if (prism2_ignorevcc) { link->conf.Vcc = socketconf.Vcc; goto skipvcc; } /* Use power settings for Vcc and Vpp if present */ /* Note that the CIS values need to be rescaled */ if (cfg->vcc.present & (1<vcc.param[CISTPL_POWER_VNOM]/10000; } else if (dflt.vcc.present & (1<vcc.present & (1<vcc.present & (1<vcc.param[CISTPL_POWER_VMIN]/10000; maxVcc = cfg->vcc.param[CISTPL_POWER_VMAX]/10000; } else if ((dflt.vcc.present & (1<= minVcc && socketconf.Vcc <= maxVcc) { link->conf.Vcc = socketconf.Vcc; } else { /* [MSM]: Note that I've given up trying to change * the Vcc if a change is indicated. It seems the * system&socketcontroller&card vendors can't seem * to get it right, so I'm tired of trying to hack * my way around it. pcmcia-cs does its best using * the voltage sense pins but sometimes the controller * lies. Then, even if we have a good read on the VS * pins, some system designs will silently ignore our * requests to set the voltage. Additionally, some * vendors have 3.3v indicated on their sense pins, * but 5v specified in the CIS or vice-versa. I've * had it. My only recommendation is "let the buyer * beware". Your system might supply 5v to a 3v card * (possibly causing damage) or a 3v capable system * might supply 5v to a 3v capable card (wasting * precious battery life). * My only recommendation (if you care) is to get * yourself an extender card (I don't know where, I * have only one myself) and a meter and test it for * yourself. */ goto next_entry; } skipvcc: WLAN_LOG_DEBUG(1, "link->conf.Vcc=%d\n", link->conf.Vcc); /* Do we need to allocate an interrupt? */ /* HACK: due to a bad CIS....we ALWAYS need an interrupt */ /* if (cfg->irq.IRQInfo1 || dflt.irq.IRQInfo1) */ link->conf.Attributes |= CONF_ENABLE_IRQ; /* IO window settings */ link->io.NumPorts1 = link->io.NumPorts2 = 0; if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) { cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io; link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; if (!(io->flags & CISTPL_IO_8BIT)) link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; if (!(io->flags & CISTPL_IO_16BIT)) link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; link->io.BasePort1 = io->win[0].base; if ( link->io.BasePort1 != 0 ) { WLAN_LOG_WARNING( "Brain damaged CIS: hard coded iobase=" "0x%x, try letting pcmcia_cs decide...\n", link->io.BasePort1 ); link->io.BasePort1 = 0; } link->io.NumPorts1 = io->win[0].len; if (io->nwin > 1) { link->io.Attributes2 = link->io.Attributes1; link->io.BasePort2 = io->win[1].base; link->io.NumPorts2 = io->win[1].len; } } /* This reserves IO space but doesn't actually enable it */ CFG_CHECK(RequestIO, pcmcia_request_io(link->handle, &link->io)); /* If we got this far, we're cool! */ break; next_entry: if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg; CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple)); } /* Allocate an interrupt line. Note that this does not assign a */ /* handler to the interrupt, unless the 'Handler' member of the */ /* irq structure is initialized. */ if (link->conf.Attributes & CONF_ENABLE_IRQ) { #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11) ) int i; link->irq.IRQInfo1 = IRQ_INFO2_VALID | IRQ_LEVEL_ID; if (irq_list[0] == -1) link->irq.IRQInfo2 = irq_mask; else for (i=0; i<4; i++) link->irq.IRQInfo2 |= 1 << irq_list[i]; #else link->irq.IRQInfo1 = IRQ_LEVEL_ID; #endif link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT; link->irq.Handler = hfa384x_interrupt; link->irq.Instance = wlandev; CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq)); } /* This actually configures the PCMCIA socket -- setting up */ /* the I/O windows and the interrupt mapping, and putting the */ /* card and host interface into "Memory and IO" mode. */ CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf)); /* Fill the netdevice with this info */ wlandev->netdev->irq = link->irq.AssignedIRQ; wlandev->netdev->base_addr = link->io.BasePort1; /* Report what we've done */ WLAN_LOG_INFO("%s: index 0x%02x: Vcc %d.%d", dev_info, link->conf.ConfigIndex, link->conf.Vcc/10, link->conf.Vcc%10); if (link->conf.Vpp1) printk(", Vpp %d.%d", link->conf.Vpp1/10, link->conf.Vpp1%10); if (link->conf.Attributes & CONF_ENABLE_IRQ) printk(", irq %d", link->irq.AssignedIRQ); if (link->io.NumPorts1) printk(", io 0x%04x-0x%04x", link->io.BasePort1, link->io.BasePort1+link->io.NumPorts1-1); if (link->io.NumPorts2) printk(" & 0x%04x-0x%04x", link->io.BasePort2, link->io.BasePort2+link->io.NumPorts2-1); printk("\n"); link->state &= ~DEV_CONFIG_PENDING; /* Let pcmcia know the device name */ link->dev = &hw->node; if (prism2_doreset) { result = hfa384x_corereset(hw, prism2_reset_holdtime, prism2_reset_settletime, 0); if ( result ) { WLAN_LOG_ERROR( "corereset() failed, result=%d.\n", result); wlandev->msdstate = WLAN_MSD_HWFAIL; goto failed; } } SET_MODULE_OWNER(wlandev->netdev); #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11) ) SET_NETDEV_DEV(wlandev->netdev, &handle_to_dev(link->handle)); #endif /* Register the network device and get assigned a name */ if (register_wlandev(wlandev) != 0) { WLAN_LOG_NOTICE("prism2sta_cs: register_wlandev() failed.\n"); goto failed; } strcpy(hw->node.dev_name, wlandev->name); /* Any device custom config/query stuff should be done here */ /* For a netdevice, we should at least grab the mac address */ return; cs_failed: cs_error(link->handle, last_fn, last_ret); WLAN_LOG_ERROR("NextTuple failure? It's probably a Vcc mismatch.\n"); failed: prism2sta_release((u_long)link); return; } /*---------------------------------------------------------------- * prism2sta_release * * Half of the config/release pair. Usually called in response to * a card ejection event. Checks to make sure no higher layers * are still (or think they are) using the card via the link->open * field. * * NOTE: Don't forget to increment the link->open variable in the * device_open method, and decrement it in the device_close * method. * * Arguments: * arg a generic 32 bit variable. It's the value that * we assigned to link->release.data in sta_attach(). * * Returns: * nothing * * Side effects: * All resources should be released after this function * executes and finds the device !open. * * Call context: * Possibly in a timer context. Don't do anything that'll * block. ----------------------------------------------------------------*/ void prism2sta_release(u_long arg) { dev_link_t *link = (dev_link_t *)arg; DBFENTER; /* First thing we should do is get the MSD back to the * HWPRESENT state. I.e. everything quiescent. */ prism2sta_ifstate(link->priv, P80211ENUM_ifstate_disable); if (link->open) { /* TODO: I don't think we're even using this bit of code * and I don't think it's hurting us at the moment. */ WLAN_LOG_DEBUG(1, "prism2sta_cs: release postponed, '%s' still open\n", link->dev->dev_name); link->state |= DEV_STALE_CONFIG; return; } pcmcia_release_configuration(link->handle); pcmcia_release_io(link->handle, &link->io); pcmcia_release_irq(link->handle, &link->irq); link->state &= ~(DEV_CONFIG | DEV_RELEASE_PENDING); DBFEXIT; } /*---------------------------------------------------------------- * prism2sta_event * * Handler for card services events. * * Arguments: * event The event code * priority hi/low - REMOVAL is the only hi * args ptr to card services struct containing info about * pcmcia status * * Returns: * Zero on success, non-zero otherwise * * Side effects: * * * Call context: * Both interrupt and process thread, depends on the event. ----------------------------------------------------------------*/ static int prism2sta_event ( event_t event, int priority, event_callback_args_t *args) { int result = 0; dev_link_t *link = (dev_link_t *) args->client_data; wlandevice_t *wlandev = (wlandevice_t*)link->priv; hfa384x_t *hw = NULL; DBFENTER; if (wlandev) hw = wlandev->priv; switch (event) { case CS_EVENT_CARD_INSERTION: WLAN_LOG_DEBUG(5,"event is INSERTION\n"); link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; prism2sta_config(link); if (!(link->state & DEV_CONFIG)) { wlandev->netdev->irq = 0; WLAN_LOG_ERROR( "%s: Initialization failed!\n", dev_info); wlandev->msdstate = WLAN_MSD_HWFAIL; break; } /* Fill in the rest of the hw struct */ hw->irq = wlandev->netdev->irq; hw->iobase = wlandev->netdev->base_addr; hw->link = link; #if 0 /* * TODO: test_hostif() not implemented yet. */ result = hfa384x_test_hostif(hw); if (result) { WLAN_LOG_ERROR( "test_hostif() failed, result=%d.\n", result); wlandev->msdstate = WLAN_MSD_HWFAIL; break; } #endif wlandev->msdstate = WLAN_MSD_HWPRESENT; break; case CS_EVENT_CARD_REMOVAL: WLAN_LOG_DEBUG(5,"event is REMOVAL\n"); link->state &= ~DEV_PRESENT; if (wlandev) { p80211netdev_hwremoved(wlandev); } #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)) if (link->state & DEV_CONFIG) { link->release.expires = jiffies + (HZ/20); add_timer(&link->release); } #endif break; case CS_EVENT_RESET_REQUEST: WLAN_LOG_DEBUG(5,"event is RESET_REQUEST\n"); WLAN_LOG_NOTICE( "prism2 card reset not supported " "due to post-reset user mode configuration " "requirements.\n"); WLAN_LOG_NOTICE( " From user mode, use " "'cardctl suspend;cardctl resume' " "instead.\n"); break; case CS_EVENT_RESET_PHYSICAL: case CS_EVENT_CARD_RESET: WLAN_LOG_WARNING("Rx'd CS_EVENT_RESET_xxx, should not " "be possible since RESET_REQUEST was denied.\n"); break; case CS_EVENT_PM_SUSPEND: WLAN_LOG_DEBUG(5,"event is SUSPEND\n"); link->state |= DEV_SUSPEND; if (link->state & DEV_CONFIG) { prism2sta_ifstate(wlandev, P80211ENUM_ifstate_disable); pcmcia_release_configuration(link->handle); } break; case CS_EVENT_PM_RESUME: WLAN_LOG_DEBUG(5,"event is RESUME\n"); link->state &= ~DEV_SUSPEND; if (link->state & DEV_CONFIG) { pcmcia_request_configuration(link->handle, &link->conf); } break; } DBFEXIT; return 0; /* noone else does anthing with the return value */ } #endif // <= 2.6.15 int hfa384x_corereset(hfa384x_t *hw, int holdtime, int settletime, int genesis) { int result = 0; conf_reg_t reg; UINT8 corsave; DBFENTER; WLAN_LOG_DEBUG(3, "Doing reset via CardServices().\n"); /* Collect COR */ reg.Function = 0; reg.Action = CS_READ; reg.Offset = CISREG_COR; #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16) result = pcmcia_access_configuration_register(hw->pdev, ®); #else result = pcmcia_access_configuration_register( hw->link->handle, ®); #endif if (result != CS_SUCCESS ) { WLAN_LOG_ERROR( ":0: AccessConfigurationRegister(CS_READ) failed," "result=%d.\n", result); result = -EIO; } corsave = reg.Value; /* Write reset bit (BIT7) */ reg.Value |= BIT7; reg.Action = CS_WRITE; reg.Offset = CISREG_COR; #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16) result = pcmcia_access_configuration_register(hw->pdev, ®); #else result = pcmcia_access_configuration_register( hw->link->handle, ®); #endif if (result != CS_SUCCESS ) { WLAN_LOG_ERROR( ":1: AccessConfigurationRegister(CS_WRITE) failed," "result=%d.\n", result); result = -EIO; } /* Hold for holdtime */ mdelay(holdtime); if (genesis) { reg.Value = genesis; reg.Action = CS_WRITE; reg.Offset = CISREG_CCSR; #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16) result = pcmcia_access_configuration_register(hw->pdev, ®); #else result = pcmcia_access_configuration_register( hw->link->handle, ®); #endif if (result != CS_SUCCESS ) { WLAN_LOG_ERROR( ":1: AccessConfigurationRegister(CS_WRITE) failed," "result=%d.\n", result); result = -EIO; } } /* Hold for holdtime */ mdelay(holdtime); /* Clear reset bit */ reg.Value &= ~BIT7; reg.Action = CS_WRITE; reg.Offset = CISREG_COR; #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16) result = pcmcia_access_configuration_register(hw->pdev, ®); #else result = pcmcia_access_configuration_register( hw->link->handle, ®); #endif if (result != CS_SUCCESS ) { WLAN_LOG_ERROR( ":2: AccessConfigurationRegister(CS_WRITE) failed," "result=%d.\n", result); result = -EIO; goto done; } /* Wait for settletime */ mdelay(settletime); /* Set non-reset bits back what they were */ reg.Value = corsave; reg.Action = CS_WRITE; reg.Offset = CISREG_COR; #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16) result = pcmcia_access_configuration_register(hw->pdev, ®); #else result = pcmcia_access_configuration_register( hw->link->handle, ®); #endif if (result != CS_SUCCESS ) { WLAN_LOG_ERROR( ":2: AccessConfigurationRegister(CS_WRITE) failed," "result=%d.\n", result); result = -EIO; goto done; } done: DBFEXIT; return result; } #ifdef MODULE static int __init prism2cs_init(void) { #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,68)) servinfo_t serv; #endif DBFENTER; WLAN_LOG_NOTICE("%s Loaded\n", version); WLAN_LOG_NOTICE("dev_info is: %s\n", dev_info); #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,68)) pcmcia_get_card_services_info(&serv); if ( serv.Revision != CS_RELEASE_CODE ) { printk(KERN_NOTICE"%s: CardServices release does not match!\n", dev_info); return -1; } /* This call will result in a call to prism2sta_attach */ /* and eventually prism2sta_detach */ register_pccard_driver( &dev_info, &prism2sta_attach, &prism2sta_detach); #else pcmcia_register_driver(&prism2_cs_driver); #endif DBFEXIT; return 0; } static void __exit prism2cs_cleanup(void) { #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,68)) dev_link_t *link = dev_list; dev_link_t *nlink; DBFENTER; #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) ) for (link=dev_list; link != NULL; link = nlink) { nlink = link->next; if ( link->state & DEV_CONFIG ) { prism2sta_release((u_long)link); } prism2sta_detach(link); /* remember detach() frees link */ } #endif unregister_pccard_driver( &dev_info); #else pcmcia_unregister_driver(&prism2_cs_driver); #endif printk(KERN_NOTICE "%s Unloaded\n", version); DBFEXIT; return; } module_init(prism2cs_init); module_exit(prism2cs_cleanup); #endif // MODULE linux-wlan-ng-0.2.9+dfsg/src/prism2/driver/prism2_pci.c0000644000175000017500000002041511024763177022256 0ustar tormodtormod#define WLAN_HOSTIF WLAN_PCI #include "hfa384x.c" #include "prism2mgmt.c" #include "prism2mib.c" #include "prism2sta.c" #define PCI_SIZE 0x1000 /* Memory size - 4K bytes */ /* ISL3874A 11Mb/s WLAN controller */ #define PCIVENDOR_INTERSIL 0x1260UL #define PCIDEVICE_ISL3874 0x3873UL /* [MSM] yeah I know...the ID says 3873. Trust me, it's a 3874. */ /* Samsung SWL-2210P 11Mb/s WLAN controller (uses ISL3874A) */ #define PCIVENDOR_SAMSUNG 0x167dUL #define PCIDEVICE_SWL_2210P 0xa000UL #define PCIVENDOR_NETGEAR 0x1385UL /* for MA311 */ /* PCI Class & Sub-Class code, Network-'Other controller' */ #define PCI_CLASS_NETWORK_OTHERS 0x280 /*---------------------------------------------------------------- * prism2sta_probe_pci * * Probe routine called when a PCI device w/ matching ID is found. * The ISL3874 implementation uses the following map: * BAR0: Prism2.x registers memory mapped, size=4k * Here's the sequence: * - Allocate the PCI resources. * - Read the PCMCIA attribute memory to make sure we have a WLAN card * - Reset the MAC * - Initialize the netdev and wlan data * - Initialize the MAC * * Arguments: * pdev ptr to pci device structure containing info about * pci configuration. * id ptr to the device id entry that matched this device. * * Returns: * zero - success * negative - failed * * Side effects: * * * Call context: * process thread * ----------------------------------------------------------------*/ static int __devinit prism2sta_probe_pci( struct pci_dev *pdev, const struct pci_device_id *id) { int result; phys_t phymem = 0; void __iomem *mem = NULL; wlandevice_t *wlandev = NULL; hfa384x_t *hw = NULL; DBFENTER; /* Enable the pci device */ if (pci_enable_device(pdev)) { WLAN_LOG_ERROR("%s: pci_enable_device() failed.\n", dev_info); result = -EIO; goto fail; } /* Figure out our resources */ phymem = pci_resource_start(pdev, 0); if (!request_mem_region(phymem, pci_resource_len(pdev, 0), "Prism2")) { printk(KERN_ERR "prism2: Cannot reserve PCI memory region\n"); result = -EIO; goto fail; } mem = ioremap(phymem, PCI_SIZE); if ( mem == 0 ) { WLAN_LOG_ERROR("%s: ioremap() failed.\n", dev_info); result = -EIO; goto fail; } /* Log the device */ WLAN_LOG_INFO("A Prism2.5 PCI device found, " "phymem:0x%llx, irq:%d, mem:0x%p\n", (unsigned long long)phymem, pdev->irq, mem); if ((wlandev = create_wlan()) == NULL) { WLAN_LOG_ERROR("%s: Memory allocation failure.\n", dev_info); result = -EIO; goto fail; } hw = wlandev->priv; if ( wlan_setup(wlandev) != 0 ) { WLAN_LOG_ERROR("%s: wlan_setup() failed.\n", dev_info); result = -EIO; goto fail; } /* Setup netdevice's ability to report resources * Note: the netdevice was allocated by wlan_setup() */ wlandev->netdev->irq = pdev->irq; wlandev->netdev->mem_start = (unsigned long) mem; wlandev->netdev->mem_end = wlandev->netdev->mem_start + pci_resource_len(pdev, 0); /* Initialize the hw data */ hfa384x_create(hw, wlandev->netdev->irq, 0, mem); hw->wlandev = wlandev; SET_MODULE_OWNER(wlandev->netdev); #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) SET_NETDEV_DEV(wlandev->netdev, &(pdev->dev)); #endif #if 0 /* TODO: Move this and an irq test into an hfa384x_testif() routine. */ outw(PRISM2STA_MAGIC, HFA384x_SWSUPPORT(wlandev->netdev->base_addr)); reg=inw( HFA384x_SWSUPPORT(wlandev->netdev->base_addr)); if ( reg != PRISM2STA_MAGIC ) { WLAN_LOG_ERROR("MAC register access test failed!\n"); result = -EIO; goto fail; } #endif /* Do a chip-level reset on the MAC */ if (prism2_doreset) { result = hfa384x_corereset(hw, prism2_reset_holdtime, prism2_reset_settletime, 0); if (result != 0) { WLAN_LOG_ERROR( "%s: hfa384x_corereset() failed.\n", dev_info); hfa384x_destroy(hw); result = -EIO; goto fail; } } pci_set_drvdata(pdev, wlandev); /* Shouldn't actually hook up the IRQ until we * _know_ things are alright. A test routine would help. */ request_irq(wlandev->netdev->irq, hfa384x_interrupt, IRQF_SHARED, wlandev->name, wlandev); wlandev->msdstate = WLAN_MSD_HWPRESENT; /* Register the wlandev, this gets us a name and registers the * linux netdevice. */ if ( register_wlandev(wlandev) != 0 ) { WLAN_LOG_ERROR("%s: register_wlandev() failed.\n", dev_info); result = -EIO; goto fail; } if (wlan_wext_write) prism2sta_ifstate(wlandev, P80211ENUM_ifstate_enable); result = 0; goto done; fail: pci_set_drvdata(pdev, NULL); if (wlandev) kfree(wlandev); if (hw) kfree(hw); if (mem) iounmap(mem); pci_release_regions(pdev); pci_disable_device(pdev); done: p80211_allow_ioctls(wlandev); DBFEXIT; return result; } static void __devexit prism2sta_remove_pci(struct pci_dev *pdev) { wlandevice_t *wlandev; hfa384x_t *hw; wlandev = (wlandevice_t *) pci_get_drvdata(pdev); hw = wlandev->priv; p80211netdev_hwremoved(wlandev); /* reset hardware */ prism2sta_ifstate(wlandev, P80211ENUM_ifstate_disable); if (pdev->irq) free_irq(pdev->irq, wlandev); unregister_wlandev(wlandev); /* free local stuff */ if (hw) { hfa384x_destroy(hw); kfree(hw); } iounmap((void __iomem *)wlandev->netdev->mem_start); wlan_unsetup(wlandev); pci_release_regions(pdev); pci_disable_device(pdev); pci_set_drvdata(pdev, NULL); kfree(wlandev); } static struct pci_device_id pci_id_tbl[] = { { PCIVENDOR_INTERSIL, PCIDEVICE_ISL3874, PCI_ANY_ID, PCI_ANY_ID, 0, 0, /* Driver data, we just put the name here */ (unsigned long)"Intersil Prism2.5 ISL3874 11Mb/s WLAN Controller" }, { PCIVENDOR_INTERSIL, 0x3872, PCI_ANY_ID, PCI_ANY_ID, 0, 0, /* Driver data, we just put the name here */ (unsigned long)"Intersil Prism2.5 ISL3872 11Mb/s WLAN Controller" }, { PCIVENDOR_SAMSUNG, PCIDEVICE_SWL_2210P, PCI_ANY_ID, PCI_ANY_ID, 0, 0, /* Driver data, we just put the name here */ (unsigned long)"Samsung MagicLAN SWL-2210P 11Mb/s WLAN Controller" }, { /* for NetGear MA311 */ PCIVENDOR_NETGEAR, 0x3872, PCI_ANY_ID, PCI_ANY_ID, 0, 0, /* Driver data, we just put the name here */ (unsigned long)"Netgear MA311 WLAN Controller" }, { 0, 0, 0, 0, 0, 0, 0 } }; MODULE_DEVICE_TABLE(pci, pci_id_tbl); /* Function declared here because of ptr reference below */ static int __devinit prism2sta_probe_pci(struct pci_dev *pdev, const struct pci_device_id *id); static void __devexit prism2sta_remove_pci(struct pci_dev *pdev); static struct pci_driver prism2_pci_drv_id = { .name = "prism2_pci", .id_table = pci_id_tbl, .probe = prism2sta_probe_pci, .remove = prism2sta_remove_pci, #ifdef CONFIG_PM .suspend = prism2sta_suspend_pci, .resume = prism2sta_resume_pci, #endif }; #ifdef MODULE static int __init prism2pci_init(void) { WLAN_LOG_NOTICE("%s Loaded\n", version); return pci_register_driver(&prism2_pci_drv_id); }; static void __exit prism2pci_cleanup(void) { pci_unregister_driver(&prism2_pci_drv_id); }; module_init(prism2pci_init); module_exit(prism2pci_cleanup); #endif int hfa384x_corereset(hfa384x_t *hw, int holdtime, int settletime, int genesis) { int result = 0; unsigned long timeout; UINT16 reg; DBFENTER; /* Assert reset and wait awhile * (note: these delays are _really_ long, but they appear to be * necessary.) */ hfa384x_setreg(hw, 0xc5, HFA384x_PCICOR); timeout = jiffies + HZ/4; while(time_before(jiffies, timeout)) udelay(5); if (genesis) { hfa384x_setreg(hw, genesis, HFA384x_PCIHCR); timeout = jiffies + HZ/4; while(time_before(jiffies, timeout)) udelay(5); } /* Clear the reset and wait some more */ hfa384x_setreg(hw, 0x45, HFA384x_PCICOR); timeout = jiffies + HZ/2; while(time_before(jiffies, timeout)) udelay(5); /* Wait for f/w to complete initialization (CMD:BUSY == 0) */ timeout = jiffies + 2*HZ; reg = hfa384x_getreg(hw, HFA384x_CMD); while ( HFA384x_CMD_ISBUSY(reg) && time_before( jiffies, timeout) ) { reg = hfa384x_getreg(hw, HFA384x_CMD); udelay(10); } if (HFA384x_CMD_ISBUSY(reg)) { WLAN_LOG_WARNING("corereset: Timed out waiting for cmd register.\n"); result=1; } DBFEXIT; return result; } linux-wlan-ng-0.2.9+dfsg/src/prism2/driver/prism2sta.c0000644000175000017500000021052311024763177022134 0ustar tormodtormod/* src/prism2/driver/prism2sta.c * * Implements the station functionality for prism2 * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- * * This file implements the module and linux pcmcia routines for the * prism2 driver. * * -------------------------------------------------------------------- */ /*================================================================*/ /* System Includes */ #define WLAN_DBVAR prism2_debug #include #include #include #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,25)) #include #endif #include #include #include #include #include #include #include #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) #include #else #include #endif #include #include #include #include #if (WLAN_HOSTIF == WLAN_PCMCIA) #include #include #include #include #include #include #endif #include #if ((WLAN_HOSTIF == WLAN_PLX) || (WLAN_HOSTIF == WLAN_PCI)) #include #include #endif /*================================================================*/ /* Project Includes */ #include #include #include #include #include #include #include #include #include #include #include /*================================================================*/ /* Local Constants */ /*================================================================*/ /* Local Macros */ /*================================================================*/ /* Local Types */ /*================================================================*/ /* Local Static Definitions */ #if (WLAN_HOSTIF == WLAN_PCMCIA) #define DRIVER_SUFFIX "_cs" #elif (WLAN_HOSTIF == WLAN_PLX) #define DRIVER_SUFFIX "_plx" typedef char* dev_info_t; #elif (WLAN_HOSTIF == WLAN_PCI) #define DRIVER_SUFFIX "_pci" typedef char* dev_info_t; #elif (WLAN_HOSTIF == WLAN_USB) #define DRIVER_SUFFIX "_usb" typedef char* dev_info_t; #else #error "HOSTIF unsupported or undefined!" #endif static char *version = "prism2" DRIVER_SUFFIX ".o: " WLAN_RELEASE; static dev_info_t dev_info = "prism2" DRIVER_SUFFIX; #if (WLAN_HOSTIF == WLAN_PLX || WLAN_HOSTIF == WLAN_PCI) #ifdef CONFIG_PM static int prism2sta_suspend_pci(struct pci_dev *pdev, pm_message_t state); static int prism2sta_resume_pci(struct pci_dev *pdev); #endif #endif #if (WLAN_HOSTIF == WLAN_PCI) #endif /* WLAN_PCI */ static wlandevice_t *create_wlan(void); /*----------------------------------------------------------------*/ /* --Module Parameters */ int prism2_reset_holdtime=30; /* Reset hold time in ms */ int prism2_reset_settletime=100; /* Reset settle time in ms */ #if (WLAN_HOSTIF == WLAN_USB) static int prism2_doreset=0; /* Do a reset at init? */ #else static int prism2_doreset=1; /* Do a reset at init? */ int prism2_bap_timeout=1000; /* BAP timeout */ int prism2_irq_evread_max=20; /* Maximum number of * ev_reads (loops) * in irq handler */ #endif #ifdef WLAN_INCLUDE_DEBUG int prism2_debug=0; module_param( prism2_debug, int, 0644); MODULE_PARM_DESC(prism2_debug, "prism2 debugging"); #endif module_param( prism2_doreset, int, 0644); MODULE_PARM_DESC(prism2_doreset, "Issue a reset on initialization"); module_param( prism2_reset_holdtime, int, 0644); MODULE_PARM_DESC( prism2_reset_holdtime, "reset hold time in ms"); module_param( prism2_reset_settletime, int, 0644); MODULE_PARM_DESC( prism2_reset_settletime, "reset settle time in ms"); #if (WLAN_HOSTIF != WLAN_USB) module_param( prism2_bap_timeout, int, 0644); MODULE_PARM_DESC(prism2_bap_timeout, "BufferAccessPath Timeout in 10*n us"); module_param( prism2_irq_evread_max, int, 0644); MODULE_PARM_DESC( prism2_irq_evread_max, "Maximim number of event reads in interrupt handler"); #endif MODULE_LICENSE("Dual MPL/GPL"); /*================================================================*/ /* Local Function Declarations */ static int prism2sta_open(wlandevice_t *wlandev); static int prism2sta_close(wlandevice_t *wlandev); static void prism2sta_reset(wlandevice_t *wlandev ); static int prism2sta_txframe(wlandevice_t *wlandev, struct sk_buff *skb, p80211_hdr_t *p80211_hdr, p80211_metawep_t *p80211_wep); static int prism2sta_mlmerequest(wlandevice_t *wlandev, p80211msg_t *msg); static int prism2sta_getcardinfo(wlandevice_t *wlandev); static int prism2sta_globalsetup(wlandevice_t *wlandev); static int prism2sta_setmulticast(wlandevice_t *wlandev, netdevice_t *dev); static void prism2sta_inf_handover( wlandevice_t *wlandev, hfa384x_InfFrame_t *inf); static void prism2sta_inf_tallies( wlandevice_t *wlandev, hfa384x_InfFrame_t *inf); static void prism2sta_inf_hostscanresults( wlandevice_t *wlandev, hfa384x_InfFrame_t *inf); static void prism2sta_inf_scanresults( wlandevice_t *wlandev, hfa384x_InfFrame_t *inf); static void prism2sta_inf_chinforesults( wlandevice_t *wlandev, hfa384x_InfFrame_t *inf); static void prism2sta_inf_linkstatus( wlandevice_t *wlandev, hfa384x_InfFrame_t *inf); static void prism2sta_inf_assocstatus( wlandevice_t *wlandev, hfa384x_InfFrame_t *inf); static void prism2sta_inf_authreq( wlandevice_t *wlandev, hfa384x_InfFrame_t *inf); static void prism2sta_inf_authreq_defer( wlandevice_t *wlandev, hfa384x_InfFrame_t *inf); static void prism2sta_inf_psusercnt( wlandevice_t *wlandev, hfa384x_InfFrame_t *inf); #ifdef CONFIG_PROC_FS static int prism2sta_proc_read( char *page, char **start, off_t offset, int count, int *eof, void *data); #endif /*================================================================*/ /* Function Definitions */ /*---------------------------------------------------------------- * dmpmem * * Debug utility function to dump memory to the kernel debug log. * * Arguments: * buf ptr data we want dumped * len length of data * * Returns: * nothing * Side effects: * * Call context: * process thread * interrupt ----------------------------------------------------------------*/ inline void dmpmem(void *buf, int n) { int c; for ( c= 0; c < n; c++) { if ( (c % 16) == 0 ) printk(KERN_DEBUG"dmp[%d]: ", c); printk("%02x ", ((UINT8*)buf)[c]); if ( (c % 16) == 15 ) printk("\n"); } if ( (c % 16) != 0 ) printk("\n"); } /*---------------------------------------------------------------- * prism2sta_open * * WLAN device open method. Called from p80211netdev when kernel * device open (start) method is called in response to the * SIOCSIIFFLAGS ioctl changing the flags bit IFF_UP * from clear to set. * * Arguments: * wlandev wlan device structure * * Returns: * 0 success * >0 f/w reported error * <0 driver reported error * * Side effects: * * Call context: * process thread ----------------------------------------------------------------*/ static int prism2sta_open(wlandevice_t *wlandev) { DBFENTER; #ifdef ANCIENT_MODULE_CODE MOD_INC_USE_COUNT; #endif /* We don't currently have to do anything else. * The setup of the MAC should be subsequently completed via * the mlme commands. * Higher layers know we're ready from dev->start==1 and * dev->tbusy==0. Our rx path knows to pass up received/ * frames because of dev->flags&IFF_UP is true. */ DBFEXIT; return 0; } /*---------------------------------------------------------------- * prism2sta_close * * WLAN device close method. Called from p80211netdev when kernel * device close method is called in response to the * SIOCSIIFFLAGS ioctl changing the flags bit IFF_UP * from set to clear. * * Arguments: * wlandev wlan device structure * * Returns: * 0 success * >0 f/w reported error * <0 driver reported error * * Side effects: * * Call context: * process thread ----------------------------------------------------------------*/ static int prism2sta_close(wlandevice_t *wlandev) { DBFENTER; #ifdef ANCIENT_MODULE_CODE MOD_DEC_USE_COUNT; #endif /* We don't currently have to do anything else. * Higher layers know we're not ready from dev->start==0 and * dev->tbusy==1. Our rx path knows to not pass up received * frames because of dev->flags&IFF_UP is false. */ DBFEXIT; return 0; } /*---------------------------------------------------------------- * prism2sta_reset * * Not currently implented. * * Arguments: * wlandev wlan device structure * none * * Returns: * nothing * * Side effects: * * Call context: * process thread ----------------------------------------------------------------*/ static void prism2sta_reset(wlandevice_t *wlandev ) { DBFENTER; DBFEXIT; return; } /*---------------------------------------------------------------- * prism2sta_txframe * * Takes a frame from p80211 and queues it for transmission. * * Arguments: * wlandev wlan device structure * pb packet buffer struct. Contains an 802.11 * data frame. * p80211_hdr points to the 802.11 header for the packet. * Returns: * 0 Success and more buffs available * 1 Success but no more buffs * 2 Allocation failure * 4 Buffer full or queue busy * * Side effects: * * Call context: * process thread ----------------------------------------------------------------*/ static int prism2sta_txframe(wlandevice_t *wlandev, struct sk_buff *skb, p80211_hdr_t *p80211_hdr, p80211_metawep_t *p80211_wep) { hfa384x_t *hw = (hfa384x_t *)wlandev->priv; int result; DBFENTER; /* If necessary, set the 802.11 WEP bit */ if ((wlandev->hostwep & (HOSTWEP_PRIVACYINVOKED | HOSTWEP_ENCRYPT)) == HOSTWEP_PRIVACYINVOKED) { p80211_hdr->a3.fc |= host2ieee16(WLAN_SET_FC_ISWEP(1)); } result = hfa384x_drvr_txframe(hw, skb, p80211_hdr, p80211_wep); DBFEXIT; return result; } /*---------------------------------------------------------------- * prism2sta_mlmerequest * * wlan command message handler. All we do here is pass the message * over to the prism2sta_mgmt_handler. * * Arguments: * wlandev wlan device structure * msg wlan command message * Returns: * 0 success * <0 successful acceptance of message, but we're * waiting for an async process to finish before * we're done with the msg. When the asynch * process is done, we'll call the p80211 * function p80211req_confirm() . * >0 An error occurred while we were handling * the message. * * Side effects: * * Call context: * process thread ----------------------------------------------------------------*/ static int prism2sta_mlmerequest(wlandevice_t *wlandev, p80211msg_t *msg) { hfa384x_t *hw = (hfa384x_t *)wlandev->priv; int result = 0; DBFENTER; switch( msg->msgcode ) { case DIDmsg_dot11req_mibget : WLAN_LOG_DEBUG(2,"Received mibget request\n"); result = prism2mgmt_mibset_mibget(wlandev, msg); break; case DIDmsg_dot11req_mibset : WLAN_LOG_DEBUG(2,"Received mibset request\n"); result = prism2mgmt_mibset_mibget(wlandev, msg); break; case DIDmsg_dot11req_powermgmt : WLAN_LOG_DEBUG(2,"Received powermgmt request\n"); result = prism2mgmt_powermgmt(wlandev, msg); break; case DIDmsg_dot11req_scan : WLAN_LOG_DEBUG(2,"Received scan request\n"); result = prism2mgmt_scan(wlandev, msg); break; case DIDmsg_dot11req_scan_results : WLAN_LOG_DEBUG(2,"Received scan_results request\n"); result = prism2mgmt_scan_results(wlandev, msg); break; case DIDmsg_dot11req_join : WLAN_LOG_DEBUG(2,"Received join request\n"); result = prism2mgmt_join(wlandev, msg); break; case DIDmsg_dot11req_authenticate : WLAN_LOG_DEBUG(2,"Received authenticate request\n"); result = prism2mgmt_authenticate(wlandev, msg); break; case DIDmsg_dot11req_deauthenticate : WLAN_LOG_DEBUG(2,"Received mlme deauthenticate request\n"); result = prism2mgmt_deauthenticate(wlandev, msg); break; case DIDmsg_dot11req_associate : WLAN_LOG_DEBUG(2,"Received mlme associate request\n"); result = prism2mgmt_associate(wlandev, msg); break; case DIDmsg_dot11req_reassociate : WLAN_LOG_DEBUG(2,"Received mlme reassociate request\n"); result = prism2mgmt_reassociate(wlandev, msg); break; case DIDmsg_dot11req_disassociate : WLAN_LOG_DEBUG(2,"Received mlme disassociate request\n"); result = prism2mgmt_disassociate(wlandev, msg); break; case DIDmsg_dot11req_reset : WLAN_LOG_DEBUG(2,"Received mlme reset request\n"); result = prism2mgmt_reset(wlandev, msg); break; case DIDmsg_dot11req_start : WLAN_LOG_DEBUG(2,"Received mlme start request\n"); result = prism2mgmt_start(wlandev, msg); break; /* * Prism2 specific messages */ case DIDmsg_p2req_join : WLAN_LOG_DEBUG(2,"Received p2 join request\n"); result = prism2mgmt_p2_join(wlandev, msg); break; case DIDmsg_p2req_readpda : WLAN_LOG_DEBUG(2,"Received mlme readpda request\n"); result = prism2mgmt_readpda(wlandev, msg); break; case DIDmsg_p2req_readcis : WLAN_LOG_DEBUG(2,"Received mlme readcis request\n"); result = prism2mgmt_readcis(wlandev, msg); break; case DIDmsg_p2req_auxport_state : WLAN_LOG_DEBUG(2,"Received mlme auxport_state request\n"); result = prism2mgmt_auxport_state(wlandev, msg); break; case DIDmsg_p2req_auxport_read : WLAN_LOG_DEBUG(2,"Received mlme auxport_read request\n"); result = prism2mgmt_auxport_read(wlandev, msg); break; case DIDmsg_p2req_auxport_write : WLAN_LOG_DEBUG(2,"Received mlme auxport_write request\n"); result = prism2mgmt_auxport_write(wlandev, msg); break; case DIDmsg_p2req_low_level : WLAN_LOG_DEBUG(2,"Received mlme low_level request\n"); result = prism2mgmt_low_level(wlandev, msg); break; case DIDmsg_p2req_test_command : WLAN_LOG_DEBUG(2,"Received mlme test_command request\n"); result = prism2mgmt_test_command(wlandev, msg); break; case DIDmsg_p2req_mmi_read : WLAN_LOG_DEBUG(2,"Received mlme mmi_read request\n"); result = prism2mgmt_mmi_read(wlandev, msg); break; case DIDmsg_p2req_mmi_write : WLAN_LOG_DEBUG(2,"Received mlme mmi_write request\n"); result = prism2mgmt_mmi_write(wlandev, msg); break; case DIDmsg_p2req_ramdl_state : WLAN_LOG_DEBUG(2,"Received mlme ramdl_state request\n"); result = prism2mgmt_ramdl_state(wlandev, msg); break; case DIDmsg_p2req_ramdl_write : WLAN_LOG_DEBUG(2,"Received mlme ramdl_write request\n"); result = prism2mgmt_ramdl_write(wlandev, msg); break; case DIDmsg_p2req_flashdl_state : WLAN_LOG_DEBUG(2,"Received mlme flashdl_state request\n"); result = prism2mgmt_flashdl_state(wlandev, msg); break; case DIDmsg_p2req_flashdl_write : WLAN_LOG_DEBUG(2,"Received mlme flashdl_write request\n"); result = prism2mgmt_flashdl_write(wlandev, msg); break; case DIDmsg_p2req_dump_state : WLAN_LOG_DEBUG(2,"Received mlme dump_state request\n"); result = prism2mgmt_dump_state(wlandev, msg); break; case DIDmsg_p2req_channel_info : WLAN_LOG_DEBUG(2,"Received mlme channel_info request\n"); result = prism2mgmt_channel_info(wlandev, msg); break; case DIDmsg_p2req_channel_info_results : WLAN_LOG_DEBUG(2,"Received mlme channel_info_results request\n"); result = prism2mgmt_channel_info_results(wlandev, msg); break; /* * Linux specific messages */ case DIDmsg_lnxreq_hostwep : break; // ignore me. case DIDmsg_lnxreq_ifstate : { p80211msg_lnxreq_ifstate_t *ifstatemsg; WLAN_LOG_DEBUG(2,"Received mlme ifstate request\n"); ifstatemsg = (p80211msg_lnxreq_ifstate_t*)msg; result = prism2sta_ifstate(wlandev, ifstatemsg->ifstate.data); ifstatemsg->resultcode.status = P80211ENUM_msgitem_status_data_ok; ifstatemsg->resultcode.data = result; result = 0; } break; case DIDmsg_lnxreq_wlansniff : WLAN_LOG_DEBUG(2,"Received mlme wlansniff request\n"); result = prism2mgmt_wlansniff(wlandev, msg); break; case DIDmsg_lnxreq_autojoin : WLAN_LOG_DEBUG(2,"Received mlme autojoin request\n"); result = prism2mgmt_autojoin(wlandev, msg); break; case DIDmsg_p2req_enable : WLAN_LOG_DEBUG(2,"Received mlme enable request\n"); result = prism2mgmt_enable(wlandev, msg); break; case DIDmsg_lnxreq_commsquality: { p80211msg_lnxreq_commsquality_t *qualmsg; WLAN_LOG_DEBUG(2,"Received commsquality request\n"); if (hw->ap) break; qualmsg = (p80211msg_lnxreq_commsquality_t*) msg; qualmsg->link.status = P80211ENUM_msgitem_status_data_ok; qualmsg->level.status = P80211ENUM_msgitem_status_data_ok; qualmsg->noise.status = P80211ENUM_msgitem_status_data_ok; qualmsg->link.data = hfa384x2host_16(hw->qual.CQ_currBSS); qualmsg->level.data = hfa384x2host_16(hw->qual.ASL_currBSS); qualmsg->noise.data = hfa384x2host_16(hw->qual.ANL_currFC); break; } default: WLAN_LOG_WARNING("Unknown mgmt request message 0x%08x", msg->msgcode); break; } DBFEXIT; return result; } /*---------------------------------------------------------------- * prism2sta_ifstate * * Interface state. This is the primary WLAN interface enable/disable * handler. Following the driver/load/deviceprobe sequence, this * function must be called with a state of "enable" before any other * commands will be accepted. * * Arguments: * wlandev wlan device structure * msgp ptr to msg buffer * * Returns: * A p80211 message resultcode value. * * Side effects: * * Call context: * process thread (usually) * interrupt ----------------------------------------------------------------*/ UINT32 prism2sta_ifstate(wlandevice_t *wlandev, UINT32 ifstate) { hfa384x_t *hw = (hfa384x_t *)wlandev->priv; UINT32 result; DBFENTER; result = P80211ENUM_resultcode_implementation_failure; WLAN_LOG_DEBUG(2, "Current MSD state(%d), requesting(%d)\n", wlandev->msdstate, ifstate); switch (ifstate) { case P80211ENUM_ifstate_fwload: switch (wlandev->msdstate) { case WLAN_MSD_HWPRESENT: wlandev->msdstate = WLAN_MSD_FWLOAD_PENDING; /* * Initialize the device+driver sufficiently * for firmware loading. */ #if (WLAN_HOSTIF != WLAN_USB) result=hfa384x_cmd_initialize(hw); #else if ((result=hfa384x_drvr_start(hw))) { WLAN_LOG_ERROR( "hfa384x_drvr_start() failed," "result=%d\n", (int)result); result = P80211ENUM_resultcode_implementation_failure; wlandev->msdstate = WLAN_MSD_HWPRESENT; break; } #endif wlandev->msdstate = WLAN_MSD_FWLOAD; result = P80211ENUM_resultcode_success; break; case WLAN_MSD_FWLOAD: hfa384x_cmd_initialize(hw); result = P80211ENUM_resultcode_success; break; case WLAN_MSD_RUNNING: WLAN_LOG_WARNING( "Cannot enter fwload state from enable state," "you must disable first.\n"); result = P80211ENUM_resultcode_invalid_parameters; break; case WLAN_MSD_HWFAIL: default: /* probe() had a problem or the msdstate contains * an unrecognized value, there's nothing we can do. */ result = P80211ENUM_resultcode_implementation_failure; break; } break; case P80211ENUM_ifstate_enable: switch (wlandev->msdstate) { case WLAN_MSD_HWPRESENT: case WLAN_MSD_FWLOAD: wlandev->msdstate = WLAN_MSD_RUNNING_PENDING; /* Initialize the device+driver for full * operation. Note that this might me an FWLOAD to * to RUNNING transition so we must not do a chip * or board level reset. Note that on failure, * the MSD state is set to HWPRESENT because we * can't make any assumptions about the state * of the hardware or a previous firmware load. */ if ((result=hfa384x_drvr_start(hw))) { WLAN_LOG_ERROR( "hfa384x_drvr_start() failed," "result=%d\n", (int)result); result = P80211ENUM_resultcode_implementation_failure; wlandev->msdstate = WLAN_MSD_HWPRESENT; break; } if ((result=prism2sta_getcardinfo(wlandev))) { WLAN_LOG_ERROR( "prism2sta_getcardinfo() failed," "result=%d\n", (int)result); result = P80211ENUM_resultcode_implementation_failure; hfa384x_drvr_stop(hw); wlandev->msdstate = WLAN_MSD_HWPRESENT; break; } if ((result=prism2sta_globalsetup(wlandev))) { WLAN_LOG_ERROR( "prism2sta_globalsetup() failed," "result=%d\n", (int)result); result = P80211ENUM_resultcode_implementation_failure; hfa384x_drvr_stop(hw); wlandev->msdstate = WLAN_MSD_HWPRESENT; break; } wlandev->msdstate = WLAN_MSD_RUNNING; hw->join_ap = 0; hw->join_retries = 60; result = P80211ENUM_resultcode_success; break; case WLAN_MSD_RUNNING: /* Do nothing, we're already in this state.*/ result = P80211ENUM_resultcode_success; break; case WLAN_MSD_HWFAIL: default: /* probe() had a problem or the msdstate contains * an unrecognized value, there's nothing we can do. */ result = P80211ENUM_resultcode_implementation_failure; break; } break; case P80211ENUM_ifstate_disable: switch (wlandev->msdstate) { case WLAN_MSD_HWPRESENT: /* Do nothing, we're already in this state.*/ result = P80211ENUM_resultcode_success; break; case WLAN_MSD_FWLOAD: case WLAN_MSD_RUNNING: wlandev->msdstate = WLAN_MSD_HWPRESENT_PENDING; /* * TODO: Shut down the MAC completely. Here a chip * or board level reset is probably called for. * After a "disable" _all_ results are lost, even * those from a fwload. */ if (!wlandev->hwremoved) netif_carrier_off(wlandev->netdev); hfa384x_drvr_stop(hw); wlandev->macmode = WLAN_MACMODE_NONE; wlandev->msdstate = WLAN_MSD_HWPRESENT; result = P80211ENUM_resultcode_success; break; case WLAN_MSD_HWFAIL: default: /* probe() had a problem or the msdstate contains * an unrecognized value, there's nothing we can do. */ result = P80211ENUM_resultcode_implementation_failure; break; } break; default: result = P80211ENUM_resultcode_invalid_parameters; break; } DBFEXIT; return result; } /*---------------------------------------------------------------- * prism2sta_getcardinfo * * Collect the NICID, firmware version and any other identifiers * we'd like to have in host-side data structures. * * Arguments: * wlandev wlan device structure * * Returns: * 0 success * >0 f/w reported error * <0 driver reported error * * Side effects: * * Call context: * Either. ----------------------------------------------------------------*/ static int prism2sta_getcardinfo(wlandevice_t *wlandev) { int result = 0; hfa384x_t *hw = (hfa384x_t *)wlandev->priv; UINT16 temp; UINT8 snum[HFA384x_RID_NICSERIALNUMBER_LEN]; char pstr[(HFA384x_RID_NICSERIALNUMBER_LEN * 4) + 1]; DBFENTER; /* Collect version and compatibility info */ /* Some are critical, some are not */ /* NIC identity */ result = hfa384x_drvr_getconfig(hw, HFA384x_RID_NICIDENTITY, &hw->ident_nic, sizeof(hfa384x_compident_t)); if ( result ) { WLAN_LOG_ERROR("Failed to retrieve NICIDENTITY\n"); goto failed; } /* get all the nic id fields in host byte order */ hw->ident_nic.id = hfa384x2host_16(hw->ident_nic.id); hw->ident_nic.variant = hfa384x2host_16(hw->ident_nic.variant); hw->ident_nic.major = hfa384x2host_16(hw->ident_nic.major); hw->ident_nic.minor = hfa384x2host_16(hw->ident_nic.minor); WLAN_LOG_INFO( "ident: nic h/w: id=0x%02x %d.%d.%d\n", hw->ident_nic.id, hw->ident_nic.major, hw->ident_nic.minor, hw->ident_nic.variant); /* Primary f/w identity */ result = hfa384x_drvr_getconfig(hw, HFA384x_RID_PRIIDENTITY, &hw->ident_pri_fw, sizeof(hfa384x_compident_t)); if ( result ) { WLAN_LOG_ERROR("Failed to retrieve PRIIDENTITY\n"); goto failed; } /* get all the private fw id fields in host byte order */ hw->ident_pri_fw.id = hfa384x2host_16(hw->ident_pri_fw.id); hw->ident_pri_fw.variant = hfa384x2host_16(hw->ident_pri_fw.variant); hw->ident_pri_fw.major = hfa384x2host_16(hw->ident_pri_fw.major); hw->ident_pri_fw.minor = hfa384x2host_16(hw->ident_pri_fw.minor); WLAN_LOG_INFO( "ident: pri f/w: id=0x%02x %d.%d.%d\n", hw->ident_pri_fw.id, hw->ident_pri_fw.major, hw->ident_pri_fw.minor, hw->ident_pri_fw.variant); /* Station (Secondary?) f/w identity */ result = hfa384x_drvr_getconfig(hw, HFA384x_RID_STAIDENTITY, &hw->ident_sta_fw, sizeof(hfa384x_compident_t)); if ( result ) { WLAN_LOG_ERROR("Failed to retrieve STAIDENTITY\n"); goto failed; } if (hw->ident_nic.id < 0x8000) { WLAN_LOG_ERROR("FATAL: Card is not an Intersil Prism2/2.5/3\n"); result = -1; goto failed; } /* get all the station fw id fields in host byte order */ hw->ident_sta_fw.id = hfa384x2host_16(hw->ident_sta_fw.id); hw->ident_sta_fw.variant = hfa384x2host_16(hw->ident_sta_fw.variant); hw->ident_sta_fw.major = hfa384x2host_16(hw->ident_sta_fw.major); hw->ident_sta_fw.minor = hfa384x2host_16(hw->ident_sta_fw.minor); /* strip out the 'special' variant bits */ hw->mm_mods = hw->ident_sta_fw.variant & (BIT14 | BIT15); hw->ident_sta_fw.variant &= ~((UINT16)(BIT14 | BIT15)); if ( hw->ident_sta_fw.id == 0x1f ) { hw->ap = 0; WLAN_LOG_INFO( "ident: sta f/w: id=0x%02x %d.%d.%d\n", hw->ident_sta_fw.id, hw->ident_sta_fw.major, hw->ident_sta_fw.minor, hw->ident_sta_fw.variant); } else { hw->ap = 1; WLAN_LOG_INFO( "ident: ap f/w: id=0x%02x %d.%d.%d\n", hw->ident_sta_fw.id, hw->ident_sta_fw.major, hw->ident_sta_fw.minor, hw->ident_sta_fw.variant); } /* Compatibility range, Modem supplier */ result = hfa384x_drvr_getconfig(hw, HFA384x_RID_MFISUPRANGE, &hw->cap_sup_mfi, sizeof(hfa384x_caplevel_t)); if ( result ) { WLAN_LOG_ERROR("Failed to retrieve MFISUPRANGE\n"); goto failed; } /* get all the Compatibility range, modem interface supplier fields in byte order */ hw->cap_sup_mfi.role = hfa384x2host_16(hw->cap_sup_mfi.role); hw->cap_sup_mfi.id = hfa384x2host_16(hw->cap_sup_mfi.id); hw->cap_sup_mfi.variant = hfa384x2host_16(hw->cap_sup_mfi.variant); hw->cap_sup_mfi.bottom = hfa384x2host_16(hw->cap_sup_mfi.bottom); hw->cap_sup_mfi.top = hfa384x2host_16(hw->cap_sup_mfi.top); WLAN_LOG_INFO( "MFI:SUP:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n", hw->cap_sup_mfi.role, hw->cap_sup_mfi.id, hw->cap_sup_mfi.variant, hw->cap_sup_mfi.bottom, hw->cap_sup_mfi.top); /* Compatibility range, Controller supplier */ result = hfa384x_drvr_getconfig(hw, HFA384x_RID_CFISUPRANGE, &hw->cap_sup_cfi, sizeof(hfa384x_caplevel_t)); if ( result ) { WLAN_LOG_ERROR("Failed to retrieve CFISUPRANGE\n"); goto failed; } /* get all the Compatibility range, controller interface supplier fields in byte order */ hw->cap_sup_cfi.role = hfa384x2host_16(hw->cap_sup_cfi.role); hw->cap_sup_cfi.id = hfa384x2host_16(hw->cap_sup_cfi.id); hw->cap_sup_cfi.variant = hfa384x2host_16(hw->cap_sup_cfi.variant); hw->cap_sup_cfi.bottom = hfa384x2host_16(hw->cap_sup_cfi.bottom); hw->cap_sup_cfi.top = hfa384x2host_16(hw->cap_sup_cfi.top); WLAN_LOG_INFO( "CFI:SUP:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n", hw->cap_sup_cfi.role, hw->cap_sup_cfi.id, hw->cap_sup_cfi.variant, hw->cap_sup_cfi.bottom, hw->cap_sup_cfi.top); /* Compatibility range, Primary f/w supplier */ result = hfa384x_drvr_getconfig(hw, HFA384x_RID_PRISUPRANGE, &hw->cap_sup_pri, sizeof(hfa384x_caplevel_t)); if ( result ) { WLAN_LOG_ERROR("Failed to retrieve PRISUPRANGE\n"); goto failed; } /* get all the Compatibility range, primary firmware supplier fields in byte order */ hw->cap_sup_pri.role = hfa384x2host_16(hw->cap_sup_pri.role); hw->cap_sup_pri.id = hfa384x2host_16(hw->cap_sup_pri.id); hw->cap_sup_pri.variant = hfa384x2host_16(hw->cap_sup_pri.variant); hw->cap_sup_pri.bottom = hfa384x2host_16(hw->cap_sup_pri.bottom); hw->cap_sup_pri.top = hfa384x2host_16(hw->cap_sup_pri.top); WLAN_LOG_INFO( "PRI:SUP:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n", hw->cap_sup_pri.role, hw->cap_sup_pri.id, hw->cap_sup_pri.variant, hw->cap_sup_pri.bottom, hw->cap_sup_pri.top); /* Compatibility range, Station f/w supplier */ result = hfa384x_drvr_getconfig(hw, HFA384x_RID_STASUPRANGE, &hw->cap_sup_sta, sizeof(hfa384x_caplevel_t)); if ( result ) { WLAN_LOG_ERROR("Failed to retrieve STASUPRANGE\n"); goto failed; } /* get all the Compatibility range, station firmware supplier fields in byte order */ hw->cap_sup_sta.role = hfa384x2host_16(hw->cap_sup_sta.role); hw->cap_sup_sta.id = hfa384x2host_16(hw->cap_sup_sta.id); hw->cap_sup_sta.variant = hfa384x2host_16(hw->cap_sup_sta.variant); hw->cap_sup_sta.bottom = hfa384x2host_16(hw->cap_sup_sta.bottom); hw->cap_sup_sta.top = hfa384x2host_16(hw->cap_sup_sta.top); if ( hw->cap_sup_sta.id == 0x04 ) { WLAN_LOG_INFO( "STA:SUP:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n", hw->cap_sup_sta.role, hw->cap_sup_sta.id, hw->cap_sup_sta.variant, hw->cap_sup_sta.bottom, hw->cap_sup_sta.top); } else { WLAN_LOG_INFO( "AP:SUP:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n", hw->cap_sup_sta.role, hw->cap_sup_sta.id, hw->cap_sup_sta.variant, hw->cap_sup_sta.bottom, hw->cap_sup_sta.top); } /* Compatibility range, primary f/w actor, CFI supplier */ result = hfa384x_drvr_getconfig(hw, HFA384x_RID_PRI_CFIACTRANGES, &hw->cap_act_pri_cfi, sizeof(hfa384x_caplevel_t)); if ( result ) { WLAN_LOG_ERROR("Failed to retrieve PRI_CFIACTRANGES\n"); goto failed; } /* get all the Compatibility range, primary f/w actor, CFI supplier fields in byte order */ hw->cap_act_pri_cfi.role = hfa384x2host_16(hw->cap_act_pri_cfi.role); hw->cap_act_pri_cfi.id = hfa384x2host_16(hw->cap_act_pri_cfi.id); hw->cap_act_pri_cfi.variant = hfa384x2host_16(hw->cap_act_pri_cfi.variant); hw->cap_act_pri_cfi.bottom = hfa384x2host_16(hw->cap_act_pri_cfi.bottom); hw->cap_act_pri_cfi.top = hfa384x2host_16(hw->cap_act_pri_cfi.top); WLAN_LOG_INFO( "PRI-CFI:ACT:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n", hw->cap_act_pri_cfi.role, hw->cap_act_pri_cfi.id, hw->cap_act_pri_cfi.variant, hw->cap_act_pri_cfi.bottom, hw->cap_act_pri_cfi.top); /* Compatibility range, sta f/w actor, CFI supplier */ result = hfa384x_drvr_getconfig(hw, HFA384x_RID_STA_CFIACTRANGES, &hw->cap_act_sta_cfi, sizeof(hfa384x_caplevel_t)); if ( result ) { WLAN_LOG_ERROR("Failed to retrieve STA_CFIACTRANGES\n"); goto failed; } /* get all the Compatibility range, station f/w actor, CFI supplier fields in byte order */ hw->cap_act_sta_cfi.role = hfa384x2host_16(hw->cap_act_sta_cfi.role); hw->cap_act_sta_cfi.id = hfa384x2host_16(hw->cap_act_sta_cfi.id); hw->cap_act_sta_cfi.variant = hfa384x2host_16(hw->cap_act_sta_cfi.variant); hw->cap_act_sta_cfi.bottom = hfa384x2host_16(hw->cap_act_sta_cfi.bottom); hw->cap_act_sta_cfi.top = hfa384x2host_16(hw->cap_act_sta_cfi.top); WLAN_LOG_INFO( "STA-CFI:ACT:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n", hw->cap_act_sta_cfi.role, hw->cap_act_sta_cfi.id, hw->cap_act_sta_cfi.variant, hw->cap_act_sta_cfi.bottom, hw->cap_act_sta_cfi.top); /* Compatibility range, sta f/w actor, MFI supplier */ result = hfa384x_drvr_getconfig(hw, HFA384x_RID_STA_MFIACTRANGES, &hw->cap_act_sta_mfi, sizeof(hfa384x_caplevel_t)); if ( result ) { WLAN_LOG_ERROR("Failed to retrieve STA_MFIACTRANGES\n"); goto failed; } /* get all the Compatibility range, station f/w actor, MFI supplier fields in byte order */ hw->cap_act_sta_mfi.role = hfa384x2host_16(hw->cap_act_sta_mfi.role); hw->cap_act_sta_mfi.id = hfa384x2host_16(hw->cap_act_sta_mfi.id); hw->cap_act_sta_mfi.variant = hfa384x2host_16(hw->cap_act_sta_mfi.variant); hw->cap_act_sta_mfi.bottom = hfa384x2host_16(hw->cap_act_sta_mfi.bottom); hw->cap_act_sta_mfi.top = hfa384x2host_16(hw->cap_act_sta_mfi.top); WLAN_LOG_INFO( "STA-MFI:ACT:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n", hw->cap_act_sta_mfi.role, hw->cap_act_sta_mfi.id, hw->cap_act_sta_mfi.variant, hw->cap_act_sta_mfi.bottom, hw->cap_act_sta_mfi.top); /* Serial Number */ result = hfa384x_drvr_getconfig(hw, HFA384x_RID_NICSERIALNUMBER, snum, HFA384x_RID_NICSERIALNUMBER_LEN); if ( !result ) { wlan_mkprintstr(snum, HFA384x_RID_NICSERIALNUMBER_LEN, pstr, sizeof(pstr)); WLAN_LOG_INFO("Prism2 card SN: %s\n", pstr); } else { WLAN_LOG_ERROR("Failed to retrieve Prism2 Card SN\n"); goto failed; } /* Collect the MAC address */ result = hfa384x_drvr_getconfig(hw, HFA384x_RID_CNFOWNMACADDR, wlandev->netdev->dev_addr, WLAN_ADDR_LEN); if ( result != 0 ) { WLAN_LOG_ERROR("Failed to retrieve mac address\n"); goto failed; } /* short preamble is always implemented */ wlandev->nsdcaps |= P80211_NSDCAP_SHORT_PREAMBLE; /* find out if hardware wep is implemented */ hfa384x_drvr_getconfig16(hw, HFA384x_RID_PRIVACYOPTIMP, &temp); if (temp) wlandev->nsdcaps |= P80211_NSDCAP_HARDWAREWEP; /* get the dBm Scaling constant */ hfa384x_drvr_getconfig16(hw, HFA384x_RID_CNFDBMADJUST, &temp); hw->dbmadjust = temp; /* Only enable scan by default on newer firmware */ if (HFA384x_FIRMWARE_VERSION(hw->ident_sta_fw.major, hw->ident_sta_fw.minor, hw->ident_sta_fw.variant) < HFA384x_FIRMWARE_VERSION(1,5,5)) { wlandev->nsdcaps |= P80211_NSDCAP_NOSCAN; } /* TODO: Set any internally managed config items */ goto done; failed: WLAN_LOG_ERROR("Failed, result=%d\n", result); done: DBFEXIT; return result; } /*---------------------------------------------------------------- * prism2sta_globalsetup * * Set any global RIDs that we want to set at device activation. * * Arguments: * wlandev wlan device structure * * Returns: * 0 success * >0 f/w reported error * <0 driver reported error * * Side effects: * * Call context: * process thread ----------------------------------------------------------------*/ static int prism2sta_globalsetup(wlandevice_t *wlandev) { hfa384x_t *hw = (hfa384x_t *)wlandev->priv; /* Set the maximum frame size */ return hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFMAXDATALEN, WLAN_DATA_MAXLEN); } static int prism2sta_setmulticast(wlandevice_t *wlandev, netdevice_t *dev) { int result = 0; hfa384x_t *hw = (hfa384x_t *)wlandev->priv; UINT16 promisc; DBFENTER; /* If we're not ready, what's the point? */ if ( hw->state != HFA384x_STATE_RUNNING ) goto exit; /* If we're an AP, do nothing here */ if (hw->ap) goto exit; if ( (dev->flags & (IFF_PROMISC | IFF_ALLMULTI)) != 0 ) promisc = P80211ENUM_truth_true; else promisc = P80211ENUM_truth_false; result = hfa384x_drvr_setconfig16_async(hw, HFA384x_RID_PROMISCMODE, promisc); /* XXX TODO: configure the multicast list */ // CLEAR_HW_MULTICAST_LIST // struct dev_mc_list element = dev->mc_list; // while (element != null) { // HW_ADD_MULTICAST_ADDR(element->dmi_addr, dmi_addrlen) // element = element->next; // } exit: DBFEXIT; return result; } /*---------------------------------------------------------------- * prism2sta_inf_handover * * Handles the receipt of a Handover info frame. Should only be present * in APs only. * * Arguments: * wlandev wlan device structure * inf ptr to info frame (contents in hfa384x order) * * Returns: * nothing * * Side effects: * * Call context: * interrupt ----------------------------------------------------------------*/ static void prism2sta_inf_handover(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf) { DBFENTER; WLAN_LOG_DEBUG(2,"received infoframe:HANDOVER (unhandled)\n"); DBFEXIT; return; } /*---------------------------------------------------------------- * prism2sta_inf_tallies * * Handles the receipt of a CommTallies info frame. * * Arguments: * wlandev wlan device structure * inf ptr to info frame (contents in hfa384x order) * * Returns: * nothing * * Side effects: * * Call context: * interrupt ----------------------------------------------------------------*/ static void prism2sta_inf_tallies(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf) { hfa384x_t *hw = (hfa384x_t *)wlandev->priv; UINT16 *src16; UINT32 *dst; UINT32 *src32; int i; int cnt; DBFENTER; /* ** Determine if these are 16-bit or 32-bit tallies, based on the ** record length of the info record. */ cnt = sizeof(hfa384x_CommTallies32_t) / sizeof(UINT32); if (inf->framelen > 22) { dst = (UINT32 *) &hw->tallies; src32 = (UINT32 *) &inf->info.commtallies32; for (i = 0; i < cnt; i++, dst++, src32++) *dst += hfa384x2host_32(*src32); } else { dst = (UINT32 *) &hw->tallies; src16 = (UINT16 *) &inf->info.commtallies16; for (i = 0; i < cnt; i++, dst++, src16++) *dst += hfa384x2host_16(*src16); } DBFEXIT; return; } /*---------------------------------------------------------------- * prism2sta_inf_scanresults * * Handles the receipt of a Scan Results info frame. * * Arguments: * wlandev wlan device structure * inf ptr to info frame (contents in hfa384x order) * * Returns: * nothing * * Side effects: * * Call context: * interrupt ----------------------------------------------------------------*/ static void prism2sta_inf_scanresults(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf) { hfa384x_t *hw = (hfa384x_t *)wlandev->priv; int nbss; hfa384x_ScanResult_t *sr = &(inf->info.scanresult); int i; hfa384x_JoinRequest_data_t joinreq; int result; DBFENTER; /* Get the number of results, first in bytes, then in results */ nbss = (inf->framelen * sizeof(UINT16)) - sizeof(inf->infotype) - sizeof(inf->info.scanresult.scanreason); nbss /= sizeof(hfa384x_ScanResultSub_t); /* Print em */ WLAN_LOG_DEBUG(1,"rx scanresults, reason=%d, nbss=%d:\n", inf->info.scanresult.scanreason, nbss); for ( i = 0; i < nbss; i++) { WLAN_LOG_DEBUG(1, "chid=%d anl=%d sl=%d bcnint=%d\n", sr->result[i].chid, sr->result[i].anl, sr->result[i].sl, sr->result[i].bcnint); WLAN_LOG_DEBUG(1, " capinfo=0x%04x proberesp_rate=%d\n", sr->result[i].capinfo, sr->result[i].proberesp_rate); } /* issue a join request */ joinreq.channel = sr->result[0].chid; memcpy( joinreq.bssid, sr->result[0].bssid, WLAN_BSSID_LEN); result = hfa384x_drvr_setconfig( hw, HFA384x_RID_JOINREQUEST, &joinreq, HFA384x_RID_JOINREQUEST_LEN); if (result) { WLAN_LOG_ERROR("setconfig(joinreq) failed, result=%d\n", result); } DBFEXIT; return; } /*---------------------------------------------------------------- * prism2sta_inf_hostscanresults * * Handles the receipt of a Scan Results info frame. * * Arguments: * wlandev wlan device structure * inf ptr to info frame (contents in hfa384x order) * * Returns: * nothing * * Side effects: * * Call context: * interrupt ----------------------------------------------------------------*/ static void prism2sta_inf_hostscanresults(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf) { hfa384x_t *hw = (hfa384x_t *)wlandev->priv; int nbss; DBFENTER; nbss = (inf->framelen - 3) / 32; WLAN_LOG_DEBUG(1, "Received %d hostscan results\n", nbss); if (nbss > 32) nbss = 32; if (hw->scanresults) kfree(hw->scanresults); hw->scanresults = kmalloc(sizeof(hfa384x_InfFrame_t), GFP_ATOMIC); memcpy(hw->scanresults, inf, sizeof(hfa384x_InfFrame_t)); if (nbss == 0) nbss = -1; /* Notify/wake the sleeping caller. */ hw->scanflag = nbss; wake_up_interruptible(&hw->cmdq); DBFEXIT; }; /*---------------------------------------------------------------- * prism2sta_inf_chinforesults * * Handles the receipt of a Channel Info Results info frame. * * Arguments: * wlandev wlan device structure * inf ptr to info frame (contents in hfa384x order) * * Returns: * nothing * * Side effects: * * Call context: * interrupt ----------------------------------------------------------------*/ static void prism2sta_inf_chinforesults(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf) { hfa384x_t *hw = (hfa384x_t *)wlandev->priv; unsigned int i, n; DBFENTER; hw->channel_info.results.scanchannels = hfa384x2host_16(inf->info.chinforesult.scanchannels); #if 0 memcpy(&inf->info.chinforesult, &hw->channel_info.results, sizeof(hfa384x_ChInfoResult_t)); #endif for (i=0, n=0; ichannel_info.results.scanchannels & (1<info.chinforesult.result[n].chid)-1; hfa384x_ChInfoResultSub_t *chinforesult=&hw->channel_info.results.result[channel]; chinforesult->chid = channel; chinforesult->anl = hfa384x2host_16(inf->info.chinforesult.result[n].anl); chinforesult->pnl = hfa384x2host_16(inf->info.chinforesult.result[n].pnl); chinforesult->active = hfa384x2host_16(inf->info.chinforesult.result[n].active); WLAN_LOG_DEBUG(2, "chinfo: channel %d, %s level (avg/peak)=%d/%d dB, pcf %d\n", channel+1, chinforesult->active & HFA384x_CHINFORESULT_BSSACTIVE ? "signal" : "noise", chinforesult->anl, chinforesult->pnl, chinforesult->active & HFA384x_CHINFORESULT_PCFACTIVE ? 1 : 0 ); n++; } } atomic_set(&hw->channel_info.done, 2); hw->channel_info.count = n; DBFEXIT; return; } void prism2sta_processing_defer(struct work_struct *data) { hfa384x_t *hw = container_of(data, struct hfa384x, link_bh); wlandevice_t *wlandev = hw->wlandev; hfa384x_bytestr32_t ssid; int result; DBFENTER; /* First let's process the auth frames */ { struct sk_buff *skb; hfa384x_InfFrame_t *inf; while ( (skb = skb_dequeue(&hw->authq)) ) { inf = (hfa384x_InfFrame_t *) skb->data; prism2sta_inf_authreq_defer(wlandev, inf); } } /* Now let's handle the linkstatus stuff */ if (hw->link_status == hw->link_status_new) goto failed; hw->link_status = hw->link_status_new; switch(hw->link_status) { case HFA384x_LINK_NOTCONNECTED: /* I'm currently assuming that this is the initial link * state. It should only be possible immediately * following an Enable command. * Response: * Block Transmits, Ignore receives of data frames */ netif_carrier_off(wlandev->netdev); WLAN_LOG_INFO("linkstatus=NOTCONNECTED (unhandled)\n"); break; case HFA384x_LINK_CONNECTED: /* This one indicates a successful scan/join/auth/assoc. * When we have the full MLME complement, this event will * signify successful completion of both mlme_authenticate * and mlme_associate. State management will get a little * ugly here. * Response: * Indicate authentication and/or association * Enable Transmits, Receives and pass up data frames */ netif_carrier_on(wlandev->netdev); /* If we are joining a specific AP, set our state and reset retries */ if(hw->join_ap == 1) hw->join_ap = 2; hw->join_retries = 60; /* Don't call this in monitor mode */ if ( wlandev->netdev->type == ARPHRD_ETHER ) { UINT16 portstatus; WLAN_LOG_INFO("linkstatus=CONNECTED\n"); /* For non-usb devices, we can use the sync versions */ /* Collect the BSSID, and set state to allow tx */ result = hfa384x_drvr_getconfig(hw, HFA384x_RID_CURRENTBSSID, wlandev->bssid, WLAN_BSSID_LEN); if ( result ) { WLAN_LOG_DEBUG(1, "getconfig(0x%02x) failed, result = %d\n", HFA384x_RID_CURRENTBSSID, result); goto failed; } result = hfa384x_drvr_getconfig(hw, HFA384x_RID_CURRENTSSID, &ssid, sizeof(ssid)); if ( result ) { WLAN_LOG_DEBUG(1, "getconfig(0x%02x) failed, result = %d\n", HFA384x_RID_CURRENTSSID, result); goto failed; } prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *)&ssid, (p80211pstrd_t *) &wlandev->ssid); /* Collect the port status */ result = hfa384x_drvr_getconfig16(hw, HFA384x_RID_PORTSTATUS, &portstatus); if ( result ) { WLAN_LOG_DEBUG(1, "getconfig(0x%02x) failed, result = %d\n", HFA384x_RID_PORTSTATUS, result); goto failed; } wlandev->macmode = (portstatus == HFA384x_PSTATUS_CONN_IBSS) ? WLAN_MACMODE_IBSS_STA : WLAN_MACMODE_ESS_STA; /* Get the ball rolling on the comms quality stuff */ prism2sta_commsqual_defer(&hw->commsqual_bh); } break; case HFA384x_LINK_DISCONNECTED: /* This one indicates that our association is gone. We've * lost connection with the AP and/or been disassociated. * This indicates that the MAC has completely cleared it's * associated state. We * should send a deauth indication * (implying disassoc) up * to the MLME. * Response: * Indicate Deauthentication * Block Transmits, Ignore receives of data frames */ if(hw->join_ap == 2) { hfa384x_JoinRequest_data_t joinreq; joinreq = hw->joinreq; /* Send the join request */ hfa384x_drvr_setconfig( hw, HFA384x_RID_JOINREQUEST, &joinreq, HFA384x_RID_JOINREQUEST_LEN); WLAN_LOG_INFO("linkstatus=DISCONNECTED (re-submitting join)\n"); } else { if (wlandev->netdev->type == ARPHRD_ETHER) WLAN_LOG_INFO("linkstatus=DISCONNECTED (unhandled)\n"); } wlandev->macmode = WLAN_MACMODE_NONE; netif_carrier_off(wlandev->netdev); break; case HFA384x_LINK_AP_CHANGE: /* This one indicates that the MAC has decided to and * successfully completed a change to another AP. We * should probably implement a reassociation indication * in response to this one. I'm thinking that the the * p80211 layer needs to be notified in case of * buffering/queueing issues. User mode also needs to be * notified so that any BSS dependent elements can be * updated. * associated state. We * should send a deauth indication * (implying disassoc) up * to the MLME. * Response: * Indicate Reassociation * Enable Transmits, Receives and pass up data frames */ WLAN_LOG_INFO("linkstatus=AP_CHANGE\n"); result = hfa384x_drvr_getconfig(hw, HFA384x_RID_CURRENTBSSID, wlandev->bssid, WLAN_BSSID_LEN); if ( result ) { WLAN_LOG_DEBUG(1, "getconfig(0x%02x) failed, result = %d\n", HFA384x_RID_CURRENTBSSID, result); goto failed; } result = hfa384x_drvr_getconfig(hw, HFA384x_RID_CURRENTSSID, &ssid, sizeof(ssid)); if ( result ) { WLAN_LOG_DEBUG(1, "getconfig(0x%02x) failed, result = %d\n", HFA384x_RID_CURRENTSSID, result); goto failed; } prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *)&ssid, (p80211pstrd_t *) &wlandev->ssid); hw->link_status = HFA384x_LINK_CONNECTED; netif_carrier_on(wlandev->netdev); break; case HFA384x_LINK_AP_OUTOFRANGE: /* This one indicates that the MAC has decided that the * AP is out of range, but hasn't found a better candidate * so the MAC maintains its "associated" state in case * we get back in range. We should block transmits and * receives in this state. Do we need an indication here? * Probably not since a polling user-mode element would * get this status from from p2PortStatus(FD40). What about * p80211? * Response: * Block Transmits, Ignore receives of data frames */ WLAN_LOG_INFO("linkstatus=AP_OUTOFRANGE (unhandled)\n"); netif_carrier_off(wlandev->netdev); break; case HFA384x_LINK_AP_INRANGE: /* This one indicates that the MAC has decided that the * AP is back in range. We continue working with our * existing association. * Response: * Enable Transmits, Receives and pass up data frames */ WLAN_LOG_INFO("linkstatus=AP_INRANGE\n"); hw->link_status = HFA384x_LINK_CONNECTED; netif_carrier_on(wlandev->netdev); break; case HFA384x_LINK_ASSOCFAIL: /* This one is actually a peer to CONNECTED. We've * requested a join for a given SSID and optionally BSSID. * We can use this one to indicate authentication and * association failures. The trick is going to be * 1) identifying the failure, and 2) state management. * Response: * Disable Transmits, Ignore receives of data frames */ if(hw->join_ap && --hw->join_retries > 0) { hfa384x_JoinRequest_data_t joinreq; joinreq = hw->joinreq; /* Send the join request */ hfa384x_drvr_setconfig( hw, HFA384x_RID_JOINREQUEST, &joinreq, HFA384x_RID_JOINREQUEST_LEN); WLAN_LOG_INFO("linkstatus=ASSOCFAIL (re-submitting join)\n"); } else { WLAN_LOG_INFO("linkstatus=ASSOCFAIL (unhandled)\n"); } netif_carrier_off(wlandev->netdev); break; default: /* This is bad, IO port problems? */ WLAN_LOG_WARNING( "unknown linkstatus=0x%02x\n", hw->link_status); goto failed; break; } wlandev->linkstatus = (hw->link_status == HFA384x_LINK_CONNECTED); #ifdef WIRELESS_EXT p80211wext_event_associated(wlandev, wlandev->linkstatus); #endif failed: DBFEXIT; } /*---------------------------------------------------------------- * prism2sta_inf_linkstatus * * Handles the receipt of a Link Status info frame. * * Arguments: * wlandev wlan device structure * inf ptr to info frame (contents in hfa384x order) * * Returns: * nothing * * Side effects: * * Call context: * interrupt ----------------------------------------------------------------*/ static void prism2sta_inf_linkstatus(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf) { hfa384x_t *hw = (hfa384x_t *)wlandev->priv; DBFENTER; hw->link_status_new = hfa384x2host_16(inf->info.linkstatus.linkstatus); schedule_work(&hw->link_bh); DBFEXIT; return; } /*---------------------------------------------------------------- * prism2sta_inf_assocstatus * * Handles the receipt of an Association Status info frame. Should * be present in APs only. * * Arguments: * wlandev wlan device structure * inf ptr to info frame (contents in hfa384x order) * * Returns: * nothing * * Side effects: * * Call context: * interrupt ----------------------------------------------------------------*/ static void prism2sta_inf_assocstatus(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf) { hfa384x_t *hw = (hfa384x_t *)wlandev->priv; hfa384x_AssocStatus_t rec; int i; DBFENTER; memcpy(&rec, &inf->info.assocstatus, sizeof(rec)); rec.assocstatus = hfa384x2host_16(rec.assocstatus); rec.reason = hfa384x2host_16(rec.reason); /* ** Find the address in the list of authenticated stations. If it wasn't ** found, then this address has not been previously authenticated and ** something weird has happened if this is anything other than an ** "authentication failed" message. If the address was found, then ** set the "associated" flag for that station, based on whether the ** station is associating or losing its association. Something weird ** has also happened if we find the address in the list of authenticated ** stations but we are getting an "authentication failed" message. */ for (i = 0; i < hw->authlist.cnt; i++) if (memcmp(rec.sta_addr, hw->authlist.addr[i], WLAN_ADDR_LEN) == 0) break; if (i >= hw->authlist.cnt) { if (rec.assocstatus != HFA384x_ASSOCSTATUS_AUTHFAIL) WLAN_LOG_WARNING("assocstatus info frame received for non-authenticated station.\n"); } else { hw->authlist.assoc[i] = (rec.assocstatus == HFA384x_ASSOCSTATUS_STAASSOC || rec.assocstatus == HFA384x_ASSOCSTATUS_REASSOC); if (rec.assocstatus == HFA384x_ASSOCSTATUS_AUTHFAIL) WLAN_LOG_WARNING("authfail assocstatus info frame received for authenticated station.\n"); } DBFEXIT; return; } /*---------------------------------------------------------------- * prism2sta_inf_authreq * * Handles the receipt of an Authentication Request info frame. Should * be present in APs only. * * Arguments: * wlandev wlan device structure * inf ptr to info frame (contents in hfa384x order) * * Returns: * nothing * * Side effects: * * Call context: * interrupt * ----------------------------------------------------------------*/ static void prism2sta_inf_authreq(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf) { hfa384x_t *hw = (hfa384x_t *)wlandev->priv; struct sk_buff *skb; DBFENTER; skb = dev_alloc_skb(sizeof(*inf)); if (skb) { skb_put(skb, sizeof(*inf)); memcpy(skb->data, inf, sizeof(*inf)); skb_queue_tail(&hw->authq, skb); schedule_work(&hw->link_bh); } DBFEXIT; } static void prism2sta_inf_authreq_defer(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf) { hfa384x_t *hw = (hfa384x_t *)wlandev->priv; hfa384x_authenticateStation_data_t rec; int i, added, result, cnt; UINT8 *addr; DBFENTER; /* ** Build the AuthenticateStation record. Initialize it for denying ** authentication. */ memcpy(rec.address, inf->info.authreq.sta_addr, WLAN_ADDR_LEN); rec.status = P80211ENUM_status_unspec_failure; /* ** Authenticate based on the access mode. */ switch (hw->accessmode) { case WLAN_ACCESS_NONE: /* ** Deny all new authentications. However, if a station ** is ALREADY authenticated, then accept it. */ for (i = 0; i < hw->authlist.cnt; i++) if (memcmp(rec.address, hw->authlist.addr[i], WLAN_ADDR_LEN) == 0) { rec.status = P80211ENUM_status_successful; break; } break; case WLAN_ACCESS_ALL: /* ** Allow all authentications. */ rec.status = P80211ENUM_status_successful; break; case WLAN_ACCESS_ALLOW: /* ** Only allow the authentication if the MAC address ** is in the list of allowed addresses. ** ** Since this is the interrupt handler, we may be here ** while the access list is in the middle of being ** updated. Choose the list which is currently okay. ** See "prism2mib_priv_accessallow()" for details. */ if (hw->allow.modify == 0) { cnt = hw->allow.cnt; addr = hw->allow.addr[0]; } else { cnt = hw->allow.cnt1; addr = hw->allow.addr1[0]; } for (i = 0; i < cnt; i++, addr += WLAN_ADDR_LEN) if (memcmp(rec.address, addr, WLAN_ADDR_LEN) == 0) { rec.status = P80211ENUM_status_successful; break; } break; case WLAN_ACCESS_DENY: /* ** Allow the authentication UNLESS the MAC address is ** in the list of denied addresses. ** ** Since this is the interrupt handler, we may be here ** while the access list is in the middle of being ** updated. Choose the list which is currently okay. ** See "prism2mib_priv_accessdeny()" for details. */ if (hw->deny.modify == 0) { cnt = hw->deny.cnt; addr = hw->deny.addr[0]; } else { cnt = hw->deny.cnt1; addr = hw->deny.addr1[0]; } rec.status = P80211ENUM_status_successful; for (i = 0; i < cnt; i++, addr += WLAN_ADDR_LEN) if (memcmp(rec.address, addr, WLAN_ADDR_LEN) == 0) { rec.status = P80211ENUM_status_unspec_failure; break; } break; } /* ** If the authentication is okay, then add the MAC address to the list ** of authenticated stations. Don't add the address if it is already in ** the list. (802.11b does not seem to disallow a station from issuing ** an authentication request when the station is already authenticated. ** Does this sort of thing ever happen? We might as well do the check ** just in case.) */ added = 0; if (rec.status == P80211ENUM_status_successful) { for (i = 0; i < hw->authlist.cnt; i++) if (memcmp(rec.address, hw->authlist.addr[i], WLAN_ADDR_LEN) == 0) break; if (i >= hw->authlist.cnt) { if (hw->authlist.cnt >= WLAN_AUTH_MAX) { rec.status = P80211ENUM_status_ap_full; } else { memcpy(hw->authlist.addr[hw->authlist.cnt], rec.address, WLAN_ADDR_LEN); hw->authlist.cnt++; added = 1; } } } /* ** Send back the results of the authentication. If this doesn't work, ** then make sure to remove the address from the authenticated list if ** it was added. */ rec.status = host2hfa384x_16(rec.status); rec.algorithm = inf->info.authreq.algorithm; result = hfa384x_drvr_setconfig(hw, HFA384x_RID_AUTHENTICATESTA, &rec, sizeof(rec)); if (result) { if (added) hw->authlist.cnt--; WLAN_LOG_ERROR("setconfig(authenticatestation) failed, result=%d\n", result); } DBFEXIT; return; } /*---------------------------------------------------------------- * prism2sta_inf_psusercnt * * Handles the receipt of a PowerSaveUserCount info frame. Should * be present in APs only. * * Arguments: * wlandev wlan device structure * inf ptr to info frame (contents in hfa384x order) * * Returns: * nothing * * Side effects: * * Call context: * interrupt ----------------------------------------------------------------*/ static void prism2sta_inf_psusercnt(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf) { hfa384x_t *hw = (hfa384x_t *)wlandev->priv; DBFENTER; hw->psusercount = hfa384x2host_16(inf->info.psusercnt.usercnt); DBFEXIT; return; } /*---------------------------------------------------------------- * prism2sta_ev_dtim * * Handles the DTIM early warning event. * * Arguments: * wlandev wlan device structure * * Returns: * nothing * * Side effects: * * Call context: * interrupt ----------------------------------------------------------------*/ void prism2sta_ev_dtim(wlandevice_t *wlandev) { #if 0 hfa384x_t *hw = (hfa384x_t *)wlandev->priv; #endif DBFENTER; WLAN_LOG_DEBUG(3, "DTIM event, currently unhandled.\n"); DBFEXIT; return; } /*---------------------------------------------------------------- * prism2sta_ev_infdrop * * Handles the InfDrop event. * * Arguments: * wlandev wlan device structure * * Returns: * nothing * * Side effects: * * Call context: * interrupt ----------------------------------------------------------------*/ void prism2sta_ev_infdrop(wlandevice_t *wlandev) { #if 0 hfa384x_t *hw = (hfa384x_t *)wlandev->priv; #endif DBFENTER; WLAN_LOG_DEBUG(3, "Info frame dropped due to card mem low.\n"); DBFEXIT; return; } /*---------------------------------------------------------------- * prism2sta_ev_info * * Handles the Info event. * * Arguments: * wlandev wlan device structure * inf ptr to a generic info frame * * Returns: * nothing * * Side effects: * * Call context: * interrupt ----------------------------------------------------------------*/ void prism2sta_ev_info(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf) { DBFENTER; inf->infotype = hfa384x2host_16(inf->infotype); /* Dispatch */ switch ( inf->infotype ) { case HFA384x_IT_HANDOVERADDR: prism2sta_inf_handover(wlandev, inf); break; case HFA384x_IT_COMMTALLIES: prism2sta_inf_tallies(wlandev, inf); break; case HFA384x_IT_HOSTSCANRESULTS: prism2sta_inf_hostscanresults(wlandev, inf); break; case HFA384x_IT_SCANRESULTS: prism2sta_inf_scanresults(wlandev, inf); break; case HFA384x_IT_CHINFORESULTS: prism2sta_inf_chinforesults(wlandev, inf); break; case HFA384x_IT_LINKSTATUS: prism2sta_inf_linkstatus(wlandev, inf); break; case HFA384x_IT_ASSOCSTATUS: prism2sta_inf_assocstatus(wlandev, inf); break; case HFA384x_IT_AUTHREQ: prism2sta_inf_authreq(wlandev, inf); break; case HFA384x_IT_PSUSERCNT: prism2sta_inf_psusercnt(wlandev, inf); break; case HFA384x_IT_KEYIDCHANGED: WLAN_LOG_WARNING("Unhandled IT_KEYIDCHANGED\n"); break; case HFA384x_IT_ASSOCREQ: WLAN_LOG_WARNING("Unhandled IT_ASSOCREQ\n"); break; case HFA384x_IT_MICFAILURE: WLAN_LOG_WARNING("Unhandled IT_MICFAILURE\n"); break; default: WLAN_LOG_WARNING( "Unknown info type=0x%02x\n", inf->infotype); break; } DBFEXIT; return; } /*---------------------------------------------------------------- * prism2sta_ev_txexc * * Handles the TxExc event. A Transmit Exception event indicates * that the MAC's TX process was unsuccessful - so the packet did * not get transmitted. * * Arguments: * wlandev wlan device structure * status tx frame status word * * Returns: * nothing * * Side effects: * * Call context: * interrupt ----------------------------------------------------------------*/ void prism2sta_ev_txexc(wlandevice_t *wlandev, UINT16 status) { DBFENTER; WLAN_LOG_DEBUG(3, "TxExc status=0x%x.\n", status); DBFEXIT; return; } /*---------------------------------------------------------------- * prism2sta_ev_tx * * Handles the Tx event. * * Arguments: * wlandev wlan device structure * status tx frame status word * Returns: * nothing * * Side effects: * * Call context: * interrupt ----------------------------------------------------------------*/ void prism2sta_ev_tx(wlandevice_t *wlandev, UINT16 status) { DBFENTER; WLAN_LOG_DEBUG(4, "Tx Complete, status=0x%04x\n", status); /* update linux network stats */ wlandev->linux_stats.tx_packets++; DBFEXIT; return; } /*---------------------------------------------------------------- * prism2sta_ev_rx * * Handles the Rx event. * * Arguments: * wlandev wlan device structure * * Returns: * nothing * * Side effects: * * Call context: * interrupt ----------------------------------------------------------------*/ void prism2sta_ev_rx(wlandevice_t *wlandev, struct sk_buff *skb) { DBFENTER; p80211netdev_rx(wlandev, skb); DBFEXIT; return; } /*---------------------------------------------------------------- * prism2sta_ev_alloc * * Handles the Alloc event. * * Arguments: * wlandev wlan device structure * * Returns: * nothing * * Side effects: * * Call context: * interrupt ----------------------------------------------------------------*/ void prism2sta_ev_alloc(wlandevice_t *wlandev) { DBFENTER; p80211netdev_wake_queue(wlandev); DBFEXIT; return; } #if (WLAN_HOSTIF == WLAN_PLX || WLAN_HOSTIF == WLAN_PCI) #ifdef CONFIG_PM static int prism2sta_suspend_pci(struct pci_dev *pdev, pm_message_t state) { wlandevice_t *wlandev; wlandev = (wlandevice_t *) pci_get_drvdata(pdev); /* reset hardware */ if (wlandev) { prism2sta_ifstate(wlandev, P80211ENUM_ifstate_disable); p80211_suspend(wlandev); } // call a netif_device_detach(wlandev->netdev) ? return 0; } static int prism2sta_resume_pci (struct pci_dev *pdev) { wlandevice_t *wlandev; wlandev = (wlandevice_t *) pci_get_drvdata(pdev); if (wlandev) { p80211_resume(wlandev); prism2sta_ifstate(wlandev, P80211ENUM_ifstate_enable); } return 0; } #endif #endif /*---------------------------------------------------------------- * create_wlan * * Called at module init time. This creates the wlandevice_t structure * and initializes it with relevant bits. * * Arguments: * none * * Returns: * the created wlandevice_t structure. * * Side effects: * also allocates the priv/hw structures. * * Call context: * process thread * ----------------------------------------------------------------*/ static wlandevice_t *create_wlan(void) { wlandevice_t *wlandev = NULL; hfa384x_t *hw = NULL; /* Alloc our structures */ wlandev = kmalloc(sizeof(wlandevice_t), GFP_KERNEL); hw = kmalloc(sizeof(hfa384x_t), GFP_KERNEL); if (!wlandev || !hw) { WLAN_LOG_ERROR("%s: Memory allocation failure.\n", dev_info); if (wlandev) kfree(wlandev); if (hw) kfree(hw); return NULL; } /* Clear all the structs */ memset(wlandev, 0, sizeof(wlandevice_t)); memset(hw, 0, sizeof(hfa384x_t)); /* Initialize the network device object. */ wlandev->nsdname = dev_info; wlandev->msdstate = WLAN_MSD_HWPRESENT_PENDING; wlandev->priv = hw; wlandev->open = prism2sta_open; wlandev->close = prism2sta_close; wlandev->reset = prism2sta_reset; #ifdef CONFIG_PROC_FS wlandev->nsd_proc_read = prism2sta_proc_read; #endif wlandev->txframe = prism2sta_txframe; wlandev->mlmerequest = prism2sta_mlmerequest; wlandev->set_multicast_list = prism2sta_setmulticast; wlandev->tx_timeout = hfa384x_tx_timeout; wlandev->nsdcaps = P80211_NSDCAP_HWFRAGMENT | P80211_NSDCAP_AUTOJOIN; /* Initialize the device private data stucture. */ hw->dot11_desired_bss_type = 1; return wlandev; } #ifdef CONFIG_PROC_FS static int prism2sta_proc_read( char *page, char **start, off_t offset, int count, int *eof, void *data) { char *p = page; wlandevice_t *wlandev = (wlandevice_t *) data; hfa384x_t *hw = (hfa384x_t *) wlandev->priv; UINT16 hwtype = 0; DBFENTER; if (offset != 0) { *eof = 1; goto exit; } // XXX 0x0001 for prism2.5/3, 0x0000 for prism2. hwtype = BIT0; #if (WLAN_HOSTIF != WLAN_USB) if (hw->isram16) hwtype |= BIT1; #endif #if (WLAN_HOSTIF == WLAN_PCI) hwtype |= BIT2; #endif #define PRISM2_CVS_ID "$Id: prism2sta.c 1858 2008-03-24 18:49:31Z pizza $" p += sprintf(p, "# %s version %s (%s) '%s'\n\n", dev_info, WLAN_RELEASE, WLAN_BUILD_DATE, PRISM2_CVS_ID); p += sprintf(p, "# nic h/w: id=0x%02x %d.%d.%d\n", hw->ident_nic.id, hw->ident_nic.major, hw->ident_nic.minor, hw->ident_nic.variant); p += sprintf(p, "# pri f/w: id=0x%02x %d.%d.%d\n", hw->ident_pri_fw.id, hw->ident_pri_fw.major, hw->ident_pri_fw.minor, hw->ident_pri_fw.variant); if (hw->ident_sta_fw.id == 0x1f) { p += sprintf(p, "# sta f/w: id=0x%02x %d.%d.%d\n", hw->ident_sta_fw.id, hw->ident_sta_fw.major, hw->ident_sta_fw.minor, hw->ident_sta_fw.variant); } else { p += sprintf(p, "# ap f/w: id=0x%02x %d.%d.%d\n", hw->ident_sta_fw.id, hw->ident_sta_fw.major, hw->ident_sta_fw.minor, hw->ident_sta_fw.variant); } #if (WLAN_HOSTIF != WLAN_USB) p += sprintf(p, "# initial nic hw type, needed for SSF ramdl\n"); p += sprintf(p, "initnichw=%04x\n", hwtype); #endif exit: DBFEXIT; return (p - page); } #endif void prism2sta_commsqual_defer(struct work_struct *data) { hfa384x_t *hw = container_of(data, struct hfa384x, commsqual_bh); wlandevice_t *wlandev = hw->wlandev; hfa384x_bytestr32_t ssid; int result = 0; DBFENTER; if (hw->wlandev->hwremoved) goto done; /* we don't care if we're in AP mode */ if ((wlandev->macmode == WLAN_MACMODE_NONE) || (wlandev->macmode == WLAN_MACMODE_ESS_AP)) { goto done; } /* It only makes sense to poll these in non-IBSS */ if (wlandev->macmode != WLAN_MACMODE_IBSS_STA) { result = hfa384x_drvr_getconfig(hw, HFA384x_RID_DBMCOMMSQUALITY, &hw->qual, HFA384x_RID_DBMCOMMSQUALITY_LEN); if (result) { WLAN_LOG_ERROR("error fetching commsqual\n"); goto done; } // qual.CQ_currBSS; // link // ASL_currBSS; // level // qual.ANL_currFC; // noise WLAN_LOG_DEBUG(3, "commsqual %d %d %d\n", hfa384x2host_16(hw->qual.CQ_currBSS), hfa384x2host_16(hw->qual.ASL_currBSS), hfa384x2host_16(hw->qual.ANL_currFC)); } /* Lastly, we need to make sure the BSSID didn't change on us */ result = hfa384x_drvr_getconfig(hw, HFA384x_RID_CURRENTBSSID, wlandev->bssid, WLAN_BSSID_LEN); if ( result ) { WLAN_LOG_DEBUG(1, "getconfig(0x%02x) failed, result = %d\n", HFA384x_RID_CURRENTBSSID, result); goto done; } result = hfa384x_drvr_getconfig(hw, HFA384x_RID_CURRENTSSID, &ssid, sizeof(ssid)); if ( result ) { WLAN_LOG_DEBUG(1, "getconfig(0x%02x) failed, result = %d\n", HFA384x_RID_CURRENTSSID, result); goto done; } prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *)&ssid, (p80211pstrd_t *) &wlandev->ssid); /* Reschedule timer */ mod_timer(&hw->commsqual_timer, round_jiffies(jiffies + HZ)); done: DBFEXIT; } void prism2sta_commsqual_timer(unsigned long data) { hfa384x_t *hw = (hfa384x_t *) data; DBFENTER; schedule_work(&hw->commsqual_bh); DBFEXIT; } linux-wlan-ng-0.2.9+dfsg/src/prism2/driver/prism2mib.c0000644000175000017500000033555611024763177022132 0ustar tormodtormod/* src/prism2/driver/prism2mib.c * * Management request for mibset/mibget * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- * * The functions in this file handle the mibset/mibget management * functions. * * -------------------------------------------------------------------- */ /*================================================================*/ /* System Includes */ #define WLAN_DBVAR prism2_debug #include #include #include #include #include #include #include #include #include #include #include #include #include #if (WLAN_HOSTIF == WLAN_PCMCIA) #include #include #include #include #include #include #endif #if ((WLAN_HOSTIF == WLAN_PLX) || (WLAN_HOSTIF == WLAN_PCI)) #include #include #endif #if (WLAN_HOSTIF == WLAN_USB) #include #endif #include /*================================================================*/ /* Project Includes */ #include #include #include #include #include #include #include #include #include #include /*================================================================*/ /* Local Constants */ #define MIB_TMP_MAXLEN 200 /* Max length of RID record (in bytes). */ /*================================================================*/ /* Local Types */ #define F_AP 0x1 /* MIB is supported on Access Points. */ #define F_STA 0x2 /* MIB is supported on stations. */ #define F_READ 0x4 /* MIB may be read. */ #define F_WRITE 0x8 /* MIB may be written. */ typedef struct mibrec { UINT32 did; UINT16 flag; UINT16 parm1; UINT16 parm2; UINT16 parm3; int (*func)(struct mibrec *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data); } mibrec_t; /*================================================================*/ /* Local Function Declarations */ static int prism2mib_bytestr2pstr( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data); static int prism2mib_bytearea2pstr( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data); static int prism2mib_uint32( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data); static int prism2mib_uint32array( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data); static int prism2mib_uint32offset( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data); static int prism2mib_truth( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data); static int prism2mib_preamble( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data); static int prism2mib_flag( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data); static int prism2mib_appcfinfoflag( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data); static int prism2mib_regulatorydomains( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data); static int prism2mib_wepdefaultkey( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data); static int prism2mib_powermanagement( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data); static int prism2mib_privacyinvoked( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data); static int prism2mib_excludeunencrypted( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data); static int prism2mib_fragmentationthreshold( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data); static int prism2mib_operationalrateset( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data); static int prism2mib_groupaddress( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data); static int prism2mib_fwid( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data); static int prism2mib_authalg( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data); static int prism2mib_authalgenable( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data); static int prism2mib_priv( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data); static void prism2mib_priv_authlist( hfa384x_t *hw, prism2sta_authlist_t *list); static void prism2mib_priv_accessmode( hfa384x_t *hw, UINT32 mode); static void prism2mib_priv_accessallow( hfa384x_t *hw, p80211macarray_t *macarray); static void prism2mib_priv_accessdeny( hfa384x_t *hw, p80211macarray_t *macarray); static void prism2mib_priv_deauthenticate( hfa384x_t *hw, UINT8 *addr); /*================================================================*/ /* Local Static Definitions */ static mibrec_t mibtab[] = { /* dot11smt MIB's */ { DIDmib_dot11smt_dot11StationConfigTable_dot11StationID, F_AP | F_STA | F_READ | F_WRITE, HFA384x_RID_CNFOWNMACADDR, HFA384x_RID_CNFOWNMACADDR_LEN, 0, prism2mib_bytearea2pstr }, { DIDmib_dot11smt_dot11StationConfigTable_dot11MediumOccupancyLimit, F_AP | F_READ | F_WRITE, HFA384x_RID_CNFAPPCFINFO, HFA384x_RID_CNFAPPCFINFO_LEN, 0, prism2mib_uint32offset }, { DIDmib_dot11smt_dot11StationConfigTable_dot11CFPollable, F_STA | F_READ, HFA384x_RID_CFPOLLABLE, 0, 0, prism2mib_uint32 }, { DIDmib_dot11smt_dot11StationConfigTable_dot11CFPPeriod, F_AP | F_READ | F_WRITE, HFA384x_RID_CNFAPPCFINFO, HFA384x_RID_CNFAPPCFINFO_LEN, 1, prism2mib_uint32offset }, { DIDmib_dot11smt_dot11StationConfigTable_dot11CFPMaxDuration, F_AP | F_READ | F_WRITE, HFA384x_RID_CNFAPPCFINFO, HFA384x_RID_CNFAPPCFINFO_LEN, 2, prism2mib_uint32offset }, { DIDmib_dot11smt_dot11StationConfigTable_dot11AuthenticationResponseTimeOut, F_STA | F_READ | F_WRITE, HFA384x_RID_CNFAUTHRSPTIMEOUT, 0, 0, prism2mib_uint32 }, { DIDmib_dot11smt_dot11StationConfigTable_dot11PrivacyOptionImplemented, F_AP | F_STA | F_READ, HFA384x_RID_PRIVACYOPTIMP, 0, 0, prism2mib_uint32 }, { DIDmib_dot11smt_dot11StationConfigTable_dot11PowerManagementMode, F_STA | F_READ | F_WRITE, HFA384x_RID_CNFPMENABLED, 0, 0, prism2mib_powermanagement }, { DIDmib_dot11smt_dot11StationConfigTable_dot11DesiredSSID, F_STA | F_READ | F_WRITE, HFA384x_RID_CNFDESIREDSSID, HFA384x_RID_CNFDESIREDSSID_LEN, 0, prism2mib_bytestr2pstr }, { DIDmib_dot11smt_dot11StationConfigTable_dot11DesiredBSSType, F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_priv }, { DIDmib_dot11smt_dot11StationConfigTable_dot11OperationalRateSet, F_STA | F_READ | F_WRITE, HFA384x_RID_TXRATECNTL, 0, 0, prism2mib_operationalrateset }, { DIDmib_dot11smt_dot11StationConfigTable_dot11OperationalRateSet, F_AP | F_READ | F_WRITE, HFA384x_RID_TXRATECNTL0, 0, 0, prism2mib_operationalrateset }, { DIDmib_dot11smt_dot11StationConfigTable_dot11BeaconPeriod, F_AP | F_READ | F_WRITE, HFA384x_RID_CNFAPBCNINT, 0, 0, prism2mib_uint32 }, { DIDmib_dot11smt_dot11StationConfigTable_dot11DTIMPeriod, F_AP | F_STA | F_READ | F_WRITE, HFA384x_RID_CNFOWNDTIMPER, 0, 0, prism2mib_uint32 }, { DIDmib_dot11smt_dot11StationConfigTable_dot11AssociationResponseTimeOut, F_AP | F_STA | F_READ, HFA384x_RID_PROTOCOLRSPTIME, 0, 0, prism2mib_uint32 }, { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithm1, F_AP | F_STA | F_READ, 1, 0, 0, prism2mib_authalg }, { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithm2, F_AP | F_STA | F_READ, 2, 0, 0, prism2mib_authalg }, { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithm3, F_AP | F_STA | F_READ, 3, 0, 0, prism2mib_authalg }, { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithm4, F_AP | F_STA | F_READ, 4, 0, 0, prism2mib_authalg }, { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithm5, F_AP | F_STA | F_READ, 5, 0, 0, prism2mib_authalg }, { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithm6, F_AP | F_STA | F_READ, 6, 0, 0, prism2mib_authalg }, { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithmsEnable1, F_AP | F_STA | F_READ | F_WRITE, 1, 0, 0, prism2mib_authalgenable }, { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithmsEnable2, F_AP | F_STA | F_READ | F_WRITE, 2, 0, 0, prism2mib_authalgenable }, { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithmsEnable3, F_AP | F_STA | F_READ | F_WRITE, 3, 0, 0, prism2mib_authalgenable }, { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithmsEnable4, F_AP | F_STA | F_READ | F_WRITE, 4, 0, 0, prism2mib_authalgenable }, { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithmsEnable5, F_AP | F_STA | F_READ | F_WRITE, 5, 0, 0, prism2mib_authalgenable }, { DIDmib_dot11smt_dot11AuthenticationAlgorithmsTable_dot11AuthenticationAlgorithmsEnable6, F_AP | F_STA | F_READ | F_WRITE, 6, 0, 0, prism2mib_authalgenable }, { DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey0, F_AP | F_STA | F_WRITE, HFA384x_RID_CNFWEPDEFAULTKEY0, 0, 0, prism2mib_wepdefaultkey }, { DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey1, F_AP | F_STA | F_WRITE, HFA384x_RID_CNFWEPDEFAULTKEY1, 0, 0, prism2mib_wepdefaultkey }, { DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey2, F_AP | F_STA | F_WRITE, HFA384x_RID_CNFWEPDEFAULTKEY2, 0, 0, prism2mib_wepdefaultkey }, { DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey3, F_AP | F_STA | F_WRITE, HFA384x_RID_CNFWEPDEFAULTKEY3, 0, 0, prism2mib_wepdefaultkey }, { DIDmib_dot11smt_dot11PrivacyTable_dot11PrivacyInvoked, F_AP | F_STA | F_READ | F_WRITE, HFA384x_RID_CNFWEPFLAGS, HFA384x_WEPFLAGS_PRIVINVOKED, 0, prism2mib_privacyinvoked }, { DIDmib_dot11smt_dot11PrivacyTable_dot11WEPDefaultKeyID, F_AP | F_STA | F_READ | F_WRITE, HFA384x_RID_CNFWEPDEFAULTKEYID, 0, 0, prism2mib_uint32 }, { DIDmib_dot11smt_dot11PrivacyTable_dot11ExcludeUnencrypted, F_AP | F_STA | F_READ | F_WRITE, HFA384x_RID_CNFWEPFLAGS, HFA384x_WEPFLAGS_EXCLUDE, 0, prism2mib_excludeunencrypted }, { DIDmib_dot11phy_dot11PhyOperationTable_dot11ShortPreambleEnabled, F_AP | F_STA | F_READ | F_WRITE, HFA384x_RID_CNFSHORTPREAMBLE, 0, 0, prism2mib_preamble }, /* dot11mac MIB's */ { DIDmib_dot11mac_dot11OperationTable_dot11MACAddress, F_AP | F_STA | F_READ | F_WRITE, HFA384x_RID_CNFOWNMACADDR, HFA384x_RID_CNFOWNMACADDR_LEN, 0, prism2mib_bytearea2pstr }, { DIDmib_dot11mac_dot11OperationTable_dot11RTSThreshold, F_STA | F_READ | F_WRITE, HFA384x_RID_RTSTHRESH, 0, 0, prism2mib_uint32 }, { DIDmib_dot11mac_dot11OperationTable_dot11RTSThreshold, F_AP | F_READ | F_WRITE, HFA384x_RID_RTSTHRESH0, 0, 0, prism2mib_uint32 }, { DIDmib_dot11mac_dot11OperationTable_dot11ShortRetryLimit, F_AP | F_STA | F_READ, HFA384x_RID_SHORTRETRYLIMIT, 0, 0, prism2mib_uint32 }, { DIDmib_dot11mac_dot11OperationTable_dot11LongRetryLimit, F_AP | F_STA | F_READ, HFA384x_RID_LONGRETRYLIMIT, 0, 0, prism2mib_uint32 }, { DIDmib_dot11mac_dot11OperationTable_dot11FragmentationThreshold, F_STA | F_READ | F_WRITE, HFA384x_RID_FRAGTHRESH, 0, 0, prism2mib_fragmentationthreshold }, { DIDmib_dot11mac_dot11OperationTable_dot11FragmentationThreshold, F_AP | F_READ | F_WRITE, HFA384x_RID_FRAGTHRESH0, 0, 0, prism2mib_fragmentationthreshold }, { DIDmib_dot11mac_dot11OperationTable_dot11MaxTransmitMSDULifetime, F_AP | F_STA | F_READ, HFA384x_RID_MAXTXLIFETIME, 0, 0, prism2mib_uint32 }, { DIDmib_dot11mac_dot11OperationTable_dot11MaxReceiveLifetime, F_AP | F_STA | F_READ, HFA384x_RID_MAXRXLIFETIME, 0, 0, prism2mib_uint32 }, { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address1, F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_groupaddress }, { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address2, F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_groupaddress }, { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address3, F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_groupaddress }, { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address4, F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_groupaddress }, { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address5, F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_groupaddress }, { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address6, F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_groupaddress }, { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address7, F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_groupaddress }, { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address8, F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_groupaddress }, { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address9, F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_groupaddress }, { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address10, F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_groupaddress }, { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address11, F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_groupaddress }, { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address12, F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_groupaddress }, { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address13, F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_groupaddress }, { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address14, F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_groupaddress }, { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address15, F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_groupaddress }, { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address16, F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_groupaddress }, { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address17, F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_groupaddress }, { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address18, F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_groupaddress }, { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address19, F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_groupaddress }, { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address20, F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_groupaddress }, { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address21, F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_groupaddress }, { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address22, F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_groupaddress }, { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address23, F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_groupaddress }, { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address24, F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_groupaddress }, { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address25, F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_groupaddress }, { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address26, F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_groupaddress }, { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address27, F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_groupaddress }, { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address28, F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_groupaddress }, { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address29, F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_groupaddress }, { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address30, F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_groupaddress }, { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address31, F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_groupaddress }, { DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address32, F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_groupaddress }, /* dot11phy MIB's */ { DIDmib_dot11phy_dot11PhyOperationTable_dot11PHYType, F_AP | F_STA | F_READ, HFA384x_RID_PHYTYPE, 0, 0, prism2mib_uint32 }, { DIDmib_dot11phy_dot11PhyOperationTable_dot11TempType, F_AP | F_STA | F_READ, HFA384x_RID_TEMPTYPE, 0, 0, prism2mib_uint32 }, { DIDmib_dot11phy_dot11PhyDSSSTable_dot11CurrentChannel, F_STA | F_READ, HFA384x_RID_CURRENTCHANNEL, 0, 0, prism2mib_uint32 }, { DIDmib_dot11phy_dot11PhyDSSSTable_dot11CurrentChannel, F_AP | F_READ, HFA384x_RID_CNFOWNCHANNEL, 0, 0, prism2mib_uint32 }, { DIDmib_dot11phy_dot11PhyDSSSTable_dot11CurrentCCAMode, F_AP | F_STA | F_READ, HFA384x_RID_CCAMODE, 0, 0, prism2mib_uint32 }, /* p2Table MIB's */ { DIDmib_p2_p2Table_p2MMTx, F_AP | F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_priv }, { DIDmib_p2_p2Table_p2EarlyBeacon, F_AP | F_READ | F_WRITE, BIT7, 0, 0, prism2mib_appcfinfoflag }, { DIDmib_p2_p2Table_p2ReceivedFrameStatistics, F_AP | F_STA | F_READ, 0, 0, 0, prism2mib_priv }, { DIDmib_p2_p2Table_p2CommunicationTallies, F_AP | F_STA | F_READ, 0, 0, 0, prism2mib_priv }, { DIDmib_p2_p2Table_p2Authenticated, F_AP | F_READ, 0, 0, 0, prism2mib_priv }, { DIDmib_p2_p2Table_p2Associated, F_AP | F_READ, 0, 0, 0, prism2mib_priv }, { DIDmib_p2_p2Table_p2PowerSaveUserCount, F_AP | F_READ, 0, 0, 0, prism2mib_priv }, { DIDmib_p2_p2Table_p2Comment, F_AP | F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_priv }, { DIDmib_p2_p2Table_p2AccessMode, F_AP | F_READ | F_WRITE, 0, 0, 0, prism2mib_priv }, { DIDmib_p2_p2Table_p2AccessAllow, F_AP | F_READ | F_WRITE, 0, 0, 0, prism2mib_priv }, { DIDmib_p2_p2Table_p2AccessDeny, F_AP | F_READ | F_WRITE, 0, 0, 0, prism2mib_priv }, { DIDmib_p2_p2Table_p2ChannelInfoResults, F_AP | F_READ, 0, 0, 0, prism2mib_priv }, /* p2Static MIB's */ { DIDmib_p2_p2Static_p2CnfPortType, F_STA | F_READ | F_WRITE, HFA384x_RID_CNFPORTTYPE, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Static_p2CnfOwnMACAddress, F_AP | F_STA | F_READ | F_WRITE, HFA384x_RID_CNFOWNMACADDR, HFA384x_RID_CNFOWNMACADDR_LEN, 0, prism2mib_bytearea2pstr }, { DIDmib_p2_p2Static_p2CnfDesiredSSID, F_STA | F_READ | F_WRITE, HFA384x_RID_CNFDESIREDSSID, HFA384x_RID_CNFDESIREDSSID_LEN, 0, prism2mib_bytestr2pstr }, { DIDmib_p2_p2Static_p2CnfOwnChannel, F_AP | F_STA | F_READ | F_WRITE, HFA384x_RID_CNFOWNCHANNEL, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Static_p2CnfOwnSSID, F_AP | F_STA | F_READ | F_WRITE, HFA384x_RID_CNFOWNSSID, HFA384x_RID_CNFOWNSSID_LEN, 0, prism2mib_bytestr2pstr }, { DIDmib_p2_p2Static_p2CnfOwnATIMWindow, F_STA | F_READ | F_WRITE, HFA384x_RID_CNFOWNATIMWIN, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Static_p2CnfSystemScale, F_AP | F_STA | F_READ | F_WRITE, HFA384x_RID_CNFSYSSCALE, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Static_p2CnfMaxDataLength, F_AP | F_STA | F_READ | F_WRITE, HFA384x_RID_CNFMAXDATALEN, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Static_p2CnfWDSAddress, F_STA | F_READ | F_WRITE, HFA384x_RID_CNFWDSADDR, HFA384x_RID_CNFWDSADDR_LEN, 0, prism2mib_bytearea2pstr }, { DIDmib_p2_p2Static_p2CnfPMEnabled, F_STA | F_READ | F_WRITE, HFA384x_RID_CNFPMENABLED, 0, 0, prism2mib_truth }, { DIDmib_p2_p2Static_p2CnfPMEPS, F_STA | F_READ | F_WRITE, HFA384x_RID_CNFPMEPS, 0, 0, prism2mib_truth }, { DIDmib_p2_p2Static_p2CnfMulticastReceive, F_STA | F_READ | F_WRITE, HFA384x_RID_CNFMULTICASTRX, 0, 0, prism2mib_truth }, { DIDmib_p2_p2Static_p2CnfMaxSleepDuration, F_STA | F_READ | F_WRITE, HFA384x_RID_CNFMAXSLEEPDUR, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Static_p2CnfPMHoldoverDuration, F_STA | F_READ | F_WRITE, HFA384x_RID_CNFPMHOLDDUR, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Static_p2CnfOwnName, F_AP | F_STA | F_READ | F_WRITE, HFA384x_RID_CNFOWNNAME, HFA384x_RID_CNFOWNNAME_LEN, 0, prism2mib_bytestr2pstr }, { DIDmib_p2_p2Static_p2CnfOwnDTIMPeriod, F_AP | F_STA | F_READ | F_WRITE, HFA384x_RID_CNFOWNDTIMPER, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Static_p2CnfWDSAddress1, F_AP | F_READ | F_WRITE, HFA384x_RID_CNFWDSADDR1, HFA384x_RID_CNFWDSADDR1_LEN, 0, prism2mib_bytearea2pstr }, { DIDmib_p2_p2Static_p2CnfWDSAddress2, F_AP | F_READ | F_WRITE, HFA384x_RID_CNFWDSADDR2, HFA384x_RID_CNFWDSADDR2_LEN, 0, prism2mib_bytearea2pstr }, { DIDmib_p2_p2Static_p2CnfWDSAddress3, F_AP | F_READ | F_WRITE, HFA384x_RID_CNFWDSADDR3, HFA384x_RID_CNFWDSADDR3_LEN, 0, prism2mib_bytearea2pstr }, { DIDmib_p2_p2Static_p2CnfWDSAddress4, F_AP | F_READ | F_WRITE, HFA384x_RID_CNFWDSADDR4, HFA384x_RID_CNFWDSADDR4_LEN, 0, prism2mib_bytearea2pstr }, { DIDmib_p2_p2Static_p2CnfWDSAddress5, F_AP | F_READ | F_WRITE, HFA384x_RID_CNFWDSADDR5, HFA384x_RID_CNFWDSADDR5_LEN, 0, prism2mib_bytearea2pstr }, { DIDmib_p2_p2Static_p2CnfWDSAddress6, F_AP | F_READ | F_WRITE, HFA384x_RID_CNFWDSADDR6, HFA384x_RID_CNFWDSADDR6_LEN, 0, prism2mib_bytearea2pstr }, { DIDmib_p2_p2Static_p2CnfMulticastPMBuffering, F_AP | F_READ | F_WRITE, HFA384x_RID_CNFMCASTPMBUFF, 0, 0, prism2mib_truth }, { DIDmib_p2_p2Static_p2CnfWEPDefaultKeyID, F_AP | F_STA | F_READ | F_WRITE, HFA384x_RID_CNFWEPDEFAULTKEYID, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Static_p2CnfWEPDefaultKey0, F_AP | F_STA | F_WRITE, HFA384x_RID_CNFWEPDEFAULTKEY0, 0, 0, prism2mib_wepdefaultkey }, { DIDmib_p2_p2Static_p2CnfWEPDefaultKey1, F_AP | F_STA | F_WRITE, HFA384x_RID_CNFWEPDEFAULTKEY1, 0, 0, prism2mib_wepdefaultkey }, { DIDmib_p2_p2Static_p2CnfWEPDefaultKey2, F_AP | F_STA | F_WRITE, HFA384x_RID_CNFWEPDEFAULTKEY2, 0, 0, prism2mib_wepdefaultkey }, { DIDmib_p2_p2Static_p2CnfWEPDefaultKey3, F_AP | F_STA | F_WRITE, HFA384x_RID_CNFWEPDEFAULTKEY3, 0, 0, prism2mib_wepdefaultkey }, { DIDmib_p2_p2Static_p2CnfWEPFlags, F_AP | F_STA | F_READ | F_WRITE, HFA384x_RID_CNFWEPFLAGS, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Static_p2CnfAuthentication, F_AP | F_STA | F_READ | F_WRITE, HFA384x_RID_CNFAUTHENTICATION, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Static_p2CnfMaxAssociatedStations, F_AP | F_READ | F_WRITE, HFA384x_RID_CNFMAXASSOCSTATIONS, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Static_p2CnfTxControl, F_AP | F_STA | F_READ | F_WRITE, HFA384x_RID_CNFTXCONTROL, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Static_p2CnfRoamingMode, F_STA | F_READ | F_WRITE, HFA384x_RID_CNFROAMINGMODE, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Static_p2CnfHostAuthentication, F_AP | F_READ | F_WRITE, HFA384x_RID_CNFHOSTAUTHASSOC, 0, 0, prism2mib_truth }, { DIDmib_p2_p2Static_p2CnfRcvCrcError, F_AP | F_STA | F_READ | F_WRITE, HFA384x_RID_CNFRCVCRCERROR, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Static_p2CnfAltRetryCount, F_AP | F_STA | F_READ | F_WRITE, HFA384x_RID_CNFALTRETRYCNT, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Static_p2CnfBeaconInterval, F_AP | F_READ | F_WRITE, HFA384x_RID_CNFAPBCNINT, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Static_p2CnfMediumOccupancyLimit, F_AP | F_READ | F_WRITE, HFA384x_RID_CNFAPPCFINFO, HFA384x_RID_CNFAPPCFINFO_LEN, 0, prism2mib_uint32offset }, { DIDmib_p2_p2Static_p2CnfCFPPeriod, F_AP | F_READ | F_WRITE, HFA384x_RID_CNFAPPCFINFO, HFA384x_RID_CNFAPPCFINFO_LEN, 1, prism2mib_uint32offset }, { DIDmib_p2_p2Static_p2CnfCFPMaxDuration, F_AP | F_READ | F_WRITE, HFA384x_RID_CNFAPPCFINFO, HFA384x_RID_CNFAPPCFINFO_LEN, 2, prism2mib_uint32offset }, { DIDmib_p2_p2Static_p2CnfCFPFlags, F_AP | F_READ | F_WRITE, HFA384x_RID_CNFAPPCFINFO, HFA384x_RID_CNFAPPCFINFO_LEN, 3, prism2mib_uint32offset }, { DIDmib_p2_p2Static_p2CnfSTAPCFInfo, F_STA | F_READ | F_WRITE, HFA384x_RID_CNFSTAPCFINFO, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Static_p2CnfPriorityQUsage, F_AP | F_STA | F_READ | F_WRITE, HFA384x_RID_CNFPRIORITYQUSAGE, HFA384x_RID_CNFPRIOQUSAGE_LEN, 0, prism2mib_uint32array }, { DIDmib_p2_p2Static_p2CnfTIMCtrl, F_AP | F_STA | F_READ | F_WRITE, HFA384x_RID_CNFTIMCTRL, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Static_p2CnfThirty2Tally, F_AP | F_STA | F_READ | F_WRITE, HFA384x_RID_CNFTHIRTY2TALLY, 0, 0, prism2mib_truth }, { DIDmib_p2_p2Static_p2CnfEnhSecurity, F_AP | F_READ | F_WRITE, HFA384x_RID_CNFENHSECURITY, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Static_p2CnfShortPreamble, F_AP | F_STA | F_READ | F_WRITE, HFA384x_RID_CNFSHORTPREAMBLE, 0, 0, prism2mib_preamble }, { DIDmib_p2_p2Static_p2CnfExcludeLongPreamble, F_AP | F_READ | F_WRITE, HFA384x_RID_CNFEXCLONGPREAMBLE, 0, 0, prism2mib_truth }, { DIDmib_p2_p2Static_p2CnfAuthenticationRspTO, F_STA | F_READ | F_WRITE, HFA384x_RID_CNFAUTHRSPTIMEOUT, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Static_p2CnfBasicRates, F_AP | F_STA | F_READ | F_WRITE, HFA384x_RID_CNFBASICRATES, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Static_p2CnfSupportedRates, F_AP | F_STA | F_READ | F_WRITE, HFA384x_RID_CNFSUPPRATES, 0, 0, prism2mib_uint32 }, /* p2Dynamic MIB's */ { DIDmib_p2_p2Dynamic_p2CreateIBSS, F_STA | F_READ | F_WRITE, HFA384x_RID_CREATEIBSS, 0, 0, prism2mib_truth }, { DIDmib_p2_p2Dynamic_p2FragmentationThreshold, F_STA | F_READ | F_WRITE, HFA384x_RID_FRAGTHRESH, 0, 0, prism2mib_fragmentationthreshold }, { DIDmib_p2_p2Dynamic_p2RTSThreshold, F_STA | F_READ | F_WRITE, HFA384x_RID_RTSTHRESH, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Dynamic_p2TxRateControl, F_STA | F_READ | F_WRITE, HFA384x_RID_TXRATECNTL, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Dynamic_p2PromiscuousMode, F_STA | F_READ | F_WRITE, HFA384x_RID_PROMISCMODE, 0, 0, prism2mib_truth }, { DIDmib_p2_p2Dynamic_p2FragmentationThreshold0, F_AP | F_READ | F_WRITE, HFA384x_RID_FRAGTHRESH0, 0, 0, prism2mib_fragmentationthreshold }, { DIDmib_p2_p2Dynamic_p2FragmentationThreshold1, F_AP | F_READ | F_WRITE, HFA384x_RID_FRAGTHRESH1, 0, 0, prism2mib_fragmentationthreshold }, { DIDmib_p2_p2Dynamic_p2FragmentationThreshold2, F_AP | F_READ | F_WRITE, HFA384x_RID_FRAGTHRESH2, 0, 0, prism2mib_fragmentationthreshold }, { DIDmib_p2_p2Dynamic_p2FragmentationThreshold3, F_AP | F_READ | F_WRITE, HFA384x_RID_FRAGTHRESH3, 0, 0, prism2mib_fragmentationthreshold }, { DIDmib_p2_p2Dynamic_p2FragmentationThreshold4, F_AP | F_READ | F_WRITE, HFA384x_RID_FRAGTHRESH4, 0, 0, prism2mib_fragmentationthreshold }, { DIDmib_p2_p2Dynamic_p2FragmentationThreshold5, F_AP | F_READ | F_WRITE, HFA384x_RID_FRAGTHRESH5, 0, 0, prism2mib_fragmentationthreshold }, { DIDmib_p2_p2Dynamic_p2FragmentationThreshold6, F_AP | F_READ | F_WRITE, HFA384x_RID_FRAGTHRESH6, 0, 0, prism2mib_fragmentationthreshold }, { DIDmib_p2_p2Dynamic_p2RTSThreshold0, F_AP | F_READ | F_WRITE, HFA384x_RID_RTSTHRESH0, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Dynamic_p2RTSThreshold1, F_AP | F_READ | F_WRITE, HFA384x_RID_RTSTHRESH1, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Dynamic_p2RTSThreshold2, F_AP | F_READ | F_WRITE, HFA384x_RID_RTSTHRESH2, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Dynamic_p2RTSThreshold3, F_AP | F_READ | F_WRITE, HFA384x_RID_RTSTHRESH3, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Dynamic_p2RTSThreshold4, F_AP | F_READ | F_WRITE, HFA384x_RID_RTSTHRESH4, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Dynamic_p2RTSThreshold5, F_AP | F_READ | F_WRITE, HFA384x_RID_RTSTHRESH5, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Dynamic_p2RTSThreshold6, F_AP | F_READ | F_WRITE, HFA384x_RID_RTSTHRESH6, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Dynamic_p2TxRateControl0, F_AP | F_READ | F_WRITE, HFA384x_RID_TXRATECNTL0, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Dynamic_p2TxRateControl1, F_AP | F_READ | F_WRITE, HFA384x_RID_TXRATECNTL1, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Dynamic_p2TxRateControl2, F_AP | F_READ | F_WRITE, HFA384x_RID_TXRATECNTL2, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Dynamic_p2TxRateControl3, F_AP | F_READ | F_WRITE, HFA384x_RID_TXRATECNTL3, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Dynamic_p2TxRateControl4, F_AP | F_READ | F_WRITE, HFA384x_RID_TXRATECNTL4, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Dynamic_p2TxRateControl5, F_AP | F_READ | F_WRITE, HFA384x_RID_TXRATECNTL5, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Dynamic_p2TxRateControl6, F_AP | F_READ | F_WRITE, HFA384x_RID_TXRATECNTL6, 0, 0, prism2mib_uint32 }, /* p2Behavior MIB's */ { DIDmib_p2_p2Behavior_p2TickTime, F_AP | F_STA | F_READ | F_WRITE, HFA384x_RID_ITICKTIME, 0, 0, prism2mib_uint32 }, /* p2NIC MIB's */ { DIDmib_p2_p2NIC_p2MaxLoadTime, F_AP | F_STA | F_READ, HFA384x_RID_MAXLOADTIME, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2NIC_p2DLBufferPage, F_AP | F_STA | F_READ, HFA384x_RID_DOWNLOADBUFFER, HFA384x_RID_DOWNLOADBUFFER_LEN, 0, prism2mib_uint32offset }, { DIDmib_p2_p2NIC_p2DLBufferOffset, F_AP | F_STA | F_READ, HFA384x_RID_DOWNLOADBUFFER, HFA384x_RID_DOWNLOADBUFFER_LEN, 1, prism2mib_uint32offset }, { DIDmib_p2_p2NIC_p2DLBufferLength, F_AP | F_STA | F_READ, HFA384x_RID_DOWNLOADBUFFER, HFA384x_RID_DOWNLOADBUFFER_LEN, 2, prism2mib_uint32offset }, { DIDmib_p2_p2NIC_p2PRIIdentity, F_AP | F_STA | F_READ, HFA384x_RID_PRIIDENTITY, HFA384x_RID_PRIIDENTITY_LEN, 0, prism2mib_uint32array }, { DIDmib_p2_p2NIC_p2PRISupRange, F_AP | F_STA | F_READ, HFA384x_RID_PRISUPRANGE, HFA384x_RID_PRISUPRANGE_LEN, 0, prism2mib_uint32array }, { DIDmib_p2_p2NIC_p2CFIActRanges, F_AP | F_STA | F_READ, HFA384x_RID_PRI_CFIACTRANGES, HFA384x_RID_CFIACTRANGES_LEN, 0, prism2mib_uint32array }, { DIDmib_p2_p2NIC_p2BuildSequence, F_AP | F_STA | F_READ, HFA384x_RID_BUILDSEQ, HFA384x_RID_BUILDSEQ_LEN, 0, prism2mib_uint32array }, { DIDmib_p2_p2NIC_p2PrimaryFWID, F_AP | F_STA | F_READ, 0, 0, 0, prism2mib_fwid }, { DIDmib_p2_p2NIC_p2SecondaryFWID, F_AP | F_STA | F_READ, 0, 0, 0, prism2mib_fwid }, { DIDmib_p2_p2NIC_p2TertiaryFWID, F_AP | F_READ, 0, 0, 0, prism2mib_fwid }, { DIDmib_p2_p2NIC_p2NICSerialNumber, F_AP | F_STA | F_READ, HFA384x_RID_NICSERIALNUMBER, HFA384x_RID_NICSERIALNUMBER_LEN, 0, prism2mib_bytearea2pstr }, { DIDmib_p2_p2NIC_p2NICIdentity, F_AP | F_STA | F_READ, HFA384x_RID_NICIDENTITY, HFA384x_RID_NICIDENTITY_LEN, 0, prism2mib_uint32array }, { DIDmib_p2_p2NIC_p2MFISupRange, F_AP | F_STA | F_READ, HFA384x_RID_MFISUPRANGE, HFA384x_RID_MFISUPRANGE_LEN, 0, prism2mib_uint32array }, { DIDmib_p2_p2NIC_p2CFISupRange, F_AP | F_STA | F_READ, HFA384x_RID_CFISUPRANGE, HFA384x_RID_CFISUPRANGE_LEN, 0, prism2mib_uint32array }, { DIDmib_p2_p2NIC_p2ChannelList, F_AP | F_STA | F_READ, HFA384x_RID_CHANNELLIST, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2NIC_p2RegulatoryDomains, F_AP | F_STA | F_READ, HFA384x_RID_REGULATORYDOMAINS, HFA384x_RID_REGULATORYDOMAINS_LEN, 0, prism2mib_regulatorydomains }, { DIDmib_p2_p2NIC_p2TempType, F_AP | F_STA | F_READ, HFA384x_RID_TEMPTYPE, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2NIC_p2STAIdentity, F_AP | F_STA | F_READ, HFA384x_RID_STAIDENTITY, HFA384x_RID_STAIDENTITY_LEN, 0, prism2mib_uint32array }, { DIDmib_p2_p2NIC_p2STASupRange, F_AP | F_STA | F_READ, HFA384x_RID_STASUPRANGE, HFA384x_RID_STASUPRANGE_LEN, 0, prism2mib_uint32array }, { DIDmib_p2_p2NIC_p2MFIActRanges, F_AP | F_STA | F_READ, HFA384x_RID_STA_MFIACTRANGES, HFA384x_RID_MFIACTRANGES_LEN, 0, prism2mib_uint32array }, { DIDmib_p2_p2NIC_p2STACFIActRanges, F_AP | F_STA | F_READ, HFA384x_RID_STA_CFIACTRANGES, HFA384x_RID_CFIACTRANGES2_LEN, 0, prism2mib_uint32array }, /* p2MAC MIB's */ { DIDmib_p2_p2MAC_p2PortStatus, F_STA | F_READ, HFA384x_RID_PORTSTATUS, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2MAC_p2CurrentSSID, F_STA | F_READ, HFA384x_RID_CURRENTSSID, HFA384x_RID_CURRENTSSID_LEN, 0, prism2mib_bytestr2pstr }, { DIDmib_p2_p2MAC_p2CurrentBSSID, F_STA | F_READ, HFA384x_RID_CURRENTBSSID, HFA384x_RID_CURRENTBSSID_LEN, 0, prism2mib_bytearea2pstr }, { DIDmib_p2_p2MAC_p2CommsQuality, F_STA | F_READ, HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 0, prism2mib_uint32array }, { DIDmib_p2_p2MAC_p2CommsQualityCQ, F_STA | F_READ, HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 0, prism2mib_uint32offset }, { DIDmib_p2_p2MAC_p2CommsQualityASL, F_STA | F_READ, HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 1, prism2mib_uint32offset }, { DIDmib_p2_p2MAC_p2CommsQualityANL, F_STA | F_READ, HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 2, prism2mib_uint32offset }, { DIDmib_p2_p2MAC_p2dbmCommsQuality, F_STA | F_READ, HFA384x_RID_DBMCOMMSQUALITY, HFA384x_RID_DBMCOMMSQUALITY_LEN, 0, prism2mib_uint32array }, { DIDmib_p2_p2MAC_p2dbmCommsQualityCQ, F_STA | F_READ, HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 0, prism2mib_uint32offset }, { DIDmib_p2_p2MAC_p2dbmCommsQualityASL, F_STA | F_READ, HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 1, prism2mib_uint32offset }, { DIDmib_p2_p2MAC_p2dbmCommsQualityANL, F_STA | F_READ, HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 2, prism2mib_uint32offset }, { DIDmib_p2_p2MAC_p2CurrentTxRate, F_STA | F_READ, HFA384x_RID_CURRENTTXRATE, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2MAC_p2CurrentBeaconInterval, F_AP | F_STA | F_READ, HFA384x_RID_CURRENTBCNINT, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2MAC_p2StaCurrentScaleThresholds, F_STA | F_READ, HFA384x_RID_CURRENTSCALETHRESH, HFA384x_RID_STACURSCALETHRESH_LEN, 0, prism2mib_uint32array }, { DIDmib_p2_p2MAC_p2APCurrentScaleThresholds, F_AP | F_READ, HFA384x_RID_CURRENTSCALETHRESH, HFA384x_RID_APCURSCALETHRESH_LEN, 0, prism2mib_uint32array }, { DIDmib_p2_p2MAC_p2ProtocolRspTime, F_AP | F_STA | F_READ, HFA384x_RID_PROTOCOLRSPTIME, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2MAC_p2ShortRetryLimit, F_AP | F_STA | F_READ, HFA384x_RID_SHORTRETRYLIMIT, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2MAC_p2LongRetryLimit, F_AP | F_STA | F_READ, HFA384x_RID_LONGRETRYLIMIT, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2MAC_p2MaxTransmitLifetime, F_AP | F_STA | F_READ, HFA384x_RID_MAXTXLIFETIME, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2MAC_p2MaxReceiveLifetime, F_AP | F_STA | F_READ, HFA384x_RID_MAXRXLIFETIME, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2MAC_p2CFPollable, F_STA | F_READ, HFA384x_RID_CFPOLLABLE, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2MAC_p2AuthenticationAlgorithms, F_AP | F_STA | F_READ, HFA384x_RID_AUTHALGORITHMS, HFA384x_RID_AUTHALGORITHMS_LEN, 0, prism2mib_uint32array }, { DIDmib_p2_p2MAC_p2PrivacyOptionImplemented, F_AP | F_STA | F_READ, HFA384x_RID_PRIVACYOPTIMP, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2MAC_p2CurrentTxRate1, F_AP | F_READ, HFA384x_RID_CURRENTTXRATE1, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2MAC_p2CurrentTxRate2, F_AP | F_READ, HFA384x_RID_CURRENTTXRATE2, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2MAC_p2CurrentTxRate3, F_AP | F_READ, HFA384x_RID_CURRENTTXRATE3, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2MAC_p2CurrentTxRate4, F_AP | F_READ, HFA384x_RID_CURRENTTXRATE4, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2MAC_p2CurrentTxRate5, F_AP | F_READ, HFA384x_RID_CURRENTTXRATE5, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2MAC_p2CurrentTxRate6, F_AP | F_READ, HFA384x_RID_CURRENTTXRATE6, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2MAC_p2OwnMACAddress, F_AP | F_READ, HFA384x_RID_OWNMACADDRESS, HFA384x_RID_OWNMACADDRESS_LEN, 0, prism2mib_bytearea2pstr }, /* p2Modem MIB's */ { DIDmib_p2_p2Modem_p2PHYType, F_AP | F_STA | F_READ, HFA384x_RID_PHYTYPE, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Modem_p2CurrentChannel, F_AP | F_STA | F_READ, HFA384x_RID_CURRENTCHANNEL, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Modem_p2CurrentPowerState, F_AP | F_STA | F_READ, HFA384x_RID_CURRENTPOWERSTATE, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Modem_p2CCAMode, F_AP | F_STA | F_READ, HFA384x_RID_CCAMODE, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Modem_p2TxPowerMax, F_AP | F_STA | F_READ | F_WRITE, HFA384x_RID_TXPOWERMAX, 0, 0, prism2mib_uint32 }, { DIDmib_dot11phy_dot11PhyTxPowerTable_dot11CurrentTxPowerLevel, F_AP | F_STA | F_READ | F_WRITE, HFA384x_RID_TXPOWERMAX, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Modem_p2SupportedDataRates, F_AP | F_STA | F_READ, HFA384x_RID_SUPPORTEDDATARATES, HFA384x_RID_SUPPORTEDDATARATES_LEN, 0, prism2mib_bytestr2pstr }, /* And finally, lnx mibs */ { DIDmib_lnx_lnxConfigTable_lnxRSNAIE, F_STA | F_READ | F_WRITE, HFA384x_RID_CNFWPADATA, 0, 0, prism2mib_priv }, { 0, 0, 0, 0, 0, NULL}}; /*---------------------------------------------------------------- These MIB's are not supported at this time: DIDmib_dot11phy_dot11PhyOperationTable_dot11ChannelAgilityPresent DIDmib_dot11phy_dot11PhyOperationTable_dot11ChannelAgilityEnabled DIDmib_dot11phy_dot11PhyDSSSTable_dot11PBCCOptionImplemented DIDmib_dot11phy_dot11RegDomainsSupportedTable_dot11RegDomainsSupportIndex DIDmib_dot11phy_dot11SupportedDataRatesTxTable_dot11SupportedDataRatesTxIndex DIDmib_dot11phy_dot11SupportedDataRatesTxTable_dot11SupportedDataRatesTxValue DIDmib_dot11phy_dot11SupportedDataRatesRxTable_dot11SupportedDataRatesRxIndex DIDmib_dot11phy_dot11SupportedDataRatesRxTable_dot11SupportedDataRatesRxValue DIDmib_dot11phy_dot11RegDomainsSupportedTable_dot11RegDomainsSupportValue TODO: need to investigate why wlan has this as enumerated and Prism2 has this as btye str. DIDmib_dot11phy_dot11PhyDSSSTable_dot11ShortPreambleOptionImplemented TODO: Find out the firmware version number(s) for identifying whether the firmware is capable of short preamble. TRUE or FALSE will be returned based on the version of the firmware. WEP Key mappings aren't supported in the f/w. DIDmib_dot11smt_dot11WEPKeyMappingsTable_dot11WEPKeyMappingIndex DIDmib_dot11smt_dot11WEPKeyMappingsTable_dot11WEPKeyMappingAddress DIDmib_dot11smt_dot11WEPKeyMappingsTable_dot11WEPKeyMappingWEPOn DIDmib_dot11smt_dot11WEPKeyMappingsTable_dot11WEPKeyMappingValue DIDmib_dot11smt_dot11PrivacyTable_dot11WEPKeyMappingLength TODO: implement counters. DIDmib_dot11smt_dot11PrivacyTable_dot11WEPICVErrorCount DIDmib_dot11smt_dot11PrivacyTable_dot11WEPExcludedCount DIDmib_dot11mac_dot11CountersTable_dot11TransmittedFragmentCount DIDmib_dot11mac_dot11CountersTable_dot11MulticastTransmittedFrameCount DIDmib_dot11mac_dot11CountersTable_dot11FailedCount DIDmib_dot11mac_dot11CountersTable_dot11RetryCount DIDmib_dot11mac_dot11CountersTable_dot11MultipleRetryCount DIDmib_dot11mac_dot11CountersTable_dot11FrameDuplicateCount DIDmib_dot11mac_dot11CountersTable_dot11RTSSuccessCount DIDmib_dot11mac_dot11CountersTable_dot11RTSFailureCount DIDmib_dot11mac_dot11CountersTable_dot11ACKFailureCount DIDmib_dot11mac_dot11CountersTable_dot11ReceivedFragmentCount DIDmib_dot11mac_dot11CountersTable_dot11MulticastReceivedFrameCount DIDmib_dot11mac_dot11CountersTable_dot11FCSErrorCount DIDmib_dot11mac_dot11CountersTable_dot11TransmittedFrameCount DIDmib_dot11mac_dot11CountersTable_dot11WEPUndecryptableCount TODO: implement sane values for these. DIDmib_dot11mac_dot11OperationTable_dot11ManufacturerID DIDmib_dot11mac_dot11OperationTable_dot11ProductID Not too worried about these at the moment. DIDmib_dot11phy_dot11PhyAntennaTable_dot11CurrentTxAntenna DIDmib_dot11phy_dot11PhyAntennaTable_dot11DiversitySupport DIDmib_dot11phy_dot11PhyAntennaTable_dot11CurrentRxAntenna DIDmib_dot11phy_dot11PhyTxPowerTable_dot11NumberSupportedPowerLevels DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel1 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel2 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel3 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel4 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel5 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel6 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel7 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel8 DIDmib_dot11phy_dot11PhyTxPowerTable_dot11CurrentTxPowerLevel Ummm, FH and IR don't apply DIDmib_dot11phy_dot11PhyFHSSTable_dot11HopTime DIDmib_dot11phy_dot11PhyFHSSTable_dot11CurrentChannelNumber DIDmib_dot11phy_dot11PhyFHSSTable_dot11MaxDwellTime DIDmib_dot11phy_dot11PhyFHSSTable_dot11CurrentDwellTime DIDmib_dot11phy_dot11PhyFHSSTable_dot11CurrentSet DIDmib_dot11phy_dot11PhyFHSSTable_dot11CurrentPattern DIDmib_dot11phy_dot11PhyFHSSTable_dot11CurrentIndex DIDmib_dot11phy_dot11PhyDSSSTable_dot11CCAModeSupported DIDmib_dot11phy_dot11PhyDSSSTable_dot11EDThreshold DIDmib_dot11phy_dot11PhyIRTable_dot11CCAWatchdogTimerMax DIDmib_dot11phy_dot11PhyIRTable_dot11CCAWatchdogCountMax DIDmib_dot11phy_dot11PhyIRTable_dot11CCAWatchdogTimerMin DIDmib_dot11phy_dot11PhyIRTable_dot11CCAWatchdogCountMin We just don't have enough antennas right now to worry about this. DIDmib_dot11phy_dot11AntennasListTable_dot11AntennaListIndex DIDmib_dot11phy_dot11AntennasListTable_dot11SupportedTxAntenna DIDmib_dot11phy_dot11AntennasListTable_dot11SupportedRxAntenna DIDmib_dot11phy_dot11AntennasListTable_dot11DiversitySelectionRx ------------------------------------------------------------------*/ /*================================================================*/ /* Function Definitions */ /*---------------------------------------------------------------- * prism2mgmt_mibset_mibget * * Set the value of a mib item. * * Arguments: * wlandev wlan device structure * msgp ptr to msg buffer * * Returns: * 0 success and done * <0 success, but we're waiting for something to finish. * >0 an error occurred while handling the message. * Side effects: * * Call context: * process thread (usually) * interrupt ----------------------------------------------------------------*/ int prism2mgmt_mibset_mibget(wlandevice_t *wlandev, void *msgp) { hfa384x_t *hw = wlandev->priv; int result, isget; mibrec_t *mib; UINT16 which; p80211msg_dot11req_mibset_t *msg = msgp; p80211itemd_t *mibitem; DBFENTER; msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.data = P80211ENUM_resultcode_success; /* ** Determine if this is an Access Point or a station. */ which = hw->ap ? F_AP : F_STA; /* ** Find the MIB in the MIB table. Note that a MIB may be in the ** table twice...once for an AP and once for a station. Make sure ** to get the correct one. Note that DID=0 marks the end of the ** MIB table. */ mibitem = (p80211itemd_t *) msg->mibattribute.data; for (mib = mibtab; mib->did != 0; mib++) if (mib->did == mibitem->did && (mib->flag & which)) break; if (mib->did == 0) { msg->resultcode.data = P80211ENUM_resultcode_not_supported; goto done; } /* ** Determine if this is a "mibget" or a "mibset". If this is a ** "mibget", then make sure that the MIB may be read. Otherwise, ** this is a "mibset" so make make sure that the MIB may be written. */ isget = (msg->msgcode == DIDmsg_dot11req_mibget); if (isget) { if (!(mib->flag & F_READ)) { msg->resultcode.data = P80211ENUM_resultcode_cant_get_writeonly_mib; goto done; } } else { if (!(mib->flag & F_WRITE)) { msg->resultcode.data = P80211ENUM_resultcode_cant_set_readonly_mib; goto done; } } /* ** Execute the MIB function. If things worked okay, then make ** sure that the MIB function also worked okay. If so, and this ** is a "mibget", then the status value must be set for both the ** "mibattribute" parameter and the mib item within the data ** portion of the "mibattribute". */ result = mib->func(mib, isget, wlandev, hw, msg, (void *) mibitem->data); if (msg->resultcode.data == P80211ENUM_resultcode_success) { if (result != 0) { WLAN_LOG_DEBUG(1, "get/set failure, result=%d\n", result); msg->resultcode.data = P80211ENUM_resultcode_implementation_failure; } else { if (isget) { msg->mibattribute.status = P80211ENUM_msgitem_status_data_ok; mibitem->status = P80211ENUM_msgitem_status_data_ok; } } } done: DBFEXIT; return(0); } /*---------------------------------------------------------------- * prism2mib_bytestr2pstr * * Get/set pstr data to/from a byte string. * * MIB record parameters: * parm1 Prism2 RID value. * parm2 Number of bytes of RID data. * parm3 Not used. * * Arguments: * mib MIB record. * isget MIBGET/MIBSET flag. * wlandev wlan device structure. * priv "priv" structure. * hw "hw" structure. * msg Message structure. * data Data buffer. * * Returns: * 0 - Success. * ~0 - Error. * ----------------------------------------------------------------*/ static int prism2mib_bytestr2pstr( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data) { int result; p80211pstrd_t *pstr = (p80211pstrd_t*) data; UINT8 bytebuf[MIB_TMP_MAXLEN]; hfa384x_bytestr_t *p2bytestr = (hfa384x_bytestr_t*) bytebuf; DBFENTER; if (isget) { result = hfa384x_drvr_getconfig(hw, mib->parm1, bytebuf, mib->parm2); prism2mgmt_bytestr2pstr(p2bytestr, pstr); } else { memset(bytebuf, 0, mib->parm2); prism2mgmt_pstr2bytestr(p2bytestr, pstr); result = hfa384x_drvr_setconfig(hw, mib->parm1, bytebuf, mib->parm2); } DBFEXIT; return(result); } /*---------------------------------------------------------------- * prism2mib_bytearea2pstr * * Get/set pstr data to/from a byte area. * * MIB record parameters: * parm1 Prism2 RID value. * parm2 Number of bytes of RID data. * parm3 Not used. * * Arguments: * mib MIB record. * isget MIBGET/MIBSET flag. * wlandev wlan device structure. * priv "priv" structure. * hw "hw" structure. * msg Message structure. * data Data buffer. * * Returns: * 0 - Success. * ~0 - Error. * ----------------------------------------------------------------*/ static int prism2mib_bytearea2pstr( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data) { int result; p80211pstrd_t *pstr = (p80211pstrd_t*) data; UINT8 bytebuf[MIB_TMP_MAXLEN]; DBFENTER; if (isget) { result = hfa384x_drvr_getconfig(hw, mib->parm1, bytebuf, mib->parm2); prism2mgmt_bytearea2pstr(bytebuf, pstr, mib->parm2); } else { memset(bytebuf, 0, mib->parm2); prism2mgmt_pstr2bytearea(bytebuf, pstr); result = hfa384x_drvr_setconfig(hw, mib->parm1, bytebuf, mib->parm2); } DBFEXIT; return(result); } /*---------------------------------------------------------------- * prism2mib_uint32 * * Get/set uint32 data. * * MIB record parameters: * parm1 Prism2 RID value. * parm2 Not used. * parm3 Not used. * * Arguments: * mib MIB record. * isget MIBGET/MIBSET flag. * wlandev wlan device structure. * priv "priv" structure. * hw "hw" structure. * msg Message structure. * data Data buffer. * * Returns: * 0 - Success. * ~0 - Error. * ----------------------------------------------------------------*/ static int prism2mib_uint32( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data) { int result; UINT32 *uint32 = (UINT32*) data; UINT8 bytebuf[MIB_TMP_MAXLEN]; UINT16 *wordbuf = (UINT16*) bytebuf; DBFENTER; if (isget) { result = hfa384x_drvr_getconfig16(hw, mib->parm1, wordbuf); *uint32 = *wordbuf; /* [MSM] Removed, getconfig16 returns the value in host order. * prism2mgmt_prism2int2p80211int(wordbuf, uint32); */ } else { /* [MSM] Removed, setconfig16 expects host order. * prism2mgmt_p80211int2prism2int(wordbuf, uint32); */ *wordbuf = *uint32; result = hfa384x_drvr_setconfig16(hw, mib->parm1, *wordbuf); } DBFEXIT; return(result); } /*---------------------------------------------------------------- * prism2mib_uint32array * * Get/set an array of uint32 data. * * MIB record parameters: * parm1 Prism2 RID value. * parm2 Number of bytes of RID data. * parm3 Not used. * * Arguments: * mib MIB record. * isget MIBGET/MIBSET flag. * wlandev wlan device structure. * priv "priv" structure. * hw "hw" structure. * msg Message structure. * data Data buffer. * * Returns: * 0 - Success. * ~0 - Error. * ----------------------------------------------------------------*/ static int prism2mib_uint32array( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data) { int result; UINT32 *uint32 = (UINT32 *) data; UINT8 bytebuf[MIB_TMP_MAXLEN]; UINT16 *wordbuf = (UINT16*) bytebuf; int i, cnt; DBFENTER; cnt = mib->parm2 / sizeof(UINT16); if (isget) { result = hfa384x_drvr_getconfig(hw, mib->parm1, wordbuf, mib->parm2); for (i = 0; i < cnt; i++) prism2mgmt_prism2int2p80211int(wordbuf+i, uint32+i); } else { for (i = 0; i < cnt; i++) prism2mgmt_p80211int2prism2int(wordbuf+i, uint32+i); result = hfa384x_drvr_setconfig(hw, mib->parm1, wordbuf, mib->parm2); } DBFEXIT; return(result); } /*---------------------------------------------------------------- * prism2mib_uint32offset * * Get/set a single element in an array of uint32 data. * * MIB record parameters: * parm1 Prism2 RID value. * parm2 Number of bytes of RID data. * parm3 Element index. * * Arguments: * mib MIB record. * isget MIBGET/MIBSET flag. * wlandev wlan device structure. * priv "priv" structure. * hw "hw" structure. * msg Message structure. * data Data buffer. * * Returns: * 0 - Success. * ~0 - Error. * ----------------------------------------------------------------*/ static int prism2mib_uint32offset( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data) { int result; UINT32 *uint32 = (UINT32*) data; UINT8 bytebuf[MIB_TMP_MAXLEN]; UINT16 *wordbuf = (UINT16*) bytebuf; UINT16 cnt; DBFENTER; cnt = mib->parm2 / sizeof(UINT16); result = hfa384x_drvr_getconfig(hw, mib->parm1, wordbuf, mib->parm2); if (result == 0) { if (isget) { if (mib->parm3 < cnt) prism2mgmt_prism2int2p80211int(wordbuf+mib->parm3, uint32); else *uint32 = 0; } else { if (mib->parm3 < cnt) { prism2mgmt_p80211int2prism2int(wordbuf+mib->parm3, uint32); result = hfa384x_drvr_setconfig(hw, mib->parm1, wordbuf, mib->parm2); } } } DBFEXIT; return(result); } /*---------------------------------------------------------------- * prism2mib_truth * * Get/set truth data. * * MIB record parameters: * parm1 Prism2 RID value. * parm2 Not used. * parm3 Not used. * * Arguments: * mib MIB record. * isget MIBGET/MIBSET flag. * wlandev wlan device structure. * priv "priv" structure. * hw "hw" structure. * msg Message structure. * data Data buffer. * * Returns: * 0 - Success. * ~0 - Error. * ----------------------------------------------------------------*/ static int prism2mib_truth( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data) { int result; UINT32 *uint32 = (UINT32*) data; UINT8 bytebuf[MIB_TMP_MAXLEN]; UINT16 *wordbuf = (UINT16*) bytebuf; DBFENTER; if (isget) { result = hfa384x_drvr_getconfig16(hw, mib->parm1, wordbuf); *uint32 = (*wordbuf) ? P80211ENUM_truth_true : P80211ENUM_truth_false; } else { *wordbuf = ((*uint32) == P80211ENUM_truth_true) ? 1 : 0; result = hfa384x_drvr_setconfig16(hw, mib->parm1, *wordbuf); } DBFEXIT; return(result); } /*---------------------------------------------------------------- * prism2mib_flag * * Get/set a flag. * * MIB record parameters: * parm1 Prism2 RID value. * parm2 Bit to get/set. * parm3 Not used. * * Arguments: * mib MIB record. * isget MIBGET/MIBSET flag. * wlandev wlan device structure. * priv "priv" structure. * hw "hw" structure. * msg Message structure. * data Data buffer. * * Returns: * 0 - Success. * ~0 - Error. * ----------------------------------------------------------------*/ static int prism2mib_flag( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data) { int result; UINT32 *uint32 = (UINT32*) data; UINT8 bytebuf[MIB_TMP_MAXLEN]; UINT16 *wordbuf = (UINT16*) bytebuf; UINT32 flags; DBFENTER; result = hfa384x_drvr_getconfig16(hw, mib->parm1, wordbuf); if (result == 0) { /* [MSM] Removed, getconfig16 returns the value in host order. * prism2mgmt_prism2int2p80211int(wordbuf, &flags); */ flags = *wordbuf; if (isget) { *uint32 = (flags & mib->parm2) ? P80211ENUM_truth_true : P80211ENUM_truth_false; } else { if ((*uint32) == P80211ENUM_truth_true) flags |= mib->parm2; else flags &= ~mib->parm2; /* [MSM] Removed, setconfig16 expects host order. * prism2mgmt_p80211int2prism2int(wordbuf, &flags); */ *wordbuf = flags; result = hfa384x_drvr_setconfig16(hw, mib->parm1, *wordbuf); } } DBFEXIT; return(result); } /*---------------------------------------------------------------- * prism2mib_appcfinfoflag * * Get/set a single flag in the APPCFINFO record. * * MIB record parameters: * parm1 Bit to get/set. * parm2 Not used. * parm3 Not used. * * Arguments: * mib MIB record. * isget MIBGET/MIBSET flag. * wlandev wlan device structure. * priv "priv" structure. * hw "hw" structure. * msg Message structure. * data Data buffer. * * Returns: * 0 - Success. * ~0 - Error. * ----------------------------------------------------------------*/ static int prism2mib_appcfinfoflag( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data) { int result; UINT32 *uint32 = (UINT32*) data; UINT8 bytebuf[MIB_TMP_MAXLEN]; UINT16 *wordbuf = (UINT16*) bytebuf; UINT16 word; DBFENTER; result = hfa384x_drvr_getconfig(hw, HFA384x_RID_CNFAPPCFINFO, bytebuf, HFA384x_RID_CNFAPPCFINFO_LEN); if (result == 0) { if (isget) { *uint32 = (hfa384x2host_16(wordbuf[3]) & mib->parm1) ? P80211ENUM_truth_true : P80211ENUM_truth_false; } else { word = hfa384x2host_16(wordbuf[3]); word = ((*uint32) == P80211ENUM_truth_true) ? (word | mib->parm1) : (word & ~mib->parm1); wordbuf[3] = host2hfa384x_16(word); result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFAPPCFINFO, bytebuf, HFA384x_RID_CNFAPPCFINFO_LEN); } } DBFEXIT; return(result); } /*---------------------------------------------------------------- * prism2mib_regulatorydomains * * Get regulatory domain data. * * MIB record parameters: * parm1 Prism2 RID value. * parm2 Number of bytes of RID data. * parm3 Not used. * * Arguments: * mib MIB record. * isget MIBGET/MIBSET flag. * wlandev wlan device structure. * priv "priv" structure. * hw "hw" structure. * msg Message structure. * data Data buffer. * * Returns: * 0 - Success. * ~0 - Error. * ----------------------------------------------------------------*/ static int prism2mib_regulatorydomains( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data) { int result; UINT32 cnt; p80211pstrd_t *pstr = (p80211pstrd_t*) data; UINT8 bytebuf[MIB_TMP_MAXLEN]; UINT16 *wordbuf = (UINT16*) bytebuf; DBFENTER; result = 0; if (isget) { result = hfa384x_drvr_getconfig(hw, mib->parm1, wordbuf, mib->parm2); prism2mgmt_prism2int2p80211int(wordbuf, &cnt); pstr->len = (UINT8) cnt; memcpy(pstr->data, &wordbuf[1], pstr->len); } DBFEXIT; return(result); } /*---------------------------------------------------------------- * prism2mib_wepdefaultkey * * Get/set WEP default keys. * * MIB record parameters: * parm1 Prism2 RID value. * parm2 Number of bytes of RID data. * parm3 Not used. * * Arguments: * mib MIB record. * isget MIBGET/MIBSET flag. * wlandev wlan device structure. * priv "priv" structure. * hw "hw" structure. * msg Message structure. * data Data buffer. * * Returns: * 0 - Success. * ~0 - Error. * ----------------------------------------------------------------*/ static int prism2mib_wepdefaultkey( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data) { int result; p80211pstrd_t *pstr = (p80211pstrd_t*) data; UINT8 bytebuf[MIB_TMP_MAXLEN]; UINT16 len; DBFENTER; if (isget) { result = 0; /* Should never happen. */ } else { len = (pstr->len > 5) ? HFA384x_RID_CNFWEP128DEFAULTKEY_LEN : HFA384x_RID_CNFWEPDEFAULTKEY_LEN; memset(bytebuf, 0, len); prism2mgmt_pstr2bytearea(bytebuf, pstr); result = hfa384x_drvr_setconfig(hw, mib->parm1, bytebuf, len); } DBFEXIT; return(result); } /*---------------------------------------------------------------- * prism2mib_powermanagement * * Get/set 802.11 power management value. Note that this is defined differently * by 802.11 and Prism2: * * Meaning 802.11 Prism2 * active 1 false * powersave 2 true * * MIB record parameters: * parm1 Prism2 RID value. * parm2 Not used. * parm3 Not used. * * Arguments: * mib MIB record. * isget MIBGET/MIBSET flag. * wlandev wlan device structure. * priv "priv" structure. * hw "hw" structure. * msg Message structure. * data Data buffer. * * Returns: * 0 - Success. * ~0 - Error. * ----------------------------------------------------------------*/ static int prism2mib_powermanagement( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data) { int result; UINT32 *uint32 = (UINT32*) data; UINT32 value; DBFENTER; if (isget) { result = prism2mib_uint32(mib, isget, wlandev, hw, msg, &value); *uint32 = (value == 0) ? 1 : 2; } else { value = ((*uint32) == 1) ? 0 : 1; result = prism2mib_uint32(mib, isget, wlandev, hw, msg, &value); } DBFEXIT; return(result); } /*---------------------------------------------------------------- * prism2mib_preamble * * Get/set Prism2 short preamble * * MIB record parameters: * parm1 Prism2 RID value. * parm2 Not used. * parm3 Not used. * * Arguments: * mib MIB record. * isget MIBGET/MIBSET flag. * wlandev wlan device structure. * priv "priv" structure. * hw "hw" structure. * msg Message structure. * data Data buffer. * * Returns: * 0 - Success. * ~0 - Error. * ----------------------------------------------------------------*/ static int prism2mib_preamble( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data) { int result; UINT32 *uint32 = (UINT32*) data; UINT8 bytebuf[MIB_TMP_MAXLEN]; UINT16 *wordbuf = (UINT16*) bytebuf; DBFENTER; if (isget) { result = hfa384x_drvr_getconfig16(hw, mib->parm1, wordbuf); *uint32 = *wordbuf; } else { *wordbuf = *uint32; result = hfa384x_drvr_setconfig16(hw, mib->parm1, *wordbuf); } DBFEXIT; return(result); } /*---------------------------------------------------------------- * prism2mib_privacyinvoked * * Get/set the dot11PrivacyInvoked value. * * MIB record parameters: * parm1 Prism2 RID value. * parm2 Bit value for PrivacyInvoked flag. * parm3 Not used. * * Arguments: * mib MIB record. * isget MIBGET/MIBSET flag. * wlandev wlan device structure. * priv "priv" structure. * hw "hw" structure. * msg Message structure. * data Data buffer. * * Returns: * 0 - Success. * ~0 - Error. * ----------------------------------------------------------------*/ static int prism2mib_privacyinvoked( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data) { int result; DBFENTER; if (wlandev->hostwep & HOSTWEP_DECRYPT) { if (wlandev->hostwep & HOSTWEP_DECRYPT) mib->parm2 |= HFA384x_WEPFLAGS_DISABLE_RXCRYPT; if (wlandev->hostwep & HOSTWEP_ENCRYPT) mib->parm2 |= HFA384x_WEPFLAGS_DISABLE_TXCRYPT; } result = prism2mib_flag(mib, isget, wlandev, hw, msg, data); DBFEXIT; return(result); } /*---------------------------------------------------------------- * prism2mib_excludeunencrypted * * Get/set the dot11ExcludeUnencrypted value. * * MIB record parameters: * parm1 Prism2 RID value. * parm2 Bit value for ExcludeUnencrypted flag. * parm3 Not used. * * Arguments: * mib MIB record. * isget MIBGET/MIBSET flag. * wlandev wlan device structure. * priv "priv" structure. * hw "hw" structure. * msg Message structure. * data Data buffer. * * Returns: * 0 - Success. * ~0 - Error. * ----------------------------------------------------------------*/ static int prism2mib_excludeunencrypted( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data) { int result; DBFENTER; result = prism2mib_flag(mib, isget, wlandev, hw, msg, data); DBFEXIT; return(result); } /*---------------------------------------------------------------- * prism2mib_fragmentationthreshold * * Get/set the fragmentation threshold. * * MIB record parameters: * parm1 Prism2 RID value. * parm2 Not used. * parm3 Not used. * * Arguments: * mib MIB record. * isget MIBGET/MIBSET flag. * wlandev wlan device structure. * priv "priv" structure. * hw "hw" structure. * msg Message structure. * data Data buffer. * * Returns: * 0 - Success. * ~0 - Error. * ----------------------------------------------------------------*/ static int prism2mib_fragmentationthreshold( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data) { int result; UINT32 *uint32 = (UINT32*) data; DBFENTER; if (!isget) if ((*uint32) % 2) { WLAN_LOG_WARNING("Attempt to set odd number " "FragmentationThreshold\n"); msg->resultcode.data = P80211ENUM_resultcode_not_supported; return(0); } result = prism2mib_uint32(mib, isget, wlandev, hw, msg, data); DBFEXIT; return(result); } /*---------------------------------------------------------------- * prism2mib_operationalrateset * * Get/set the operational rate set. * * MIB record parameters: * parm1 Prism2 RID value. * parm2 Not used. * parm3 Not used. * * Arguments: * mib MIB record. * isget MIBGET/MIBSET flag. * wlandev wlan device structure. * priv "priv" structure. * hw "hw" structure. * msg Message structure. * data Data buffer. * * Returns: * 0 - Success. * ~0 - Error. * ----------------------------------------------------------------*/ static int prism2mib_operationalrateset( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data) { int result; p80211pstrd_t *pstr = (p80211pstrd_t *) data; UINT8 bytebuf[MIB_TMP_MAXLEN]; UINT16 *wordbuf = (UINT16*) bytebuf; DBFENTER; if (isget) { result = hfa384x_drvr_getconfig16(hw, mib->parm1, wordbuf); prism2mgmt_get_oprateset(wordbuf, pstr); } else { prism2mgmt_set_oprateset(wordbuf, pstr); result = hfa384x_drvr_setconfig16(hw, mib->parm1, *wordbuf); result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFSUPPRATES, *wordbuf); } DBFEXIT; return(result); } /*---------------------------------------------------------------- * prism2mib_groupaddress * * Get/set the dot11GroupAddressesTable. * * MIB record parameters: * parm1 Not used. * parm2 Not used. * parm3 Not used. * * Arguments: * mib MIB record. * isget MIBGET/MIBSET flag. * wlandev wlan device structure. * priv "priv" structure. * hw "hw" structure. * msg Message structure. * data Data buffer. * * Returns: * 0 - Success. * ~0 - Error. * ----------------------------------------------------------------*/ static int prism2mib_groupaddress( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data) { int result; p80211pstrd_t *pstr = (p80211pstrd_t *) data; UINT8 bytebuf[MIB_TMP_MAXLEN]; UINT16 len; DBFENTER; /* TODO: fix this. f/w doesn't support mcast filters */ if (isget) { prism2mgmt_get_grpaddr(mib->did, pstr, hw); return(0); } result = prism2mgmt_set_grpaddr(mib->did, bytebuf, pstr, hw); if (result != 0) { msg->resultcode.data = P80211ENUM_resultcode_not_supported; return(result); } if (hw->dot11_grpcnt <= MAX_PRISM2_GRP_ADDR) { len = hw->dot11_grpcnt * WLAN_ADDR_LEN; memcpy(bytebuf, hw->dot11_grp_addr[0], len); result = hfa384x_drvr_setconfig(hw, HFA384x_RID_GROUPADDR, bytebuf, len); /* ** Turn off promiscuous mode if count is equal to MAX. We may ** have been at a higher count in promiscuous mode and need to ** turn it off. */ /* but only if we're not already in promisc mode. :) */ if ((hw->dot11_grpcnt == MAX_PRISM2_GRP_ADDR) && !( wlandev->netdev->flags & IFF_PROMISC)) { result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_PROMISCMODE, 0); } } else { /* ** Clear group addresses in card and set to promiscuous mode. */ memset(bytebuf, 0, sizeof(bytebuf)); result = hfa384x_drvr_setconfig(hw, HFA384x_RID_GROUPADDR, bytebuf, 0); if (result == 0) { result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_PROMISCMODE, 1); } } DBFEXIT; return(result); } /*---------------------------------------------------------------- * prism2mib_fwid * * Get the firmware ID. * * MIB record parameters: * parm1 Not used. * parm2 Not used. * parm3 Not used. * * Arguments: * mib MIB record. * isget MIBGET/MIBSET flag. * wlandev wlan device structure. * priv "priv" structure. * hw "hw" structure. * msg Message structure. * data Data buffer. * * Returns: * 0 - Success. * ~0 - Error. * ----------------------------------------------------------------*/ static int prism2mib_fwid( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data) { int result; p80211pstrd_t *pstr = (p80211pstrd_t *) data; hfa384x_FWID_t fwid; DBFENTER; if (isget) { result = hfa384x_drvr_getconfig(hw, HFA384x_RID_FWID, &fwid, HFA384x_RID_FWID_LEN); if (mib->did == DIDmib_p2_p2NIC_p2PrimaryFWID) { fwid.primary[HFA384x_FWID_LEN - 1] = '\0'; pstr->len = strlen(fwid.primary); memcpy(pstr->data, fwid.primary, pstr->len); } else { fwid.secondary[HFA384x_FWID_LEN - 1] = '\0'; pstr->len = strlen(fwid.secondary); memcpy(pstr->data, fwid.secondary, pstr->len); } } else result = 0; /* Should never happen. */ DBFEXIT; return(result); } /*---------------------------------------------------------------- * prism2mib_authalg * * Get values from the AuhtenticationAlgorithmsTable. * * MIB record parameters: * parm1 Table index (1-6). * parm2 Not used. * parm3 Not used. * * Arguments: * mib MIB record. * isget MIBGET/MIBSET flag. * wlandev wlan device structure. * priv "priv" structure. * hw "hw" structure. * msg Message structure. * data Data buffer. * * Returns: * 0 - Success. * ~0 - Error. * ----------------------------------------------------------------*/ static int prism2mib_authalg( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data) { UINT32 *uint32 = (UINT32*) data; DBFENTER; /* MSM: pkx supplied code that code queries RID FD4D....but the f/w's * results are bogus. Therefore, we have to simulate the appropriate * results here in the driver based on our knowledge of existing MAC * features. That's the whole point behind this ugly function. */ if (isget) { msg->resultcode.data = P80211ENUM_resultcode_success; switch (mib->parm1) { case 1: /* Open System */ *uint32 = P80211ENUM_authalg_opensystem; break; case 2: /* SharedKey */ *uint32 = P80211ENUM_authalg_sharedkey; break; default: *uint32 = 0; msg->resultcode.data = P80211ENUM_resultcode_not_supported; break; } } DBFEXIT; return(0); } /*---------------------------------------------------------------- * prism2mib_authalgenable * * Get/set the enable values from the AuhtenticationAlgorithmsTable. * * MIB record parameters: * parm1 Table index (1-6). * parm2 Not used. * parm3 Not used. * * Arguments: * mib MIB record. * isget MIBGET/MIBSET flag. * wlandev wlan device structure. * priv "priv" structure. * hw "hw" structure. * msg Message structure. * data Data buffer. * * Returns: * 0 - Success. * ~0 - Error. * ----------------------------------------------------------------*/ static int prism2mib_authalgenable( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data) { int result; UINT32 *uint32 = (UINT32*) data; int index; UINT16 cnf_auth; UINT16 mask; DBFENTER; index = mib->parm1 - 1; result = hfa384x_drvr_getconfig16( hw, HFA384x_RID_CNFAUTHENTICATION, &cnf_auth); WLAN_LOG_DEBUG(2,"cnfAuthentication0=%d, index=%d\n", cnf_auth, index); if (isget) { if ( index == 0 || index == 1 ) { *uint32 = (cnf_auth & (1<resultcode.data = P80211ENUM_resultcode_not_supported; } } else { if ( index == 0 || index == 1 ) { mask = 1 << index; if (*uint32==P80211ENUM_truth_true ) { cnf_auth |= mask; } else { cnf_auth &= ~mask; } result = hfa384x_drvr_setconfig16( hw, HFA384x_RID_CNFAUTHENTICATION, cnf_auth); WLAN_LOG_DEBUG(2,"cnfAuthentication:=%d\n", cnf_auth); if ( result ) { WLAN_LOG_DEBUG(1,"Unable to set p2cnfAuthentication to %d\n", cnf_auth); msg->resultcode.data = P80211ENUM_resultcode_implementation_failure; } } else { msg->resultcode.data = P80211ENUM_resultcode_not_supported; } } DBFEXIT; return(result); } /*---------------------------------------------------------------- * prism2mib_priv * * Get/set values in the "priv" data structure. * * MIB record parameters: * parm1 Not used. * parm2 Not used. * parm3 Not used. * * Arguments: * mib MIB record. * isget MIBGET/MIBSET flag. * wlandev wlan device structure. * priv "priv" structure. * hw "hw" structure. * msg Message structure. * data Data buffer. * * Returns: * 0 - Success. * ~0 - Error. * ----------------------------------------------------------------*/ static int prism2mib_priv( mibrec_t *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data) { UINT32 *uint32 = (UINT32*) data; p80211pstrd_t *pstr = (p80211pstrd_t*) data; p80211macarray_t *macarray = (p80211macarray_t *) data; int i, cnt, result, done; DBFENTER; switch (mib->did) { case DIDmib_p2_p2Table_p2ReceivedFrameStatistics: /* ** Note: The values in this record are changed by the ** interrupt handler and therefore cannot be guaranteed ** to be stable while they are being copied. However, ** the interrupt handler will take priority over this ** code. Hence, if the same values are copied twice, ** then we are ensured that the values have not been ** changed. If they have, then just try again. Don't ** try more than 10 times...if we still haven't got it, ** then the values we do have are probably good enough. ** This scheme for copying values is used in order to ** prevent having to block the interrupt handler while ** we copy the values. */ if (isget) { UINT8 test[sizeof(wlandev->rx)]; for (i = 0; i < 10; i++) { memcpy(data, &wlandev->rx, sizeof(wlandev->rx)); memcpy(test, &wlandev->rx, sizeof(wlandev->rx)); if (memcmp(data, test, sizeof(wlandev->rx)) == 0) break; } } break; case DIDmib_p2_p2Table_p2CommunicationTallies: /* ** Note: The values in this record are changed by the ** interrupt handler and therefore cannot be guaranteed ** to be stable while they are being copied. See the ** note above about copying values. */ if (isget) { UINT8 test[sizeof(hw->tallies)]; result = hfa384x_drvr_commtallies(hw); /* ?????? We need to wait a bit here for the */ /* tallies to get updated. ?????? */ /* MSM: TODO: The right way to do this is to * add a "commtallie" wait queue to the * priv structure that gets run every time * we receive a commtally info frame. * This process would sleep on that * queue and get awakened when the * the requested info frame arrives. * Don't have time to do and test this * right now. */ /* Ugh, this is nasty. */ for (i = 0; i < 10; i++) { memcpy(data, &hw->tallies, sizeof(hw->tallies)); memcpy(test, &hw->tallies, sizeof(hw->tallies)); if ( memcmp(data, test, sizeof(hw->tallies)) == 0) break; } } break; case DIDmib_p2_p2Table_p2Authenticated: if (isget) { prism2sta_authlist_t old; prism2mib_priv_authlist(hw, &old); macarray->cnt = 0; for (i = 0; i < old.cnt; i++) { if (!old.assoc[i]) { memcpy(macarray->data[macarray->cnt], old.addr[i], WLAN_ADDR_LEN); macarray->cnt++; } } } break; case DIDmib_p2_p2Table_p2Associated: if (isget) { prism2sta_authlist_t old; prism2mib_priv_authlist(hw, &old); macarray->cnt = 0; for (i = 0; i < old.cnt; i++) { if (old.assoc[i]) { memcpy(macarray->data[macarray->cnt], old.addr[i], WLAN_ADDR_LEN); macarray->cnt++; } } } break; case DIDmib_p2_p2Table_p2PowerSaveUserCount: if (isget) *uint32 = hw->psusercount; break; case DIDmib_p2_p2Table_p2Comment: if (isget) { pstr->len = strlen(hw->comment); memcpy(pstr->data, hw->comment, pstr->len); } else { cnt = pstr->len; if (cnt < 0) cnt = 0; if (cnt >= sizeof(hw->comment)) cnt = sizeof(hw->comment)-1; memcpy(hw->comment, pstr->data, cnt); pstr->data[cnt] = '\0'; } break; case DIDmib_p2_p2Table_p2AccessMode: if (isget) *uint32 = hw->accessmode; else prism2mib_priv_accessmode(hw, *uint32); break; case DIDmib_p2_p2Table_p2AccessAllow: if (isget) { macarray->cnt = hw->allow.cnt; memcpy(macarray->data, hw->allow.addr, macarray->cnt*WLAN_ADDR_LEN); } else { prism2mib_priv_accessallow(hw, macarray); } break; case DIDmib_p2_p2Table_p2AccessDeny: if (isget) { macarray->cnt = hw->deny.cnt; memcpy(macarray->data, hw->deny.addr, macarray->cnt*WLAN_ADDR_LEN); } else { prism2mib_priv_accessdeny(hw, macarray); } break; case DIDmib_p2_p2Table_p2ChannelInfoResults: if (isget) { done = atomic_read(&hw->channel_info.done); if (done == 0) { msg->resultcode.status = P80211ENUM_msgitem_status_no_value; break; } if (done == 1) { msg->resultcode.status = P80211ENUM_msgitem_status_incomplete_itemdata; break; } for (i = 0; i < 14; i++, uint32 += 5) { uint32[0] = i+1; uint32[1] = hw->channel_info.results.result[i].anl; uint32[2] = hw->channel_info.results.result[i].pnl; uint32[3] = (hw->channel_info.results.result[i].active & HFA384x_CHINFORESULT_BSSACTIVE) ? 1 : 0; uint32[4] = (hw->channel_info.results.result[i].active & HFA384x_CHINFORESULT_PCFACTIVE) ? 1 : 0; } } break; case DIDmib_dot11smt_dot11StationConfigTable_dot11DesiredBSSType: if (isget) *uint32 = hw->dot11_desired_bss_type; else hw->dot11_desired_bss_type = *uint32; break; case DIDmib_lnx_lnxConfigTable_lnxRSNAIE: { hfa384x_WPAData_t wpa; if (isget) { hfa384x_drvr_getconfig( hw, HFA384x_RID_CNFWPADATA, (UINT8 *) &wpa, sizeof(wpa)); pstr->len = hfa384x2host_16(wpa.datalen); memcpy(pstr->data, wpa.data, pstr->len); } else { wpa.datalen = host2hfa384x_16(pstr->len); memcpy(wpa.data, pstr->data, pstr->len); result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFWPADATA, (UINT8 *) &wpa, sizeof(wpa)); } break; } default: WLAN_LOG_ERROR("Unhandled DID 0x%08x\n", mib->did); } DBFEXIT; return(0); } /*---------------------------------------------------------------- * prism2mib_priv_authlist * * Get a copy of the list of authenticated stations. * * Arguments: * priv "priv" structure. * list List of authenticated stations. * * Returns: * Nothing * ----------------------------------------------------------------*/ static void prism2mib_priv_authlist( hfa384x_t *hw, prism2sta_authlist_t *list) { prism2sta_authlist_t test; int i; DBFENTER; /* ** Note: The values in this record are changed by the interrupt ** handler and therefore cannot be guaranteed to be stable while ** they are being copied. However, the interrupt handler will ** take priority over this code. Hence, if the same values are ** copied twice, then we are ensured that the values have not ** been changed. If they have, then just try again. Don't try ** more than 10 times...the list of authenticated stations is ** unlikely to be changing frequently enough that we can't get ** a snapshot in 10 tries. Don't try more than this so that we ** don't risk locking-up for long periods of time. If we still ** haven't got the snapshot, then generate an error message and ** return an empty list (since this is the only valid list that ** we can guarentee). This scheme for copying values is used in ** order to prevent having to block the interrupt handler while ** we copy the values. */ for (i = 0; i < 10; i++) { memcpy(list, &hw->authlist, sizeof(prism2sta_authlist_t)); memcpy(&test, &hw->authlist, sizeof(prism2sta_authlist_t)); if (memcmp(list, &test, sizeof(prism2sta_authlist_t)) == 0) break; } if (i >= 10) { list->cnt = 0; WLAN_LOG_ERROR("Could not obtain snapshot of authenticated stations.\n"); } DBFEXIT; return; } /*---------------------------------------------------------------- * prism2mib_priv_accessmode * * Set the Access Mode. * * Arguments: * priv "priv" structure. * hw "hw" structure. * mode New access mode. * * Returns: * Nothing * ----------------------------------------------------------------*/ static void prism2mib_priv_accessmode( hfa384x_t *hw, UINT32 mode) { prism2sta_authlist_t old; int i, j, deauth; UINT8 *addr; DBFENTER; /* ** If the mode is not changing or it is changing to "All", then it's ** okay to go ahead without a lot of messing around. Otherwise, the ** access mode is changing in a way that may leave some stations ** authenticated which should not be authenticated. It will be ** necessary to de-authenticate these stations. */ if (mode == WLAN_ACCESS_ALL || mode == hw->accessmode) { hw->accessmode = mode; return; } /* ** Switch to the new access mode. Once this is done, then the interrupt ** handler (which uses this value) will be prevented from authenticating ** ADDITIONAL stations which should not be authenticated. Then get a ** copy of the current list of authenticated stations. */ hw->accessmode = mode; prism2mib_priv_authlist(hw, &old); /* ** Now go through the list of previously authenticated stations (some ** of which might de-authenticate themselves while we are processing it ** but that is okay). Any station which no longer matches the access ** mode, must be de-authenticated. */ for (i = 0; i < old.cnt; i++) { addr = old.addr[i]; if (mode == WLAN_ACCESS_NONE) deauth = 1; else { if (mode == WLAN_ACCESS_ALLOW) { for (j = 0; j < hw->allow.cnt; j++) if (memcmp(addr, hw->allow.addr[j], WLAN_ADDR_LEN) == 0) break; deauth = (j >= hw->allow.cnt); } else { for (j = 0; j < hw->deny.cnt; j++) if (memcmp(addr, hw->deny.addr[j], WLAN_ADDR_LEN) == 0) break; deauth = (j < hw->deny.cnt); } } if (deauth) prism2mib_priv_deauthenticate(hw, addr); } DBFEXIT; return; } /*---------------------------------------------------------------- * prism2mib_priv_accessallow * * Change the list of allowed MAC addresses. * * Arguments: * priv "priv" structure. * hw "hw" structure. * macarray New array of MAC addresses. * * Returns: * Nothing * ----------------------------------------------------------------*/ static void prism2mib_priv_accessallow( hfa384x_t *hw, p80211macarray_t *macarray) { prism2sta_authlist_t old; int i, j; DBFENTER; /* ** Change the access list. Note that the interrupt handler may be in ** the middle of using the access list!!! Since the interrupt handler ** will always have priority over this process and this is the only ** process that will modify the list, this problem can be handled as ** follows: ** ** 1. Set the "modify" flag. ** 2. Change the first copy of the list. ** 3. Clear the "modify" flag. ** 4. Change the backup copy of the list. ** ** The interrupt handler will check the "modify" flag. If NOT set, then ** the first copy of the list is valid and may be used. Otherwise, the ** first copy is being changed but the backup copy is valid and may be ** used. Doing things this way prevents having to have the interrupt ** handler block while the list is being updated. */ hw->allow.modify = 1; hw->allow.cnt = macarray->cnt; memcpy(hw->allow.addr, macarray->data, macarray->cnt*WLAN_ADDR_LEN); hw->allow.modify = 0; hw->allow.cnt1 = macarray->cnt; memcpy(hw->allow.addr1, macarray->data, macarray->cnt*WLAN_ADDR_LEN); /* ** If the current access mode is "Allow", then changing the access ** list may leave some stations authenticated which should not be ** authenticated. It will be necessary to de-authenticate these ** stations. Otherwise, the list can be changed without a lot of fuss. */ if (hw->accessmode == WLAN_ACCESS_ALLOW) { /* ** Go through the list of authenticated stations (some of ** which might de-authenticate themselves while we are ** processing it but that is okay). Any station which is ** no longer in the list of allowed stations, must be ** de-authenticated. */ prism2mib_priv_authlist(hw, &old); for (i = 0; i < old.cnt; i++) { for (j = 0; j < hw->allow.cnt; j++) if (memcmp(old.addr[i], hw->allow.addr[j], WLAN_ADDR_LEN) == 0) break; if (j >= hw->allow.cnt) prism2mib_priv_deauthenticate(hw, old.addr[i]); } } DBFEXIT; return; } /*---------------------------------------------------------------- * prism2mib_priv_accessdeny * * Change the list of denied MAC addresses. * * Arguments: * priv "priv" structure. * hw "hw" structure. * macarray New array of MAC addresses. * * Returns: * Nothing * ----------------------------------------------------------------*/ static void prism2mib_priv_accessdeny( hfa384x_t *hw, p80211macarray_t *macarray) { prism2sta_authlist_t old; int i, j; DBFENTER; /* ** Change the access list. Note that the interrupt handler may be in ** the middle of using the access list!!! Since the interrupt handler ** will always have priority over this process and this is the only ** process that will modify the list, this problem can be handled as ** follows: ** ** 1. Set the "modify" flag. ** 2. Change the first copy of the list. ** 3. Clear the "modify" flag. ** 4. Change the backup copy of the list. ** ** The interrupt handler will check the "modify" flag. If NOT set, then ** the first copy of the list is valid and may be used. Otherwise, the ** first copy is being changed but the backup copy is valid and may be ** used. Doing things this way prevents having to have the interrupt ** handler block while the list is being updated. */ hw->deny.modify = 1; hw->deny.cnt = macarray->cnt; memcpy(hw->deny.addr, macarray->data, macarray->cnt*WLAN_ADDR_LEN); hw->deny.modify = 0; hw->deny.cnt1 = macarray->cnt; memcpy(hw->deny.addr1, macarray->data, macarray->cnt*WLAN_ADDR_LEN); /* ** If the current access mode is "Deny", then changing the access ** list may leave some stations authenticated which should not be ** authenticated. It will be necessary to de-authenticate these ** stations. Otherwise, the list can be changed without a lot of fuss. */ if (hw->accessmode == WLAN_ACCESS_DENY) { /* ** Go through the list of authenticated stations (some of ** which might de-authenticate themselves while we are ** processing it but that is okay). Any station which is ** now in the list of denied stations, must be de-authenticated. */ prism2mib_priv_authlist(hw, &old); for (i = 0; i < old.cnt; i++) for (j = 0; j < hw->deny.cnt; j++) if (memcmp(old.addr[i], hw->deny.addr[j], WLAN_ADDR_LEN) == 0) { prism2mib_priv_deauthenticate(hw, old.addr[i]); break; } } DBFEXIT; return; } /*---------------------------------------------------------------- * prism2mib_priv_deauthenticate * * De-authenticate a station. This is done by sending a HandoverAddress * information frame to the firmware. This should work, according to * Intersil. * * Arguments: * priv "priv" structure. * hw "hw" structure. * addr MAC address of station to be de-authenticated. * * Returns: * Nothing * ----------------------------------------------------------------*/ static void prism2mib_priv_deauthenticate( hfa384x_t *hw, UINT8 *addr) { DBFENTER; hfa384x_drvr_handover(hw, addr); DBFEXIT; return; } /*---------------------------------------------------------------- * prism2mgmt_pstr2bytestr * * Convert the pstr data in the WLAN message structure into an hfa384x * byte string format. * * Arguments: * bytestr hfa384x byte string data type * pstr wlan message data * * Returns: * Nothing * ----------------------------------------------------------------*/ void prism2mgmt_pstr2bytestr(hfa384x_bytestr_t *bytestr, p80211pstrd_t *pstr) { DBFENTER; bytestr->len = host2hfa384x_16((UINT16)(pstr->len)); memcpy(bytestr->data, pstr->data, pstr->len); DBFEXIT; } /*---------------------------------------------------------------- * prism2mgmt_pstr2bytearea * * Convert the pstr data in the WLAN message structure into an hfa384x * byte area format. * * Arguments: * bytearea hfa384x byte area data type * pstr wlan message data * * Returns: * Nothing * ----------------------------------------------------------------*/ void prism2mgmt_pstr2bytearea(UINT8 *bytearea, p80211pstrd_t *pstr) { DBFENTER; memcpy(bytearea, pstr->data, pstr->len); DBFEXIT; } /*---------------------------------------------------------------- * prism2mgmt_bytestr2pstr * * Convert the data in an hfa384x byte string format into a * pstr in the WLAN message. * * Arguments: * bytestr hfa384x byte string data type * msg wlan message * * Returns: * Nothing * ----------------------------------------------------------------*/ void prism2mgmt_bytestr2pstr(hfa384x_bytestr_t *bytestr, p80211pstrd_t *pstr) { DBFENTER; pstr->len = (UINT8)(hfa384x2host_16((UINT16)(bytestr->len))); memcpy(pstr->data, bytestr->data, pstr->len); DBFEXIT; } /*---------------------------------------------------------------- * prism2mgmt_bytearea2pstr * * Convert the data in an hfa384x byte area format into a pstr * in the WLAN message. * * Arguments: * bytearea hfa384x byte area data type * msg wlan message * * Returns: * Nothing * ----------------------------------------------------------------*/ void prism2mgmt_bytearea2pstr(UINT8 *bytearea, p80211pstrd_t *pstr, int len) { DBFENTER; pstr->len = (UINT8)len; memcpy(pstr->data, bytearea, len); DBFEXIT; } /*---------------------------------------------------------------- * prism2mgmt_prism2int2p80211int * * Convert an hfa384x integer into a wlan integer * * Arguments: * prism2enum pointer to hfa384x integer * wlanenum pointer to p80211 integer * * Returns: * Nothing * ----------------------------------------------------------------*/ void prism2mgmt_prism2int2p80211int(UINT16 *prism2int, UINT32 *wlanint) { DBFENTER; *wlanint = (UINT32)hfa384x2host_16(*prism2int); DBFEXIT; } /*---------------------------------------------------------------- * prism2mgmt_p80211int2prism2int * * Convert a wlan integer into an hfa384x integer * * Arguments: * prism2enum pointer to hfa384x integer * wlanenum pointer to p80211 integer * * Returns: * Nothing * ----------------------------------------------------------------*/ void prism2mgmt_p80211int2prism2int(UINT16 *prism2int, UINT32 *wlanint) { DBFENTER; *prism2int = host2hfa384x_16((UINT16)(*wlanint)); DBFEXIT; } /*---------------------------------------------------------------- * prism2mgmt_prism2enum2p80211enum * * Convert the hfa384x enumerated int into a p80211 enumerated int * * Arguments: * prism2enum pointer to hfa384x integer * wlanenum pointer to p80211 integer * rid hfa384x record id * * Returns: * Nothing * ----------------------------------------------------------------*/ void prism2mgmt_prism2enum2p80211enum(UINT16 *prism2enum, UINT32 *wlanenum, UINT16 rid) { DBFENTER; /* At the moment, the need for this functionality hasn't presented itself. All the wlan enumerated values are a 1-to-1 match against the Prism2 enumerated values*/ DBFEXIT; return; } /*---------------------------------------------------------------- * prism2mgmt_p80211enum2prism2enum * * Convert the p80211 enumerated int into an hfa384x enumerated int * * Arguments: * prism2enum pointer to hfa384x integer * wlanenum pointer to p80211 integer * rid hfa384x record id * * Returns: * Nothing * ----------------------------------------------------------------*/ void prism2mgmt_p80211enum2prism2enum(UINT16 *prism2enum, UINT32 *wlanenum, UINT16 rid) { DBFENTER; /* At the moment, the need for this functionality hasn't presented itself. All the wlan enumerated values are a 1-to-1 match against the Prism2 enumerated values*/ DBFEXIT; return; } /*---------------------------------------------------------------- * prism2mgmt_get_oprateset * * Convert the hfa384x bit area into a wlan octet string. * * Arguments: * rate Prism2 bit area * pstr wlan octet string * * Returns: * Nothing * ----------------------------------------------------------------*/ void prism2mgmt_get_oprateset(UINT16 *rate, p80211pstrd_t *pstr) { UINT8 len; UINT8 *datarate; DBFENTER; len = 0; datarate = pstr->data; /* 1 Mbps */ if ( BIT0 & (*rate) ) { len += (UINT8)1; *datarate = (UINT8)2; datarate++; } /* 2 Mbps */ if ( BIT1 & (*rate) ) { len += (UINT8)1; *datarate = (UINT8)4; datarate++; } /* 5.5 Mbps */ if ( BIT2 & (*rate) ) { len += (UINT8)1; *datarate = (UINT8)11; datarate++; } /* 11 Mbps */ if ( BIT3 & (*rate) ) { len += (UINT8)1; *datarate = (UINT8)22; datarate++; } pstr->len = len; DBFEXIT; return; } /*---------------------------------------------------------------- * prism2mgmt_set_oprateset * * Convert the wlan octet string into an hfa384x bit area. * * Arguments: * rate Prism2 bit area * pstr wlan octet string * * Returns: * Nothing * ----------------------------------------------------------------*/ void prism2mgmt_set_oprateset(UINT16 *rate, p80211pstrd_t *pstr) { UINT8 *datarate; int i; DBFENTER; *rate = 0; datarate = pstr->data; for ( i=0; i < pstr->len; i++, datarate++ ) { switch (*datarate) { case 2: /* 1 Mbps */ *rate |= BIT0; break; case 4: /* 2 Mbps */ *rate |= BIT1; break; case 11: /* 5.5 Mbps */ *rate |= BIT2; break; case 22: /* 11 Mbps */ *rate |= BIT3; break; default: WLAN_LOG_DEBUG(1, "Unrecoginzed Rate of %d\n", *datarate); break; } } DBFEXIT; return; } /*---------------------------------------------------------------- * prism2mgmt_get_grpaddr * * Retrieves a particular group address from the list of * group addresses. * * Arguments: * did mibitem did * pstr wlan octet string * priv prism2 driver private data structure * * Returns: * Nothing * ----------------------------------------------------------------*/ void prism2mgmt_get_grpaddr(UINT32 did, p80211pstrd_t *pstr, hfa384x_t *hw ) { int index; DBFENTER; index = prism2mgmt_get_grpaddr_index(did); if ( index >= 0 ) { pstr->len = WLAN_ADDR_LEN; memcpy(pstr->data, hw->dot11_grp_addr[index], WLAN_ADDR_LEN); } DBFEXIT; return; } /*---------------------------------------------------------------- * prism2mgmt_set_grpaddr * * Convert the wlan octet string into an hfa384x bit area. * * Arguments: * did mibitem did * buf * groups * * Returns: * 0 Success * !0 Error * ----------------------------------------------------------------*/ int prism2mgmt_set_grpaddr(UINT32 did, UINT8 *prism2buf, p80211pstrd_t *pstr, hfa384x_t *hw ) { UINT8 no_addr[WLAN_ADDR_LEN]; int index; DBFENTER; memset(no_addr, 0, WLAN_ADDR_LEN); if (memcmp(no_addr, pstr->data, WLAN_ADDR_LEN) != 0) { /* ** The address is NOT 0 so we are "adding" an address to the ** group address list. Check to make sure we aren't trying ** to add more than the maximum allowed number of group ** addresses in the list. The new address is added to the ** end of the list regardless of the DID used to add the ** address. */ if (hw->dot11_grpcnt >= MAX_GRP_ADDR) return(-1); memcpy(hw->dot11_grp_addr[hw->dot11_grpcnt], pstr->data, WLAN_ADDR_LEN); hw->dot11_grpcnt += 1; } else { /* ** The address is 0. Interpret this as "deleting" an address ** from the group address list. Get the address index from ** the DID. If this is within the range of used addresses, ** then delete the specified address by shifting all following ** addresses down. Then clear the last address (which should ** now be unused). If the address index is NOT within the ** range of used addresses, then just ignore the address. */ index = prism2mgmt_get_grpaddr_index(did); if (index >= 0 && index < hw->dot11_grpcnt) { hw->dot11_grpcnt -= 1; memmove(hw->dot11_grp_addr[index], hw->dot11_grp_addr[index + 1], ((hw->dot11_grpcnt)-index) * WLAN_ADDR_LEN); memset(hw->dot11_grp_addr[hw->dot11_grpcnt], 0, WLAN_ADDR_LEN); } } DBFEXIT; return(0); } /*---------------------------------------------------------------- * prism2mgmt_get_grpaddr_index * * Gets the index in the group address list based on the did. * * Arguments: * did mibitem did * * Returns: * >= 0 If valid did * < 0 If not valid did * ----------------------------------------------------------------*/ int prism2mgmt_get_grpaddr_index( UINT32 did ) { int index; DBFENTER; index = -1; switch (did) { case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address1: index = 0; break; case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address2: index = 1; break; case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address3: index = 2; break; case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address4: index = 3; break; case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address5: index = 4; break; case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address6: index = 5; break; case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address7: index = 6; break; case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address8: index = 7; break; case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address9: index = 8; break; case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address10: index = 9; break; case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address11: index = 10; break; case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address12: index = 11; break; case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address13: index = 12; break; case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address14: index = 13; break; case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address15: index = 14; break; case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address16: index = 15; break; case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address17: index = 16; break; case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address18: index = 17; break; case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address19: index = 18; break; case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address20: index = 19; break; case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address21: index = 20; break; case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address22: index = 21; break; case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address23: index = 22; break; case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address24: index = 23; break; case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address25: index = 24; break; case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address26: index = 25; break; case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address27: index = 26; break; case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address28: index = 27; break; case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address29: index = 28; break; case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address30: index = 29; break; case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address31: index = 30; break; case DIDmib_dot11mac_dot11GroupAddressesTable_dot11Address32: index = 31; break; } DBFEXIT; return index; } linux-wlan-ng-0.2.9+dfsg/src/prism2/driver/prism2mgmt.c0000644000175000017500000024413711024763177022321 0ustar tormodtormod/* src/prism2/driver/prism2mgmt.c * * Management request handler functions. * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- * * The functions in this file handle management requests sent from * user mode. * * Most of these functions have two separate blocks of code that are * conditional on whether this is a station or an AP. This is used * to separate out the STA and AP responses to these management primitives. * It's a choice (good, bad, indifferent?) to have the code in the same * place so it's clear that the same primitive is implemented in both * cases but has different behavior. * * -------------------------------------------------------------------- */ /*================================================================*/ /* System Includes */ #define WLAN_DBVAR prism2_debug #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if (WLAN_HOSTIF == WLAN_USB) #include #endif #if (WLAN_HOSTIF == WLAN_PCMCIA) #include #include #include #include #include #include #endif #include /*================================================================*/ /* Project Includes */ #include #include #include #include #include #include #include #include #include #include /*================================================================*/ /* Local Constants */ /*================================================================*/ /* Local Macros */ /* Converts 802.11 format rate specifications to prism2 */ #define p80211rate_to_p2bit(n) ((((n)&~BIT7) == 2) ? BIT0 : \ (((n)&~BIT7) == 4) ? BIT1 : \ (((n)&~BIT7) == 11) ? BIT2 : \ (((n)&~BIT7) == 22) ? BIT3 : 0) /*================================================================*/ /* Local Types */ /*================================================================*/ /* Local Static Definitions */ /*================================================================*/ /* Local Function Declarations */ /*================================================================*/ /* Function Definitions */ /*---------------------------------------------------------------- * prism2mgmt_powermgmt * * Set the power management state of this station's MAC. * * Arguments: * wlandev wlan device structure * msgp ptr to msg buffer * * Returns: * 0 success and done * <0 success, but we're waiting for something to finish. * >0 an error occurred while handling the message. * Side effects: * * Call context: * process thread (usually) * interrupt ----------------------------------------------------------------*/ int prism2mgmt_powermgmt(wlandevice_t *wlandev, void *msgp) { int result = 0; hfa384x_t *hw = wlandev->priv; p80211msg_dot11req_powermgmt_t *msg = msgp; DBFENTER; if (!hw->ap) { /*** STATION ***/ /* * Set CNFPMENABLED (on or off) * Set CNFMULTICASTRX (if PM on, otherwise clear) * Spout a notice stating that SleepDuration and * HoldoverDuration and PMEPS also have an impact. */ /* Powermgmt is currently unsupported for STA */ msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.data = P80211ENUM_resultcode_not_supported; } else { /*** ACCESS POINT ***/ /* Powermgmt is never supported for AP */ msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.data = P80211ENUM_resultcode_not_supported; } DBFEXIT; return result; } /*---------------------------------------------------------------- * prism2mgmt_scan * * Initiate a scan for BSSs. * * This function corresponds to MLME-scan.request and part of * MLME-scan.confirm. As far as I can tell in the standard, there * are no restrictions on when a scan.request may be issued. We have * to handle in whatever state the driver/MAC happen to be. * * Arguments: * wlandev wlan device structure * msgp ptr to msg buffer * * Returns: * 0 success and done * <0 success, but we're waiting for something to finish. * >0 an error occurred while handling the message. * Side effects: * * Call context: * process thread (usually) * interrupt ----------------------------------------------------------------*/ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp) { int result = 0; hfa384x_t *hw = wlandev->priv; p80211msg_dot11req_scan_t *msg = msgp; UINT16 roamingmode, word; int i, timeout; int istmpenable = 0; hfa384x_HostScanRequest_data_t scanreq; DBFENTER; if (hw->ap) { WLAN_LOG_ERROR("Prism2 in AP mode cannot perform scans.\n"); result = 1; msg->resultcode.data = P80211ENUM_resultcode_not_supported; goto exit; } /* gatekeeper check */ if (HFA384x_FIRMWARE_VERSION(hw->ident_sta_fw.major, hw->ident_sta_fw.minor, hw->ident_sta_fw.variant) < HFA384x_FIRMWARE_VERSION(1,3,2)) { WLAN_LOG_ERROR("HostScan not supported with current firmware (<1.3.2).\n"); result = 1; msg->resultcode.data = P80211ENUM_resultcode_not_supported; goto exit; } memset(&scanreq, 0, sizeof(scanreq)); /* save current roaming mode */ result = hfa384x_drvr_getconfig16(hw, HFA384x_RID_CNFROAMINGMODE, &roamingmode); if ( result ) { WLAN_LOG_ERROR("getconfig(ROAMMODE) failed. result=%d\n", result); msg->resultcode.data = P80211ENUM_resultcode_implementation_failure; goto exit; } /* drop into mode 3 for the scan */ result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFROAMINGMODE, HFA384x_ROAMMODE_HOSTSCAN_HOSTROAM); if ( result ) { WLAN_LOG_ERROR("setconfig(ROAMINGMODE) failed. result=%d\n", result); msg->resultcode.data = P80211ENUM_resultcode_implementation_failure; goto exit; } /* active or passive? */ if (HFA384x_FIRMWARE_VERSION(hw->ident_sta_fw.major, hw->ident_sta_fw.minor, hw->ident_sta_fw.variant) > HFA384x_FIRMWARE_VERSION(1,5,0)) { if (msg->scantype.data != P80211ENUM_scantype_active) { word = host2hfa384x_16(msg->maxchanneltime.data); } else { word = 0; } result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFPASSIVESCANCTRL, word); if ( result ) { WLAN_LOG_WARNING("Passive scan not supported with " "current firmware. (<1.5.1)\n"); } } /* set up the txrate to be 2MBPS. Should be fastest basicrate... */ word = HFA384x_RATEBIT_2; scanreq.txRate = host2hfa384x_16(word); /* set up the channel list */ word = 0; for (i = 0; i < msg->channellist.data.len; i++) { UINT8 channel = msg->channellist.data.data[i]; if (channel > 14) continue; /* channel 1 is BIT0 ... channel 14 is BIT13 */ word |= (1 << (channel-1)); } scanreq.channelList = host2hfa384x_16(word); /* set up the ssid, if present. */ scanreq.ssid.len = host2hfa384x_16(msg->ssid.data.len); memcpy(scanreq.ssid.data, msg->ssid.data.data, msg->ssid.data.len); /* Enable the MAC port if it's not already enabled */ result = hfa384x_drvr_getconfig16(hw, HFA384x_RID_PORTSTATUS, &word); if ( result ) { WLAN_LOG_ERROR("getconfig(PORTSTATUS) failed. " "result=%d\n", result); msg->resultcode.data = P80211ENUM_resultcode_implementation_failure; goto exit; } if (word == HFA384x_PORTSTATUS_DISABLED) { UINT16 wordbuf[17]; result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFROAMINGMODE, HFA384x_ROAMMODE_HOSTSCAN_HOSTROAM); if ( result ) { WLAN_LOG_ERROR("setconfig(ROAMINGMODE) failed. result=%d\n", result); msg->resultcode.data = P80211ENUM_resultcode_implementation_failure; goto exit; } /* Construct a bogus SSID and assign it to OwnSSID and * DesiredSSID */ wordbuf[0] = host2hfa384x_16(WLAN_SSID_MAXLEN); get_random_bytes(&wordbuf[1], WLAN_SSID_MAXLEN); result = hfa384x_drvr_setconfig( hw, HFA384x_RID_CNFOWNSSID, wordbuf, HFA384x_RID_CNFOWNSSID_LEN); if ( result ) { WLAN_LOG_ERROR("Failed to set OwnSSID.\n"); msg->resultcode.data = P80211ENUM_resultcode_implementation_failure; goto exit; } result = hfa384x_drvr_setconfig( hw, HFA384x_RID_CNFDESIREDSSID, wordbuf, HFA384x_RID_CNFDESIREDSSID_LEN); if ( result ) { WLAN_LOG_ERROR("Failed to set DesiredSSID.\n"); msg->resultcode.data = P80211ENUM_resultcode_implementation_failure; goto exit; } /* bsstype */ result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFPORTTYPE, HFA384x_PORTTYPE_IBSS); if ( result ) { WLAN_LOG_ERROR("Failed to set CNFPORTTYPE.\n"); msg->resultcode.data = P80211ENUM_resultcode_implementation_failure; goto exit; } /* ibss options */ result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CREATEIBSS, HFA384x_CREATEIBSS_JOINCREATEIBSS); if ( result ) { WLAN_LOG_ERROR("Failed to set CREATEIBSS.\n"); msg->resultcode.data = P80211ENUM_resultcode_implementation_failure; goto exit; } result = hfa384x_drvr_enable(hw, 0); if ( result ) { WLAN_LOG_ERROR("drvr_enable(0) failed. " "result=%d\n", result); msg->resultcode.data = P80211ENUM_resultcode_implementation_failure; goto exit; } istmpenable = 1; } /* Figure out our timeout first Kus, then HZ */ timeout = msg->channellist.data.len * msg->maxchanneltime.data; timeout = (timeout * HZ)/1000; /* Issue the scan request */ hw->scanflag = 0; WLAN_HEX_DUMP(5,"hscanreq", &scanreq, sizeof(scanreq)); result = hfa384x_drvr_setconfig( hw, HFA384x_RID_HOSTSCAN, &scanreq, sizeof(hfa384x_HostScanRequest_data_t)); if ( result ) { WLAN_LOG_ERROR("setconfig(SCANREQUEST) failed. result=%d\n", result); msg->resultcode.data = P80211ENUM_resultcode_implementation_failure; goto exit; } /* sleep until info frame arrives */ wait_event_interruptible_timeout(hw->cmdq, hw->scanflag, timeout); msg->numbss.status = P80211ENUM_msgitem_status_data_ok; if (hw->scanflag == -1) hw->scanflag = 0; msg->numbss.data = hw->scanflag; hw->scanflag = 0; /* Disable port if we temporarily enabled it. */ if (istmpenable) { result = hfa384x_drvr_disable(hw, 0); if ( result ) { WLAN_LOG_ERROR("drvr_disable(0) failed. " "result=%d\n", result); msg->resultcode.data = P80211ENUM_resultcode_implementation_failure; goto exit; } } /* restore original roaming mode */ result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFROAMINGMODE, roamingmode); if ( result ) { WLAN_LOG_ERROR("setconfig(ROAMMODE) failed. result=%d\n", result); msg->resultcode.data = P80211ENUM_resultcode_implementation_failure; goto exit; } result = 0; msg->resultcode.data = P80211ENUM_resultcode_success; exit: msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; DBFEXIT; return result; } /*---------------------------------------------------------------- * prism2mgmt_scan_results * * Retrieve the BSS description for one of the BSSs identified in * a scan. * * Arguments: * wlandev wlan device structure * msgp ptr to msg buffer * * Returns: * 0 success and done * <0 success, but we're waiting for something to finish. * >0 an error occurred while handling the message. * Side effects: * * Call context: * process thread (usually) * interrupt ----------------------------------------------------------------*/ int prism2mgmt_scan_results(wlandevice_t *wlandev, void *msgp) { int result = 0; p80211msg_dot11req_scan_results_t *req; hfa384x_t *hw = wlandev->priv; hfa384x_HScanResultSub_t *item = NULL; int count; DBFENTER; req = (p80211msg_dot11req_scan_results_t *) msgp; req->resultcode.status = P80211ENUM_msgitem_status_data_ok; if (hw->ap) { result = 1; req->resultcode.data = P80211ENUM_resultcode_not_supported; goto exit; } if (! hw->scanresults) { WLAN_LOG_ERROR("dot11req_scan_results can only be used after a successful dot11req_scan.\n"); result = 2; req->resultcode.data = P80211ENUM_resultcode_invalid_parameters; goto exit; } count = (hw->scanresults->framelen - 3) / 32; if (count > 32) count = 32; if (req->bssindex.data >= count) { WLAN_LOG_DEBUG(0, "requested index (%d) out of range (%d)\n", req->bssindex.data, count); result = 2; req->resultcode.data = P80211ENUM_resultcode_invalid_parameters; goto exit; } item = &(hw->scanresults->info.hscanresult.result[req->bssindex.data]); /* signal and noise */ req->signal.status = P80211ENUM_msgitem_status_data_ok; req->noise.status = P80211ENUM_msgitem_status_data_ok; req->signal.data = hfa384x2host_16(item->sl); req->noise.data = hfa384x2host_16(item->anl); /* BSSID */ req->bssid.status = P80211ENUM_msgitem_status_data_ok; req->bssid.data.len = WLAN_BSSID_LEN; memcpy(req->bssid.data.data, item->bssid, WLAN_BSSID_LEN); /* SSID */ req->ssid.status = P80211ENUM_msgitem_status_data_ok; req->ssid.data.len = hfa384x2host_16(item->ssid.len); memcpy(req->ssid.data.data, item->ssid.data, req->ssid.data.len); /* supported rates */ for (count = 0; count < 10 ; count++) if (item->supprates[count] == 0) break; #define REQBASICRATE(N) \ if ((count >= N) && DOT11_RATE5_ISBASIC_GET(item->supprates[(N)-1])) { \ req->basicrate ## N .data = item->supprates[(N)-1]; \ req->basicrate ## N .status = P80211ENUM_msgitem_status_data_ok; \ } REQBASICRATE(1); REQBASICRATE(2); REQBASICRATE(3); REQBASICRATE(4); REQBASICRATE(5); REQBASICRATE(6); REQBASICRATE(7); REQBASICRATE(8); #define REQSUPPRATE(N) \ if (count >= N) { \ req->supprate ## N .data = item->supprates[(N)-1]; \ req->supprate ## N .status = P80211ENUM_msgitem_status_data_ok; \ } REQSUPPRATE(1); REQSUPPRATE(2); REQSUPPRATE(3); REQSUPPRATE(4); REQSUPPRATE(5); REQSUPPRATE(6); REQSUPPRATE(7); REQSUPPRATE(8); /* beacon period */ req->beaconperiod.status = P80211ENUM_msgitem_status_data_ok; req->beaconperiod.data = hfa384x2host_16(item->bcnint); /* timestamps */ req->timestamp.status = P80211ENUM_msgitem_status_data_ok; req->timestamp.data = jiffies; req->localtime.status = P80211ENUM_msgitem_status_data_ok; req->localtime.data = jiffies; /* atim window */ req->ibssatimwindow.status = P80211ENUM_msgitem_status_data_ok; req->ibssatimwindow.data = hfa384x2host_16(item->atim); /* Channel */ req->dschannel.status = P80211ENUM_msgitem_status_data_ok; req->dschannel.data = hfa384x2host_16(item->chid); /* capinfo bits */ count = hfa384x2host_16(item->capinfo); /* privacy flag */ req->privacy.status = P80211ENUM_msgitem_status_data_ok; req->privacy.data = WLAN_GET_MGMT_CAP_INFO_PRIVACY(count); /* cfpollable */ req->cfpollable.status = P80211ENUM_msgitem_status_data_ok; req->cfpollable.data = WLAN_GET_MGMT_CAP_INFO_CFPOLLABLE(count); /* cfpollreq */ req->cfpollreq.status = P80211ENUM_msgitem_status_data_ok; req->cfpollreq.data = WLAN_GET_MGMT_CAP_INFO_CFPOLLREQ(count); /* bsstype */ req->bsstype.status = P80211ENUM_msgitem_status_data_ok; req->bsstype.data = (WLAN_GET_MGMT_CAP_INFO_ESS(count)) ? P80211ENUM_bsstype_infrastructure : P80211ENUM_bsstype_independent; // item->proberesp_rate /* req->fhdwelltime req->fhhopset req->fhhoppattern req->fhhopindex req->cfpdurremaining */ result = 0; req->resultcode.data = P80211ENUM_resultcode_success; exit: DBFEXIT; return result; } /*---------------------------------------------------------------- * prism2mgmt_join * * Join a BSS whose BSS description was previously obtained with * a scan. * * Arguments: * wlandev wlan device structure * msgp ptr to msg buffer * * Returns: * 0 success and done * <0 success, but we're waiting for something to finish. * >0 an error occurred while handling the message. * Side effects: * * Call context: * process thread (usually) * interrupt ----------------------------------------------------------------*/ int prism2mgmt_join(wlandevice_t *wlandev, void *msgp) { int result = 0; hfa384x_t *hw = wlandev->priv; p80211msg_dot11req_join_t *msg = msgp; DBFENTER; if (!hw->ap) { /*** STATION ***/ /* TODO: Implement after scan */ msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.data = P80211ENUM_resultcode_not_supported; } else { /*** ACCESS POINT ***/ /* Never supported by APs */ msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.data = P80211ENUM_resultcode_not_supported; } DBFEXIT; return result; } /*---------------------------------------------------------------- * prism2mgmt_p2_join * * Join a specific BSS * * Arguments: * wlandev wlan device structure * msgp ptr to msg buffer * * Returns: * 0 success and done * <0 success, but we're waiting for something to finish. * >0 an error occurred while handling the message. * Side effects: * * Call context: * process thread (usually) * interrupt ----------------------------------------------------------------*/ int prism2mgmt_p2_join(wlandevice_t *wlandev, void *msgp) { int result = 0; hfa384x_t *hw = wlandev->priv; p80211msg_p2req_join_t *msg = msgp; UINT16 reg; p80211pstrd_t *pstr; UINT8 bytebuf[256]; hfa384x_bytestr_t *p2bytestr = (hfa384x_bytestr_t*)bytebuf; hfa384x_JoinRequest_data_t joinreq; DBFENTER; if (!hw->ap) { wlandev->macmode = WLAN_MACMODE_NONE; /*** STATION ***/ /* Set the PortType */ msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.data = P80211ENUM_resultcode_success; /* ess port */ result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFPORTTYPE, 1); if ( result ) { WLAN_LOG_ERROR("Failed to set Port Type\n"); goto failed; } /* Set the auth type */ if ( msg->authtype.data == P80211ENUM_authalg_sharedkey ) { reg = HFA384x_CNFAUTHENTICATION_SHAREDKEY; } else { reg = HFA384x_CNFAUTHENTICATION_OPENSYSTEM; } result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFAUTHENTICATION, reg); if ( result ) { WLAN_LOG_ERROR("Failed to set Authentication\n"); goto failed; } /* Turn off all roaming */ hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFROAMINGMODE, 3); if ( result ) { WLAN_LOG_ERROR("Failed to Turn off Roaming\n"); goto failed; } /* Basic rates */ reg = 0; if ( msg->basicrate1.status == P80211ENUM_msgitem_status_data_ok ) { reg = p80211rate_to_p2bit(msg->basicrate1.data); } if ( msg->basicrate2.status == P80211ENUM_msgitem_status_data_ok ) { reg |= p80211rate_to_p2bit(msg->basicrate2.data); } if ( msg->basicrate3.status == P80211ENUM_msgitem_status_data_ok ) { reg |= p80211rate_to_p2bit(msg->basicrate3.data); } if ( msg->basicrate4.status == P80211ENUM_msgitem_status_data_ok ) { reg |= p80211rate_to_p2bit(msg->basicrate4.data); } if ( msg->basicrate5.status == P80211ENUM_msgitem_status_data_ok ) { reg |= p80211rate_to_p2bit(msg->basicrate5.data); } if ( msg->basicrate6.status == P80211ENUM_msgitem_status_data_ok ) { reg |= p80211rate_to_p2bit(msg->basicrate6.data); } if ( msg->basicrate7.status == P80211ENUM_msgitem_status_data_ok ) { reg |= p80211rate_to_p2bit(msg->basicrate7.data); } if ( msg->basicrate8.status == P80211ENUM_msgitem_status_data_ok ) { reg |= p80211rate_to_p2bit(msg->basicrate8.data); } if( reg == 0) reg = 0x03; result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFBASICRATES, reg); if ( result ) { WLAN_LOG_ERROR("Failed to set basicrates=%d.\n", reg); goto failed; } /* Operational rates (supprates and txratecontrol) */ reg = 0; if ( msg->operationalrate1.status == P80211ENUM_msgitem_status_data_ok ) { reg = p80211rate_to_p2bit(msg->operationalrate1.data); } if ( msg->operationalrate2.status == P80211ENUM_msgitem_status_data_ok ) { reg |= p80211rate_to_p2bit(msg->operationalrate2.data); } if ( msg->operationalrate3.status == P80211ENUM_msgitem_status_data_ok ) { reg |= p80211rate_to_p2bit(msg->operationalrate3.data); } if ( msg->operationalrate4.status == P80211ENUM_msgitem_status_data_ok ) { reg |= p80211rate_to_p2bit(msg->operationalrate4.data); } if ( msg->operationalrate5.status == P80211ENUM_msgitem_status_data_ok ) { reg |= p80211rate_to_p2bit(msg->operationalrate5.data); } if ( msg->operationalrate6.status == P80211ENUM_msgitem_status_data_ok ) { reg |= p80211rate_to_p2bit(msg->operationalrate6.data); } if ( msg->operationalrate7.status == P80211ENUM_msgitem_status_data_ok ) { reg |= p80211rate_to_p2bit(msg->operationalrate7.data); } if ( msg->operationalrate8.status == P80211ENUM_msgitem_status_data_ok ) { reg |= p80211rate_to_p2bit(msg->operationalrate8.data); } if( reg == 0) reg = 0x0f; result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFSUPPRATES, reg); if ( result ) { WLAN_LOG_ERROR("Failed to set supprates=%d.\n", reg); goto failed; } result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_TXRATECNTL, reg); if ( result ) { WLAN_LOG_ERROR("Failed to set txrates=%d.\n", reg); goto failed; } /* Set the ssid */ memset(bytebuf, 0, 256); pstr = (p80211pstrd_t*)&(msg->ssid.data); prism2mgmt_pstr2bytestr(p2bytestr, pstr); result = hfa384x_drvr_setconfig( hw, HFA384x_RID_CNFDESIREDSSID, bytebuf, HFA384x_RID_CNFDESIREDSSID_LEN); if ( result ) { WLAN_LOG_ERROR("Failed to set SSID\n"); goto failed; } /* Enable the Port */ result = hfa384x_cmd_enable(hw, 0); if ( result ) { WLAN_LOG_ERROR("Enable macport failed, result=%d.\n", result); goto failed; } /* Fill in the join request */ joinreq.channel = msg->channel.data; memcpy( joinreq.bssid, ((unsigned char *) &msg->bssid.data) + 1, WLAN_BSSID_LEN); hw->joinreq = joinreq; hw->join_ap = 1; /* Send the join request */ result = hfa384x_drvr_setconfig( hw, HFA384x_RID_JOINREQUEST, &joinreq, HFA384x_RID_JOINREQUEST_LEN); if(result != 0) { WLAN_LOG_ERROR("Join request failed, result=%d.\n", result); goto failed; } } else { /*** ACCESS POINT ***/ /* Never supported by APs */ msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.data = P80211ENUM_resultcode_not_supported; } goto done; failed: WLAN_LOG_DEBUG(1, "Failed to set a config option, result=%d\n", result); msg->resultcode.data = P80211ENUM_resultcode_invalid_parameters; done: result = 0; DBFEXIT; return result; } /*---------------------------------------------------------------- * prism2mgmt_authenticate * * Station should be begin an authentication exchange. * * Arguments: * wlandev wlan device structure * msgp ptr to msg buffer * * Returns: * 0 success and done * <0 success, but we're waiting for something to finish. * >0 an error occurred while handling the message. * Side effects: * * Call context: * process thread (usually) * interrupt ----------------------------------------------------------------*/ int prism2mgmt_authenticate(wlandevice_t *wlandev, void *msgp) { int result = 0; hfa384x_t *hw = wlandev->priv; p80211msg_dot11req_authenticate_t *msg = msgp; DBFENTER; if (!hw->ap) { /*** STATION ***/ /* TODO: Decide how we're going to handle this one w/ Prism2 */ /* It could be entertaining since Prism2 doesn't have */ /* an explicit way to control this */ msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.data = P80211ENUM_resultcode_not_supported; } else { /*** ACCESS POINT ***/ /* Never supported by APs */ msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.data = P80211ENUM_resultcode_not_supported; } DBFEXIT; return result; } /*---------------------------------------------------------------- * prism2mgmt_deauthenticate * * Send a deauthenticate notification. * * Arguments: * wlandev wlan device structure * msgp ptr to msg buffer * * Returns: * 0 success and done * <0 success, but we're waiting for something to finish. * >0 an error occurred while handling the message. * Side effects: * * Call context: * process thread (usually) * interrupt ----------------------------------------------------------------*/ int prism2mgmt_deauthenticate(wlandevice_t *wlandev, void *msgp) { int result = 0; hfa384x_t *hw = wlandev->priv; p80211msg_dot11req_deauthenticate_t *msg = msgp; DBFENTER; if (!hw->ap) { /*** STATION ***/ /* TODO: Decide how we're going to handle this one w/ Prism2 */ /* It could be entertaining since Prism2 doesn't have */ /* an explicit way to control this */ msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.data = P80211ENUM_resultcode_not_supported; } else { /*** ACCESS POINT ***/ hfa384x_drvr_handover(hw, msg->peerstaaddress.data.data); msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.data = P80211ENUM_resultcode_success; } DBFEXIT; return result; } /*---------------------------------------------------------------- * prism2mgmt_associate * * Associate with an ESS. * * Arguments: * wlandev wlan device structure * msgp ptr to msg buffer * * Returns: * 0 success and done * <0 success, but we're waiting for something to finish. * >0 an error occurred while handling the message. * Side effects: * * Call context: * process thread (usually) * interrupt ----------------------------------------------------------------*/ int prism2mgmt_associate(wlandevice_t *wlandev, void *msgp) { hfa384x_t *hw = wlandev->priv; int result = 0; p80211msg_dot11req_associate_t *msg = msgp; DBFENTER; if (!hw->ap) { /*** STATION ***/ #if 0 /* Set the TxRates */ reg = 0x000f; hfa384x_drvr_setconfig16(hw, HFA384x_RID_TXRATECNTL, reg); #endif /* Set the PortType */ /* ess port */ hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFPORTTYPE, 1); /* Enable the Port */ hfa384x_drvr_enable(hw, 0); /* Set the resultcode */ msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.data = P80211ENUM_resultcode_success; } else { /*** ACCESS POINT ***/ /* Never supported on AP */ msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.data = P80211ENUM_resultcode_not_supported; } DBFEXIT; return result; } /*---------------------------------------------------------------- * prism2mgmt_reassociate * * Renew association because of a BSS change. * * Arguments: * wlandev wlan device structure * msgp ptr to msg buffer * * Returns: * 0 success and done * <0 success, but we're waiting for something to finish. * >0 an error occurred while handling the message. * Side effects: * * Call context: * process thread (usually) * interrupt ----------------------------------------------------------------*/ int prism2mgmt_reassociate(wlandevice_t *wlandev, void *msgp) { int result = 0; hfa384x_t *hw = wlandev->priv; p80211msg_dot11req_reassociate_t *msg = msgp; DBFENTER; if (!hw->ap) { /*** STATION ***/ /* TODO: Not supported yet...not sure how we're going to do it */ msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.data = P80211ENUM_resultcode_not_supported; } else { /*** ACCESS POINT ***/ /* Never supported on AP */ msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.data = P80211ENUM_resultcode_not_supported; } DBFEXIT; return result; } /*---------------------------------------------------------------- * prism2mgmt_disassociate * * Send a disassociation notification. * * Arguments: * wlandev wlan device structure * msgp ptr to msg buffer * * Returns: * 0 success and done * <0 success, but we're waiting for something to finish. * >0 an error occurred while handling the message. * Side effects: * * Call context: * process thread (usually) * interrupt ----------------------------------------------------------------*/ int prism2mgmt_disassociate(wlandevice_t *wlandev, void *msgp) { int result = 0; hfa384x_t *hw = wlandev->priv; p80211msg_dot11req_disassociate_t *msg = msgp; DBFENTER; if (!hw->ap) { /*** STATION ***/ /* TODO: Not supported yet...not sure how to do it */ msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.data = P80211ENUM_resultcode_not_supported; } else { /*** ACCESS POINT ***/ hfa384x_drvr_handover(hw, msg->peerstaaddress.data.data); msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.data = P80211ENUM_resultcode_success; } DBFEXIT; return result; } /*---------------------------------------------------------------- * prism2mgmt_reset * * Reset the MAC and MSD. The p80211 layer has it's own handling * that should be done before and after this function. * Procedure: * - disable system interrupts ?? * - disable MAC interrupts * - restore system interrupts * - issue the MAC initialize command * - clear any MSD level state (including timers, queued events, * etc.). Note that if we're removing timer'd/queue events, we may * need to have remained in the system interrupt disabled state. * We should be left in the same state that we're in following * driver initialization. * * Arguments: * wlandev wlan device structure * msgp ptr to msg buffer, MAY BE NULL! for a driver local * call. * * Returns: * 0 success and done * <0 success, but we're waiting for something to finish. * >0 an error occurred while handling the message. * Side effects: * * Call context: * process thread, commonly wlanctl, but might be rmmod/pci_close. ----------------------------------------------------------------*/ int prism2mgmt_reset(wlandevice_t *wlandev, void *msgp) { int result = 0; hfa384x_t *hw = wlandev->priv; p80211msg_dot11req_reset_t *msg = msgp; DBFENTER; /* * This is supported on both AP and STA and it's not allowed * to fail. */ if ( msgp ) { msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.data = P80211ENUM_resultcode_success; WLAN_LOG_INFO("dot11req_reset: the macaddress and " "setdefaultmib arguments are currently unsupported.\n"); } /* * If we got this far, the MSD must be in the MSDRUNNING state * therefore, we must stop and then restart the hw/MAC combo. */ hfa384x_drvr_stop(hw); result = hfa384x_drvr_start(hw); if (result != 0) { WLAN_LOG_ERROR("dot11req_reset: Initialize command failed," " bad things will happen from here.\n"); return 0; } DBFEXIT; return 0; } /*---------------------------------------------------------------- * prism2mgmt_start * * Start a BSS. Any station can do this for IBSS, only AP for ESS. * * Arguments: * wlandev wlan device structure * msgp ptr to msg buffer * * Returns: * 0 success and done * <0 success, but we're waiting for something to finish. * >0 an error occurred while handling the message. * Side effects: * * Call context: * process thread (usually) * interrupt ----------------------------------------------------------------*/ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp) { int result = 0; hfa384x_t *hw = wlandev->priv; p80211msg_dot11req_start_t *msg = msgp; p80211pstrd_t *pstr; UINT8 bytebuf[80]; hfa384x_bytestr_t *p2bytestr = (hfa384x_bytestr_t*)bytebuf; hfa384x_PCFInfo_data_t *pcfinfo = (hfa384x_PCFInfo_data_t*)bytebuf; UINT16 word; DBFENTER; wlandev->macmode = WLAN_MACMODE_NONE; /* Set the SSID */ memcpy(&wlandev->ssid, &msg->ssid.data, sizeof(msg->ssid.data)); if (!hw->ap) { /*** ADHOC IBSS ***/ /* see if current f/w is less than 8c3 */ if (HFA384x_FIRMWARE_VERSION(hw->ident_sta_fw.major, hw->ident_sta_fw.minor, hw->ident_sta_fw.variant) < HFA384x_FIRMWARE_VERSION(0,8,3)) { /* Ad-Hoc not quite supported on Prism2 */ msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.data = P80211ENUM_resultcode_not_supported; goto done; } msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; /*** STATION ***/ /* Set the REQUIRED config items */ /* SSID */ pstr = (p80211pstrd_t*)&(msg->ssid.data); prism2mgmt_pstr2bytestr(p2bytestr, pstr); result = hfa384x_drvr_setconfig( hw, HFA384x_RID_CNFOWNSSID, bytebuf, HFA384x_RID_CNFOWNSSID_LEN); if ( result ) { WLAN_LOG_ERROR("Failed to set CnfOwnSSID\n"); goto failed; } result = hfa384x_drvr_setconfig( hw, HFA384x_RID_CNFDESIREDSSID, bytebuf, HFA384x_RID_CNFDESIREDSSID_LEN); if ( result ) { WLAN_LOG_ERROR("Failed to set CnfDesiredSSID\n"); goto failed; } /* bsstype - we use the default in the ap firmware */ /* IBSS port */ hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFPORTTYPE, 0); /* beacon period */ word = msg->beaconperiod.data; result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFAPBCNINT, word); if ( result ) { WLAN_LOG_ERROR("Failed to set beacon period=%d.\n", word); goto failed; } /* dschannel */ word = msg->dschannel.data; result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFOWNCHANNEL, word); if ( result ) { WLAN_LOG_ERROR("Failed to set channel=%d.\n", word); goto failed; } /* Basic rates */ word = p80211rate_to_p2bit(msg->basicrate1.data); if ( msg->basicrate2.status == P80211ENUM_msgitem_status_data_ok ) { word |= p80211rate_to_p2bit(msg->basicrate2.data); } if ( msg->basicrate3.status == P80211ENUM_msgitem_status_data_ok ) { word |= p80211rate_to_p2bit(msg->basicrate3.data); } if ( msg->basicrate4.status == P80211ENUM_msgitem_status_data_ok ) { word |= p80211rate_to_p2bit(msg->basicrate4.data); } if ( msg->basicrate5.status == P80211ENUM_msgitem_status_data_ok ) { word |= p80211rate_to_p2bit(msg->basicrate5.data); } if ( msg->basicrate6.status == P80211ENUM_msgitem_status_data_ok ) { word |= p80211rate_to_p2bit(msg->basicrate6.data); } if ( msg->basicrate7.status == P80211ENUM_msgitem_status_data_ok ) { word |= p80211rate_to_p2bit(msg->basicrate7.data); } if ( msg->basicrate8.status == P80211ENUM_msgitem_status_data_ok ) { word |= p80211rate_to_p2bit(msg->basicrate8.data); } result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFBASICRATES, word); if ( result ) { WLAN_LOG_ERROR("Failed to set basicrates=%d.\n", word); goto failed; } /* Operational rates (supprates and txratecontrol) */ word = p80211rate_to_p2bit(msg->operationalrate1.data); if ( msg->operationalrate2.status == P80211ENUM_msgitem_status_data_ok ) { word |= p80211rate_to_p2bit(msg->operationalrate2.data); } if ( msg->operationalrate3.status == P80211ENUM_msgitem_status_data_ok ) { word |= p80211rate_to_p2bit(msg->operationalrate3.data); } if ( msg->operationalrate4.status == P80211ENUM_msgitem_status_data_ok ) { word |= p80211rate_to_p2bit(msg->operationalrate4.data); } if ( msg->operationalrate5.status == P80211ENUM_msgitem_status_data_ok ) { word |= p80211rate_to_p2bit(msg->operationalrate5.data); } if ( msg->operationalrate6.status == P80211ENUM_msgitem_status_data_ok ) { word |= p80211rate_to_p2bit(msg->operationalrate6.data); } if ( msg->operationalrate7.status == P80211ENUM_msgitem_status_data_ok ) { word |= p80211rate_to_p2bit(msg->operationalrate7.data); } if ( msg->operationalrate8.status == P80211ENUM_msgitem_status_data_ok ) { word |= p80211rate_to_p2bit(msg->operationalrate8.data); } result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFSUPPRATES, word); if ( result ) { WLAN_LOG_ERROR("Failed to set supprates=%d.\n", word); goto failed; } result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_TXRATECNTL, word); if ( result ) { WLAN_LOG_ERROR("Failed to set txrates=%d.\n", word); goto failed; } /* Set the macmode so the frame setup code knows what to do */ if ( msg->bsstype.data == P80211ENUM_bsstype_independent ) { wlandev->macmode = WLAN_MACMODE_IBSS_STA; /* lets extend the data length a bit */ hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFMAXDATALEN, 2304); } /* Enable the Port */ result = hfa384x_drvr_enable(hw, 0); if ( result ) { WLAN_LOG_ERROR("Enable macport failed, result=%d.\n", result); goto failed; } msg->resultcode.data = P80211ENUM_resultcode_success; goto done; } /*** ACCESS POINT ***/ msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; /* Validate the command, if BSStype=infra is the tertiary loaded? */ if ( msg->bsstype.data == P80211ENUM_bsstype_independent ) { WLAN_LOG_ERROR("AP driver cannot create IBSS.\n"); goto failed; } else if ( hw->cap_sup_sta.id != 5) { WLAN_LOG_ERROR("AP driver failed to detect AP firmware.\n"); goto failed; } /* Set the REQUIRED config items */ /* SSID */ pstr = (p80211pstrd_t*)&(msg->ssid.data); prism2mgmt_pstr2bytestr(p2bytestr, pstr); result = hfa384x_drvr_setconfig( hw, HFA384x_RID_CNFOWNSSID, bytebuf, HFA384x_RID_CNFOWNSSID_LEN); if ( result ) { WLAN_LOG_ERROR("Failed to set SSID, result=0x%04x\n", result); goto failed; } /* bsstype - we use the default in the ap firmware */ /* beacon period */ word = msg->beaconperiod.data; result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFAPBCNINT, word); if ( result ) { WLAN_LOG_ERROR("Failed to set beacon period=%d.\n", word); goto failed; } /* dschannel */ word = msg->dschannel.data; result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFOWNCHANNEL, word); if ( result ) { WLAN_LOG_ERROR("Failed to set channel=%d.\n", word); goto failed; } /* Basic rates */ word = p80211rate_to_p2bit(msg->basicrate1.data); if ( msg->basicrate2.status == P80211ENUM_msgitem_status_data_ok ) { word |= p80211rate_to_p2bit(msg->basicrate2.data); } if ( msg->basicrate3.status == P80211ENUM_msgitem_status_data_ok ) { word |= p80211rate_to_p2bit(msg->basicrate3.data); } if ( msg->basicrate4.status == P80211ENUM_msgitem_status_data_ok ) { word |= p80211rate_to_p2bit(msg->basicrate4.data); } if ( msg->basicrate5.status == P80211ENUM_msgitem_status_data_ok ) { word |= p80211rate_to_p2bit(msg->basicrate5.data); } if ( msg->basicrate6.status == P80211ENUM_msgitem_status_data_ok ) { word |= p80211rate_to_p2bit(msg->basicrate6.data); } if ( msg->basicrate7.status == P80211ENUM_msgitem_status_data_ok ) { word |= p80211rate_to_p2bit(msg->basicrate7.data); } if ( msg->basicrate8.status == P80211ENUM_msgitem_status_data_ok ) { word |= p80211rate_to_p2bit(msg->basicrate8.data); } result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFBASICRATES, word); if ( result ) { WLAN_LOG_ERROR("Failed to set basicrates=%d.\n", word); goto failed; } /* Operational rates (supprates and txratecontrol) */ word = p80211rate_to_p2bit(msg->operationalrate1.data); if ( msg->operationalrate2.status == P80211ENUM_msgitem_status_data_ok ) { word |= p80211rate_to_p2bit(msg->operationalrate2.data); } if ( msg->operationalrate3.status == P80211ENUM_msgitem_status_data_ok ) { word |= p80211rate_to_p2bit(msg->operationalrate3.data); } if ( msg->operationalrate4.status == P80211ENUM_msgitem_status_data_ok ) { word |= p80211rate_to_p2bit(msg->operationalrate4.data); } if ( msg->operationalrate5.status == P80211ENUM_msgitem_status_data_ok ) { word |= p80211rate_to_p2bit(msg->operationalrate5.data); } if ( msg->operationalrate6.status == P80211ENUM_msgitem_status_data_ok ) { word |= p80211rate_to_p2bit(msg->operationalrate6.data); } if ( msg->operationalrate7.status == P80211ENUM_msgitem_status_data_ok ) { word |= p80211rate_to_p2bit(msg->operationalrate7.data); } if ( msg->operationalrate8.status == P80211ENUM_msgitem_status_data_ok ) { word |= p80211rate_to_p2bit(msg->operationalrate8.data); } result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFSUPPRATES, word); if ( result ) { WLAN_LOG_ERROR("Failed to set supprates=%d.\n", word); goto failed; } result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_TXRATECNTL0, word); if ( result ) { WLAN_LOG_ERROR("Failed to set txrates=%d.\n", word); goto failed; } /* ibssatimwindow */ if (msg->ibssatimwindow.status == P80211ENUM_msgitem_status_data_ok) { WLAN_LOG_INFO("prism2mgmt_start: atimwindow not used in " "Infrastructure mode, ignored.\n"); } /* DTIM period */ word = msg->dtimperiod.data; result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFOWNDTIMPER, word); if ( result ) { WLAN_LOG_ERROR("Failed to set dtim period=%d.\n", word); goto failed; } /* probedelay */ if (msg->probedelay.status == P80211ENUM_msgitem_status_data_ok) { WLAN_LOG_INFO("prism2mgmt_start: probedelay not " "supported in prism2, ignored.\n"); } /* cfpollable, cfpollreq, cfpperiod, cfpmaxduration */ if (msg->cfpollable.data == P80211ENUM_truth_true && msg->cfpollreq.data == P80211ENUM_truth_true ) { WLAN_LOG_ERROR("cfpollable=cfpollreq=true is illegal.\n"); result = -1; goto failed; } /* read the PCFInfo and update */ result = hfa384x_drvr_getconfig(hw, HFA384x_RID_CNFAPPCFINFO, pcfinfo, HFA384x_RID_CNFAPPCFINFO_LEN); if ( result ) { WLAN_LOG_INFO("prism2mgmt_start: read(pcfinfo) failed, " "assume it's " "not supported, pcf settings ignored.\n"); goto pcf_skip; } if ((msg->cfpollable.data == P80211ENUM_truth_false && msg->cfpollreq.data == P80211ENUM_truth_false) ) { pcfinfo->MediumOccupancyLimit = 0; pcfinfo->CFPPeriod = 0; pcfinfo->CFPMaxDuration = 0; pcfinfo->CFPFlags &= host2hfa384x_16((UINT16)~BIT0); if ( msg->cfpperiod.status == P80211ENUM_msgitem_status_data_ok || msg->cfpmaxduration.status == P80211ENUM_msgitem_status_data_ok ) { WLAN_LOG_WARNING( "Setting cfpperiod or cfpmaxduration when " "cfpollable and cfreq are false is pointless.\n"); } } if ((msg->cfpollable.data == P80211ENUM_truth_true || msg->cfpollreq.data == P80211ENUM_truth_true) ) { if ( msg->cfpollable.data == P80211ENUM_truth_true) { pcfinfo->CFPFlags |= host2hfa384x_16((UINT16)BIT0); } if ( msg->cfpperiod.status == P80211ENUM_msgitem_status_data_ok) { pcfinfo->CFPPeriod = msg->cfpperiod.data; pcfinfo->CFPPeriod = host2hfa384x_16(pcfinfo->CFPPeriod); } if ( msg->cfpmaxduration.status == P80211ENUM_msgitem_status_data_ok) { pcfinfo->CFPMaxDuration = msg->cfpmaxduration.data; pcfinfo->CFPMaxDuration = host2hfa384x_16(pcfinfo->CFPMaxDuration); pcfinfo->MediumOccupancyLimit = pcfinfo->CFPMaxDuration; } } result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFAPPCFINFO, pcfinfo, HFA384x_RID_CNFAPPCFINFO_LEN); if ( result ) { WLAN_LOG_ERROR("write(pcfinfo) failed.\n"); goto failed; } pcf_skip: /* Set the macmode so the frame setup code knows what to do */ if ( msg->bsstype.data == P80211ENUM_bsstype_infrastructure ) { wlandev->macmode = WLAN_MACMODE_ESS_AP; /* lets extend the data length a bit */ hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFMAXDATALEN, 2304); } /* Set the BSSID to the same as our MAC */ memcpy( wlandev->bssid, wlandev->netdev->dev_addr, WLAN_BSSID_LEN); /* Enable the Port */ result = hfa384x_drvr_enable(hw, 0); if ( result ) { WLAN_LOG_ERROR("Enable macport failed, result=%d.\n", result); goto failed; } msg->resultcode.data = P80211ENUM_resultcode_success; goto done; failed: WLAN_LOG_DEBUG(1, "Failed to set a config option, result=%d\n", result); msg->resultcode.data = P80211ENUM_resultcode_invalid_parameters; done: result = 0; DBFEXIT; return result; } /*---------------------------------------------------------------- * prism2mgmt_enable * * Start a BSS. Any station can do this for IBSS, only AP for ESS. * * Arguments: * wlandev wlan device structure * msgp ptr to msg buffer * * Returns: * 0 success and done * <0 success, but we're waiting for something to finish. * >0 an error occurred while handling the message. * Side effects: * * Call context: * process thread (usually) * interrupt ----------------------------------------------------------------*/ int prism2mgmt_enable(wlandevice_t *wlandev, void *msgp) { int result = 0; hfa384x_t *hw = wlandev->priv; p80211msg_p2req_enable_t *msg = msgp; DBFENTER; if (!hw->ap) { /*** STATION ***/ /* Ad-Hoc not quite supported on Prism2 */ msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.data = P80211ENUM_resultcode_not_supported; goto done; } /*** ACCESS POINT ***/ msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; /* Is the tertiary loaded? */ if ( hw->cap_sup_sta.id != 5) { WLAN_LOG_ERROR("AP driver failed to detect AP firmware.\n"); goto failed; } /* Set the macmode so the frame setup code knows what to do */ wlandev->macmode = WLAN_MACMODE_ESS_AP; /* Set the BSSID to the same as our MAC */ memcpy( wlandev->bssid, wlandev->netdev->dev_addr, WLAN_BSSID_LEN); /* Enable the Port */ result = hfa384x_drvr_enable(hw, 0); if ( result ) { WLAN_LOG_ERROR("Enable macport failed, result=%d.\n", result); goto failed; } msg->resultcode.data = P80211ENUM_resultcode_success; goto done; failed: msg->resultcode.data = P80211ENUM_resultcode_invalid_parameters; done: result = 0; DBFEXIT; return result; } /*---------------------------------------------------------------- * prism2mgmt_readpda * * Collect the PDA data and put it in the message. * * Arguments: * wlandev wlan device structure * msgp ptr to msg buffer * * Returns: * 0 success and done * <0 success, but we're waiting for something to finish. * >0 an error occurred while handling the message. * Side effects: * * Call context: * process thread (usually) ----------------------------------------------------------------*/ int prism2mgmt_readpda(wlandevice_t *wlandev, void *msgp) { hfa384x_t *hw = wlandev->priv; p80211msg_p2req_readpda_t *msg = msgp; int result; DBFENTER; /* We only support collecting the PDA when in the FWLOAD * state. */ if (wlandev->msdstate != WLAN_MSD_FWLOAD) { WLAN_LOG_ERROR( "PDA may only be read " "in the fwload state.\n"); msg->resultcode.data = P80211ENUM_resultcode_implementation_failure; msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; } else { /* Call drvr_readpda(), it handles the auxport enable * and validating the returned PDA. */ result = hfa384x_drvr_readpda( hw, msg->pda.data, HFA384x_PDA_LEN_MAX); if (result) { WLAN_LOG_ERROR( "hfa384x_drvr_readpda() failed, " "result=%d\n", result); msg->resultcode.data = P80211ENUM_resultcode_implementation_failure; msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; DBFEXIT; return 0; } msg->pda.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.data = P80211ENUM_resultcode_success; msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; } DBFEXIT; return 0; } /*---------------------------------------------------------------- * prism2mgmt_readcis * * Collect the CIS data and put it in the message. * * Arguments: * wlandev wlan device structure * msgp ptr to msg buffer * * Returns: * 0 success and done * <0 success, but we're waiting for something to finish. * >0 an error occurred while handling the message. * Side effects: * * Call context: * process thread (usually) ----------------------------------------------------------------*/ int prism2mgmt_readcis(wlandevice_t *wlandev, void *msgp) { int result; hfa384x_t *hw = wlandev->priv; p80211msg_p2req_readcis_t *msg = msgp; DBFENTER; memset(msg->cis.data, 0, sizeof(msg->cis.data)); result = hfa384x_drvr_getconfig(hw, HFA384x_RID_CIS, msg->cis.data, HFA384x_RID_CIS_LEN); if ( result ) { WLAN_LOG_INFO("prism2mgmt_readcis: read(cis) failed.\n"); msg->cis.status = P80211ENUM_msgitem_status_no_value; msg->resultcode.data = P80211ENUM_resultcode_implementation_failure; } else { msg->cis.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.data = P80211ENUM_resultcode_success; } msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; DBFEXIT; return 0; } /*---------------------------------------------------------------- * prism2mgmt_auxport_state * * Enables/Disables the card's auxiliary port. Should be called * before and after a sequence of auxport_read()/auxport_write() * calls. * * Arguments: * wlandev wlan device structure * msgp ptr to msg buffer * * Returns: * 0 success and done * <0 success, but we're waiting for something to finish. * >0 an error occurred while handling the message. * Side effects: * * Call context: * process thread (usually) ----------------------------------------------------------------*/ int prism2mgmt_auxport_state(wlandevice_t *wlandev, void *msgp) { p80211msg_p2req_auxport_state_t *msg = msgp; #if (WLAN_HOSTIF != WLAN_USB) hfa384x_t *hw = wlandev->priv; DBFENTER; msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; if (msg->enable.data == P80211ENUM_truth_true) { if ( hfa384x_cmd_aux_enable(hw, 0) ) { msg->resultcode.data = P80211ENUM_resultcode_implementation_failure; } else { msg->resultcode.data = P80211ENUM_resultcode_success; } } else { hfa384x_cmd_aux_disable(hw); msg->resultcode.data = P80211ENUM_resultcode_success; } #else /* !USB */ DBFENTER; msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.data = P80211ENUM_resultcode_not_supported; #endif /* WLAN_HOSTIF != WLAN_USB */ DBFEXIT; return 0; } /*---------------------------------------------------------------- * prism2mgmt_auxport_read * * Copies data from the card using the auxport. The auxport must * have previously been enabled. Note: this is not the way to * do downloads, see the [ram|flash]dl functions. * * Arguments: * wlandev wlan device structure * msgp ptr to msg buffer * * Returns: * 0 success and done * <0 success, but we're waiting for something to finish. * >0 an error occurred while handling the message. * Side effects: * * Call context: * process thread (usually) ----------------------------------------------------------------*/ int prism2mgmt_auxport_read(wlandevice_t *wlandev, void *msgp) { #if (WLAN_HOSTIF != WLAN_USB) hfa384x_t *hw = wlandev->priv; p80211msg_p2req_auxport_read_t *msg = msgp; UINT32 addr; UINT32 len; UINT8* buf; UINT32 maxlen = sizeof(msg->data.data); DBFENTER; if ( hw->auxen ) { addr = msg->addr.data; len = msg->len.data; buf = msg->data.data; if ( len <= maxlen ) { /* max read/write size */ hfa384x_copy_from_aux(hw, addr, HFA384x_AUX_CTL_EXTDS, buf, len); msg->resultcode.data = P80211ENUM_resultcode_success; } else { WLAN_LOG_DEBUG(1,"Attempt to read > maxlen from auxport.\n"); msg->resultcode.data = P80211ENUM_resultcode_refused; } } else { msg->resultcode.data = P80211ENUM_resultcode_refused; } msg->data.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; DBFEXIT; return 0; #else DBFENTER; WLAN_LOG_ERROR("prism2mgmt_auxport_read: Not supported on USB.\n"); DBFEXIT; return 0; #endif } /*---------------------------------------------------------------- * prism2mgmt_auxport_write * * Copies data to the card using the auxport. The auxport must * have previously been enabled. Note: this is not the way to * do downloads, see the [ram|flash]dl functions. * * Arguments: * wlandev wlan device structure * msgp ptr to msg buffer * * Returns: * 0 success and done * <0 success, but we're waiting for something to finish. * >0 an error occurred while handling the message. * Side effects: * * Call context: * process thread (usually) ----------------------------------------------------------------*/ int prism2mgmt_auxport_write(wlandevice_t *wlandev, void *msgp) { #if (WLAN_HOSTIF != WLAN_USB) hfa384x_t *hw = wlandev->priv; p80211msg_p2req_auxport_write_t *msg = msgp; UINT32 addr; UINT32 len; UINT8* buf; UINT32 maxlen = sizeof(msg->data.data); DBFENTER; if ( hw->auxen ) { addr = msg->addr.data; len = msg->len.data; buf = msg->data.data; if ( len <= maxlen ) { /* max read/write size */ hfa384x_copy_to_aux(hw, addr, HFA384x_AUX_CTL_EXTDS, buf, len); } else { WLAN_LOG_DEBUG(1,"Attempt to write > maxlen from auxport.\n"); msg->resultcode.data = P80211ENUM_resultcode_refused; } } else { msg->resultcode.data = P80211ENUM_resultcode_refused; } msg->data.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; DBFEXIT; return 0; #else DBFENTER; WLAN_LOG_ERROR("prism2mgmt_auxport_read: Not supported on USB.\n"); DBFEXIT; return 0; #endif } /*---------------------------------------------------------------- * prism2mgmt_low_level * * Puts the card into the desired test mode. * * Arguments: * wlandev wlan device structure * msgp ptr to msg buffer * * Returns: * 0 success and done * <0 success, but we're waiting for something to finish. * >0 an error occurred while handling the message. * Side effects: * * Call context: * process thread (usually) ----------------------------------------------------------------*/ int prism2mgmt_low_level(wlandevice_t *wlandev, void *msgp) { hfa384x_t *hw = wlandev->priv; p80211msg_p2req_low_level_t *msg = msgp; hfa384x_metacmd_t cmd; DBFENTER; msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; /* call some routine to execute the test command */ cmd.cmd = (UINT16) msg->command.data; cmd.parm0 = (UINT16) msg->param0.data; cmd.parm1 = (UINT16) msg->param1.data; cmd.parm2 = (UINT16) msg->param2.data; hfa384x_drvr_low_level(hw,&cmd); msg->resp0.data = (UINT32) cmd.result.resp0; msg->resp1.data = (UINT32) cmd.result.resp1; msg->resp2.data = (UINT32) cmd.result.resp2; msg->resultcode.data = P80211ENUM_resultcode_success; DBFEXIT; return 0; } /*---------------------------------------------------------------- * prism2mgmt_test_command * * Puts the card into the desired test mode. * * Arguments: * wlandev wlan device structure * msgp ptr to msg buffer * * Returns: * 0 success and done * <0 success, but we're waiting for something to finish. * >0 an error occurred while handling the message. * Side effects: * * Call context: * process thread (usually) ----------------------------------------------------------------*/ int prism2mgmt_test_command(wlandevice_t *wlandev, void *msgp) { hfa384x_t *hw = wlandev->priv; p80211msg_p2req_test_command_t *msg = msgp; hfa384x_metacmd_t cmd; DBFENTER; cmd.cmd = ((UINT16) msg->testcode.data) << 8 | 0x38; cmd.parm0 = (UINT16) msg->testparam.data; cmd.parm1 = 0; cmd.parm2 = 0; /* call some routine to execute the test command */ hfa384x_drvr_low_level(hw,&cmd); msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.data = P80211ENUM_resultcode_success; msg->status.status = P80211ENUM_msgitem_status_data_ok; msg->status.data = cmd.result.status; msg->resp0.status = P80211ENUM_msgitem_status_data_ok; msg->resp0.data = cmd.result.resp0; msg->resp1.status = P80211ENUM_msgitem_status_data_ok; msg->resp1.data = cmd.result.resp1; msg->resp2.status = P80211ENUM_msgitem_status_data_ok; msg->resp2.data = cmd.result.resp2; DBFEXIT; return 0; } /*---------------------------------------------------------------- * prism2mgmt_mmi_read * * Read from one of the MMI registers. * * Arguments: * wlandev wlan device structure * msgp ptr to msg buffer * * Returns: * 0 success and done * <0 success, but we're waiting for something to finish. * >0 an error occurred while handling the message. * Side effects: * * Call context: * process thread (usually) ----------------------------------------------------------------*/ int prism2mgmt_mmi_read(wlandevice_t *wlandev, void *msgp) { hfa384x_t *hw = wlandev->priv; p80211msg_p2req_mmi_read_t *msg = msgp; UINT32 resp = 0; DBFENTER; msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; /* call some routine to execute the test command */ hfa384x_drvr_mmi_read(hw, msg->addr.data, &resp); /* I'm not sure if this is "architecturally" correct, but it is expedient. */ msg->value.status = P80211ENUM_msgitem_status_data_ok; msg->value.data = resp; msg->resultcode.data = P80211ENUM_resultcode_success; DBFEXIT; return 0; } /*---------------------------------------------------------------- * prism2mgmt_mmi_write * * Write a data value to one of the MMI registers. * * Arguments: * wlandev wlan device structure * msgp ptr to msg buffer * * Returns: * 0 success and done * <0 success, but we're waiting for something to finish. * >0 an error occurred while handling the message. * Side effects: * * Call context: * process thread (usually) ----------------------------------------------------------------*/ int prism2mgmt_mmi_write(wlandevice_t *wlandev, void *msgp) { hfa384x_t *hw = wlandev->priv; p80211msg_p2req_mmi_write_t *msg = msgp; DBFENTER; msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; /* call some routine to execute the test command */ hfa384x_drvr_mmi_write(hw, msg->addr.data, msg->data.data); msg->resultcode.data = P80211ENUM_resultcode_success; DBFEXIT; return 0; } /*---------------------------------------------------------------- * prism2mgmt_ramdl_state * * Establishes the beginning/end of a card RAM download session. * * It is expected that the ramdl_write() function will be called * one or more times between the 'enable' and 'disable' calls to * this function. * * Note: This function should not be called when a mac comm port * is active. * * Arguments: * wlandev wlan device structure * msgp ptr to msg buffer * * Returns: * 0 success and done * <0 success, but we're waiting for something to finish. * >0 an error occurred while handling the message. * Side effects: * * Call context: * process thread (usually) ----------------------------------------------------------------*/ int prism2mgmt_ramdl_state(wlandevice_t *wlandev, void *msgp) { hfa384x_t *hw = wlandev->priv; p80211msg_p2req_ramdl_state_t *msg = msgp; DBFENTER; if (wlandev->msdstate != WLAN_MSD_FWLOAD) { WLAN_LOG_ERROR( "ramdl_state(): may only be called " "in the fwload state.\n"); msg->resultcode.data = P80211ENUM_resultcode_implementation_failure; msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; DBFEXIT; return 0; } /* ** Note: Interrupts are locked out if this is an AP and are NOT ** locked out if this is a station. */ msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; if ( msg->enable.data == P80211ENUM_truth_true ) { if ( hfa384x_drvr_ramdl_enable(hw, msg->exeaddr.data) ) { msg->resultcode.data = P80211ENUM_resultcode_implementation_failure; } else { msg->resultcode.data = P80211ENUM_resultcode_success; } } else { hfa384x_drvr_ramdl_disable(hw); msg->resultcode.data = P80211ENUM_resultcode_success; } DBFEXIT; return 0; } /*---------------------------------------------------------------- * prism2mgmt_ramdl_write * * Writes a buffer to the card RAM using the download state. This * is for writing code to card RAM. To just read or write raw data * use the aux functions. * * Arguments: * wlandev wlan device structure * msgp ptr to msg buffer * * Returns: * 0 success and done * <0 success, but we're waiting for something to finish. * >0 an error occurred while handling the message. * Side effects: * * Call context: * process thread (usually) ----------------------------------------------------------------*/ int prism2mgmt_ramdl_write(wlandevice_t *wlandev, void *msgp) { hfa384x_t *hw = wlandev->priv; p80211msg_p2req_ramdl_write_t *msg = msgp; UINT32 addr; UINT32 len; UINT8 *buf; DBFENTER; if (wlandev->msdstate != WLAN_MSD_FWLOAD) { WLAN_LOG_ERROR( "ramdl_write(): may only be called " "in the fwload state.\n"); msg->resultcode.data = P80211ENUM_resultcode_implementation_failure; msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; DBFEXIT; return 0; } msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; /* first validate the length */ if ( msg->len.data > sizeof(msg->data.data) ) { msg->resultcode.status = P80211ENUM_resultcode_invalid_parameters; return 0; } /* call the hfa384x function to do the write */ addr = msg->addr.data; len = msg->len.data; buf = msg->data.data; if ( hfa384x_drvr_ramdl_write(hw, addr, buf, len) ) { msg->resultcode.data = P80211ENUM_resultcode_refused; } msg->resultcode.data = P80211ENUM_resultcode_success; DBFEXIT; return 0; } /*---------------------------------------------------------------- * prism2mgmt_flashdl_state * * Establishes the beginning/end of a card Flash download session. * * It is expected that the flashdl_write() function will be called * one or more times between the 'enable' and 'disable' calls to * this function. * * Note: This function should not be called when a mac comm port * is active. * * Arguments: * wlandev wlan device structure * msgp ptr to msg buffer * * Returns: * 0 success and done * <0 success, but we're waiting for something to finish. * >0 an error occurred while handling the message. * Side effects: * * Call context: * process thread (usually) ----------------------------------------------------------------*/ int prism2mgmt_flashdl_state(wlandevice_t *wlandev, void *msgp) { int result = 0; hfa384x_t *hw = wlandev->priv; p80211msg_p2req_flashdl_state_t *msg = msgp; DBFENTER; if (wlandev->msdstate != WLAN_MSD_FWLOAD) { WLAN_LOG_ERROR( "flashdl_state(): may only be called " "in the fwload state.\n"); msg->resultcode.data = P80211ENUM_resultcode_implementation_failure; msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; DBFEXIT; return 0; } /* ** Note: Interrupts are locked out if this is an AP and are NOT ** locked out if this is a station. */ msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; if ( msg->enable.data == P80211ENUM_truth_true ) { if ( hfa384x_drvr_flashdl_enable(hw) ) { msg->resultcode.data = P80211ENUM_resultcode_implementation_failure; } else { msg->resultcode.data = P80211ENUM_resultcode_success; } } else { hfa384x_drvr_flashdl_disable(hw); msg->resultcode.data = P80211ENUM_resultcode_success; /* NOTE: At this point, the MAC is in the post-reset * state and the driver is in the fwload state. * We need to get the MAC back into the fwload * state. To do this, we set the nsdstate to HWPRESENT * and then call the ifstate function to redo everything * that got us into the fwload state. */ wlandev->msdstate = WLAN_MSD_HWPRESENT; result = prism2sta_ifstate(wlandev, P80211ENUM_ifstate_fwload); if (result != P80211ENUM_resultcode_success) { WLAN_LOG_ERROR("prism2sta_ifstate(fwload) failed," "P80211ENUM_resultcode=%d\n", result); msg->resultcode.data = P80211ENUM_resultcode_implementation_failure; result = -1; } } DBFEXIT; return 0; } /*---------------------------------------------------------------- * prism2mgmt_flashdl_write * * * * Arguments: * wlandev wlan device structure * msgp ptr to msg buffer * * Returns: * 0 success and done * <0 success, but we're waiting for something to finish. * >0 an error occurred while handling the message. * Side effects: * * Call context: * process thread (usually) ----------------------------------------------------------------*/ int prism2mgmt_flashdl_write(wlandevice_t *wlandev, void *msgp) { hfa384x_t *hw = wlandev->priv; p80211msg_p2req_flashdl_write_t *msg = msgp; UINT32 addr; UINT32 len; UINT8 *buf; DBFENTER; if (wlandev->msdstate != WLAN_MSD_FWLOAD) { WLAN_LOG_ERROR( "flashdl_write(): may only be called " "in the fwload state.\n"); msg->resultcode.data = P80211ENUM_resultcode_implementation_failure; msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; DBFEXIT; return 0; } /* ** Note: Interrupts are locked out if this is an AP and are NOT ** locked out if this is a station. */ msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; /* first validate the length */ if ( msg->len.data > sizeof(msg->data.data) ) { msg->resultcode.status = P80211ENUM_resultcode_invalid_parameters; return 0; } /* call the hfa384x function to do the write */ addr = msg->addr.data; len = msg->len.data; buf = msg->data.data; if ( hfa384x_drvr_flashdl_write(hw, addr, buf, len) ) { msg->resultcode.data = P80211ENUM_resultcode_refused; } msg->resultcode.data = P80211ENUM_resultcode_success; DBFEXIT; return 0; } /*---------------------------------------------------------------- * prism2mgmt_dump_state * * Dumps the driver's and hardware's current state via the kernel * log at KERN_NOTICE level. * * Arguments: * wlandev wlan device structure * msgp ptr to msg buffer * * Returns: * 0 success and done * <0 success, but we're waiting for something to finish. * >0 an error occurred while handling the message. * Side effects: * * Call context: * process thread (usually) ----------------------------------------------------------------*/ int prism2mgmt_dump_state(wlandevice_t *wlandev, void *msgp) { p80211msg_p2req_dump_state_t *msg = msgp; int result = 0; #if (WLAN_HOSTIF != WLAN_USB) hfa384x_t *hw = wlandev->priv; UINT16 auxbuf[15]; DBFENTER; WLAN_LOG_NOTICE("prism2 driver and hardware state:\n"); if ( (result = hfa384x_cmd_aux_enable(hw, 0)) ) { WLAN_LOG_ERROR("aux_enable failed, result=%d\n", result); goto failed; } hfa384x_copy_from_aux(hw, 0x01e2, HFA384x_AUX_CTL_EXTDS, auxbuf, sizeof(auxbuf)); hfa384x_cmd_aux_disable(hw); WLAN_LOG_NOTICE(" cmac: FreeBlocks=%d\n", auxbuf[5]); WLAN_LOG_NOTICE(" cmac: IntEn=0x%02x EvStat=0x%02x\n", hfa384x_getreg(hw, HFA384x_INTEN), hfa384x_getreg(hw, HFA384x_EVSTAT)); #ifdef USE_FID_STACK WLAN_LOG_NOTICE(" drvr: txfid_top=%d stacksize=%d\n", hw->txfid_top,HFA384x_DRVR_FIDSTACKLEN_MAX); #else WLAN_LOG_NOTICE(" drvr: txfid_head=%d txfid_tail=%d txfid_N=%d\n", hw->txfid_head, hw->txfid_tail, hw->txfid_N); #endif msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.data = P80211ENUM_resultcode_success; #else /* (WLAN_HOSTIF == WLAN_USB) */ DBFENTER; msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.data = P80211ENUM_resultcode_not_supported; goto failed; #endif /* (WLAN_HOSTIF != WLAN_USB) */ failed: DBFEXIT; return result; } /*---------------------------------------------------------------- * prism2mgmt_channel_info * * Issues a ChannelInfoRequest. * * Arguments: * wlandev wlan device structure * msgp ptr to msg buffer * * Returns: * 0 success and done * <0 success, but we're waiting for something to finish. * >0 an error occurred while handling the message. * Side effects: * * Call context: * process thread (usually) ----------------------------------------------------------------*/ int prism2mgmt_channel_info(wlandevice_t *wlandev, void *msgp) { p80211msg_p2req_channel_info_t *msg=msgp; hfa384x_t *hw = wlandev->priv; int result, i, n=0; UINT16 channel_mask=0; hfa384x_ChannelInfoRequest_data_t chinforeq; // unsigned long now; DBFENTER; if (!hw->ap) { /*** STATION ***/ /* Not supported in STA f/w */ P80211_SET_INT(msg->resultcode, P80211ENUM_resultcode_not_supported); goto done; } /*** ACCESS POINT ***/ #define CHINFO_TIMEOUT 2 P80211_SET_INT(msg->resultcode, P80211ENUM_resultcode_success); /* setting default value for channellist = all channels */ if (!msg->channellist.data) { P80211_SET_INT(msg->channellist, 0x00007FFE); } /* setting default value for channeldwelltime = 100 ms */ if (!msg->channeldwelltime.data) { P80211_SET_INT(msg->channeldwelltime, 100); } channel_mask = (UINT16) (msg->channellist.data >> 1); for (i=0, n=0; i < 14; i++) { if (channel_mask & (1<numchinfo, n); chinforeq.channelList = host2hfa384x_16(channel_mask); chinforeq.channelDwellTime = host2hfa384x_16(msg->channeldwelltime.data); atomic_set(&hw->channel_info.done, 1); result = hfa384x_drvr_setconfig( hw, HFA384x_RID_CHANNELINFOREQUEST, &chinforeq, HFA384x_RID_CHANNELINFOREQUEST_LEN); if ( result ) { WLAN_LOG_ERROR("setconfig(CHANNELINFOREQUEST) failed. result=%d\n", result); msg->resultcode.data = P80211ENUM_resultcode_not_supported; goto done; } /* now = jiffies; while (atomic_read(&hw->channel_info.done) != 1) { if ((jiffies - now) > CHINFO_TIMEOUT*HZ) { WLAN_LOG_NOTICE("ChannelInfo results not received in %d seconds, aborting.\n", CHINFO_TIMEOUT); msg->resultcode.data = P80211ENUM_resultcode_timeout; goto done; } current->state = TASK_INTERRUPTIBLE; schedule_timeout(HZ/4); current->state = TASK_RUNNING; } */ done: DBFEXIT; return 0; } /*---------------------------------------------------------------- * prism2mgmt_channel_info_results * * Returns required ChannelInfo result. * * Arguments: * wlandev wlan device structure * msgp ptr to msg buffer * * Returns: * 0 success and done * <0 success, but we're waiting for something to finish. * >0 an error occurred while handling the message. * Side effects: * * Call context: * process thread (usually) ----------------------------------------------------------------*/ int prism2mgmt_channel_info_results(wlandevice_t *wlandev, void *msgp) { hfa384x_t *hw = wlandev->priv; p80211msg_p2req_channel_info_results_t *msg=msgp; int result=0; int channel; DBFENTER; if (!hw->ap) { /*** STATION ***/ /* Not supported in STA f/w */ P80211_SET_INT(msg->resultcode, P80211ENUM_resultcode_not_supported); goto done; } /*** ACCESS POINT ***/ switch (atomic_read(&hw->channel_info.done)) { case 0: msg->resultcode.status = P80211ENUM_msgitem_status_no_value; goto done; case 1: msg->resultcode.status = P80211ENUM_msgitem_status_incomplete_itemdata; goto done; } P80211_SET_INT(msg->resultcode, P80211ENUM_resultcode_success); channel=msg->channel.data-1; if (channel < 0 || ! (hw->channel_info.results.scanchannels & 1<resultcode.data = P80211ENUM_resultcode_invalid_parameters; goto done; } WLAN_LOG_DEBUG(2, "chinfo_results: channel %d, avg/peak level=%d/%d dB, active=%d\n", channel+1, hw->channel_info.results.result[channel].anl, hw->channel_info.results.result[channel].pnl, hw->channel_info.results.result[channel].active ); P80211_SET_INT(msg->avgnoiselevel, hw->channel_info.results.result[channel].anl); P80211_SET_INT(msg->peaknoiselevel, hw->channel_info.results.result[channel].pnl); P80211_SET_INT(msg->bssactive, hw->channel_info.results.result[channel].active & HFA384x_CHINFORESULT_BSSACTIVE ? P80211ENUM_truth_true : P80211ENUM_truth_false) ; P80211_SET_INT(msg->pcfactive, hw->channel_info.results.result[channel].active & HFA384x_CHINFORESULT_PCFACTIVE ? P80211ENUM_truth_true : P80211ENUM_truth_false) ; done: DBFEXIT; return result; } /*---------------------------------------------------------------- * prism2mgmt_autojoin * * Associate with an ESS. * * Arguments: * wlandev wlan device structure * msgp ptr to msg buffer * * Returns: * 0 success and done * <0 success, but we're waiting for something to finish. * >0 an error occurred while handling the message. * Side effects: * * Call context: * process thread (usually) * interrupt ----------------------------------------------------------------*/ int prism2mgmt_autojoin(wlandevice_t *wlandev, void *msgp) { hfa384x_t *hw = wlandev->priv; int result = 0; UINT16 reg; UINT16 port_type; p80211msg_lnxreq_autojoin_t *msg = msgp; p80211pstrd_t *pstr; UINT8 bytebuf[256]; hfa384x_bytestr_t *p2bytestr = (hfa384x_bytestr_t*)bytebuf; DBFENTER; wlandev->macmode = WLAN_MACMODE_NONE; /* Set the SSID */ memcpy(&wlandev->ssid, &msg->ssid.data, sizeof(msg->ssid.data)); if (hw->ap) { /*** ACCESS POINT ***/ /* Never supported on AP */ msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.data = P80211ENUM_resultcode_not_supported; goto done; } /* Disable the Port */ hfa384x_drvr_disable(hw, 0); /*** STATION ***/ /* Set the TxRates */ hfa384x_drvr_setconfig16(hw, HFA384x_RID_TXRATECNTL, 0x000f); /* Set the auth type */ if ( msg->authtype.data == P80211ENUM_authalg_sharedkey ) { reg = HFA384x_CNFAUTHENTICATION_SHAREDKEY; } else { reg = HFA384x_CNFAUTHENTICATION_OPENSYSTEM; } hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFAUTHENTICATION, reg); /* Set the ssid */ memset(bytebuf, 0, 256); pstr = (p80211pstrd_t*)&(msg->ssid.data); prism2mgmt_pstr2bytestr(p2bytestr, pstr); result = hfa384x_drvr_setconfig( hw, HFA384x_RID_CNFDESIREDSSID, bytebuf, HFA384x_RID_CNFDESIREDSSID_LEN); #if 0 /* we can use the new-fangled auto-unknown mode if the firmware is 1.3.3 or newer */ if (HFA384x_FIRMARE_VERSION(hw->ident_sta_fw.major, hw->ident_sta_fw.minor, hw->ident_sta_fw.variant) >= HFA384x_FIRMWARE_VERSION(1,3,3)) { /* Set up the IBSS options */ reg = HFA384x_CREATEIBSS_JOINESS_JOINCREATEIBSS; hfa384x_drvr_setconfig16(hw, HFA384x_RID_CREATEIBSS, reg); /* Set the PortType */ port_type = HFA384x_PORTTYPE_IBSS; } else { port_type = HFA384x_PORTTYPE_BSS; } #else port_type = HFA384x_PORTTYPE_BSS; #endif /* Set the PortType */ hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFPORTTYPE, port_type); /* Enable the Port */ hfa384x_drvr_enable(hw, 0); /* Set the resultcode */ msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.data = P80211ENUM_resultcode_success; done: DBFEXIT; return result; } /*---------------------------------------------------------------- * prism2mgmt_wlansniff * * Start or stop sniffing. * * Arguments: * wlandev wlan device structure * msgp ptr to msg buffer * * Returns: * 0 success and done * <0 success, but we're waiting for something to finish. * >0 an error occurred while handling the message. * Side effects: * * Call context: * process thread (usually) * interrupt ----------------------------------------------------------------*/ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp) { int result = 0; p80211msg_lnxreq_wlansniff_t *msg = msgp; hfa384x_t *hw = wlandev->priv; UINT16 word; DBFENTER; msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; switch (msg->enable.data) { case P80211ENUM_truth_false: /* Confirm that we're in monitor mode */ if ( wlandev->netdev->type == ARPHRD_ETHER ) { msg->resultcode.data = P80211ENUM_resultcode_invalid_parameters; result = 0; goto exit; } /* Disable monitor mode */ result = hfa384x_cmd_monitor(hw, HFA384x_MONITOR_DISABLE); if ( result ) { WLAN_LOG_DEBUG(1, "failed to disable monitor mode, result=%d\n", result); goto failed; } /* Disable port 0 */ result = hfa384x_drvr_disable(hw, 0); if ( result ) { WLAN_LOG_DEBUG(1, "failed to disable port 0 after sniffing, result=%d\n", result); goto failed; } /* Clear the driver state */ wlandev->netdev->type = ARPHRD_ETHER; /* Restore the wepflags */ result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFWEPFLAGS, hw->presniff_wepflags); if ( result ) { WLAN_LOG_DEBUG(1, "failed to restore wepflags=0x%04x, result=%d\n", hw->presniff_wepflags, result); goto failed; } /* Set the port to its prior type and enable (if necessary) */ if (hw->presniff_port_type != 0 ) { word = hw->presniff_port_type; result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFPORTTYPE, word); if ( result ) { WLAN_LOG_DEBUG(1, "failed to restore porttype, result=%d\n", result); goto failed; } /* Enable the port */ result = hfa384x_drvr_enable(hw, 0); if ( result ) { WLAN_LOG_DEBUG(1, "failed to enable port to presniff setting, result=%d\n", result); goto failed; } } else { result = hfa384x_drvr_disable(hw, 0); } WLAN_LOG_INFO("monitor mode disabled\n"); msg->resultcode.data = P80211ENUM_resultcode_success; result = 0; goto exit; break; case P80211ENUM_truth_true: /* Disable the port (if enabled), only check Port 0 */ if ( hw->port_enabled[0]) { if (wlandev->netdev->type == ARPHRD_ETHER) { /* Save macport 0 state */ result = hfa384x_drvr_getconfig16(hw, HFA384x_RID_CNFPORTTYPE, &(hw->presniff_port_type)); if ( result ) { WLAN_LOG_DEBUG(1,"failed to read porttype, result=%d\n", result); goto failed; } /* Save the wepflags state */ result = hfa384x_drvr_getconfig16(hw, HFA384x_RID_CNFWEPFLAGS, &(hw->presniff_wepflags)); if ( result ) { WLAN_LOG_DEBUG(1,"failed to read wepflags, result=%d\n", result); goto failed; } hfa384x_drvr_stop(hw); result = hfa384x_drvr_start(hw); if ( result ) { WLAN_LOG_DEBUG(1, "failed to restart the card for sniffing, result=%d\n", result); goto failed; } } else { /* Disable the port */ result = hfa384x_drvr_disable(hw, 0); if ( result ) { WLAN_LOG_DEBUG(1, "failed to enable port for sniffing, result=%d\n", result); goto failed; } } } else { hw->presniff_port_type = 0; } /* Set the channel we wish to sniff */ word = msg->channel.data; result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFOWNCHANNEL, word); hw->sniff_channel=word; if ( result ) { WLAN_LOG_DEBUG(1, "failed to set channel %d, result=%d\n", word, result); goto failed; } /* Now if we're already sniffing, we can skip the rest */ if (wlandev->netdev->type != ARPHRD_ETHER) { /* Set the port type to pIbss */ word = HFA384x_PORTTYPE_PSUEDOIBSS; result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFPORTTYPE, word); if ( result ) { WLAN_LOG_DEBUG(1, "failed to set porttype %d, result=%d\n", word, result); goto failed; } if ((msg->keepwepflags.status == P80211ENUM_msgitem_status_data_ok) && (msg->keepwepflags.data != P80211ENUM_truth_true)) { /* Set the wepflags for no decryption */ word = HFA384x_WEPFLAGS_DISABLE_TXCRYPT | HFA384x_WEPFLAGS_DISABLE_RXCRYPT; result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFWEPFLAGS, word); } if ( result ) { WLAN_LOG_DEBUG(1, "failed to set wepflags=0x%04x, result=%d\n", word, result); goto failed; } } /* Do we want to strip the FCS in monitor mode? */ if ((msg->stripfcs.status == P80211ENUM_msgitem_status_data_ok) && (msg->stripfcs.data == P80211ENUM_truth_true)) { hw->sniff_fcs = 0; } else { hw->sniff_fcs = 1; } /* Do we want to truncate the packets? */ if (msg->packet_trunc.status == P80211ENUM_msgitem_status_data_ok) { hw->sniff_truncate = msg->packet_trunc.data; } else { hw->sniff_truncate = 0; } /* Enable the port */ result = hfa384x_drvr_enable(hw, 0); if ( result ) { WLAN_LOG_DEBUG(1, "failed to enable port for sniffing, result=%d\n", result); goto failed; } /* Enable monitor mode */ result = hfa384x_cmd_monitor(hw, HFA384x_MONITOR_ENABLE); if ( result ) { WLAN_LOG_DEBUG(1, "failed to enable monitor mode, result=%d\n", result); goto failed; } if (wlandev->netdev->type == ARPHRD_ETHER) { WLAN_LOG_INFO("monitor mode enabled\n"); } /* Set the driver state */ /* Do we want the prism2 header? */ if ((msg->prismheader.status == P80211ENUM_msgitem_status_data_ok) && (msg->prismheader.data == P80211ENUM_truth_true)) { hw->sniffhdr = 0; wlandev->netdev->type = ARPHRD_IEEE80211_PRISM; } else if ((msg->wlanheader.status == P80211ENUM_msgitem_status_data_ok) && (msg->wlanheader.data == P80211ENUM_truth_true)) { hw->sniffhdr = 1; wlandev->netdev->type = ARPHRD_IEEE80211_PRISM; } else { wlandev->netdev->type = ARPHRD_IEEE80211; } msg->resultcode.data = P80211ENUM_resultcode_success; result = 0; goto exit; break; default: msg->resultcode.data = P80211ENUM_resultcode_invalid_parameters; result = 0; goto exit; break; } failed: msg->resultcode.data = P80211ENUM_resultcode_refused; result = 0; exit: DBFEXIT; return result; } linux-wlan-ng-0.2.9+dfsg/src/prism2/driver/Makefile0000644000175000017500000000570111024763177021504 0ustar tormodtormod# src/prism2/driver/Makefile # # Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. # -------------------------------------------------------------------- # # linux-wlan # # 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. # # 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. # # -------------------------------------------------------------------- # # Inquiries regarding the linux-wlan Open Source project can be # made directly to: # # AbsoluteValue Systems Inc. # info@linux-wlan.com # http://www.linux-wlan.com # # -------------------------------------------------------------------- # # Portions of the development of this software were funded by # Intersil Corporation as part of PRISM(R) chipset product development. # # -------------------------------------------------------------------- -include $(WLAN_SRC)/../config.mk ifeq ($(WLAN_DEBUG), y) WLAN_INCLUDE_DEBUG=-DWLAN_INCLUDE_DEBUG endif obj-m := ifeq ($(PRISM2_PCMCIA), y) obj-m += prism2_cs.o endif ifeq ($(PRISM2_PCI), y) obj-m += prism2_pci.o endif ifeq ($(PRISM2_PLX), y) obj-m += prism2_plx.o endif ifeq ($(PRISM2_USB), y) obj-m += prism2_usb.o endif ifneq ($(KERNELRELEASE),) EXTRA_CFLAGS += -I$(WLAN_SRC)/include -I$(WLAN_SRC)/prism2/include $(WLAN_INCLUDE_DEBUG) ifeq ($(KERN_25), y) else include $(TOPDIR)/Rules.make endif else PWD := $(shell pwd) default: ifeq ($(KERN_2_6_5), y) ifeq ($(KERN_2_6_17), y) cp $(WLAN_SRC)/p80211/Module*.symvers . $(MAKE) -C $(LINUX_SRC) M='$(PWD)' WLAN_SRC=$(WLAN_SRC) modules else $(MAKE) -C $(LINUX_SRC) M='$(WLAN_SRC) $(WLAN_SRC)/p80211 $(PWD)' WLAN_SRC=$(WLAN_SRC) modules endif else # kbuild 2.4 $(MAKE) -C $(LINUX_SRC) SUBDIRS=$(PWD) WLAN_SRC=$(WLAN_SRC) \ modules endif # kbuild switch endif #KERNELRELEASE clean: rm -Rf *.o *.ko .*.cmd *.mod.c *.flags .*.flags .tmp_versions Module*.symvers install: ifeq ($(KERN_25), y) cp $(obj-m:.o=.ko) $(TARGET_MODDIR) else cp $(obj-m) $(TARGET_MODDIR) endif linux-wlan-ng-0.2.9+dfsg/src/prism2/driver/prism2_usb.c0000644000175000017500000002462611024763177022304 0ustar tormodtormod#define WLAN_HOSTIF WLAN_USB #include "hfa384x_usb.c" #include "prism2mgmt.c" #include "prism2mib.c" #include "prism2sta.c" #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) #error "prism2_usb requires at least a 2.4.x kernel!" #endif #define PRISM_USB_DEVICE(vid, pid, name) \ USB_DEVICE(vid, pid), \ .driver_info = (unsigned long) name static struct usb_device_id usb_prism_tbl[] = { {PRISM_USB_DEVICE(0x0707, 0xee04, "Intersil Americas USB 802.11b WLAN DEVICE")}, {PRISM_USB_DEVICE(0x04bb, 0x0922, "IOData AirPort WN-B11/USBS")}, {PRISM_USB_DEVICE(0x07aa, 0x0012, "Corega Wireless LAN USB Stick-11")}, {PRISM_USB_DEVICE(0x09aa, 0x3642, "Prism2.x 11Mbps WLAN USB Adapter")}, {PRISM_USB_DEVICE(0x1668, 0x0408, "Actiontec Prism2.5 11Mbps WLAN USB Adapter")}, {PRISM_USB_DEVICE(0x1668, 0x0421, "Actiontec Prism2.5 11Mbps WLAN USB Adapter")}, {PRISM_USB_DEVICE(0x1915, 0x2236, "Linksys WUSB11v3.0 11Mbps WLAN USB Adapter")}, {PRISM_USB_DEVICE(0x066b, 0x2212, "Linksys WUSB11v2.5 11Mbps WLAN USB Adapter")}, {PRISM_USB_DEVICE(0x066b, 0x2213, "Linksys WUSB12v1.1 11Mbps WLAN USB Adapter")}, {PRISM_USB_DEVICE(0x067c, 0x1022, "Siemens SpeedStream 1022 11Mbps WLAN USB Adapter")}, {PRISM_USB_DEVICE(0x049f, 0x0033, "Compaq/Intel W100 PRO/Wireless 11Mbps multiport WLAN Adapter")}, {PRISM_USB_DEVICE(0x0411, 0x0016, "Melco WLI-USB-S11 11Mbps WLAN Adapter")}, {PRISM_USB_DEVICE(0x08de, 0x7a01, "PRISM25 IEEE 802.11 Mini USB Adapter")}, {PRISM_USB_DEVICE(0x8086, 0x1111, "Intel PRO/Wireless 2011B LAN USB Adapter")}, {PRISM_USB_DEVICE(0x0d8e, 0x7a01, "PRISM25 IEEE 802.11 Mini USB Adapter")}, {PRISM_USB_DEVICE(0x045e, 0x006e, "Microsoft MN510 Wireless USB Adapter")}, {PRISM_USB_DEVICE(0x0967, 0x0204, "Acer Warplink USB Adapter")}, {PRISM_USB_DEVICE(0x0cde, 0x0002, "Z-Com 725/726 Prism2.5 USB/USB Integrated")}, {PRISM_USB_DEVICE(0x0cde, 0x0005, "Z-Com Xl735 Wireless 802.11b USB Adapter")}, {PRISM_USB_DEVICE(0x413c, 0x8100, "Dell TrueMobile 1180 Wireless USB Adapter")}, {PRISM_USB_DEVICE(0x0b3b, 0x1601, "ALLNET 0193 11Mbps WLAN USB Adapter")}, {PRISM_USB_DEVICE(0x0b3b, 0x1602, "ZyXEL ZyAIR B200 Wireless USB Adapter")}, {PRISM_USB_DEVICE(0x0baf, 0x00eb, "USRobotics USR1120 Wireless USB Adapter")}, {PRISM_USB_DEVICE(0x0411, 0x0027, "Melco WLI-USB-KS11G 11Mbps WLAN Adapter")}, {PRISM_USB_DEVICE(0x04f1, 0x3009, "JVC MP-XP7250 Builtin USB WLAN Adapter")}, {PRISM_USB_DEVICE(0x0846, 0x4110, "NetGear MA111")}, {PRISM_USB_DEVICE(0x03f3, 0x0020, "Adaptec AWN-8020 USB WLAN Adapter")}, // {PRISM_USB_DEVICE(0x0ace, 0x1201, "ZyDAS ZD1201 Wireless USB Adapter")}, {PRISM_USB_DEVICE(0x2821, 0x3300, "ASUS-WL140 Wireless USB Adapter")}, {PRISM_USB_DEVICE(0x2001, 0x3700, "DWL-122 Wireless USB Adapter")}, {PRISM_USB_DEVICE(0x2001, 0x3702, "DWL-120 Rev F Wireless USB Adapter")}, {PRISM_USB_DEVICE(0x50c2, 0x4013, "Averatec USB WLAN Adapter")}, {PRISM_USB_DEVICE(0x2c02, 0x14ea, "Planex GW-US11H WLAN USB Adapter")}, {PRISM_USB_DEVICE(0x124a, 0x168b, "Airvast PRISM3 WLAN USB Adapter")}, {PRISM_USB_DEVICE(0x083a, 0x3503, "T-Sinus 111 USB WLAN Adapter")}, {PRISM_USB_DEVICE(0x2821, 0x3300, "Hawking HighDB USB Adapter")}, {PRISM_USB_DEVICE(0x0411, 0x0044, "Melco WLI-USB-KB11 11Mbps WLAN Adapter")}, {PRISM_USB_DEVICE(0x1668, 0x6106, "ROPEX FreeLan 802.11b USB Adapter")}, {PRISM_USB_DEVICE(0x124a, 0x4017, "Pheenet WL-503IA 802.11b USB Adapter")}, {PRISM_USB_DEVICE(0x0bb2, 0x0302, "Ambit Microsystems Corp.")}, {PRISM_USB_DEVICE(0x9016, 0x182d, "Sitecom WL-022 802.11b USB Adapter")}, {PRISM_USB_DEVICE(0x0543, 0x0f01, "ViewSonic Airsync USB Adapter 11Mbps (Prism2.5)")}, { /* terminator */ } }; MODULE_DEVICE_TABLE(usb, usb_prism_tbl); /*---------------------------------------------------------------- * prism2sta_probe_usb * * Probe routine called by the USB subsystem. * * Arguments: * dev ptr to the usb_device struct * ifnum interface number being offered * * Returns: * NULL - we're not claiming the device+interface * non-NULL - we are claiming the device+interface and * this is a ptr to the data we want back * when disconnect is called. * * Side effects: * * Call context: * I'm not sure, assume it's interrupt. * ----------------------------------------------------------------*/ #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) static void __devinit *prism2sta_probe_usb( struct usb_device *dev, unsigned int ifnum, const struct usb_device_id *id) #else static int prism2sta_probe_usb( struct usb_interface *interface, const struct usb_device_id *id) #endif { #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) struct usb_interface *interface; #else struct usb_device *dev; #endif wlandevice_t *wlandev = NULL; hfa384x_t *hw = NULL; int result = 0; DBFENTER; #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) interface = &dev->actconfig->interface[ifnum]; #else dev = interface_to_usbdev(interface); #endif if ((wlandev = create_wlan()) == NULL) { WLAN_LOG_ERROR("%s: Memory allocation failure.\n", dev_info); result = -EIO; goto failed; } hw = wlandev->priv; if ( wlan_setup(wlandev) != 0 ) { WLAN_LOG_ERROR("%s: wlan_setup() failed.\n", dev_info); result = -EIO; goto failed; } /* Initialize the hw data */ hfa384x_create(hw, dev); hw->wlandev = wlandev; SET_MODULE_OWNER(wlandev->netdev); #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) SET_NETDEV_DEV(wlandev->netdev, &(interface->dev)); #endif /* Do a chip-level reset on the MAC */ if (prism2_doreset) { result = hfa384x_corereset(hw, prism2_reset_holdtime, prism2_reset_settletime, 0); if (result != 0) { hfa384x_destroy(hw); result = -EIO; WLAN_LOG_ERROR( "%s: hfa384x_corereset() failed.\n", dev_info); goto failed; } } #ifndef NEW_MODULE_CODE usb_inc_dev_use(dev); #endif #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)) usb_get_dev(dev); #endif wlandev->msdstate = WLAN_MSD_HWPRESENT; /* Register the wlandev, this gets us a name and registers the * linux netdevice. */ if ( register_wlandev(wlandev) != 0 ) { WLAN_LOG_ERROR("%s: register_wlandev() failed.\n", dev_info); result = -EIO; goto failed; } if (wlan_wext_write) prism2sta_ifstate(wlandev, P80211ENUM_ifstate_enable); goto done; failed: if (wlandev) kfree(wlandev); if (hw) kfree(hw); wlandev = NULL; done: DBFEXIT; p80211_allow_ioctls(wlandev); #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) return wlandev; #else usb_set_intfdata(interface, wlandev); return result; #endif } /*---------------------------------------------------------------- * prism2sta_disconnect_usb * * Called when a device previously claimed by probe is removed * from the USB. * * Arguments: * dev ptr to the usb_device struct * ptr ptr returned by probe() when the device * was claimed. * * Returns: * Nothing * * Side effects: * * Call context: * process ----------------------------------------------------------------*/ #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) static void __devexit prism2sta_disconnect_usb(struct usb_device *dev, void *ptr) #else static void prism2sta_disconnect_usb(struct usb_interface *interface) #endif { #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)) wlandevice_t *wlandev; #else wlandevice_t *wlandev = (wlandevice_t*)ptr; #endif DBFENTER; #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)) wlandev = (wlandevice_t *) usb_get_intfdata(interface); #endif if ( wlandev != NULL ) { LIST_HEAD(cleanlist); struct list_head *entry; struct list_head *temp; unsigned long flags; hfa384x_t *hw = wlandev->priv; if (!hw) goto exit; spin_lock_irqsave(&hw->ctlxq.lock, flags); p80211netdev_hwremoved(wlandev); list_splice_init(&hw->ctlxq.reapable, &cleanlist); list_splice_init(&hw->ctlxq.completing, &cleanlist); list_splice_init(&hw->ctlxq.pending, &cleanlist); list_splice_init(&hw->ctlxq.active, &cleanlist); spin_unlock_irqrestore(&hw->ctlxq.lock, flags); /* There's no hardware to shutdown, but the driver * might have some tasks or tasklets that must be * stopped before we can tear everything down. */ prism2sta_ifstate(wlandev, P80211ENUM_ifstate_disable); del_singleshot_timer_sync(&hw->throttle); del_singleshot_timer_sync(&hw->reqtimer); del_singleshot_timer_sync(&hw->resptimer); /* Unlink all the URBs. This "removes the wheels" * from the entire CTLX handling mechanism. */ usb_kill_urb(&hw->rx_urb); usb_kill_urb(&hw->tx_urb); usb_kill_urb(&hw->ctlx_urb); tasklet_kill(&hw->completion_bh); tasklet_kill(&hw->reaper_bh); flush_scheduled_work(); /* Now we complete any outstanding commands * and tell everyone who is waiting for their * responses that we have shut down. */ list_for_each(entry, &cleanlist) { hfa384x_usbctlx_t *ctlx; ctlx = list_entry(entry, hfa384x_usbctlx_t, list); complete(&ctlx->done); } /* Give any outstanding synchronous commands * a chance to complete. All they need to do * is "wake up", so that's easy. * (I'd like a better way to do this, really.) */ msleep(100); /* Now delete the CTLXs, because no-one else can now. */ list_for_each_safe(entry, temp, &cleanlist) { hfa384x_usbctlx_t *ctlx; ctlx = list_entry(entry, hfa384x_usbctlx_t, list); kfree(ctlx); } /* Unhook the wlandev */ unregister_wlandev(wlandev); wlan_unsetup(wlandev); #ifndef NEW_MODULE_CODE usb_dec_dev_use(hw->usb); #endif #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)) usb_put_dev(hw->usb); #endif hfa384x_destroy(hw); kfree(hw); kfree(wlandev); } exit: #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)) usb_set_intfdata(interface, NULL); #endif DBFEXIT; } static struct usb_driver prism2_usb_driver = { #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,4,19)) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)) .owner = THIS_MODULE, #endif .name = "prism2_usb", .probe = prism2sta_probe_usb, .disconnect = prism2sta_disconnect_usb, .id_table = usb_prism_tbl, /* fops, minor? */ }; #ifdef MODULE static int __init prism2usb_init(void) { DBFENTER; WLAN_LOG_NOTICE("%s Loaded\n", version); WLAN_LOG_NOTICE("dev_info is: %s\n", dev_info); /* This call will result in calls to prism2sta_probe_usb. */ return usb_register(&prism2_usb_driver); DBFEXIT; }; static void __exit prism2usb_cleanup(void) { DBFENTER; usb_deregister(&prism2_usb_driver); printk(KERN_NOTICE "%s Unloaded\n", version); DBFEXIT; }; module_init(prism2usb_init); module_exit(prism2usb_cleanup); #endif // module linux-wlan-ng-0.2.9+dfsg/src/prism2/driver/prism2_plx.c0000644000175000017500000003146211024763177022312 0ustar tormodtormod#define WLAN_HOSTIF WLAN_PLX #include "hfa384x.c" #include "prism2mgmt.c" #include "prism2mib.c" #include "prism2sta.c" #define PLX_ATTR_SIZE 0x1000 /* Attribute memory size - 4K bytes */ #define COR_OFFSET 0x3e0 /* COR attribute offset of Prism2 PC card */ #define COR_VALUE 0x41 /* Enable PC card with irq in level trigger */ #define PLX_INTCSR 0x4c /* Interrupt Control and Status Register */ #define PLX_INTCSR_INTEN (1<<6) /* Interrupt Enable bit */ #define PLX_MIN_ATTR_LEN 512 /* at least 2 x 256 is needed for CIS */ /* 3Com 3CRW777A (PLX) board ID */ #define PCIVENDOR_3COM 0x10B7 #define PCIDEVICE_AIRCONNECT 0x7770 /* Eumitcom PCI WL11000 PCI Adapter (PLX) board device+vendor ID */ #define PCIVENDOR_EUMITCOM 0x1638UL #define PCIDEVICE_WL11000 0x1100UL /* Global Sun Tech GL24110P PCI Adapter (PLX) board device+vendor ID */ #define PCIVENDOR_GLOBALSUN 0x16abUL #define PCIDEVICE_GL24110P 0x1101UL #define PCIDEVICE_GL24110P_ALT 0x1102UL /* Netgear MA301 PCI Adapter (PLX) board device+vendor ID */ #define PCIVENDOR_NETGEAR 0x1385UL #define PCIDEVICE_MA301 0x4100UL /* US Robotics USR2410 PCI Adapter (PLX) board device+vendor ID */ #define PCIVENDOR_USROBOTICS 0x16ecUL #define PCIDEVICE_USR2410 0x3685UL /* Linksys WPC11 card with the WDT11 adapter (PLX) board device+vendor ID */ #define PCIVENDOR_Linksys 0x16abUL #define PCIDEVICE_Wpc11Wdt11 0x1102UL /* National Datacomm Corp SOHOware Netblaster II PCI */ #define PCIVENDOR_NDC 0x15e8UL #define PCIDEVICE_NCP130_PLX 0x0130UL #define PCIDEVICE_NCP130_ASIC 0x0131UL /* NDC NCP130_PLX is also sold by Corega. Their name is CGWLPCIA11 */ #define PCIVENDOR_COREGA PCIVENDOR_NDC #define PCIDEVICE_CGWLPCIA11 PCIDEVICE_NCP130_PLX /* PCI Class & Sub-Class code, Network-'Other controller' */ #define PCI_CLASS_NETWORK_OTHERS 0x280 /*---------------------------------------------------------------- * prism2sta_probe_plx * * Probe routine called when a PCI device w/ matching ID is found. * This PLX implementation uses the following map: * BAR0: Unused * BAR1: ???? * BAR2: PCMCIA attribute memory * BAR3: PCMCIA i/o space * Here's the sequence: * - Allocate the PCI resources. * - Read the PCMCIA attribute memory to make sure we have a WLAN card * - Reset the MAC using the PCMCIA COR * - Initialize the netdev and wlan data * - Initialize the MAC * * Arguments: * pdev ptr to pci device structure containing info about * pci configuration. * id ptr to the device id entry that matched this device. * * Returns: * zero - success * negative - failed * * Side effects: * * * Call context: * process thread * ----------------------------------------------------------------*/ static int __devinit prism2sta_probe_plx( struct pci_dev *pdev, const struct pci_device_id *id) { int result; phys_t pccard_ioaddr; phys_t pccard_attr_mem; unsigned int pccard_attr_len; void __iomem *attr_mem = NULL; UINT32 plx_addr; wlandevice_t *wlandev = NULL; hfa384x_t *hw = NULL; int reg; u32 regic; if (pci_enable_device(pdev)) return -EIO; /* TMC7160 boards are special */ if ((pdev->vendor == PCIVENDOR_NDC) && (pdev->device == PCIDEVICE_NCP130_ASIC)) { unsigned long delay; pccard_attr_mem = 0; pccard_ioaddr = pci_resource_start(pdev, 1); outb(0x45, pccard_ioaddr); delay = jiffies + 1*HZ; while (time_before(jiffies, delay)); if (inb(pccard_ioaddr) != 0x45) { WLAN_LOG_ERROR("Initialize the TMC7160 failed. (0x%x)\n", inb(pccard_ioaddr)); return -EIO; } pccard_ioaddr = pci_resource_start(pdev, 2); prism2_doreset = 0; WLAN_LOG_INFO("NDC NCP130 with TMC716(ASIC) PCI interface device found at io:0x%x, irq:%d\n", pccard_ioaddr, pdev->irq); goto init; } /* Collect the resource requirements */ pccard_attr_mem = pci_resource_start(pdev, 2); pccard_attr_len = pci_resource_len(pdev, 2); if (pccard_attr_len < PLX_MIN_ATTR_LEN) return -EIO; pccard_ioaddr = pci_resource_start(pdev, 3); /* bjoern: We need to tell the card to enable interrupts, in * case the serial eprom didn't do this already. See the * PLX9052 data book, p8-1 and 8-24 for reference. * [MSM]: This bit of code came from the orinoco_cs driver. */ plx_addr = pci_resource_start(pdev, 1); regic = 0; regic = inl(plx_addr+PLX_INTCSR); if(regic & PLX_INTCSR_INTEN) { WLAN_LOG_DEBUG(1, "%s: Local Interrupt already enabled\n", dev_info); } else { regic |= PLX_INTCSR_INTEN; outl(regic, plx_addr+PLX_INTCSR); regic = inl(plx_addr+PLX_INTCSR); if(!(regic & PLX_INTCSR_INTEN)) { WLAN_LOG_ERROR( "%s: Couldn't enable Local Interrupts\n", dev_info); return -EIO; } } /* These assignments are here in case of future mappings for * io space and irq that might be similar to ioremap */ if (!request_mem_region(pccard_attr_mem, pci_resource_len(pdev, 2), "Prism2")) { WLAN_LOG_ERROR("%s: Couldn't reserve PCI memory region\n", dev_info); return -EIO; } attr_mem = ioremap(pccard_attr_mem, pccard_attr_len); WLAN_LOG_INFO("A PLX PCI/PCMCIA interface device found, " "phymem:0x%llx, phyio=0x%x, irq:%d, " "mem: 0x%lx\n", (unsigned long long)pccard_attr_mem, pccard_ioaddr, pdev->irq, (unsigned long)attr_mem); /* Verify whether PC card is present. * [MSM] This needs improvement, the right thing to do is * probably to walk the CIS looking for the vendor and product * IDs. It would be nice if this could be tied in with the * etc/pcmcia/wlan-ng.conf file. Any volunteers? ;-) */ if ( readb(attr_mem + 0) != 0x01 || readb(attr_mem + 2) != 0x03 || readb(attr_mem + 4) != 0x00 || readb(attr_mem + 6) != 0x00 || readb(attr_mem + 8) != 0xFF || readb(attr_mem + 10) != 0x17 || readb(attr_mem + 12) != 0x04 || readb(attr_mem + 14) != 0x67) { WLAN_LOG_ERROR("Prism2 PC card CIS is invalid.\n"); return -EIO; } WLAN_LOG_INFO("A PCMCIA WLAN adapter was found.\n"); /* Write COR to enable PC card */ writeb(COR_VALUE, attr_mem + COR_OFFSET); reg = readb(attr_mem + COR_OFFSET); init: /* * Now do everything the same as a PCI device * [MSM] TODO: We could probably factor this out of pcmcia/pci/plx * and perhaps usb. Perhaps a task for another day....... */ if ((wlandev = create_wlan()) == NULL) { WLAN_LOG_ERROR("%s: Memory allocation failure.\n", dev_info); result = -EIO; goto failed; } hw = wlandev->priv; if ( wlan_setup(wlandev) != 0 ) { WLAN_LOG_ERROR("%s: wlan_setup() failed.\n", dev_info); result = -EIO; goto failed; } /* Setup netdevice's ability to report resources * Note: the netdevice was allocated by wlan_setup() */ wlandev->netdev->irq = pdev->irq; wlandev->netdev->base_addr = pccard_ioaddr; wlandev->netdev->mem_start = (unsigned long)attr_mem; wlandev->netdev->mem_end = (unsigned long)attr_mem + pci_resource_len(pdev, 0); /* Initialize the hw data */ hfa384x_create(hw, wlandev->netdev->irq, pccard_ioaddr, attr_mem); hw->wlandev = wlandev; SET_MODULE_OWNER(wlandev->netdev); #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) SET_NETDEV_DEV(wlandev->netdev, &(pdev->dev)); #endif #if 0 /* TODO: Move this and an irq test into an hfa384x_testif() routine. */ outw(PRISM2STA_MAGIC, HFA384x_SWSUPPORT(wlandev->netdev->base_addr)); reg=inw( HFA384x_SWSUPPORT(wlandev->netdev->base_addr)); if ( reg != PRISM2STA_MAGIC ) { WLAN_LOG_ERROR("MAC register access test failed!\n"); result = -EIO; goto failed; } #endif /* Do a chip-level reset on the MAC */ if (prism2_doreset) { result = hfa384x_corereset(hw, prism2_reset_holdtime, prism2_reset_settletime, 0); if (result != 0) { hfa384x_destroy(hw); WLAN_LOG_ERROR( "%s: hfa384x_corereset() failed.\n", dev_info); result = -EIO; goto failed; } } pci_set_drvdata(pdev, wlandev); /* Shouldn't actually hook up the IRQ until we * _know_ things are alright. A test routine would help. */ request_irq(wlandev->netdev->irq, hfa384x_interrupt, IRQF_SHARED, wlandev->name, wlandev); wlandev->msdstate = WLAN_MSD_HWPRESENT; /* Register the wlandev, this gets us a name and registers the * linux netdevice. */ if ( register_wlandev(wlandev) != 0 ) { WLAN_LOG_ERROR("%s: register_wlandev() failed.\n", dev_info); result = -EIO; goto failed; } if (wlan_wext_write) prism2sta_ifstate(wlandev, P80211ENUM_ifstate_enable); result = 0; goto done; failed: pci_set_drvdata(pdev, NULL); if (wlandev) kfree(wlandev); if (hw) kfree(hw); if (attr_mem) iounmap(attr_mem); pci_release_regions(pdev); pci_disable_device(pdev); done: p80211_allow_ioctls(wlandev); DBFEXIT; return result; } static void __devexit prism2sta_remove_plx(struct pci_dev *pdev) { wlandevice_t *wlandev; hfa384x_t *hw; wlandev = (wlandevice_t *) pci_get_drvdata(pdev); hw = wlandev->priv; p80211netdev_hwremoved(wlandev); /* reset hardware */ prism2sta_ifstate(wlandev, P80211ENUM_ifstate_disable); if (pdev->irq) free_irq(pdev->irq, wlandev); unregister_wlandev(wlandev); /* free local stuff */ if (hw) { hfa384x_destroy(hw); kfree(hw); } iounmap((void __iomem *)wlandev->netdev->mem_start); wlan_unsetup(wlandev); pci_release_regions(pdev); pci_disable_device(pdev); pci_set_drvdata(pdev, NULL); kfree(wlandev); } static struct pci_device_id plx_id_tbl[] = { { PCIVENDOR_EUMITCOM, PCIDEVICE_WL11000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, /* Driver data, we just put the name here */ (unsigned long)"Eumitcom WL11000 PCI(PLX) card" }, { PCIVENDOR_GLOBALSUN, PCIDEVICE_GL24110P, PCI_ANY_ID, PCI_ANY_ID, 0, 0, /* Driver data, we just put the name here */ (unsigned long)"Global Sun Tech GL24110P PCI(PLX) card" }, { PCIVENDOR_GLOBALSUN, PCIDEVICE_GL24110P_ALT, PCI_ANY_ID, PCI_ANY_ID, 0, 0, /* Driver data, we just put the name here */ (unsigned long)"Global Sun Tech GL24110P PCI(PLX) card" }, { PCIVENDOR_NETGEAR, PCIDEVICE_MA301, PCI_ANY_ID, PCI_ANY_ID, 0, 0, /* Driver data, we just put the name here */ (unsigned long)"Global Sun Tech GL24110P PCI(PLX) card" }, { PCIVENDOR_USROBOTICS, PCIDEVICE_USR2410, PCI_ANY_ID, PCI_ANY_ID, 0, 0, /* Driver data, we just put the name here */ (unsigned long)"US Robotics USR2410 PCI(PLX) card" }, { PCIVENDOR_Linksys, PCIDEVICE_Wpc11Wdt11, PCI_ANY_ID, PCI_ANY_ID, 0, 0, /* Driver data, we just put the name here */ (unsigned long)"Linksys WPC11 with WDT11 PCI(PLX) adapter" }, { PCIVENDOR_NDC, PCIDEVICE_NCP130_PLX, PCI_ANY_ID, PCI_ANY_ID, 0, 0, /* Driver data, we just put the name here */ (unsigned long)"NDC Netblaster II PCI(PLX)" }, { PCIVENDOR_NDC, PCIDEVICE_NCP130_ASIC, PCI_ANY_ID, PCI_ANY_ID, 0, 0, /* Driver data, we just put the name here */ (unsigned long)"NDC Netblaster II PCI(TMC7160)" }, { PCIVENDOR_3COM, PCIDEVICE_AIRCONNECT, PCI_ANY_ID, PCI_ANY_ID, 0, 0, /* Driver data, we just put the name here */ (unsigned long)"3Com AirConnect PCI 802.11b 11Mb/s WLAN Controller" }, { 0, 0, 0, 0, 0, 0, 0 } }; MODULE_DEVICE_TABLE(pci, plx_id_tbl); /* Function declared here because of ptr reference below */ static int __devinit prism2sta_probe_plx(struct pci_dev *pdev, const struct pci_device_id *); static void __devexit prism2sta_remove_plx(struct pci_dev *pdev); static struct pci_driver prism2_plx_drv_id = { .name = "prism2_plx", .id_table = plx_id_tbl, .probe = prism2sta_probe_plx, .remove = prism2sta_remove_plx, #ifdef CONFIG_PM .suspend = prism2sta_suspend_pci, .resume = prism2sta_resume_pci, #endif }; #ifdef MODULE static int __init prism2plx_init(void) { WLAN_LOG_NOTICE("%s Loaded\n", version); return pci_register_driver(&prism2_plx_drv_id); }; static void __exit prism2plx_cleanup(void) { pci_unregister_driver(&prism2_plx_drv_id); }; module_init(prism2plx_init); module_exit(prism2plx_cleanup); #endif // MODULE int hfa384x_corereset(hfa384x_t *hw, int holdtime, int settletime, int genesis) { int result = 0; #define COR_OFFSET 0x3e0 /* COR attribute offset of Prism2 PC card */ #define COR_VALUE 0x41 /* Enable PC card with irq in level trigger */ #define HCR_OFFSET 0x3e2 /* HCR attribute offset of Prism2 PC card */ UINT8 corsave; DBFENTER; WLAN_LOG_DEBUG(3, "Doing reset via direct COR access.\n"); /* Collect COR */ corsave = readb(hw->membase + COR_OFFSET); /* Write reset bit (BIT7) */ writeb(corsave | BIT7, hw->membase + COR_OFFSET); /* Hold for holdtime */ mdelay(holdtime); if (genesis) { writeb(genesis, hw->membase + HCR_OFFSET); /* Hold for holdtime */ mdelay(holdtime); } /* Clear reset bit */ writeb(corsave & ~BIT7, hw->membase + COR_OFFSET); /* Wait for settletime */ mdelay(settletime); /* Set non-reset bits back what they were */ writeb(corsave, hw->membase + COR_OFFSET); DBFEXIT; return result; } linux-wlan-ng-0.2.9+dfsg/src/prism2/driver/hfa384x.c0000644000175000017500000031612311024763177021400 0ustar tormodtormod/* src/prism2/driver/hfa384x.c * * Implements the functions of the Intersil hfa384x MAC * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- * * This file implements functions that correspond to the prism2/hfa384x * 802.11 MAC hardware and firmware host interface. * * The functions can be considered to represent several levels of * abstraction. The lowest level functions are simply C-callable wrappers * around the register accesses. The next higher level represents C-callable * prism2 API functions that match the Intersil documentation as closely * as is reasonable. The next higher layer implements common sequences * of invokations of the API layer (e.g. write to bap, followed by cmd). * * Common sequences: * hfa384x_drvr_xxx Highest level abstractions provided by the * hfa384x code. They are driver defined wrappers * for common sequences. These functions generally * use the services of the lower levels. * * hfa384x_drvr_xxxconfig An example of the drvr level abstraction. These * functions are wrappers for the RID get/set * sequence. They call copy_[to|from]_bap() and * cmd_access(). These functions operate on the * RIDs and buffers without validation. The caller * is responsible for that. * * API wrapper functions: * hfa384x_cmd_xxx functions that provide access to the f/w commands. * The function arguments correspond to each command * argument, even command arguments that get packed * into single registers. These functions _just_ * issue the command by setting the cmd/parm regs * & reading the status/resp regs. Additional * activities required to fully use a command * (read/write from/to bap, get/set int status etc.) * are implemented separately. Think of these as * C-callable prism2 commands. * * Lowest Layer Functions: * hfa384x_docmd_xxx These functions implement the sequence required * to issue any prism2 command. Primarily used by the * hfa384x_cmd_xxx functions. * * hfa384x_bap_xxx BAP read/write access functions. * Note: we usually use BAP0 for non-interrupt context * and BAP1 for interrupt context. * * hfa384x_dl_xxx download related functions. * * Driver State Issues: * Note that there are two pairs of functions that manage the * 'initialized' and 'running' states of the hw/MAC combo. The four * functions are create(), destroy(), start(), and stop(). create() * sets up the data structures required to support the hfa384x_* * functions and destroy() cleans them up. The start() function gets * the actual hardware running and enables the interrupts. The stop() * function shuts the hardware down. The sequence should be: * create() * . * . Self contained test routines can run here, particularly * . corereset() and test_hostif(). * . * start() * . * . Do interesting things w/ the hardware * . * stop() * destroy() * * Note that destroy() can be called without calling stop() first. * -------------------------------------------------------------------- */ /*================================================================*/ /* System Includes */ #define WLAN_DBVAR prism2_debug #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) #include #else #include #endif #if (WLAN_HOSTIF == WLAN_PCMCIA) #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13) ) #include #endif #include #include #include #include #include #endif #if ((WLAN_HOSTIF == WLAN_PLX) || (WLAN_HOSTIF == WLAN_PCI)) #include #include #endif #include // XXXX #define CMD_IRQ /*================================================================*/ /* Project Includes */ #include #include #include #include #include #include #include #include #include #include #include /*================================================================*/ /* Local Constants */ static const UINT16 crc16tab[256] = { 0x0000, 0xc0c1, 0xc181, 0x0140, 0xc301, 0x03c0, 0x0280, 0xc241, 0xc601, 0x06c0, 0x0780, 0xc741, 0x0500, 0xc5c1, 0xc481, 0x0440, 0xcc01, 0x0cc0, 0x0d80, 0xcd41, 0x0f00, 0xcfc1, 0xce81, 0x0e40, 0x0a00, 0xcac1, 0xcb81, 0x0b40, 0xc901, 0x09c0, 0x0880, 0xc841, 0xd801, 0x18c0, 0x1980, 0xd941, 0x1b00, 0xdbc1, 0xda81, 0x1a40, 0x1e00, 0xdec1, 0xdf81, 0x1f40, 0xdd01, 0x1dc0, 0x1c80, 0xdc41, 0x1400, 0xd4c1, 0xd581, 0x1540, 0xd701, 0x17c0, 0x1680, 0xd641, 0xd201, 0x12c0, 0x1380, 0xd341, 0x1100, 0xd1c1, 0xd081, 0x1040, 0xf001, 0x30c0, 0x3180, 0xf141, 0x3300, 0xf3c1, 0xf281, 0x3240, 0x3600, 0xf6c1, 0xf781, 0x3740, 0xf501, 0x35c0, 0x3480, 0xf441, 0x3c00, 0xfcc1, 0xfd81, 0x3d40, 0xff01, 0x3fc0, 0x3e80, 0xfe41, 0xfa01, 0x3ac0, 0x3b80, 0xfb41, 0x3900, 0xf9c1, 0xf881, 0x3840, 0x2800, 0xe8c1, 0xe981, 0x2940, 0xeb01, 0x2bc0, 0x2a80, 0xea41, 0xee01, 0x2ec0, 0x2f80, 0xef41, 0x2d00, 0xedc1, 0xec81, 0x2c40, 0xe401, 0x24c0, 0x2580, 0xe541, 0x2700, 0xe7c1, 0xe681, 0x2640, 0x2200, 0xe2c1, 0xe381, 0x2340, 0xe101, 0x21c0, 0x2080, 0xe041, 0xa001, 0x60c0, 0x6180, 0xa141, 0x6300, 0xa3c1, 0xa281, 0x6240, 0x6600, 0xa6c1, 0xa781, 0x6740, 0xa501, 0x65c0, 0x6480, 0xa441, 0x6c00, 0xacc1, 0xad81, 0x6d40, 0xaf01, 0x6fc0, 0x6e80, 0xae41, 0xaa01, 0x6ac0, 0x6b80, 0xab41, 0x6900, 0xa9c1, 0xa881, 0x6840, 0x7800, 0xb8c1, 0xb981, 0x7940, 0xbb01, 0x7bc0, 0x7a80, 0xba41, 0xbe01, 0x7ec0, 0x7f80, 0xbf41, 0x7d00, 0xbdc1, 0xbc81, 0x7c40, 0xb401, 0x74c0, 0x7580, 0xb541, 0x7700, 0xb7c1, 0xb681, 0x7640, 0x7200, 0xb2c1, 0xb381, 0x7340, 0xb101, 0x71c0, 0x7080, 0xb041, 0x5000, 0x90c1, 0x9181, 0x5140, 0x9301, 0x53c0, 0x5280, 0x9241, 0x9601, 0x56c0, 0x5780, 0x9741, 0x5500, 0x95c1, 0x9481, 0x5440, 0x9c01, 0x5cc0, 0x5d80, 0x9d41, 0x5f00, 0x9fc1, 0x9e81, 0x5e40, 0x5a00, 0x9ac1, 0x9b81, 0x5b40, 0x9901, 0x59c0, 0x5880, 0x9841, 0x8801, 0x48c0, 0x4980, 0x8941, 0x4b00, 0x8bc1, 0x8a81, 0x4a40, 0x4e00, 0x8ec1, 0x8f81, 0x4f40, 0x8d01, 0x4dc0, 0x4c80, 0x8c41, 0x4400, 0x84c1, 0x8581, 0x4540, 0x8701, 0x47c0, 0x4680, 0x8641, 0x8201, 0x42c0, 0x4380, 0x8341, 0x4100, 0x81c1, 0x8081, 0x4040 }; /*================================================================*/ /* Local Macros */ /*================================================================*/ /* Local Types */ /*================================================================*/ /* Local Static Definitions */ extern int prism2_debug; /*================================================================*/ /* Local Function Declarations */ static void hfa384x_int_dtim(wlandevice_t *wlandev); static void hfa384x_int_infdrop(wlandevice_t *wlandev); static void hfa384x_bap_tasklet(unsigned long data); static void hfa384x_int_info(wlandevice_t *wlandev); static void hfa384x_int_txexc(wlandevice_t *wlandev); static void hfa384x_int_tx(wlandevice_t *wlandev); static void hfa384x_int_rx(wlandevice_t *wlandev); #ifdef CMD_IRQ static void hfa384x_int_cmd(wlandevice_t *wlandev); #endif static void hfa384x_int_rxmonitor( wlandevice_t *wlandev, UINT16 rxfid, hfa384x_rx_frame_t *rxdesc); static void hfa384x_int_alloc(wlandevice_t *wlandev); static int hfa384x_docmd_wait( hfa384x_t *hw, hfa384x_metacmd_t *cmd); static int hfa384x_dl_docmd_wait( hfa384x_t *hw, hfa384x_metacmd_t *cmd); static UINT16 hfa384x_mkcrc16(UINT8 *p, int len); int hfa384x_copy_to_bap4(hfa384x_t *hw, UINT16 bap, UINT16 id, UINT16 offset, void *buf, UINT len, void* buf2, UINT len2, void *buf3, UINT len3, void* buf4, UINT len4); /*================================================================*/ /* Function Definitions */ static UINT16 txfid_queue_empty(hfa384x_t *hw) { return (hw->txfid_head == hw->txfid_tail) ? 1 : 0; } static UINT16 txfid_queue_remove(hfa384x_t *hw) { UINT16 result= 0; if (txfid_queue_empty(hw)) { WLAN_LOG_DEBUG(3,"queue empty.\n"); } else { result = hw->txfid_queue[hw->txfid_head]; hw->txfid_head = (hw->txfid_head + 1) % hw->txfid_N; } return (UINT16)result; } static INT16 txfid_queue_add(hfa384x_t *hw, UINT16 val) { INT16 result = 0; if (hw->txfid_head == ((hw->txfid_tail + 1) % hw->txfid_N)) { result = -1; WLAN_LOG_DEBUG(3,"queue full.\n"); } else { hw->txfid_queue[hw->txfid_tail] = val; result = hw->txfid_tail; hw->txfid_tail = (hw->txfid_tail + 1) % hw->txfid_N; } return result; } /*---------------------------------------------------------------- * hfa384x_create * * Initializes the hfa384x_t data structure for use. Note this * does _not_ intialize the actual hardware, just the data structures * we use to keep track of its state. * * Arguments: * hw device structure * irq device irq number * iobase [pcmcia] i/o base address for register access * [pci] zero * [plx] i/o base address for register access * membase [pcmcia] pcmcia_cs "link" pointer * [pci] memory base address for register access * [plx] memory base address for card attribute memory * * Returns: * nothing * * Side effects: * * Call context: * process thread ----------------------------------------------------------------*/ void hfa384x_create(hfa384x_t *hw, UINT irq, UINT32 iobase, UINT8 __iomem *membase) { DBFENTER; memset(hw, 0, sizeof(hfa384x_t)); hw->irq = irq; hw->iobase = iobase; hw->membase = membase; spin_lock_init(&(hw->cmdlock)); /* BAP setup */ spin_lock_init(&(hw->baplock)); tasklet_init(&hw->bap_tasklet, hfa384x_bap_tasklet, (unsigned long) hw); init_waitqueue_head(&hw->cmdq); sema_init(&hw->infofid_sem, 1); hw->txfid_head = 0; hw->txfid_tail = 0; hw->txfid_N = HFA384x_DRVR_FIDSTACKLEN_MAX; memset(hw->txfid_queue, 0, sizeof(hw->txfid_queue)); hw->isram16 = 1; /* Init the auth queue head */ skb_queue_head_init(&hw->authq); INIT_WORK2(&hw->link_bh, prism2sta_processing_defer); INIT_WORK2(&hw->commsqual_bh, prism2sta_commsqual_defer); init_timer(&hw->commsqual_timer); hw->commsqual_timer.data = (unsigned long) hw; hw->commsqual_timer.function = prism2sta_commsqual_timer; hw->link_status = HFA384x_LINK_NOTCONNECTED; hw->state = HFA384x_STATE_INIT; DBFEXIT; } /*---------------------------------------------------------------- * hfa384x_destroy * * Partner to hfa384x_create(). This function cleans up the hw * structure so that it can be freed by the caller using a simple * kfree. Currently, this function is just a placeholder. If, at some * point in the future, an hw in the 'shutdown' state requires a 'deep' * kfree, this is where it should be done. Note that if this function * is called on a _running_ hw structure, the drvr_stop() function is * called. * * Arguments: * hw device structure * * Returns: * nothing, this function is not allowed to fail. * * Side effects: * * Call context: * process ----------------------------------------------------------------*/ void hfa384x_destroy( hfa384x_t *hw) { struct sk_buff *skb; DBFENTER; if ( hw->state == HFA384x_STATE_RUNNING ) { hfa384x_drvr_stop(hw); } hw->state = HFA384x_STATE_PREINIT; if (hw->scanresults) { kfree(hw->scanresults); hw->scanresults = NULL; } /* Now to clean out the auth queue */ while ( (skb = skb_dequeue(&hw->authq)) ) { dev_kfree_skb(skb); } DBFEXIT; return; } /*---------------------------------------------------------------- * hfa384x_drvr_getconfig * * Performs the sequence necessary to read a config/info item. * * Arguments: * hw device structure * rid config/info record id (host order) * buf host side record buffer. Upon return it will * contain the body portion of the record (minus the * RID and len). * len buffer length (in bytes, should match record length) * * Returns: * 0 success * >0 f/w reported error - f/w status code * <0 driver reported error * -ENODATA length mismatch between argument and retrieved * record. * * Side effects: * * Call context: * process thread ----------------------------------------------------------------*/ int hfa384x_drvr_getconfig(hfa384x_t *hw, UINT16 rid, void *buf, UINT16 len) { int result = 0; DBFENTER; result = hfa384x_cmd_access( hw, 0, rid, buf, len); DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_drvr_setconfig * * Performs the sequence necessary to write a config/info item. * * Arguments: * hw device structure * rid config/info record id (in host order) * buf host side record buffer * len buffer length (in bytes) * * Returns: * 0 success * >0 f/w reported error - f/w status code * <0 driver reported error * * Side effects: * * Call context: * process thread ----------------------------------------------------------------*/ int hfa384x_drvr_setconfig(hfa384x_t *hw, UINT16 rid, void *buf, UINT16 len) { int result = 0; DBFENTER; result = hfa384x_cmd_access( hw, 1, rid, buf, len); DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_drvr_readpda * * Performs the sequence to read the PDA space. Note there is no * drvr_writepda() function. Writing a PDA is * generally implemented by a calling component via calls to * cmd_download and writing to the flash download buffer via the * aux regs. * * Arguments: * hw device structure * buf buffer to store PDA in * len buffer length * * Returns: * 0 success * >0 f/w reported error - f/w status code * <0 driver reported error * -ETIMEOUT timout waiting for the cmd regs to become * available, or waiting for the control reg * to indicate the Aux port is enabled. * -ENODATA the buffer does NOT contain a valid PDA. * Either the card PDA is bad, or the auxdata * reads are giving us garbage. * * Side effects: * * Call context: * process thread or non-card interrupt. ----------------------------------------------------------------*/ int hfa384x_drvr_readpda(hfa384x_t *hw, void *buf, UINT len) { int result = 0; UINT16 *pda = buf; int pdaok = 0; int morepdrs = 1; int currpdr = 0; /* word offset of the current pdr */ int i; UINT16 pdrlen; /* pdr length in bytes, host order */ UINT16 pdrcode; /* pdr code, host order */ UINT16 crc; UINT16 pdacrc; struct pdaloc { UINT32 cardaddr; UINT16 auxctl; } pdaloc[] = { { HFA3842_PDA_BASE, HFA384x_AUX_CTL_NV}, { HFA3842_PDA_BASE, HFA384x_AUX_CTL_EXTDS}, { HFA3841_PDA_BASE, HFA384x_AUX_CTL_NV}, { HFA3841_PDA_BASE, HFA384x_AUX_CTL_EXTDS}, { HFA3841_PDA_BOGUS_BASE, HFA384x_AUX_CTL_NV} }; DBFENTER; /* Check for aux available */ result = hfa384x_cmd_aux_enable(hw, 0); if ( result ) { WLAN_LOG_DEBUG(1,"aux_enable() failed. result=%d\n", result); goto failed; } /* Read the pda from each known address. */ for ( i = 0; i < (sizeof(pdaloc)/sizeof(pdaloc[0])); i++) { WLAN_LOG_DEBUG( 3, "Checking PDA@(0x%08x,%s)\n", pdaloc[i].cardaddr, pdaloc[i].auxctl == HFA384x_AUX_CTL_NV ? "CTL_NV" : "CTL_EXTDS"); /* Copy bufsize bytes from our current pdaloc */ hfa384x_copy_from_aux(hw, pdaloc[i].cardaddr, pdaloc[i].auxctl, buf, len); /* Test for garbage */ /* Traverse the PDR list Looking for PDA-END */ pdaok = 1; /* intially assume good */ morepdrs = 1; currpdr = 0; while ( pdaok && morepdrs ) { pdrlen = hfa384x2host_16(pda[currpdr]) * 2; pdrcode = hfa384x2host_16(pda[currpdr+1]); /* Test for completion at END record */ if ( pdrcode == HFA384x_PDR_END_OF_PDA ) { if ( pdrlen == 4 ) { morepdrs = 0; /* Calculate CRC-16 and compare to PDA * value. Note the addition of 2 words * for ENDREC.len and ENDREC.code * fields. */ crc = hfa384x_mkcrc16( (UINT8*)pda, (currpdr + 2) * sizeof(UINT16)); pdacrc =hfa384x2host_16(pda[currpdr+2]); if ( crc != pdacrc ) { WLAN_LOG_DEBUG(3, "PDA crc failed:" "calc_crc=0x%04x," "pdr_crc=0x%04x.\n", crc, pdacrc); pdaok = 0; } } else { WLAN_LOG_DEBUG(3, "END record detected w/ " "len(%d) != 2, assuming bad PDA\n", pdrlen); pdaok = 0; } break; } /* Test the record length */ if ( pdrlen > HFA384x_PDR_LEN_MAX || pdrlen == 0) { WLAN_LOG_DEBUG(3, "pdrlen for address #%d " "at %#x:%#x:%d\n", i, pdaloc[i].cardaddr, pdaloc[i].auxctl, pdrlen); WLAN_LOG_DEBUG(3,"pdrlen invalid=%d\n", pdrlen); pdaok = 0; break; } /* Move to the next pdr */ if ( morepdrs ) { /* note the access to pda[], we need words */ currpdr += hfa384x2host_16(pda[currpdr]) + 1; if (currpdr*sizeof(UINT16) > len) { WLAN_LOG_DEBUG(3, "Didn't find PDA_END in buffer, " "trying next location.\n"); pdaok = 0; break; } } } if ( pdaok ) { WLAN_LOG_INFO( "PDA Read from 0x%08x in %s space.\n", pdaloc[i].cardaddr, pdaloc[i].auxctl == 0 ? "EXTDS" : pdaloc[i].auxctl == 1 ? "NV" : pdaloc[i].auxctl == 2 ? "PHY" : pdaloc[i].auxctl == 3 ? "ICSRAM" : ""); break; } } result = pdaok ? 0 : -ENODATA; if ( result ) { WLAN_LOG_DEBUG(3,"Failure: pda is not okay\n"); } hfa384x_cmd_aux_disable(hw); failed: DBFEXIT; return result; } /*---------------------------------------------------------------- * mkpda_crc * * Calculates the CRC16 for the given PDA and inserts the value * into the end record. * * Arguments: * pda ptr to the PDA data structure. * * Returns: * 0 - success * ~0 - failure (probably an errno) ----------------------------------------------------------------*/ static UINT16 hfa384x_mkcrc16(UINT8 *p, int len) { UINT16 crc = 0; UINT8 *lim = p + len; while (p < lim) { crc = (crc >> 8 ) ^ crc16tab[(crc & 0xff) ^ *p++]; } return crc; } /*---------------------------------------------------------------- * hfa384x_drvr_ramdl_enable * * Begins the ram download state. Checks to see that we're not * already in a download state and that a port isn't enabled. * Sets the download state and calls cmd_download with the * ENABLE_VOLATILE subcommand and the exeaddr argument. * * Arguments: * hw device structure * exeaddr the card execution address that will be * jumped to when ramdl_disable() is called * (host order). * * Returns: * 0 success * >0 f/w reported error - f/w status code * <0 driver reported error * * Side effects: * * Call context: * process thread ----------------------------------------------------------------*/ int hfa384x_drvr_ramdl_enable(hfa384x_t *hw, UINT32 exeaddr) { int result = 0; UINT16 lowaddr; UINT16 hiaddr; int i; DBFENTER; /* Check that a port isn't active */ for ( i = 0; i < HFA384x_PORTID_MAX; i++) { if ( hw->port_enabled[i] ) { WLAN_LOG_DEBUG(1,"Can't download with a port enabled.\n"); result = -EINVAL; goto done; } } /* Check that we're not already in a download state */ if ( hw->dlstate != HFA384x_DLSTATE_DISABLED ) { WLAN_LOG_DEBUG(1,"Download state not disabled.\n"); result = -EINVAL; goto done; } /* Are we supposed to go into genesis mode? */ if (exeaddr == 0x3f0000) { UINT16 initseq[2] = { 0xe100, 0xffa1 }; UINT16 readbuf[2]; UINT8 hcr = 0x0f; /* Default to x16 SRAM */ hw->isram16 = 1; WLAN_LOG_DEBUG(1, "Dropping into Genesis mode\n"); /* Issue card reset and enable aux port */ hfa384x_corereset(hw, prism2_reset_holdtime, prism2_reset_settletime, 0); hfa384x_cmd_aux_enable(hw, 1); /* Genesis set */ hfa384x_copy_to_aux(hw, 0x7E0038, HFA384x_AUX_CTL_EXTDS, initseq, sizeof(initseq)); hfa384x_corereset(hw, prism2_reset_holdtime, prism2_reset_settletime, hcr); /* Validate memory config */ hfa384x_copy_to_aux(hw, 0x7E0038, HFA384x_AUX_CTL_EXTDS, initseq, sizeof(initseq)); hfa384x_copy_from_aux(hw, 0x7E0038, HFA384x_AUX_CTL_EXTDS, readbuf, sizeof(initseq)); WLAN_HEX_DUMP(3, "readback", readbuf, sizeof(readbuf)); if (memcmp(initseq, readbuf, sizeof(readbuf))) { hcr = 0x1f; /* x8 SRAM */ hw->isram16 = 0; hfa384x_copy_to_aux(hw, 0x7E0038, HFA384x_AUX_CTL_EXTDS, initseq, sizeof(initseq)); hfa384x_corereset(hw, prism2_reset_holdtime, prism2_reset_settletime, hcr); hfa384x_copy_to_aux(hw, 0x7E0038, HFA384x_AUX_CTL_EXTDS, initseq, sizeof(initseq)); hfa384x_copy_from_aux(hw, 0x7E0038, HFA384x_AUX_CTL_EXTDS, readbuf, sizeof(initseq)); WLAN_HEX_DUMP(2, "readback", readbuf, sizeof(readbuf)); if (memcmp(initseq, readbuf, sizeof(readbuf))) { WLAN_LOG_ERROR("Genesis mode failed\n"); result = -1; goto done; } } /* Now we're in genesis mode */ hw->dlstate = HFA384x_DLSTATE_GENESIS; goto done; } /* Retrieve the buffer loc&size and timeout */ if ( (result = hfa384x_drvr_getconfig(hw, HFA384x_RID_DOWNLOADBUFFER, &(hw->bufinfo), sizeof(hw->bufinfo))) ) { goto done; } hw->bufinfo.page = hfa384x2host_16(hw->bufinfo.page); hw->bufinfo.offset = hfa384x2host_16(hw->bufinfo.offset); hw->bufinfo.len = hfa384x2host_16(hw->bufinfo.len); if ( (result = hfa384x_drvr_getconfig16(hw, HFA384x_RID_MAXLOADTIME, &(hw->dltimeout))) ) { goto done; } hw->dltimeout = hfa384x2host_16(hw->dltimeout); /* Enable the aux port */ if ( (result = hfa384x_cmd_aux_enable(hw, 0)) ) { WLAN_LOG_DEBUG(1,"Aux enable failed, result=%d.\n", result); goto done; } /* Call the download(1,addr) function */ lowaddr = HFA384x_ADDR_CMD_MKOFF(exeaddr); hiaddr = HFA384x_ADDR_CMD_MKPAGE(exeaddr); result = hfa384x_cmd_download(hw, HFA384x_PROGMODE_RAM, lowaddr, hiaddr, 0); if ( result == 0) { /* Set the download state */ hw->dlstate = HFA384x_DLSTATE_RAMENABLED; } else { WLAN_LOG_DEBUG(1,"cmd_download(0x%04x, 0x%04x) failed, result=%d.\n", lowaddr,hiaddr, result); /* Disable the aux port */ hfa384x_cmd_aux_disable(hw); } done: DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_drvr_ramdl_disable * * Ends the ram download state. * * Arguments: * hw device structure * * Returns: * 0 success * >0 f/w reported error - f/w status code * <0 driver reported error * * Side effects: * * Call context: * process thread ----------------------------------------------------------------*/ int hfa384x_drvr_ramdl_disable(hfa384x_t *hw) { DBFENTER; /* Check that we're already in the download state */ if ( ( hw->dlstate != HFA384x_DLSTATE_RAMENABLED ) && ( hw->dlstate != HFA384x_DLSTATE_GENESIS ) ) { return -EINVAL; } if (hw->dlstate == HFA384x_DLSTATE_GENESIS) { hfa384x_corereset(hw, prism2_reset_holdtime, prism2_reset_settletime, hw->isram16 ? 0x07: 0x17); goto done; } /* Disable the aux port */ hfa384x_cmd_download(hw, HFA384x_PROGMODE_DISABLE, 0, 0 , 0); done: hw->dlstate = HFA384x_DLSTATE_DISABLED; hfa384x_cmd_aux_disable(hw); DBFEXIT; return 0; } /*---------------------------------------------------------------- * hfa384x_drvr_ramdl_write * * Performs a RAM download of a chunk of data. First checks to see * that we're in the RAM download state, then uses the aux functions * to 1) copy the data, 2) readback and compare. The download * state is unaffected. When all data has been written using * this function, call drvr_ramdl_disable() to end the download state * and restart the MAC. * * Arguments: * hw device structure * daddr Card address to write to. (host order) * buf Ptr to data to write. * len Length of data (host order). * * Returns: * 0 success * >0 f/w reported error - f/w status code * <0 driver reported error * * Side effects: * * Call context: * process thread ----------------------------------------------------------------*/ int hfa384x_drvr_ramdl_write(hfa384x_t *hw, UINT32 daddr, void* buf, UINT32 len) { int result = 0; UINT8 *verbuf; DBFENTER; /* Check that we're in the ram download state */ if ( ( hw->dlstate != HFA384x_DLSTATE_RAMENABLED ) && ( hw->dlstate != HFA384x_DLSTATE_GENESIS ) ) { return -EINVAL; } WLAN_LOG_INFO("Writing %d bytes to ram @0x%06x\n", len, daddr); #if 0 WLAN_HEX_DUMP(1, "dldata", buf, len); #endif /* Copy the data via the aux port */ hfa384x_copy_to_aux(hw, daddr, HFA384x_AUX_CTL_EXTDS, buf, len); /* Create a buffer for the verify */ verbuf = kmalloc(len, GFP_KERNEL); if (verbuf == NULL ) return 1; /* Read back and compare */ hfa384x_copy_from_aux(hw, daddr, HFA384x_AUX_CTL_EXTDS, verbuf, len); if ( memcmp(buf, verbuf, len) ) { WLAN_LOG_DEBUG(1,"ramdl verify failed!\n"); result = -EINVAL; } kfree_s(verbuf, len); DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_drvr_flashdl_enable * * Begins the flash download state. Checks to see that we're not * already in a download state and that a port isn't enabled. * Sets the download state and retrieves the flash download * buffer location, buffer size, and timeout length. * * Arguments: * hw device structure * * Returns: * 0 success * >0 f/w reported error - f/w status code * <0 driver reported error * * Side effects: * * Call context: * process thread ----------------------------------------------------------------*/ int hfa384x_drvr_flashdl_enable(hfa384x_t *hw) { int result = 0; int i; DBFENTER; /* Check that a port isn't active */ for ( i = 0; i < HFA384x_PORTID_MAX; i++) { if ( hw->port_enabled[i] ) { WLAN_LOG_DEBUG(1,"called when port enabled.\n"); return -EINVAL; } } /* Check that we're not already in a download state */ if ( hw->dlstate != HFA384x_DLSTATE_DISABLED ) { return -EINVAL; } /* Retrieve the buffer loc&size and timeout */ if ( (result = hfa384x_drvr_getconfig(hw, HFA384x_RID_DOWNLOADBUFFER, &(hw->bufinfo), sizeof(hw->bufinfo))) ) { return result; } hw->bufinfo.page = hfa384x2host_16(hw->bufinfo.page); hw->bufinfo.offset = hfa384x2host_16(hw->bufinfo.offset); hw->bufinfo.len = hfa384x2host_16(hw->bufinfo.len); if ( (result = hfa384x_drvr_getconfig16(hw, HFA384x_RID_MAXLOADTIME, &(hw->dltimeout))) ) { return result; } hw->dltimeout = hfa384x2host_16(hw->dltimeout); /* Enable the aux port */ if ( (result = hfa384x_cmd_aux_enable(hw, 0)) ) { return result; } hw->dlstate = HFA384x_DLSTATE_FLASHENABLED; DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_drvr_flashdl_disable * * Ends the flash download state. Note that this will cause the MAC * firmware to restart. * * Arguments: * hw device structure * * Returns: * 0 success * >0 f/w reported error - f/w status code * <0 driver reported error * * Side effects: * * Call context: * process thread ----------------------------------------------------------------*/ int hfa384x_drvr_flashdl_disable(hfa384x_t *hw) { DBFENTER; /* Check that we're already in the download state */ if ( hw->dlstate != HFA384x_DLSTATE_FLASHENABLED ) { return -EINVAL; } /* There isn't much we can do at this point, so I don't */ /* bother w/ the return value */ hfa384x_cmd_download(hw, HFA384x_PROGMODE_DISABLE, 0, 0 , 0); hw->dlstate = HFA384x_DLSTATE_DISABLED; /* Disable the aux port */ hfa384x_cmd_aux_disable(hw); DBFEXIT; return 0; } /*---------------------------------------------------------------- * hfa384x_drvr_flashdl_write * * Performs a FLASH download of a chunk of data. First checks to see * that we're in the FLASH download state, then sets the download * mode, uses the aux functions to 1) copy the data to the flash * buffer, 2) sets the download 'write flash' mode, 3) readback and * compare. Lather rinse, repeat as many times an necessary to get * all the given data into flash. * When all data has been written using this function (possibly * repeatedly), call drvr_flashdl_disable() to end the download state * and restart the MAC. * * Arguments: * hw device structure * daddr Card address to write to. (host order) * buf Ptr to data to write. * len Length of data (host order). * * Returns: * 0 success * >0 f/w reported error - f/w status code * <0 driver reported error * * Side effects: * * Call context: * process thread ----------------------------------------------------------------*/ int hfa384x_drvr_flashdl_write(hfa384x_t *hw, UINT32 daddr, void* buf, UINT32 len) { int result = 0; UINT8 *verbuf; UINT32 dlbufaddr; UINT32 currlen; UINT32 currdaddr; UINT16 destlo; UINT16 desthi; int nwrites; int i; DBFENTER; /* Check that we're in the flash download state */ if ( hw->dlstate != HFA384x_DLSTATE_FLASHENABLED ) { return -EINVAL; } WLAN_LOG_INFO("Download %d bytes to flash @0x%06x\n", len, daddr); /* Need a flat address for arithmetic */ dlbufaddr = HFA384x_ADDR_AUX_MKFLAT( hw->bufinfo.page, hw->bufinfo.offset); verbuf = kmalloc(hw->bufinfo.len, GFP_KERNEL); #if 0 WLAN_LOG_WARNING("dlbuf@0x%06lx len=%d to=%d\n", dlbufaddr, hw->bufinfo.len, hw->dltimeout); #endif /* Figure out how many times to to the flash prog */ nwrites = len / hw->bufinfo.len; nwrites += (len % hw->bufinfo.len) ? 1 : 0; if ( verbuf == NULL ) { WLAN_LOG_ERROR("Failed to allocate flash verify buffer\n"); return 1; } /* For each */ for ( i = 0; i < nwrites; i++) { /* Get the dest address and len */ currlen = (len - (hw->bufinfo.len * i)) > hw->bufinfo.len ? hw->bufinfo.len : (len - (hw->bufinfo.len * i)); currdaddr = daddr + (hw->bufinfo.len * i); destlo = HFA384x_ADDR_CMD_MKOFF(currdaddr); desthi = HFA384x_ADDR_CMD_MKPAGE(currdaddr); WLAN_LOG_INFO("Writing %d bytes to flash @0x%06x\n", currlen, currdaddr); #if 0 WLAN_HEX_DUMP(1, "dldata", buf+(hw->bufinfo.len*i), currlen); #endif /* Set the download mode */ result = hfa384x_cmd_download(hw, HFA384x_PROGMODE_NV, destlo, desthi, currlen); if ( result ) { WLAN_LOG_ERROR("download(NV,lo=%x,hi=%x,len=%x) " "cmd failed, result=%d. Aborting d/l\n", destlo, desthi, currlen, result); goto exit_proc; } /* copy the data to the flash buffer */ hfa384x_copy_to_aux(hw, dlbufaddr, HFA384x_AUX_CTL_EXTDS, buf+(hw->bufinfo.len*i), currlen); /* set the download 'write flash' mode */ result = hfa384x_cmd_download(hw, HFA384x_PROGMODE_NVWRITE, 0,0,0); if ( result ) { WLAN_LOG_ERROR( "download(NVWRITE,lo=%x,hi=%x,len=%x) " "cmd failed, result=%d. Aborting d/l\n", destlo, desthi, currlen, result); goto exit_proc; } /* readback and compare, if fail...bail */ hfa384x_copy_from_aux(hw, currdaddr, HFA384x_AUX_CTL_NV, verbuf, currlen); if ( memcmp(buf+(hw->bufinfo.len*i), verbuf, currlen) ) { return -EINVAL; } } exit_proc: /* DOH! This kfree's for you Mark :-) My forehead hurts... */ kfree(verbuf); /* Leave the firmware in the 'post-prog' mode. flashdl_disable will */ /* actually disable programming mode. Remember, that will cause the */ /* the firmware to effectively reset itself. */ DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_cmd_initialize * * Issues the initialize command and sets the hw->state based * on the result. * * Arguments: * hw device structure * * Returns: * 0 success * >0 f/w reported error - f/w status code * <0 driver reported error * * Side effects: * * Call context: * process thread ----------------------------------------------------------------*/ int hfa384x_cmd_initialize(hfa384x_t *hw) { int result = 0; int i; hfa384x_metacmd_t cmd; DBFENTER; /* we don't want to be interrupted during the reset */ hfa384x_setreg(hw, 0, HFA384x_INTEN); hfa384x_setreg(hw, 0xffff, HFA384x_EVACK); cmd.cmd = HFA384x_CMDCODE_INIT; cmd.parm0 = 0; cmd.parm1 = 0; cmd.parm2 = 0; spin_lock_bh(&hw->cmdlock); result = hfa384x_docmd_wait(hw, &cmd); spin_unlock_bh(&hw->cmdlock); if ( result == 0 ) { for ( i = 0; i < HFA384x_NUMPORTS_MAX; i++) { hw->port_enabled[i] = 0; } } hw->link_status = HFA384x_LINK_NOTCONNECTED; DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_drvr_commtallies * * Send a commtallies inquiry to the MAC. Note that this is an async * call that will result in an info frame arriving sometime later. * * Arguments: * hw device structure * * Returns: * zero success. * * Side effects: * * Call context: * process ----------------------------------------------------------------*/ int hfa384x_drvr_commtallies( hfa384x_t *hw ) { hfa384x_metacmd_t cmd; int result; DBFENTER; cmd.cmd = HFA384x_CMDCODE_INQ; cmd.parm0 = HFA384x_IT_COMMTALLIES; cmd.parm1 = 0; cmd.parm2 = 0; spin_lock_bh(&hw->cmdlock); result = hfa384x_docmd_wait(hw, &cmd); spin_unlock_bh(&hw->cmdlock); DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_drvr_enable * * Issues the enable command to enable communications on one of * the MACs 'ports'. Only macport 0 is valid for stations. * APs may also enable macports 1-6. Only ports that are currently * disabled may be enabled. * * Arguments: * hw device structure * macport MAC port number * * Returns: * 0 success * >0 f/w reported failure - f/w status code * <0 driver reported error (timeout|bad arg) * * Side effects: * * Call context: * process thread ----------------------------------------------------------------*/ int hfa384x_drvr_enable(hfa384x_t *hw, UINT16 macport) { int result = 0; DBFENTER; if ((!hw->isap && macport != 0) || (hw->isap && !(macport <= HFA384x_PORTID_MAX)) || (hw->port_enabled[macport]) ){ result = -EINVAL; } else { result = hfa384x_cmd_enable(hw, macport); if ( result == 0 ) { hw->port_enabled[macport] = 1; } } DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_cmd_enable * * Issues the the enable command to enable communications on one of the * MACs 'ports'. * * Arguments: * hw device structure * macport MAC port number * * Returns: * 0 success * >0 f/w reported failure - f/w status code * <0 driver reported error (timeout|bad arg) * * Side effects: * * Call context: * process thread ----------------------------------------------------------------*/ int hfa384x_cmd_enable(hfa384x_t *hw, UINT16 macport) { int result = 0; hfa384x_metacmd_t cmd; DBFENTER; cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_ENABLE) | HFA384x_CMD_MACPORT_SET(macport); cmd.parm0 = 0; cmd.parm1 = 0; cmd.parm2 = 0; spin_lock_bh(&hw->cmdlock); result = hfa384x_docmd_wait(hw, &cmd); spin_unlock_bh(&hw->cmdlock); DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_drvr_disable * * Issues the disable command to stop communications on one of * the MACs 'ports'. Only macport 0 is valid for stations. * APs may also disable macports 1-6. Only ports that have been * previously enabled may be disabled. * * Arguments: * hw device structure * macport MAC port number (host order) * * Returns: * 0 success * >0 f/w reported failure - f/w status code * <0 driver reported error (timeout|bad arg) * * Side effects: * * Call context: * process thread ----------------------------------------------------------------*/ int hfa384x_drvr_disable(hfa384x_t *hw, UINT16 macport) { int result = 0; DBFENTER; if ((!hw->isap && macport != 0) || (hw->isap && !(macport <= HFA384x_PORTID_MAX)) || !(hw->port_enabled[macport]) ){ result = -EINVAL; } else { result = hfa384x_cmd_disable(hw, macport); if ( result == 0 ) { hw->port_enabled[macport] = 0; } } DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_cmd_disable * * Issues the command to disable a port. * * Arguments: * hw device structure * macport MAC port number (host order) * * Returns: * 0 success * >0 f/w reported failure - f/w status code * <0 driver reported error (timeout|bad arg) * * Side effects: * * Call context: * process thread ----------------------------------------------------------------*/ int hfa384x_cmd_disable(hfa384x_t *hw, UINT16 macport) { int result = 0; hfa384x_metacmd_t cmd; DBFENTER; cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_DISABLE) | HFA384x_CMD_MACPORT_SET(macport); cmd.parm0 = 0; cmd.parm1 = 0; cmd.parm2 = 0; spin_lock_bh(&hw->cmdlock); result = hfa384x_docmd_wait(hw, &cmd); spin_unlock_bh(&hw->cmdlock); DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_cmd_diagnose * * Issues the diagnose command to test the: register interface, * MAC controller (including loopback), External RAM, Non-volatile * memory integrity, and synthesizers. Following execution of this * command, MAC/firmware are in the 'initial state'. Therefore, * the Initialize command should be issued after successful * completion of this command. This function may only be called * when the MAC is in the 'communication disabled' state. * * Arguments: * hw device structure * * Returns: * 0 success * >0 f/w reported failure - f/w status code * <0 driver reported error (timeout|bad arg) * * Side effects: * * Call context: * process thread ----------------------------------------------------------------*/ #define DIAG_PATTERNA ((UINT16)0xaaaa) #define DIAG_PATTERNB ((UINT16)0x5555) int hfa384x_cmd_diagnose(hfa384x_t *hw) { int result = 0; hfa384x_metacmd_t cmd; DBFENTER; cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_DIAG); cmd.parm0 = DIAG_PATTERNA; cmd.parm1 = DIAG_PATTERNB; cmd.parm2 = 0; spin_lock_bh(&hw->cmdlock); result = hfa384x_docmd_wait(hw, &cmd); spin_unlock_bh(&hw->cmdlock); DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_cmd_allocate * * Issues the allocate command instructing the firmware to allocate * a 'frame structure buffer' in MAC controller RAM. This command * does not provide the result, it only initiates one of the f/w's * asynchronous processes to construct the buffer. When the * allocation is complete, it will be indicated via the Alloc * bit in the EvStat register and the FID identifying the allocated * space will be available from the AllocFID register. Some care * should be taken when waiting for the Alloc event. If a Tx or * Notify command w/ Reclaim has been previously executed, it's * possible the first Alloc event after execution of this command * will be for the reclaimed buffer and not the one you asked for. * This case must be handled in the Alloc event handler. * * Arguments: * hw device structure * len allocation length, must be an even value * in the range [4-2400]. (host order) * * Returns: * 0 success * >0 f/w reported failure - f/w status code * <0 driver reported error (timeout|bad arg) * * Side effects: * * Call context: * process thread ----------------------------------------------------------------*/ int hfa384x_cmd_allocate(hfa384x_t *hw, UINT16 len) { int result = 0; hfa384x_metacmd_t cmd; DBFENTER; if ( (len % 2) || len < HFA384x_CMD_ALLOC_LEN_MIN || len > HFA384x_CMD_ALLOC_LEN_MAX ) { result = -EINVAL; } else { cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_ALLOC); cmd.parm0 = len; cmd.parm1 = 0; cmd.parm2 = 0; spin_lock_bh(&hw->cmdlock); result = hfa384x_docmd_wait(hw, &cmd); spin_unlock_bh(&hw->cmdlock); } DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_cmd_transmit * * Instructs the firmware to transmit a frame previously copied * to a given buffer. This function returns immediately, the Tx * results are available via the Tx or TxExc events (if the frame * control bits are set). The reclaim argument specifies if the * FID passed will be used by the f/w tx process or returned for * use w/ another transmit command. If reclaim is set, expect an * Alloc event signalling the availibility of the FID for reuse. * * NOTE: hw->cmdlock MUST BE HELD before calling this function! * * Arguments: * hw device structure * reclaim [0|1] indicates whether the given FID will * be handed back (via Alloc event) for reuse. * (host order) * qos [0-3] Value to put in the QoS field of the * tx command, identifies a queue to place the * outgoing frame in. * (host order) * fid FID of buffer containing the frame that was * previously copied to MAC memory via the bap. * (host order) * * Returns: * 0 success * >0 f/w reported failure - f/w status code * <0 driver reported error (timeout|bad arg) * * Side effects: * hw->resp0 will contain the FID being used by async tx * process. If reclaim==0, resp0 will be the same as the fid * argument. If reclaim==1, resp0 will be the different and * is the value to watch for in the Tx|TxExc to indicate completion * of the frame passed in fid. * * Call context: * process thread ----------------------------------------------------------------*/ int hfa384x_cmd_transmit(hfa384x_t *hw, UINT16 reclaim, UINT16 qos, UINT16 fid) { int result = 0; hfa384x_metacmd_t cmd; DBFENTER; cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_TX) | HFA384x_CMD_RECL_SET(reclaim) | HFA384x_CMD_QOS_SET(qos); cmd.parm0 = fid; cmd.parm1 = 0; cmd.parm2 = 0; result = hfa384x_docmd_wait(hw, &cmd); DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_cmd_clearpersist * * Instructs the firmware to clear the persistence bit in a given * FID. This has the effect of telling the firmware to drop the * persistent frame. The FID must be one that was previously used * to transmit a PRST frame. * * Arguments: * hw device structure * fid FID of the persistent frame (host order) * * Returns: * 0 success * >0 f/w reported failure - f/w status code * <0 driver reported error (timeout|bad arg) * * Side effects: * * Call context: * process thread ----------------------------------------------------------------*/ int hfa384x_cmd_clearpersist(hfa384x_t *hw, UINT16 fid) { int result = 0; hfa384x_metacmd_t cmd; DBFENTER; cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_CLRPRST); cmd.parm0 = fid; cmd.parm1 = 0; cmd.parm2 = 0; spin_lock_bh(&hw->cmdlock); result = hfa384x_docmd_wait(hw, &cmd); spin_unlock_bh(&hw->cmdlock); DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_cmd_notify * * Sends an info frame to the firmware to alter the behavior * of the f/w asynch processes. Can only be called when the MAC * is in the enabled state. * * Arguments: * hw device structure * reclaim [0|1] indicates whether the given FID will * be handed back (via Alloc event) for reuse. * (host order) * fid FID of buffer containing the frame that was * previously copied to MAC memory via the bap. * (host order) * * Returns: * 0 success * >0 f/w reported failure - f/w status code * <0 driver reported error (timeout|bad arg) * * Side effects: * hw->resp0 will contain the FID being used by async notify * process. If reclaim==0, resp0 will be the same as the fid * argument. If reclaim==1, resp0 will be the different. * * Call context: * process thread ----------------------------------------------------------------*/ int hfa384x_cmd_notify(hfa384x_t *hw, UINT16 reclaim, UINT16 fid, void *buf, UINT16 len) { int result = 0; hfa384x_metacmd_t cmd; DBFENTER; cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_NOTIFY) | HFA384x_CMD_RECL_SET(reclaim); cmd.parm0 = fid; cmd.parm1 = 0; cmd.parm2 = 0; spin_lock_bh(&hw->cmdlock); /* Copy the record to FID */ result = hfa384x_copy_to_bap(hw, HFA384x_BAP_PROC, hw->infofid, 0, buf, len); if ( result ) { WLAN_LOG_DEBUG(1, "copy_to_bap(%04x, 0, %d) failed, result=0x%x\n", hw->infofid, len, result); result = -EIO; goto failed; } result = hfa384x_docmd_wait(hw, &cmd); failed: spin_unlock_bh(&hw->cmdlock); DBFEXIT; return result; } #if 0 /*---------------------------------------------------------------- * hfa384x_cmd_inquiry * * Requests an info frame from the firmware. The info frame will * be delivered asynchronously via the Info event. * * Arguments: * hw device structure * fid FID of the info frame requested. (host order) * * Returns: * 0 success * >0 f/w reported failure - f/w status code * <0 driver reported error (timeout|bad arg) * * Side effects: * * Call context: * process thread ----------------------------------------------------------------*/ static int hfa384x_cmd_inquiry(hfa384x_t *hw, UINT16 fid) { int result = 0; hfa384x_metacmd_t cmd; DBFENTER; cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_INQ); cmd.parm0 = fid; cmd.parm1 = 0; cmd.parm2 = 0; spin_lock_bh(&hw->cmdlock); result = hfa384x_docmd_wait(hw, &cmd); spin_unlock_bh(&hw->cmdlock); DBFEXIT; return result; } #endif /*---------------------------------------------------------------- * hfa384x_cmd_access * * Requests that a given record be copied to/from the record * buffer. If we're writing from the record buffer, the contents * must previously have been written to the record buffer via the * bap. If we're reading into the record buffer, the record can * be read out of the record buffer after this call. * * Arguments: * hw device structure * write [0|1] copy the record buffer to the given * configuration record. (host order) * rid RID of the record to read/write. (host order) * buf host side record buffer. Upon return it will * contain the body portion of the record (minus the * RID and len). * len buffer length (in bytes, should match record length) * * Returns: * 0 success * >0 f/w reported failure - f/w status code * <0 driver reported error (timeout|bad arg) * * Side effects: * * Call context: * process thread ----------------------------------------------------------------*/ int hfa384x_cmd_access(hfa384x_t *hw, UINT16 write, UINT16 rid, void* buf, UINT16 len) { int result = 0; hfa384x_metacmd_t cmd; hfa384x_rec_t rec; DBFENTER; #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)) /* This should NOT be called in interrupt context! */ if (in_irq()) { WLAN_LOG_ERROR("Krap, in Interrupt context!"); #ifdef WLAN_INCLUDE_DEBUG BUG(); #endif } #endif spin_lock_bh(&hw->cmdlock); if (write) { rec.rid = host2hfa384x_16(rid); rec.reclen = host2hfa384x_16((len/2) + 1); /* note conversion to words, +1 for rid field */ /* write the record */ result = hfa384x_copy_to_bap4( hw, HFA384x_BAP_PROC, rid, 0, &rec, sizeof(rec), buf, len, NULL, 0, NULL, 0); if ( result ) { WLAN_LOG_DEBUG(3,"Failure writing record header+data\n"); goto fail; } } cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_ACCESS) | HFA384x_CMD_WRITE_SET(write); cmd.parm0 = rid; cmd.parm1 = 0; cmd.parm2 = 0; result = hfa384x_docmd_wait(hw, &cmd); if ( result ) { WLAN_LOG_ERROR("Call to hfa384x_docmd_wait failed (%d %d)\n", result, cmd.result.resp0); goto fail; } if (!write) { result = hfa384x_copy_from_bap( hw, HFA384x_BAP_PROC, rid, 0, &rec, sizeof(rec)); if ( result ) { WLAN_LOG_DEBUG(3,"Call to hfa384x_copy_from_bap failed\n"); goto fail; } /* Validate the record length */ if ( ((hfa384x2host_16(rec.reclen)-1)*2) != len ) { /* note body len calculation in bytes */ WLAN_LOG_DEBUG(1, "RID len mismatch, rid=0x%04x hlen=%d fwlen=%d\n", rid, len, (hfa384x2host_16(rec.reclen)-1)*2); result = -ENODATA; goto fail; } result = hfa384x_copy_from_bap( hw, HFA384x_BAP_PROC, rid, sizeof(rec), buf, len); } fail: spin_unlock_bh(&hw->cmdlock); DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_cmd_monitor * * Enables the 'monitor mode' of the MAC. Here's the description of * monitor mode that I've received thus far: * * "The "monitor mode" of operation is that the MAC passes all * frames for which the PLCP checks are correct. All received * MPDUs are passed to the host with MAC Port = 7, with a * receive status of good, FCS error, or undecryptable. Passing * certain MPDUs is a violation of the 802.11 standard, but useful * for a debugging tool." Normal communication is not possible * while monitor mode is enabled. * * Arguments: * hw device structure * enable a code (0x0b|0x0f) that enables/disables * monitor mode. (host order) * * Returns: * 0 success * >0 f/w reported failure - f/w status code * <0 driver reported error (timeout|bad arg) * * Side effects: * * Call context: * process thread ----------------------------------------------------------------*/ int hfa384x_cmd_monitor(hfa384x_t *hw, UINT16 enable) { int result = 0; hfa384x_metacmd_t cmd; DBFENTER; cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) | HFA384x_CMD_AINFO_SET(enable); cmd.parm0 = 0; cmd.parm1 = 0; cmd.parm2 = 0; spin_lock_bh(&hw->cmdlock); result = hfa384x_docmd_wait(hw, &cmd); spin_unlock_bh(&hw->cmdlock); DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_cmd_download * * Sets the controls for the MAC controller code/data download * process. The arguments set the mode and address associated * with a download. Note that the aux registers should be enabled * prior to setting one of the download enable modes. * * Arguments: * hw device structure * mode 0 - Disable programming and begin code exec * 1 - Enable volatile mem programming * 2 - Enable non-volatile mem programming * 3 - Program non-volatile section from NV download * buffer. * (host order) * lowaddr * highaddr For mode 1, sets the high & low order bits of * the "destination address". This address will be * the execution start address when download is * subsequently disabled. * For mode 2, sets the high & low order bits of * the destination in NV ram. * For modes 0 & 3, should be zero. (host order) * NOTE: these address args are in CMD format * codelen Length of the data to write in mode 2, * zero otherwise. (host order) * * Returns: * 0 success * >0 f/w reported failure - f/w status code * <0 driver reported error (timeout|bad arg) * * Side effects: * * Call context: * process thread ----------------------------------------------------------------*/ int hfa384x_cmd_download(hfa384x_t *hw, UINT16 mode, UINT16 lowaddr, UINT16 highaddr, UINT16 codelen) { int result = 0; hfa384x_metacmd_t cmd; DBFENTER; cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_DOWNLD) | HFA384x_CMD_PROGMODE_SET(mode); cmd.parm0 = lowaddr; cmd.parm1 = highaddr; cmd.parm2 = codelen; spin_lock_bh(&hw->cmdlock); result = hfa384x_dl_docmd_wait(hw, &cmd); spin_unlock_bh(&hw->cmdlock); DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_cmd_aux_enable * * Goes through the process of enabling the auxilary port. This * is necessary prior to raw reads/writes to card data space. * Direct access to the card data space is only used for downloading * code and debugging. * Note that a call to this function is required before attempting * a download. * * Arguments: * hw device structure * * Returns: * 0 success * >0 f/w reported failure - f/w status code * <0 driver reported error (timeout) * * Side effects: * * Call context: * process thread ----------------------------------------------------------------*/ int hfa384x_cmd_aux_enable(hfa384x_t *hw, int force) { int result = -ETIMEDOUT; unsigned long flags; UINT32 retries_remaining; UINT16 reg; UINT auxen_mirror = hw->auxen; DBFENTER; /* Check for existing enable */ if ( hw->auxen ) { hw->auxen++; return 0; } /* acquire the lock */ spin_lock_irqsave( &(hw->cmdlock), flags); /* wait for cmd register busy bit to clear */ retries_remaining = 100000; do { reg = hfa384x_getreg(hw, HFA384x_CMD); udelay(10); } while (HFA384x_CMD_ISBUSY(reg) && --retries_remaining); if (retries_remaining != 0) { /* busy bit clear, it's OK to write to ParamX regs */ hfa384x_setreg(hw, HFA384x_AUXPW0, HFA384x_PARAM0); hfa384x_setreg(hw, HFA384x_AUXPW1, HFA384x_PARAM1); hfa384x_setreg(hw, HFA384x_AUXPW2, HFA384x_PARAM2); /* Set the aux enable in the Control register */ hfa384x_setreg(hw, HFA384x_CONTROL_AUX_DOENABLE, HFA384x_CONTROL); /* Now wait for completion */ retries_remaining = 100000; do { reg = hfa384x_getreg(hw, HFA384x_CONTROL); udelay(10); } while ( ((reg & (BIT14|BIT15)) != HFA384x_CONTROL_AUX_ISENABLED) && --retries_remaining ); if (retries_remaining != 0) { result = 0; hw->auxen++; } } /* Force it enabled even if the command failed, if told.. */ if ((hw->auxen == auxen_mirror) && force) hw->auxen++; spin_unlock_irqrestore( &(hw->cmdlock), flags); DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_cmd_aux_disable * * Goes through the process of disabling the auxilary port * enabled with aux_enable(). * * Arguments: * hw device structure * * Returns: * 0 success * >0 f/w reported failure - f/w status code * <0 driver reported error (timeout) * * Side effects: * * Call context: * process thread ----------------------------------------------------------------*/ int hfa384x_cmd_aux_disable(hfa384x_t *hw) { int result = -ETIMEDOUT; unsigned long timeout; UINT16 reg = 0; DBFENTER; /* See if there's more than one enable */ if (hw->auxen) hw->auxen--; if (hw->auxen) return 0; /* Clear the aux enable in the Control register */ hfa384x_setreg(hw, 0, HFA384x_PARAM0); hfa384x_setreg(hw, 0, HFA384x_PARAM1); hfa384x_setreg(hw, 0, HFA384x_PARAM2); hfa384x_setreg(hw, HFA384x_CONTROL_AUX_DODISABLE, HFA384x_CONTROL); /* Now wait for completion */ timeout = jiffies + 1*HZ; reg = hfa384x_getreg(hw, HFA384x_CONTROL); while ( ((reg & (BIT14|BIT15)) != HFA384x_CONTROL_AUX_ISDISABLED) && time_before(jiffies,timeout) ){ udelay(10); reg = hfa384x_getreg(hw, HFA384x_CONTROL); } if ((reg & (BIT14|BIT15)) == HFA384x_CONTROL_AUX_ISDISABLED ) { result = 0; } DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_drvr_low_level * * Write test commands to the card. Some test commands don't make * sense without prior set-up. For example, continous TX isn't very * useful until you set the channel. That functionality should be * * Side effects: * * Call context: * process thread * -----------------------------------------------------------------*/ int hfa384x_drvr_low_level(hfa384x_t *hw, hfa384x_metacmd_t *cmd) { int result = 0; DBFENTER; /* Do i need a host2hfa... conversion ? */ #if 0 printk(KERN_INFO "%#x %#x %#x %#x\n", cmd->cmd, cmd->parm0, cmd->parm1, cmd->parm2); #endif spin_lock_bh(&hw->cmdlock); result = hfa384x_docmd_wait(hw, cmd); spin_unlock_bh(&hw->cmdlock); DBFEXIT; return result; } /* TODO: determine if these will ever be needed */ #if 0 int hfa384x_cmd_readmif(hfa384x_t *hw) { DBFENTER; DBFEXIT; return 0; } int hfa384x_cmd_writemif(hfa384x_t *hw) { DBFENTER; DBFEXIT; return 0; } #endif /*---------------------------------------------------------------- * hfa384x_drvr_mmi_read * * Read mmi registers. mmi is intersil-speak for the baseband * processor registers. * * Arguments: * hw device structure * register The test register to be accessed (must be even #). * * Returns: * 0 success * >0 f/w reported error - f/w status code * <0 driver reported error * * Side effects: * * Call context: * process thread ----------------------------------------------------------------*/ int hfa384x_drvr_mmi_read(hfa384x_t *hw, UINT32 addr, UINT32 *resp) { int result = 0; hfa384x_metacmd_t cmd; DBFENTER; cmd.cmd = (UINT16) 0x30; cmd.parm0 = (UINT16) addr; cmd.parm1 = 0; cmd.parm2 = 0; /* Do i need a host2hfa... conversion ? */ spin_lock_bh(&hw->cmdlock); result = hfa384x_docmd_wait(hw, &cmd); spin_unlock_bh(&hw->cmdlock); *resp = (UINT32) cmd.result.resp0; DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_drvr_mmi_write * * Read mmi registers. mmi is intersil-speak for the baseband * processor registers. * * Arguments: * hw device structure * addr The test register to be accessed (must be even #). * data The data value to write to the register. * * Returns: * 0 success * >0 f/w reported error - f/w status code * <0 driver reported error * * Side effects: * * Call context: * process thread ----------------------------------------------------------------*/ int hfa384x_drvr_mmi_write(hfa384x_t *hw, UINT32 addr, UINT32 data) { int result = 0; hfa384x_metacmd_t cmd; DBFENTER; cmd.cmd = (UINT16) 0x31; cmd.parm0 = (UINT16) addr; cmd.parm1 = (UINT16) data; cmd.parm2 = 0; WLAN_LOG_DEBUG(1,"mmi write : addr = 0x%08x\n", addr); WLAN_LOG_DEBUG(1,"mmi write : data = 0x%08x\n", data); /* Do i need a host2hfa... conversion ? */ spin_lock_bh(&hw->cmdlock); result = hfa384x_docmd_wait(hw, &cmd); spin_unlock_bh(&hw->cmdlock); DBFEXIT; return result; } /* TODO: determine if these will ever be needed */ #if 0 int hfa384x_cmd_readmif(hfa384x_t *hw) { DBFENTER; DBFEXIT; return 0; } int hfa384x_cmd_writemif(hfa384x_t *hw) { DBFENTER; DBFEXIT; return 0; } #endif /*---------------------------------------------------------------- * hfa384x_copy_from_bap * * Copies a collection of bytes from the MAC controller memory via * one set of BAP registers. * * Arguments: * hw device structure * bap [0|1] which BAP to use * id FID or RID, destined for the select register (host order) * offset An _even_ offset into the buffer for the given * FID/RID. We haven't the means to validate this, * so be careful. (host order) * buf ptr to array of bytes * len length of data to transfer in bytes * * Returns: * 0 success * >0 f/w reported failure - value of offset reg. * <0 driver reported error (timeout|bad arg) * * Side effects: * * Call context: * process thread * interrupt ----------------------------------------------------------------*/ int hfa384x_copy_from_bap(hfa384x_t *hw, UINT16 bap, UINT16 id, UINT16 offset, void *buf, UINT len) { int result = 0; unsigned long flags = 0; UINT8 *d = (UINT8*)buf; UINT selectreg; UINT offsetreg; UINT datareg; UINT i; UINT16 reg = 0; DBFENTER; /* Validate bap, offset, buf, and len */ if ( (bap > 1) || (offset > HFA384x_BAP_OFFSET_MAX) || (offset % 2) || (buf == NULL) || (len > HFA384x_BAP_DATALEN_MAX) ){ result = -EINVAL; } else { selectreg = (bap == 1) ? HFA384x_SELECT1 : HFA384x_SELECT0 ; offsetreg = (bap == 1) ? HFA384x_OFFSET1 : HFA384x_OFFSET0 ; datareg = (bap == 1) ? HFA384x_DATA1 : HFA384x_DATA0 ; /* Obtain lock */ spin_lock_irqsave( &(hw->baplock), flags); /* Write id to select reg */ hfa384x_setreg(hw, id, selectreg); /* Write offset to offset reg */ hfa384x_setreg(hw, offset, offsetreg); /* Wait for offset[busy] to clear (see BAP_TIMEOUT) */ i = 0; do { reg = hfa384x_getreg(hw, offsetreg); if ( i > 0 ) udelay(10); i++; } while ( i < prism2_bap_timeout && HFA384x_OFFSET_ISBUSY(reg)); #if (WLAN_HOSTIF != WLAN_PCI) /* Release lock */ spin_unlock_irqrestore( &(hw->baplock), flags); #endif if ( HFA384x_OFFSET_ISBUSY(reg) ){ /* If timeout, return -ETIMEDOUT */ result = reg; } else if ( HFA384x_OFFSET_ISERR(reg) ){ /* If offset[err] == 1, return -EINVAL */ result = reg; } else { /* Read even(len) buf contents from data reg */ for ( i = 0; i < (len & 0xfffe); i+=2 ) { *(UINT16*)(&(d[i])) = hfa384x_getreg_noswap(hw, datareg); } /* If len odd, handle last byte */ if ( len % 2 ){ reg = hfa384x_getreg_noswap(hw, datareg); d[len-1] = ((UINT8*)(®))[0]; } } /* According to Intersil errata dated 9/16/02: "In PRISM PCI MAC host interface, if both BAPs are concurrently requesing memory access, both will accept the Ack. There is no firmware workaround possible. To prevent BAP access failures or hang conditions the host MUST NOT access both BAPs in sucession unless at least 5us elapses between accesses. The safest choice is to USE ONLY ONE BAP for all data movement operations." What this means: We have to serialize ALL BAP accesses, and furthermore, add a 5us delay after access if we're using a PCI platform. Unfortunately, this means we have to lock out interrupts througout the entire BAP copy. It remains to be seen if "BAP access" means "BAP setup" or the more literal definition of "copying data back and forth" I'm erring for the latter, safer definition. -- SLP. */ #if (WLAN_HOSTIF == WLAN_PCI) udelay(5); /* Release lock */ spin_unlock_irqrestore( &(hw->baplock), flags); #endif } if (result) { WLAN_LOG_DEBUG(1, "copy_from_bap(0x%04x, 0, %d) failed, result=0x%x\n", reg, len, result); } DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_copy_to_bap * * Copies a collection of bytes to the MAC controller memory via * one set of BAP registers. * * Arguments: * hw device structure * bap [0|1] which BAP to use * id FID or RID, destined for the select register (host order) * offset An _even_ offset into the buffer for the given * FID/RID. We haven't the means to validate this, * so be careful. (host order) * buf ptr to array of bytes * len length of data to transfer (in bytes) * * Returns: * 0 success * >0 f/w reported failure - value of offset reg. * <0 driver reported error (timeout|bad arg) * * Side effects: * * Call context: * process thread * interrupt ----------------------------------------------------------------*/ int hfa384x_copy_to_bap(hfa384x_t *hw, UINT16 bap, UINT16 id, UINT16 offset, void *buf, UINT len) { return hfa384x_copy_to_bap4(hw, bap, id, offset, buf, len, NULL, 0, NULL, 0, NULL, 0); } int hfa384x_copy_to_bap4(hfa384x_t *hw, UINT16 bap, UINT16 id, UINT16 offset, void *buf, UINT len1, void* buf2, UINT len2, void *buf3, UINT len3, void *buf4, UINT len4) { int result = 0; unsigned long flags = 0; UINT8 *d; UINT selectreg; UINT offsetreg; UINT datareg; UINT i; UINT16 reg; DBFENTER; // printk(KERN_DEBUG "ctb1 %d id %04x o %d %d %d %d %d\n", bap, id, offset, len1, len2, len3, len4); /* Validate bap, offset, buf, and len */ if ( (bap > 1) || (offset > HFA384x_BAP_OFFSET_MAX) || (offset % 2) || (buf == NULL) || (len1+len2+len3+len4 > HFA384x_BAP_DATALEN_MAX) ){ result = -EINVAL; } else { selectreg = (bap == 1) ? HFA384x_SELECT1 : HFA384x_SELECT0; offsetreg = (bap == 1) ? HFA384x_OFFSET1 : HFA384x_OFFSET0; datareg = (bap == 1) ? HFA384x_DATA1 : HFA384x_DATA0; /* Obtain lock */ spin_lock_irqsave( &(hw->baplock), flags); /* Write id to select reg */ hfa384x_setreg(hw, id, selectreg); udelay(10); /* Write offset to offset reg */ hfa384x_setreg(hw, offset, offsetreg); /* Wait for offset[busy] to clear (see BAP_TIMEOUT) */ i = 0; do { reg = hfa384x_getreg(hw, offsetreg); if ( i > 0 ) udelay(10); i++; } while ( i < prism2_bap_timeout && HFA384x_OFFSET_ISBUSY(reg)); #if (WLAN_HOSTIF != WLAN_PCI) /* Release lock */ spin_unlock_irqrestore( &(hw->baplock), flags); #endif if ( HFA384x_OFFSET_ISBUSY(reg) ){ /* If timeout, return reg */ result = reg; } else if ( HFA384x_OFFSET_ISERR(reg) ){ /* If offset[err] == 1, return reg */ result = reg; } else { d = (UINT8*)buf; /* Write even(len1) buf contents to data reg */ for ( i = 0; i < (len1 & 0xfffe); i+=2 ) { hfa384x_setreg_noswap(hw, *(UINT16*)(&(d[i])), datareg); } if (len1 & 1) { UINT16 data; UINT8 *b = (UINT8 *) &data; b[0] = d[len1-1]; if (buf2 != NULL) { d = (UINT8*)buf2; b[1] = d[0]; len2--; buf2++; } hfa384x_setreg_noswap(hw, data, datareg); } if ((buf2 != NULL) && (len2 > 0)) { /* Write even(len2) buf contents to data reg */ d = (UINT8*)buf2; for ( i = 0; i < (len2 & 0xfffe); i+=2 ) { hfa384x_setreg_noswap(hw, *(UINT16*)(&(d[i])), datareg); } if (len2 & 1) { UINT16 data; UINT8 *b = (UINT8 *) &data; b[0] = d[len2-1]; if (buf3 != NULL) { d = (UINT8*)buf3; b[1] = d[0]; len3--; buf3++; } hfa384x_setreg_noswap(hw, data, datareg); } } if ((buf3 != NULL) && (len3 > 0)) { /* Write even(len3) buf contents to data reg */ d = (UINT8*)buf3; for ( i = 0; i < (len3 & 0xfffe); i+=2 ) { hfa384x_setreg_noswap(hw, *(UINT16*)(&(d[i])), datareg); } if (len3 & 1) { UINT16 data; UINT8 *b = (UINT8 *) &data; b[0] = d[len3-1]; if (buf4 != NULL) { d = (UINT8*)buf4; b[1] = d[0]; len4--; buf4++; } hfa384x_setreg_noswap(hw, data, datareg); } } if ((buf4 != NULL) && (len4 > 0)) { /* Write even(len4) buf contents to data reg */ d = (UINT8*)buf4; for ( i = 0; i < (len4 & 0xfffe); i+=2 ) { hfa384x_setreg_noswap(hw, *(UINT16*)(&(d[i])), datareg); } if (len4 & 1) { UINT16 data; UINT8 *b = (UINT8 *) &data; b[0] = d[len4-1]; b[1] = 0; hfa384x_setreg_noswap(hw, data, datareg); } } // printk(KERN_DEBUG "ctb2 %d id %04x o %d %d %d %d %d\n", bap, id, offset, len1, len2, len3, len4); } #if (WLAN_HOSTIF == WLAN_PCI) udelay(5); /* Release lock */ spin_unlock_irqrestore( &(hw->baplock), flags); #endif } if (result) WLAN_LOG_ERROR("copy_to_bap() failed.\n"); DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_copy_from_aux * * Copies a collection of bytes from the controller memory. The * Auxiliary port MUST be enabled prior to calling this function. * We _might_ be in a download state. * * Arguments: * hw device structure * cardaddr address in hfa384x data space to read * auxctl address space select * buf ptr to destination host buffer * len length of data to transfer (in bytes) * * Returns: * nothing * * Side effects: * buf contains the data copied * * Call context: * process thread * interrupt ----------------------------------------------------------------*/ void hfa384x_copy_from_aux( hfa384x_t *hw, UINT32 cardaddr, UINT32 auxctl, void *buf, UINT len) { UINT16 currpage; UINT16 curroffset; UINT i = 0; DBFENTER; if ( !(hw->auxen) ) { WLAN_LOG_DEBUG(1, "Attempt to read 0x%04x when aux not enabled\n", cardaddr); return; } /* Build appropriate aux page and offset */ currpage = HFA384x_AUX_MKPAGE(cardaddr); curroffset = HFA384x_AUX_MKOFF(cardaddr, auxctl); hfa384x_setreg(hw, currpage, HFA384x_AUXPAGE); hfa384x_setreg(hw, curroffset, HFA384x_AUXOFFSET); udelay(5); /* beat */ /* read the data */ while ( i < len) { *((UINT16*)(buf+i)) = hfa384x_getreg_noswap(hw, HFA384x_AUXDATA); i+=2; curroffset+=2; if ( (curroffset&HFA384x_ADDR_AUX_OFF_MASK) > HFA384x_ADDR_AUX_OFF_MAX ) { currpage++; curroffset = 0; curroffset = HFA384x_AUX_MKOFF(curroffset, auxctl); hfa384x_setreg(hw, currpage, HFA384x_AUXPAGE); hfa384x_setreg(hw, curroffset, HFA384x_AUXOFFSET); udelay(5); /* beat */ } } /* Make sure the auxctl bits are clear */ hfa384x_setreg(hw, 0, HFA384x_AUXOFFSET); DBFEXIT; } /*---------------------------------------------------------------- * hfa384x_copy_to_aux * * Copies a collection of bytes to the controller memory. The * Auxiliary port MUST be enabled prior to calling this function. * We _might_ be in a download state. * * Arguments: * hw device structure * cardaddr address in hfa384x data space to read * auxctl address space select * buf ptr to destination host buffer * len length of data to transfer (in bytes) * * Returns: * nothing * * Side effects: * Controller memory now contains a copy of buf * * Call context: * process thread * interrupt ----------------------------------------------------------------*/ void hfa384x_copy_to_aux( hfa384x_t *hw, UINT32 cardaddr, UINT32 auxctl, void *buf, UINT len) { UINT16 currpage; UINT16 curroffset; UINT i = 0; DBFENTER; if ( !(hw->auxen) ) { WLAN_LOG_DEBUG(1, "Attempt to read 0x%04x when aux not enabled\n", cardaddr); return; } /* Build appropriate aux page and offset */ currpage = HFA384x_AUX_MKPAGE(cardaddr); curroffset = HFA384x_AUX_MKOFF(cardaddr, auxctl); hfa384x_setreg(hw, currpage, HFA384x_AUXPAGE); hfa384x_setreg(hw, curroffset, HFA384x_AUXOFFSET); udelay(5); /* beat */ /* write the data */ while ( i < len) { hfa384x_setreg_noswap(hw, *((UINT16*)(buf+i)), HFA384x_AUXDATA); i+=2; curroffset+=2; if ( curroffset > HFA384x_ADDR_AUX_OFF_MAX ) { currpage++; curroffset = 0; hfa384x_setreg(hw, currpage, HFA384x_AUXPAGE); hfa384x_setreg(hw, curroffset, HFA384x_AUXOFFSET); udelay(5); /* beat */ } } DBFEXIT; } /*---------------------------------------------------------------- * hfa384x_cmd_wait * * Waits for availability of the Command register, then * issues the given command. Then polls the Evstat register * waiting for command completion. Timeouts shouldn't be * possible since we're preventing overlapping commands and all * commands should be cleared and acknowledged. * * Arguments: * wlandev device structure * cmd cmd structure. Includes all arguments and result * data points. All in host order. * * Returns: * 0 success * -ETIMEDOUT timed out waiting for register ready or * command completion * >0 command indicated error, Status and Resp0-2 are * in hw structure. * * Side effects: * * * Call context: * process thread ----------------------------------------------------------------*/ static int hfa384x_docmd_wait( hfa384x_t *hw, hfa384x_metacmd_t *cmd) { int result = -ETIMEDOUT; UINT16 reg = 0; UINT16 counter; DBFENTER; hw->cmdflag = 0; hw->cmddata = cmd; /* wait for the busy bit to clear */ counter = 0; reg = hfa384x_getreg(hw, HFA384x_CMD); while ( HFA384x_CMD_ISBUSY(reg) && (counter < 10)) { reg = hfa384x_getreg(hw, HFA384x_CMD); counter++; udelay(10); } if (HFA384x_CMD_ISBUSY(reg)) { WLAN_LOG_ERROR("hfa384x_cmd timeout(1), reg=0x%0hx.\n", reg); goto failed; } if (!HFA384x_CMD_ISBUSY(reg)) { /* busy bit clear, write command */ hfa384x_setreg(hw, cmd->parm0, HFA384x_PARAM0); hfa384x_setreg(hw, cmd->parm1, HFA384x_PARAM1); hfa384x_setreg(hw, cmd->parm2, HFA384x_PARAM2); hfa384x_setreg(hw, cmd->cmd, HFA384x_CMD); #ifdef CMD_IRQ #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0)) while (! hw->cmdflag) interruptible_sleep_on(&hw->cmdq); #else wait_event_interruptible(hw->cmdq, hw->cmdflag); #endif result = HFA384x_STATUS_RESULT_GET(cmd->status); #else // CMD_IRQ /* Now wait for completion */ counter = 0; reg = hfa384x_getreg(hw, HFA384x_EVSTAT); /* Initialization is the problem. It takes about 100ms. "normal" commands are typically is about 200-400 us (I've never seen less than 200). Longer is better so that we're not hammering the bus. */ while ( !HFA384x_EVSTAT_ISCMD(reg) && (counter < 5000)) { reg = hfa384x_getreg(hw, HFA384x_EVSTAT); counter++; udelay(200); } if ( HFA384x_EVSTAT_ISCMD(reg) ) { result = 0; cmd->result.status = hfa384x_getreg(hw, HFA384x_STATUS); cmd->result.resp0 = hfa384x_getreg(hw, HFA384x_RESP0); cmd->result.resp1 = hfa384x_getreg(hw, HFA384x_RESP1); cmd->result.resp2 = hfa384x_getreg(hw, HFA384x_RESP2); hfa384x_setreg(hw, HFA384x_EVACK_CMD, HFA384x_EVACK); result = HFA384x_STATUS_RESULT_GET(cmd->result.status); } else { WLAN_LOG_ERROR("hfa384x_cmd timeout(2), reg=0x%0hx.\n", reg); } #endif /* CMD_IRQ */ } failed: hw->cmdflag = 0; hw->cmddata = NULL; DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_dl_docmd_wait * * Waits for availability of the Command register, then * issues the given command. Then polls the Evstat register * waiting for command completion. Timeouts shouldn't be * possible since we're preventing overlapping commands and all * commands should be cleared and acknowledged. * * This routine is only used for downloads. Since it doesn't lock out * interrupts the system response is much better. * * Arguments: * wlandev device structure * cmd cmd structure. Includes all arguments and result * data points. All in host order. * * Returns: * 0 success * -ETIMEDOUT timed out waiting for register ready or * command completion * >0 command indicated error, Status and Resp0-2 are * in hw structure. * * Side effects: * * * Call context: * process thread ----------------------------------------------------------------*/ static int hfa384x_dl_docmd_wait( hfa384x_t *hw, hfa384x_metacmd_t *cmd) { int result = -ETIMEDOUT; unsigned long timeout; UINT16 reg = 0; DBFENTER; /* wait for the busy bit to clear */ timeout = jiffies + 1*HZ; reg = hfa384x_getreg(hw, HFA384x_CMD); while ( HFA384x_CMD_ISBUSY(reg) && time_before( jiffies, timeout) ) { reg = hfa384x_getreg(hw, HFA384x_CMD); udelay(10); } if (HFA384x_CMD_ISBUSY(reg)) { WLAN_LOG_WARNING("Timed out waiting for cmd register.\n"); goto failed; } if (!HFA384x_CMD_ISBUSY(reg)) { /* busy bit clear, write command */ hfa384x_setreg(hw, cmd->parm0, HFA384x_PARAM0); hfa384x_setreg(hw, cmd->parm1, HFA384x_PARAM1); hfa384x_setreg(hw, cmd->parm2, HFA384x_PARAM2); hfa384x_setreg(hw, cmd->cmd, HFA384x_CMD); /* Now wait for completion */ if ( (HFA384x_CMD_CMDCODE_GET(cmd->cmd) == HFA384x_CMDCODE_DOWNLD) ) { /* dltimeout is in ms */ timeout = (((UINT32)hw->dltimeout) / 1000UL) * HZ; if ( timeout > 0 ) { timeout += jiffies; } else { timeout = jiffies + 1*HZ; } } else { timeout = jiffies + 1*HZ; } reg = hfa384x_getreg(hw, HFA384x_EVSTAT); while ( !HFA384x_EVSTAT_ISCMD(reg) && time_before(jiffies,timeout) ) { udelay(100); reg = hfa384x_getreg(hw, HFA384x_EVSTAT); } if ( HFA384x_EVSTAT_ISCMD(reg) ) { result = 0; cmd->result.status = hfa384x_getreg(hw, HFA384x_STATUS); cmd->result.resp0 = hfa384x_getreg(hw, HFA384x_RESP0); cmd->result.resp1 = hfa384x_getreg(hw, HFA384x_RESP1); cmd->result.resp2 = hfa384x_getreg(hw, HFA384x_RESP2); hfa384x_setreg(hw, HFA384x_EVACK_CMD, HFA384x_EVACK); result = HFA384x_STATUS_RESULT_GET(cmd->result.status); } } failed: DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_drvr_start * * Issues the MAC initialize command, sets up some data structures, * and enables the interrupts. After this function completes, the * low-level stuff should be ready for any/all commands. * * Arguments: * hw device structure * Returns: * 0 success * >0 f/w reported error - f/w status code * <0 driver reported error * * Side effects: * * Call context: * process thread ----------------------------------------------------------------*/ int hfa384x_drvr_start(hfa384x_t *hw) { int result = 0; UINT16 reg; int i; int j; DBFENTER; /* call initialize */ result = hfa384x_cmd_initialize(hw); if (result != 0) { WLAN_LOG_ERROR("Initialize command failed.\n"); goto failed; } /* make sure interrupts are disabled and any layabout events cleared */ hfa384x_setreg(hw, 0, HFA384x_INTEN); hfa384x_setreg(hw, 0xffff, HFA384x_EVACK); hw->txfid_head = 0; hw->txfid_tail = 0; hw->txfid_N = HFA384x_DRVR_FIDSTACKLEN_MAX; memset(hw->txfid_queue, 0, sizeof(hw->txfid_queue)); /* Allocate tx and notify FIDs */ /* First, tx */ for ( i = 0; i < HFA384x_DRVR_FIDSTACKLEN_MAX-1; i++) { result = hfa384x_cmd_allocate(hw, HFA384x_DRVR_TXBUF_MAX); if (result != 0) { WLAN_LOG_ERROR("Allocate(tx) command failed.\n"); goto failed; } j = 0; do { reg = hfa384x_getreg(hw, HFA384x_EVSTAT); udelay(10); j++; } while ( !HFA384x_EVSTAT_ISALLOC(reg) && j < 50); /* 50 is timeout */ if ( j >= 50 ) { WLAN_LOG_ERROR("Timed out waiting for evalloc(tx).\n"); result = -ETIMEDOUT; goto failed; } reg = hfa384x_getreg(hw, HFA384x_ALLOCFID); txfid_queue_add(hw, reg); WLAN_LOG_DEBUG(4,"hw->txfid_queue[%d]=0x%04x\n",i,reg); reg = HFA384x_EVACK_ALLOC_SET(1); hfa384x_setreg(hw, reg, HFA384x_EVACK); } /* Now, the info frame fid */ result = hfa384x_cmd_allocate(hw, HFA384x_INFOFRM_MAXLEN); if (result != 0) { WLAN_LOG_ERROR("Allocate(tx) command failed.\n"); goto failed; } i = 0; do { reg = hfa384x_getreg(hw, HFA384x_EVSTAT); udelay(10); i++; } while ( !HFA384x_EVSTAT_ISALLOC(reg) && i < 50); /* 50 is timeout */ if ( i >= 50 ) { WLAN_LOG_ERROR("Timed out waiting for evalloc(info).\n"); result = -ETIMEDOUT; goto failed; } hw->infofid = hfa384x_getreg(hw, HFA384x_ALLOCFID); reg = HFA384x_EVACK_ALLOC_SET(1); hfa384x_setreg(hw, reg, HFA384x_EVACK); WLAN_LOG_DEBUG(4,"hw->infofid=0x%04x\n", hw->infofid); /* Set swsupport regs to magic # for card presence detection */ hfa384x_setreg(hw, HFA384x_DRVR_MAGIC, HFA384x_SWSUPPORT0); /* Now enable the interrupts and set the running state */ hfa384x_setreg(hw, 0xffff, HFA384x_EVSTAT); hfa384x_events_all(hw); hw->state = HFA384x_STATE_RUNNING; goto done; failed: WLAN_LOG_ERROR("Failed, result=%d\n", result); done: DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_drvr_stop * * Issues the initialize command to leave us in the 'reset' state. * * Arguments: * hw device structure * Returns: * 0 success * >0 f/w reported error - f/w status code * <0 driver reported error * * Side effects: * * Call context: * process thread ----------------------------------------------------------------*/ int hfa384x_drvr_stop(hfa384x_t *hw) { int result = 0; int i; DBFENTER; del_timer_sync(&hw->commsqual_timer); if ( hw->wlandev->hwremoved ) { /* only flush when we're shutting down for good */ flush_scheduled_work(); } if (hw->state == HFA384x_STATE_RUNNING) { /* * Send the MAC initialize cmd. */ hfa384x_cmd_initialize(hw); /* * Make absolutely sure interrupts are disabled and any * layabout events cleared */ hfa384x_setreg(hw, 0, HFA384x_INTEN); hfa384x_setreg(hw, 0xffff, HFA384x_EVACK); } tasklet_kill(&hw->bap_tasklet); hw->link_status = HFA384x_LINK_NOTCONNECTED; hw->state = HFA384x_STATE_INIT; /* Clear all the port status */ for ( i = 0; i < HFA384x_NUMPORTS_MAX; i++) { hw->port_enabled[i] = 0; } DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_drvr_txframe * * Takes a frame from prism2sta and queues it for transmission. * * Arguments: * hw device structure * skb packet buffer struct. Contains an 802.11 * data frame. * p80211_hdr points to the 802.11 header for the packet. * Returns: * 0 Success and more buffs available * 1 Success but no more buffs * 2 Allocation failure * 3 MAC Tx command failed * 4 Buffer full or queue busy * * Side effects: * * Call context: * process thread ----------------------------------------------------------------*/ int hfa384x_drvr_txframe(hfa384x_t *hw, struct sk_buff *skb, p80211_hdr_t *p80211_hdr, p80211_metawep_t *p80211_wep) { hfa384x_tx_frame_t txdesc; UINT16 macq = 0; UINT16 fid; int result; DBFENTER; /* Build Tx frame structure */ /* Set up the control field */ memset(&txdesc, 0, sizeof(txdesc)); /* Tx complete and Tx exception disable per dleach. Might be causing * buf depletion */ #define DOBOTH 1 #if DOBOTH txdesc.tx_control = HFA384x_TX_MACPORT_SET(0) | HFA384x_TX_STRUCTYPE_SET(1) | HFA384x_TX_TXEX_SET(1) | HFA384x_TX_TXOK_SET(1); #elif DOEXC txdesc.tx_control = HFA384x_TX_MACPORT_SET(0) | HFA384x_TX_STRUCTYPE_SET(1) | HFA384x_TX_TXEX_SET(1) | HFA384x_TX_TXOK_SET(0); #else txdesc.tx_control = HFA384x_TX_MACPORT_SET(0) | HFA384x_TX_STRUCTYPE_SET(1) | HFA384x_TX_TXEX_SET(0) | HFA384x_TX_TXOK_SET(0); #endif /* if we're using host WEP, increase size by IV+ICV */ if (p80211_wep->data) { txdesc.data_len = host2hfa384x_16(skb->len+8); // txdesc.tx_control |= HFA384x_TX_NOENCRYPT_SET(1); } else { txdesc.data_len = host2hfa384x_16(skb->len); } txdesc.tx_control = host2hfa384x_16(txdesc.tx_control); /* copy the header over to the txdesc */ memcpy(&(txdesc.frame_control), p80211_hdr, sizeof(p80211_hdr_t)); /* Since tbusy is set whenever the stack is empty, there should * always be something on the stack if we get to this point. * [MSM]: NOT TRUE!!!!! so I added the test of fid below. */ /* Allocate FID */ fid = txfid_queue_remove(hw); if ( fid == 0 ) { /* stack or queue was empty */ return 4; } /* now let's get the cmdlock */ spin_lock(&hw->cmdlock); /* Copy descriptor+payload to FID */ if (p80211_wep->data) { result = hfa384x_copy_to_bap4(hw, HFA384x_BAP_PROC, fid, 0, &txdesc, sizeof(txdesc), p80211_wep->iv, sizeof(p80211_wep->iv), p80211_wep->data, skb->len, p80211_wep->icv, sizeof(p80211_wep->icv)); } else { result = hfa384x_copy_to_bap4(hw, HFA384x_BAP_PROC, fid, 0, &txdesc, sizeof(txdesc), skb->data, skb->len, NULL, 0, NULL, 0); } if ( result ) { WLAN_LOG_DEBUG(1, "copy_to_bap(%04x, %d, %d) failed, result=0x%x\n", fid, sizeof(txdesc), skb->len, result); /* put the fid back in the queue */ txfid_queue_add(hw, fid); result = 3; goto failed; } /* Issue Tx command */ result = hfa384x_cmd_transmit(hw, HFA384x_TXCMD_RECL, macq, fid); if ( result != 0 ) { txfid_queue_add(hw, fid); WLAN_LOG_DEBUG(1,"cmd_tx(%04x) failed, result=%d\n", fid, result); result = 3; goto failed; } /* indicate we haven't any buffers, int_alloc will clear */ result = txfid_queue_empty(hw); failed: spin_unlock(&hw->cmdlock); DBFEXIT; return result; } /*---------------------------------------------------------------- * hfa384x_interrupt * * Driver interrupt handler. * * Arguments: * irq irq number * dev_id pointer to the device * regs registers * * Returns: * nothing * * Side effects: * May result in a frame being passed up the stack or an info * frame being handled. * * Call context: * Ummm, could it be interrupt? ----------------------------------------------------------------*/ irqreturn_t hfa384x_interrupt(int irq, void *dev_id PT_REGS) { int reg; wlandevice_t *wlandev = (wlandevice_t*)dev_id; hfa384x_t *hw = wlandev->priv; int ev_read = 0; DBFENTER; if (!wlandev || wlandev->hwremoved) return IRQ_NONE; /* Not much we can do w/o hardware */ #if (WLAN_HOSTIF == WLAN_PCMCIA) if (hw->iobase == 0) /* XXX FIXME Properly */ return IRQ_NONE; #endif for (;;ev_read++) { if (ev_read >= prism2_irq_evread_max) break; /* Check swsupport reg magic # for card presence */ reg = hfa384x_getreg(hw, HFA384x_SWSUPPORT0); if ( reg != HFA384x_DRVR_MAGIC) { WLAN_LOG_DEBUG(2, "irq=%d, no magic. Card removed?.\n", irq); break; } /* read the EvStat register for interrupt enabled events */ reg = hfa384x_getreg(hw, HFA384x_EVSTAT); /* AND with the enabled interrupts */ reg &= hfa384x_getreg(hw, HFA384x_INTEN); /* Handle the events */ if ( HFA384x_EVSTAT_ISWTERR(reg) ){ WLAN_LOG_ERROR( "Error: WTERR interrupt received (unhandled).\n"); hfa384x_setreg(hw, HFA384x_EVACK_WTERR_SET(1), HFA384x_EVACK); } if ( HFA384x_EVSTAT_ISINFDROP(reg) ){ hfa384x_int_infdrop(wlandev); hfa384x_setreg(hw, HFA384x_EVACK_INFDROP_SET(1), HFA384x_EVACK); } if (HFA384x_EVSTAT_ISBAP_OP(reg)) { /* Disable the BAP interrupts */ hfa384x_events_nobap(hw); tasklet_schedule(&hw->bap_tasklet); } if ( HFA384x_EVSTAT_ISALLOC(reg) ){ hfa384x_int_alloc(wlandev); hfa384x_setreg(hw, HFA384x_EVACK_ALLOC_SET(1), HFA384x_EVACK); } if ( HFA384x_EVSTAT_ISDTIM(reg) ){ hfa384x_int_dtim(wlandev); hfa384x_setreg(hw, HFA384x_EVACK_DTIM_SET(1), HFA384x_EVACK); } #ifdef CMD_IRQ if ( HFA384x_EVSTAT_ISCMD(reg) ){ hfa384x_int_cmd(wlandev); hfa384x_setreg(hw, HFA384x_EVACK_CMD_SET(1), HFA384x_EVACK); } #endif /* allow the evstat to be updated after the evack */ udelay(20); } DBFEXIT; return IRQ_HANDLED; } #ifdef CMD_IRQ /*---------------------------------------------------------------- * hfa384x_int_cmd * * Handles command completion event. * * Arguments: * wlandev wlan device structure * * Returns: * nothing * * Side effects: * * Call context: * interrupt ----------------------------------------------------------------*/ void hfa384x_int_cmd(wlandevice_t *wlandev) { hfa384x_t *hw = wlandev->priv; DBFENTER; // check to make sure it's the right command? if (hw->cmddata) { hw->cmddata->status = hfa384x_getreg(hw, HFA384x_STATUS); hw->cmddata->resp0 = hfa384x_getreg(hw, HFA384x_RESP0); hw->cmddata->resp1 = hfa384x_getreg(hw, HFA384x_RESP1); hw->cmddata->resp2 = hfa384x_getreg(hw, HFA384x_RESP2); } hw->cmdflag = 1; printk(KERN_INFO "um. int_cmd\n"); wake_up_interruptible(&hw->cmdq); // XXXX perform a bap copy too? DBFEXIT; return; } #endif /*---------------------------------------------------------------- * hfa384x_int_dtim * * Handles the DTIM early warning event. * * Arguments: * wlandev wlan device structure * * Returns: * nothing * * Side effects: * * Call context: * interrupt ----------------------------------------------------------------*/ static void hfa384x_int_dtim(wlandevice_t *wlandev) { #if 0 hfa384x_t *hw = wlandev->priv; #endif DBFENTER; prism2sta_ev_dtim(wlandev); DBFEXIT; return; } /*---------------------------------------------------------------- * hfa384x_int_infdrop * * Handles the InfDrop event. * * Arguments: * wlandev wlan device structure * * Returns: * nothing * * Side effects: * * Call context: * interrupt ----------------------------------------------------------------*/ static void hfa384x_int_infdrop(wlandevice_t *wlandev) { #if 0 hfa384x_t *hw = wlandev->priv; #endif DBFENTER; prism2sta_ev_infdrop(wlandev); DBFEXIT; return; } /*---------------------------------------------------------------- * hfa384x_int_info * * Handles the Info event. * * Arguments: * wlandev wlan device structure * * Returns: * nothing * * Side effects: * * Call context: * tasklet ----------------------------------------------------------------*/ static void hfa384x_int_info(wlandevice_t *wlandev) { hfa384x_t *hw = wlandev->priv; UINT16 reg; hfa384x_InfFrame_t inf; int result; DBFENTER; /* Retrieve the FID */ reg = hfa384x_getreg(hw, HFA384x_INFOFID); /* Retrieve the length */ result = hfa384x_copy_from_bap( hw, HFA384x_BAP_INT, reg, 0, &inf.framelen, sizeof(UINT16)); if ( result ) { WLAN_LOG_DEBUG(1, "copy_from_bap(0x%04x, 0, %d) failed, result=0x%x\n", reg, sizeof(inf), result); goto failed; } inf.framelen = hfa384x2host_16(inf.framelen); /* Retrieve the rest */ result = hfa384x_copy_from_bap( hw, HFA384x_BAP_INT, reg, sizeof(UINT16), &(inf.infotype), inf.framelen * sizeof(UINT16)); if ( result ) { WLAN_LOG_DEBUG(1, "copy_from_bap(0x%04x, 0, %d) failed, result=0x%x\n", reg, sizeof(inf), result); goto failed; } prism2sta_ev_info(wlandev, &inf); failed: DBFEXIT; return; } /*---------------------------------------------------------------- * hfa384x_int_txexc * * Handles the TxExc event. A Transmit Exception event indicates * that the MAC's TX process was unsuccessful - so the packet did * not get transmitted. * * Arguments: * wlandev wlan device structure * * Returns: * nothing * * Side effects: * * Call context: * tasklet ----------------------------------------------------------------*/ static void hfa384x_int_txexc(wlandevice_t *wlandev) { hfa384x_t *hw = wlandev->priv; UINT16 status; UINT16 fid; int result = 0; DBFENTER; /* Collect the status and display */ fid = hfa384x_getreg(hw, HFA384x_TXCOMPLFID); result = hfa384x_copy_from_bap(hw, HFA384x_BAP_INT, fid, 0, &status, sizeof(status)); if ( result ) { WLAN_LOG_DEBUG(1, "copy_from_bap(0x%04x, 0, %d) failed, result=0x%x\n", fid, sizeof(status), result); goto failed; } status = hfa384x2host_16(status); prism2sta_ev_txexc(wlandev, status); failed: DBFEXIT; return; } /*---------------------------------------------------------------- * hfa384x_int_tx * * Handles the Tx event. * * Arguments: * wlandev wlan device structure * * Returns: * nothing * * Side effects: * * Call context: * tasklet ----------------------------------------------------------------*/ static void hfa384x_int_tx(wlandevice_t *wlandev) { hfa384x_t *hw = wlandev->priv; UINT16 fid; UINT16 status; int result = 0; DBFENTER; fid = hfa384x_getreg(hw, HFA384x_TXCOMPLFID); result = hfa384x_copy_from_bap(hw, HFA384x_BAP_INT, fid, 0, &status, sizeof(status)); if ( result ) { WLAN_LOG_DEBUG(1, "copy_from_bap(0x%04x, 0, %d) failed, result=0x%x\n", fid, sizeof(status), result); goto failed; } status = hfa384x2host_16(status); prism2sta_ev_tx(wlandev, status); failed: DBFEXIT; return; } /*---------------------------------------------------------------- * hfa384x_int_rx * * Handles the Rx event. * * Arguments: * wlandev wlan device structure * * Returns: * nothing * * Side effects: * * Call context: * tasklet ----------------------------------------------------------------*/ static void hfa384x_int_rx(wlandevice_t *wlandev) { hfa384x_t *hw = wlandev->priv; UINT16 rxfid; hfa384x_rx_frame_t rxdesc; int result; int hdrlen; UINT16 fc; p80211_rxmeta_t *rxmeta; struct sk_buff *skb = NULL; UINT8 *datap; DBFENTER; /* Get the FID */ rxfid = hfa384x_getreg(hw, HFA384x_RXFID); /* Get the descriptor (including headers) */ result = hfa384x_copy_from_bap(hw, HFA384x_BAP_INT, rxfid, 0, &rxdesc, sizeof(rxdesc)); if ( result ) { WLAN_LOG_DEBUG(1, "copy_from_bap(0x%04x, %d, %d) failed, result=0x%x\n", rxfid, 0, sizeof(rxdesc), result); goto done; } /* Byte order convert once up front. */ rxdesc.status = hfa384x2host_16(rxdesc.status); rxdesc.time = hfa384x2host_32(rxdesc.time); /* drop errors and whatnot in promisc mode */ if (( wlandev->netdev->flags & IFF_PROMISC ) && (HFA384x_RXSTATUS_ISFCSERR(rxdesc.status) || HFA384x_RXSTATUS_ISUNDECR(rxdesc.status))) goto done; /* Now handle frame based on port# */ switch( HFA384x_RXSTATUS_MACPORT_GET(rxdesc.status) ) { case 0: fc = ieee2host16(rxdesc.frame_control); /* If exclude and we receive an unencrypted, drop it */ if ( (wlandev->hostwep & HOSTWEP_EXCLUDEUNENCRYPTED) && !WLAN_GET_FC_ISWEP(fc)) { goto done; } hdrlen = p80211_headerlen(fc); /* Allocate the buffer, note CRC (aka FCS). pballoc */ /* assumes there needs to be space for one */ skb = dev_alloc_skb(hfa384x2host_16(rxdesc.data_len) + hdrlen + WLAN_CRC_LEN + 2); /* a little extra */ if ( ! skb ) { WLAN_LOG_ERROR("alloc_skb failed.\n"); goto done; } skb->dev = wlandev->netdev; /* theoretically align the IP header on a 32-bit word. */ if ( hdrlen == WLAN_HDR_A4_LEN ) skb_reserve(skb, 2); /* Copy the 802.11 hdr to the buffer */ datap = skb_put(skb, WLAN_HDR_A3_LEN); memcpy(datap, &rxdesc.frame_control, WLAN_HDR_A3_LEN); /* Snag the A4 address if present */ if (hdrlen == WLAN_HDR_A4_LEN) { datap = skb_put(skb, WLAN_ADDR_LEN); memcpy(datap, &rxdesc.address4, WLAN_HDR_A3_LEN); } /* we can convert the data_len as we passed the original on */ rxdesc.data_len = hfa384x2host_16(rxdesc.data_len); /* Copy the payload data to the buffer */ if ( rxdesc.data_len > 0 ) { datap = skb_put(skb, rxdesc.data_len); result = hfa384x_copy_from_bap(hw, HFA384x_BAP_INT, rxfid, HFA384x_RX_DATA_OFF, datap, rxdesc.data_len); if ( result ) { WLAN_LOG_DEBUG(1, "copy_from_bap(0x%04x, %d, %d) failed, result=0x%x\n", rxfid, HFA384x_RX_DATA_OFF, rxdesc.data_len, result); goto failed; } } /* the prism2 cards don't return the FCS */ datap = skb_put(skb, WLAN_CRC_LEN); memset (datap, 0xff, WLAN_CRC_LEN); skb_reset_mac_header(skb); /* Attach the rxmeta, set some stuff */ p80211skb_rxmeta_attach(wlandev, skb); rxmeta = P80211SKB_RXMETA(skb); rxmeta->mactime = rxdesc.time; rxmeta->rxrate = rxdesc.rate; rxmeta->signal = rxdesc.signal - hw->dbmadjust; rxmeta->noise = rxdesc.silence - hw->dbmadjust; prism2sta_ev_rx(wlandev, skb); goto done; case 7: if ( ! HFA384x_RXSTATUS_ISFCSERR(rxdesc.status) ) { hfa384x_int_rxmonitor( wlandev, rxfid, &rxdesc); } else { WLAN_LOG_DEBUG(3,"Received monitor frame: FCSerr set\n"); } goto done; default: WLAN_LOG_WARNING("Received frame on unsupported port=%d\n", HFA384x_RXSTATUS_MACPORT_GET(rxdesc.status) ); goto done; } failed: dev_kfree_skb(skb); done: DBFEXIT; return; } /*---------------------------------------------------------------- * hfa384x_int_rxmonitor * * Helper function for int_rx. Handles monitor frames. * Note that this function allocates space for the FCS and sets it * to 0xffffffff. The hfa384x doesn't give us the FCS value but the * higher layers expect it. 0xffffffff is used as a flag to indicate * the FCS is bogus. * * Arguments: * wlandev wlan device structure * rxfid received FID * rxdesc rx descriptor read from card in int_rx * * Returns: * nothing * * Side effects: * Allocates an skb and passes it up via the PF_PACKET interface. * Call context: * interrupt ----------------------------------------------------------------*/ static void hfa384x_int_rxmonitor( wlandevice_t *wlandev, UINT16 rxfid, hfa384x_rx_frame_t *rxdesc) { hfa384x_t *hw = wlandev->priv; UINT hdrlen = 0; UINT datalen = 0; UINT skblen = 0; UINT truncated = 0; UINT8 *datap; UINT16 fc; struct sk_buff *skb; DBFENTER; /* Don't forget the status, time, and data_len fields are in host order */ /* Figure out how big the frame is */ fc = ieee2host16(rxdesc->frame_control); hdrlen = p80211_headerlen(fc); datalen = hfa384x2host_16(rxdesc->data_len); /* Allocate an ind message+framesize skb */ skblen = sizeof(p80211msg_lnxind_wlansniffrm_t) + hdrlen + datalen + WLAN_CRC_LEN; /* sanity check the length */ if ( skblen > (sizeof(p80211msg_lnxind_wlansniffrm_t) + WLAN_HDR_A4_LEN + WLAN_DATA_MAXLEN + WLAN_CRC_LEN) ) { WLAN_LOG_DEBUG(1, "overlen frm: len=%d\n", skblen - sizeof(p80211msg_lnxind_wlansniffrm_t)); } if ( (skb = dev_alloc_skb(skblen)) == NULL ) { WLAN_LOG_ERROR("alloc_skb failed trying to allocate %d bytes\n", skblen); return; } /* only prepend the prism header if in the right mode */ if ((wlandev->netdev->type == ARPHRD_IEEE80211_PRISM) && (hw->sniffhdr == 0)) { p80211msg_lnxind_wlansniffrm_t *msg; datap = skb_put(skb, sizeof(p80211msg_lnxind_wlansniffrm_t)); msg = (p80211msg_lnxind_wlansniffrm_t*) datap; /* Initialize the message members */ msg->msgcode = DIDmsg_lnxind_wlansniffrm; msg->msglen = sizeof(p80211msg_lnxind_wlansniffrm_t); strcpy(msg->devname, wlandev->name); msg->hosttime.did = DIDmsg_lnxind_wlansniffrm_hosttime; msg->hosttime.status = 0; msg->hosttime.len = 4; msg->hosttime.data = jiffies; msg->mactime.did = DIDmsg_lnxind_wlansniffrm_mactime; msg->mactime.status = 0; msg->mactime.len = 4; msg->mactime.data = rxdesc->time * 1000; msg->channel.did = DIDmsg_lnxind_wlansniffrm_channel; msg->channel.status = 0; msg->channel.len = 4; msg->channel.data = hw->sniff_channel; msg->rssi.did = DIDmsg_lnxind_wlansniffrm_rssi; msg->rssi.status = P80211ENUM_msgitem_status_no_value; msg->rssi.len = 4; msg->rssi.data = 0; msg->sq.did = DIDmsg_lnxind_wlansniffrm_sq; msg->sq.status = P80211ENUM_msgitem_status_no_value; msg->sq.len = 4; msg->sq.data = 0; msg->signal.did = DIDmsg_lnxind_wlansniffrm_signal; msg->signal.status = 0; msg->signal.len = 4; msg->signal.data = rxdesc->signal; msg->noise.did = DIDmsg_lnxind_wlansniffrm_noise; msg->noise.status = 0; msg->noise.len = 4; msg->noise.data = rxdesc->silence; msg->rate.did = DIDmsg_lnxind_wlansniffrm_rate; msg->rate.status = 0; msg->rate.len = 4; msg->rate.data = rxdesc->rate / 5; /* set to 802.11 units */ msg->istx.did = DIDmsg_lnxind_wlansniffrm_istx; msg->istx.status = 0; msg->istx.len = 4; msg->istx.data = P80211ENUM_truth_false; msg->frmlen.did = DIDmsg_lnxind_wlansniffrm_frmlen; msg->frmlen.status = 0; msg->frmlen.len = 4; msg->frmlen.data = hdrlen + datalen + WLAN_CRC_LEN; } else if ((wlandev->netdev->type == ARPHRD_IEEE80211_PRISM) && (hw->sniffhdr != 0)) { p80211_caphdr_t *caphdr; /* The NEW header format! */ datap = skb_put(skb, sizeof(p80211_caphdr_t)); caphdr = (p80211_caphdr_t*) datap; caphdr->version = htonl(P80211CAPTURE_VERSION); caphdr->length = htonl(sizeof(p80211_caphdr_t)); caphdr->mactime = __cpu_to_be64(rxdesc->time); caphdr->hosttime = __cpu_to_be64(jiffies); caphdr->phytype = htonl(4); /* dss_dot11_b */ caphdr->channel = htonl(hw->sniff_channel); caphdr->datarate = htonl(rxdesc->rate); caphdr->antenna = htonl(0); /* unknown */ caphdr->priority = htonl(0); /* unknown */ caphdr->ssi_type = htonl(3); /* rssi_raw */ caphdr->ssi_signal = htonl(rxdesc->signal); caphdr->ssi_noise = htonl(rxdesc->silence); caphdr->preamble = htonl(0); /* unknown */ caphdr->encoding = htonl(1); /* cck */ } /* Copy the 802.11 header to the skb (ctl frames may be less than a full header) */ datap = skb_put(skb, hdrlen); memcpy( datap, &(rxdesc->frame_control), hdrlen); /* If any, copy the data from the card to the skb */ if ( datalen > 0 ) { /* Truncate the packet if the user wants us to */ UINT dataread = datalen; if(hw->sniff_truncate > 0 && dataread > hw->sniff_truncate) { dataread = hw->sniff_truncate; truncated = 1; } datap = skb_put(skb, dataread); hfa384x_copy_from_bap(hw, HFA384x_BAP_INT, rxfid, HFA384x_RX_DATA_OFF, datap, dataread); /* check for unencrypted stuff if WEP bit set. */ if (*(datap - hdrlen + 1) & 0x40) // wep set if ((*(datap) == 0xaa) && (*(datap+1) == 0xaa)) *(datap - hdrlen + 1) &= 0xbf; // clear wep; it's the 802.2 header! } if (!truncated && hw->sniff_fcs) { /* Set the FCS */ datap = skb_put(skb, WLAN_CRC_LEN); memset( datap, 0xff, WLAN_CRC_LEN); } /* pass it back up */ prism2sta_ev_rx(wlandev, skb); DBFEXIT; return; } /*---------------------------------------------------------------- * hfa384x_int_alloc * * Handles the Alloc event. * * Arguments: * wlandev wlan device structure * * Returns: * nothing * * Side effects: * * Call context: * interrupt ----------------------------------------------------------------*/ static void hfa384x_int_alloc(wlandevice_t *wlandev) { hfa384x_t *hw = wlandev->priv; UINT16 fid; INT16 result; DBFENTER; /* Handle the reclaimed FID */ /* collect the FID and push it onto the stack */ fid = hfa384x_getreg(hw, HFA384x_ALLOCFID); if ( fid != hw->infofid ) { /* It's a transmit fid */ WLAN_LOG_DEBUG(5, "int_alloc(%#x)\n", fid); result = txfid_queue_add(hw, fid); if (result != -1) { prism2sta_ev_alloc(wlandev); WLAN_LOG_DEBUG(5, "q_add.\n"); } else { WLAN_LOG_DEBUG(5, "q_full.\n"); } } else { /* unlock the info fid */ up(&hw->infofid_sem); } DBFEXIT; return; } /*---------------------------------------------------------------- * hfa384x_drvr_handover * * Sends a handover notification to the MAC. * * Arguments: * hw device structure * addr address of station that's left * * Returns: * zero success. * -ERESTARTSYS received signal while waiting for semaphore. * -EIO failed to write to bap, or failed in cmd. * * Side effects: * * Call context: * process thread, NOTE: this call may block on a semaphore! ----------------------------------------------------------------*/ int hfa384x_drvr_handover( hfa384x_t *hw, UINT8 *addr) { int result = 0; hfa384x_HandoverAddr_t rec; UINT len; DBFENTER; /* Acquire the infofid */ if ( down_interruptible(&hw->infofid_sem) ) { result = -ERESTARTSYS; goto failed; } /* Set up the record */ len = sizeof(hfa384x_HandoverAddr_t); rec.framelen = host2hfa384x_16(len/2 - 1); rec.infotype = host2hfa384x_16(HFA384x_IT_HANDOVERADDR); memcpy(rec.handover_addr, addr, sizeof(rec.handover_addr)); /* Issue the command */ result = hfa384x_cmd_notify(hw, 1, hw->infofid, &rec, len); if ( result != 0 ) { WLAN_LOG_DEBUG(1,"cmd_notify(%04x) failed, result=%d", hw->infofid, result); result = -EIO; goto failed; } failed: DBFEXIT; return result; } void hfa384x_tx_timeout(wlandevice_t *wlandev) { DBFENTER; WLAN_LOG_WARNING("Implement me.\n"); DBFEXIT; } /* Handles all "rx" BAP operations */ static void hfa384x_bap_tasklet(unsigned long data) { hfa384x_t *hw = (hfa384x_t *) data; wlandevice_t *wlandev = hw->wlandev; int counter = prism2_irq_evread_max; int reg; DBFENTER; while (counter-- > 0) { /* Get interrupt register */ reg = hfa384x_getreg(hw, HFA384x_EVSTAT); if ((reg == 0xffff) || !(reg & HFA384x_INT_BAP_OP)) { break; } if ( HFA384x_EVSTAT_ISINFO(reg) ){ hfa384x_int_info(wlandev); hfa384x_setreg(hw, HFA384x_EVACK_INFO_SET(1), HFA384x_EVACK); } if ( HFA384x_EVSTAT_ISTXEXC(reg) ){ hfa384x_int_txexc(wlandev); hfa384x_setreg(hw, HFA384x_EVACK_TXEXC_SET(1), HFA384x_EVACK); } if ( HFA384x_EVSTAT_ISTX(reg) ){ hfa384x_int_tx(wlandev); hfa384x_setreg(hw, HFA384x_EVACK_TX_SET(1), HFA384x_EVACK); } if ( HFA384x_EVSTAT_ISRX(reg) ){ hfa384x_int_rx(wlandev); hfa384x_setreg(hw, HFA384x_EVACK_RX_SET(1), HFA384x_EVACK); } } /* re-enable interrupts */ hfa384x_events_all(hw); DBFEXIT; } linux-wlan-ng-0.2.9+dfsg/src/prism2/prism2_ssf.pda0000644000175000017500000000040511024763201021306 0ustar tormodtormod; Minimal PDA file to get SSF cards operating. ; (PDR 0002) PDA Version Record ; Version 8 2 0002 0008 ; NIC hardware description ;2 0400 0001 ; PE pcmcia, x8 RAM ;2 0400 0003 ; PE pcmcia, x16 RAM ;2 0400 0005 ; PE pci, x8 RAM ;2 0400 0007 ; PE pci, x16 RAM linux-wlan-ng-0.2.9+dfsg/src/wlancfg/0000755000175000017500000000000011026545443016747 5ustar tormodtormodlinux-wlan-ng-0.2.9+dfsg/src/wlancfg/Makefile0000644000175000017500000000451311024763156020413 0ustar tormodtormod# src/wlancfg/Makefile # # Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. # -------------------------------------------------------------------- # # linux-wlan # # 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. # # 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. # # -------------------------------------------------------------------- # # Inquiries regarding the linux-wlan Open Source project can be # made directly to: # # AbsoluteValue Systems Inc. # info@linux-wlan.com # http://www.linux-wlan.com # # -------------------------------------------------------------------- # # Portions of the development of this software were funded by # Intersil Corporation as part of PRISM(R) chipset product development. # # -------------------------------------------------------------------- -include ../../config.mk CPPFLAGS= -I../include -I$(LINUX_SRC)/include -D__LINUX_WLAN__ SRCS = ../shared/p80211types.c \ ../shared/p80211meta.c \ ../shared/p80211metamsg.c \ ../shared/p80211metamib.c OBJS = ../shared/p80211types.o \ ../shared/p80211meta.o \ ../shared/p80211metamsg.o \ ../shared/p80211metamib.o wlancfg: wlancfg.o $(OBJS) $(CC) $(LDFLAGS) -o wlancfg wlancfg.o $(OBJS) install: cp wlancfg $(TARGET_INST_EXEDIR) clean: rm -f core core.* *.o .*.o *.s *.a .depend tmp_make *~ tags rm -f wlancfg linux-wlan-ng-0.2.9+dfsg/src/wlancfg/wlancfg.c0000644000175000017500000010325411024763156020542 0ustar tormodtormod/* src/wlancfg/wlancfg.c * * User utility for setting, saving, and querying the wlan card configuration. * * Copyright (C) 2001 Rebel.com Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Originally written 2001 by Robert James. * * The author may be reached as bob.james@rebel.com, or * Robert James * Rebel.com Inc. * 150 Isabella St., Suite 1000 * Ottawa, Ontario * Canada K1S 5R3 * * -------------------------------------------------------------------- */ /* ** The "wlancfg" utility program provides an alternative method to ** "wlanctl", for manipulating MIB values. It was designed to provide ** an easier mechanism for saving and restoring the complete wireless ** configuration (i.e. when re-starting the device driver) and to provide ** a more efficient mechanism for GUI's to query multiple MIB's. ** ** Usage: wlancfg query dev ** wlancfg show dev [all] ** wlancfg set dev ** wlancfg list ** wlancfg version ** ** where: dev - Name of device (e.g. wlan0). ** ** The functions are as follows: ** ** query - Read MIB names (separated by whitespace) from "stdin" ** and output their values (separated by carriage returns) ** to "stdout". The MIB's may be either read/write or ** read-only. ** show - Query the values of all supported read/write MIB's and ** output their values (separated by carriage returns) to ** "stdout". The syntax of the output will be: ** ** name=value ** ** If the "all" parameter is specified, then all supported ** MIB's (i.e. read-only MIB's as well) are output. ** set - Read MIB name/value pairs (separated by carriage returns) ** from "stdin" and set the values of the specified MIB's. The ** pairs must have the same syntax as above. The MIB's must ** be read/write. ** list - Display a list of all supported MIB's. ** version - Display the compiled version of "wlancfg". */ /*================================================================*/ /* System Includes */ #include #include #include #include /* Ugly hack for LinuxPPC R4, don't have time to figure it out right now */ #if defined(__WLAN_PPC__) #undef __GLIBC__ #endif #include #include #include /*================================================================*/ /* Project Includes */ #include #include #include #include #include #include #include #include #include /*================================================================*/ /* Local Types */ /* ** The request specification (req_spec) structure is used to record ** frequently used information about the "dot11req_mibget" and ** "dot11req_mibset" request messages. It is used to prevent the ** necessity of recalculating this information when executing these ** requests repeatedly. */ typedef struct req_spec { UINT32 msgcode; /* Request message code. */ UINT32 msglen; /* Length of message. */ p80211meta_t *attptr; /* "mibattribute" argument. */ UINT32 attdid; /* "mibattribute" DID. */ UINT32 attoff; /* Request message offset. */ UINT32 attlen; /* Request message data length. */ p80211meta_t *resptr; /* "resultcode" argument. */ UINT32 resdid; /* "resultcode" DID. */ UINT32 resoff; /* Request message offset. */ UINT32 reslen; /* Request message data length. */ } req_spec_t; /*================================================================*/ /* Local Function Declarations */ static void wlancfg_usage(void); static int wlancfg_query(char *device); static int wlancfg_show(char *device, int all); static int wlancfg_set(char *device); static void wlancfg_list(void); static int wlancfg_reqspec(char *request, req_spec_t *mibget); static int wlancfg_getvalue(char *device, p80211meta_t *item, req_spec_t *mibget, int skt, p80211ioctl_req_t *req, char *value); static int wlancfg_setvalue(char *device, req_spec_t *mibset, int skt, p80211ioctl_req_t *req, char *value); static int wlancfg_build(char *device, req_spec_t *spec, char *value, p80211msgd_t *msg); static void wlancfg_totext(p80211meta_t *item, req_spec_t *mibget, p80211msgd_t *msg, char *value); static int wlancfg_getreq(char *cat, char *name, int argcnt, UINT32 *msgcode, p80211meta_t **arglist); /***************************************************************** ** ** main ** ** "wlancfg" main entry point. ** ** Arguments: argc - Number of command line arguments. ** argv - Array of argument strings. ** ** Returns: 0 - Success. ** 1 - Failure. */ int main(int argc, char **argv) { int result, all; if (argc < 2) goto usage; if (strcmp(argv[1], "query") == 0) { if (argc != 3) goto usage; result = wlancfg_query(argv[2]); goto done; } if (strcmp(argv[1], "show") == 0) { all = 0; if (argc != 3) { if (argc != 4) goto usage; if (strcmp(argv[3], "all") != 0) goto usage; all = 1; } result = wlancfg_show(argv[2], all); goto done; } if (strcmp(argv[1], "set") == 0) { if (argc != 3) goto usage; result = wlancfg_set(argv[2]); goto done; } if (strcmp(argv[1], "list") == 0) { if (argc != 2) goto usage; wlancfg_list(); result = 0; goto done; } if (strcmp(argv[1], "version") == 0) { if (argc != 2) goto usage; printf("%s\n", WLAN_RELEASE); result = 0; goto done; } usage: wlancfg_usage(); result = 0; done: return(result); } /***************************************************************** ** ** wlancfg_usage ** ** Output the command syntax. */ static void wlancfg_usage(void) { printf("\nQuery, show, or set configuration settings.\n\n"); printf("Usage: wlancfg query dev\n"); printf(" wlancfg show dev [all]\n"); printf(" wlancfg set dev\n"); printf(" wlancfg list\n"); printf(" wlancfg version\n\n"); printf(" where: dev - Name of device (e.g. wlan0).\n"); return; } /***************************************************************** ** ** wlancfg_query ** ** Query specific MIB's and output their values. ** ** Returns: 0 - Success. ** 1 - Failure. */ static int wlancfg_query( char *device) /* I: Device name. */ { int result; req_spec_t mibget; p80211ioctl_req_t req; UINT8 msg[MSG_BUFF_LEN]; int skt, cnt; char name[100], value[MSG_BUFF_LEN]; UINT32 did; p80211meta_t *item; /* ** All MIB values will be queried using the "dot11req_mibget" request. ** Do some initialization for this request. */ result = wlancfg_reqspec("dot11req_mibget", &mibget); if (result != 0) return(1); /* ** Get a socket to be used to talk to the device driver and then ** set up the invariant parts of the "ioctl" request. The variable ** parts (i.e. length and result code) will be set later when the ** actual requests are created. */ skt = socket(AF_INET, SOCK_STREAM, 0); if (skt == -1) { perror("wlancfg"); return(1); } strncpy(req.name, device, sizeof(req.name)); req.magic = P80211_IOCTL_MAGIC; /* Set the magic. */ req.data = msg; /* ** Read MIB names from "stdin" until there are no more. Make sure ** that the user hasn't had an "accident" and entered a name which ** is too long. ** ** Note: The "scanf()" documentation is not clear on how strings ** which are too long are handled. Possibilities are: ** ** 1. "n" characters read and no null-termination added. ** 2. "n" characters read and '\0' added at "name[n]". ** 3. "n-1" characters read and '\0' added at "name[n-1]". ** ** The following code will work in all 3 cases and not overflow ** the "name" array. */ name[sizeof(name)-2] = '\0'; name[sizeof(name)-1] = '\0'; while (1) { cnt = scanf("%99s", name); /* sizeof(name)-1 = 99 */ if (cnt == 0 || cnt == EOF) break; if (name[sizeof(name)-2] != '\0' || name[sizeof(name)-1] != '\0') { fprintf(stderr, "wlancfg: MIB name is too long.\n"); return(1); } /* ** Find the MIB. */ did = p80211_text2did(mib_catlist, NULL, NULL, name); if (did == P80211DID_INVALID) { fprintf(stderr, "wlancfg: Unknown MIB: %s\n", name); return(1); } item = p80211_did2item(mib_catlist, did); if (item == NULL) /* Should never happen. */ { fprintf(stderr, "wlancfg: Internal MIB search error: %s\n", name); return(1); } /* ** Query the MIB value and output it. If no value was found ** (i.e. the MIB is unsupported), then output an empty line so ** that the input names and output values don't get out of sync. ** Otherwise, output the actual value...which follows the "=". ** The "=" will always exist so we don't need to deal with the ** case where it is not found. */ result = wlancfg_getvalue(device, item, &mibget, skt, &req, value); if (result != 0) return(1); if (value[0] == '\0') printf("\n"); else printf("%s\n", strchr(value, '=')+1); } return(0); } /***************************************************************** ** ** wlancfg_show ** ** Query all the current writeable MIB's and output them. If the "all" ** flag is set, then all MIB's (including read-only MIB's) are output. ** ** Returns: 0 - Success. ** 1 - Failure. */ static int wlancfg_show( char *device, /* I: Device name. */ int all) /* I: "all" flag. */ { int result; req_spec_t mibget; p80211ioctl_req_t req; UINT8 msg[MSG_BUFF_LEN]; int skt, i, j, k, ncats, ngrps, nitems, out; UINT32 did; grplistitem_t *grp; p80211meta_t *item; char value[MSG_BUFF_LEN]; /* ** All MIB values will be queried using the "dot11req_mibget" request. ** Do some initialization for this request. */ result = wlancfg_reqspec("dot11req_mibget", &mibget); if (result != 0) return(1); /* ** Get a socket to be used to talk to the device driver and then ** set up the invariant parts of the "ioctl" request. The variable ** parts (i.e. length and result code) will be set later when the ** actual requests are created. */ skt = socket(AF_INET, SOCK_STREAM, 0); if (skt == -1) { perror("wlancfg"); return(1); } strncpy(req.name, device, sizeof(req.name)); req.magic = P80211_IOCTL_MAGIC; /* Set the magic. */ req.data = msg; /* ** Scan through all the MIB's in all the groups in all the catagories. ** Output the MIB if it is writeable or if all MIB's are being output. ** However, DON'T output the MIB if it is not readable! */ ncats = GETMETASIZE(mib_catlist); for (i = 1; i < ncats; i++) { ngrps = GETMETASIZE(mib_catlist[i].grplist); for (j = 1; j < ngrps; j++) { did = P80211DID_MKSECTION(i) | P80211DID_MKGROUP(j); grp = p80211_did2grp(mib_catlist, did); if (grp == NULL) /* Should never happen. */ { fprintf(stderr, "wlancfg: DID %lx not found.\n", did); return(1); } item = grp->itemlist; nitems = GETMETASIZE(item); for (item++, k = 1; k < nitems; k++, item++) { out = all || ((item->did & P80211DID_ACCESS_WRITE) != 0); out = out && ((item->did & P80211DID_ACCESS_READ) != 0); if (out) { result = wlancfg_getvalue(device, item, &mibget, skt, &req, value); if (result != 0) return(1); /* ** Output the value only if a value was found (i.e. skip ** unsupported MIB's). */ if (value[0] != '\0') printf("%s\n", value); } } } } return(0); } /***************************************************************** ** ** wlancfg_set ** ** Set the wlan parameters. ** ** Returns: 0 - Success. ** 1 - Failure. */ static int wlancfg_set( char *device) /* I: Device name. */ { int result; req_spec_t mibset; p80211ioctl_req_t req; UINT8 msg[MSG_BUFF_LEN]; int skt; char pair[500], *ch; /* ** All MIB values will be set using the "dot11req_mibset" request. ** Do some initialization for this request. */ result = wlancfg_reqspec("dot11req_mibset", &mibset); if (result != 0) return(1); /* ** Get a socket to be used to talk to the device driver and then ** set up the invariant parts of the "ioctl" request. The variable ** parts (i.e. length and result code) will be set later when the ** actual requests are created. */ skt = socket(AF_INET, SOCK_STREAM, 0); if (skt == -1) { perror("wlancfg"); return(1); } strncpy(req.name, device, sizeof(req.name)); req.magic = P80211_IOCTL_MAGIC; /* Set the magic. */ req.data = msg; /* ** Read MIB name/value pairs from "stdin" until there are no more. ** There should be one pair per line. The following things can happen ** with "fgets()": ** ** 1. Nothing is read (i.e. end of file). We are done. ** 2. The last character read is a '\n'. Strip the carriage return ** off and process the line. ** 3. No '\n' was read but the buffer was not filled. The last ** line in the file has been read. Process it. The next read ** should result in an end-of-file. ** 4. No '\n' was read and the buffer was filled. The line is ** too long. Abort things. */ while (1) { if (fgets(pair, sizeof(pair), stdin) == NULL) break; ch = strrchr(pair, '\n'); if (ch != NULL) *ch = '\0'; else if (strlen(pair) >= sizeof(pair)-1) { fprintf(stderr, "wlancfg: MIB name/value is too long.\n"); return(1); } /* ** Set the MIB value. */ result = wlancfg_setvalue(device, &mibset, skt, &req, pair); if (result != 0) return(1); } return(0); } /***************************************************************** ** ** wlancfg_list ** ** List all supported MIB's. */ static void wlancfg_list(void) { int i, j, k, l; int ncat, ngrp, nitm; int len, cnt, type; catlistitem_t *cat; grplistitem_t *grp; p80211meta_t *mib; p80211enum_t *enump; /* ** Go through every MIB in every group in every catagory and find the ** maximum MIB name length. */ len = 0; ncat = GETMETASIZE(mib_catlist); cat = mib_catlist + 1; for (i = 1; i < ncat; i++, cat++) { ngrp = GETMETASIZE(cat->grplist); grp = (cat->grplist) + 1; for (j = 1; j < ngrp; j++, grp++) { nitm = GETMETASIZE(grp->itemlist); mib = grp->itemlist + 1; for (k = 1; k < nitm; k++, mib++) { l = strlen(mib->name); if (len < l) len = l; } } } /* ** Go through each MIB catagory. */ ncat = GETMETASIZE(mib_catlist); cat = mib_catlist + 1; for (i = 1; i < ncat; i++, cat++) { cnt = printf("\nCatagory: %s\n", cat->name); for (j = 2; j < cnt; j++) printf("="); printf("\n"); /* ** Go through each MIB in this group. */ ngrp = GETMETASIZE(cat->grplist); grp = (cat->grplist) + 1; for (j = 1; j < ngrp; j++, grp++) { printf("\n%s\n", grp->name); nitm = GETMETASIZE(grp->itemlist); mib = grp->itemlist + 1; for (k = 1; k < nitm; k++, mib++) { cnt = printf(" %s", mib->name); for (l = cnt-6; l < len; l++) printf(" "); printf((mib->did & P80211DID_ACCESS_READ) ? "R" : " "); printf((mib->did & P80211DID_ACCESS_WRITE) ? "W " : " "); type = p80211item_gettype(mib); if (type == P80211_TYPE_OCTETSTR) printf("OCTETSTR{minlen=%ld,maxlen=%ld}\n", mib->minlen, mib->maxlen); else if (type == P80211_TYPE_DISPLAYSTR) printf("DISPLAYSTR{minlen=%ld,maxlen=%ld}\n", mib->minlen, mib->maxlen); else if (type == P80211_TYPE_INT) { if (mib->min || mib->max) printf("INT{min=%ld,max=%ld}\n", mib->min, mib->max); else printf("INT\n"); } else if (type == P80211_TYPE_ENUMINT) { printf("ENUMINT{"); enump = mib->enumptr; for (l = 0; l < enump->nitems; l++) { printf("%s", enump->list[l].name); if (l < enump->nitems - 1) printf("|"); } printf("}\n"); } else if (type == P80211_TYPE_UNKDATA) printf("UNKDATA{maxlen=%ld}\n", mib->maxlen); else if (type == P80211_TYPE_INTARRAY) printf("INTARRAY{len=%ld}\n", mib->maxlen); else if (type == P80211_TYPE_BITARRAY) printf("BITARRAY{range=%ld-%ld}\n", mib->min, mib->max); else if (type == P80211_TYPE_MACARRAY) printf("MACARRAY{maxlen=%ld}\n", mib->maxlen); else printf("Unknown type!\n"); } } } return; } /***************************************************************** ** ** wlancfg_reqspec ** ** Build the "request specification" structure for the "dot11req_mibget" ** or "dot11req_mibset" request. As well, verify that the request is as we ** expect it. Note that this verification shouldn't be necessary at all ** if we are sure that there is no bug in the request definition! ** ** Returns: 0 - Success. ** 1 - Failure. */ static int wlancfg_reqspec( char *request, /* I: "dot11req_mibget" or "dot11req_mibset". */ req_spec_t *spec) /* O: Request specification. */ { int result; p80211meta_t *arglist; /* ** Find the request message code. */ result = wlancfg_getreq("dot11req", request, 2, &spec->msgcode, &arglist); if (result != 0) return(1); /* ** Make sure that the first argument is "mibattribute". If so, then ** fill in the specification for the "mibattribute" argument. Make ** sure that the offset and length values are valid. Also, make sure ** that the "mibattribute" argument is flagged as "request" and that ** there are conversion functions defined for it. */ if (strcmp(arglist[1].name, "mibattribute") != 0) { fprintf(stderr, "wlancfg: First argument is not MIBATTRIBUTE.\n"); return(1); } spec->attptr = &arglist[1]; spec->attdid = spec->msgcode | P80211DID_MKITEM(1) | arglist[1].did; spec->attoff = p80211item_getoffset(msg_catlist, spec->attdid); spec->attlen = p80211item_maxdatalen(msg_catlist, spec->attdid); if (spec->attoff == 0xffffffff || spec->attlen == 0xffffffffUL) { fprintf(stderr, "wlancfg: Invalid MIBATTRIBUTE offset or length.\n"); return(1); } if (!P80211ITEM_ISREQUEST(arglist[1].flags)) { fprintf(stderr, "wlancfg: MIBATTRIBUTE argument is non-request.\n"); return(1); } if (arglist[1].fromtextptr == NULL || arglist[1].totextptr == NULL) { fprintf(stderr, "wlancfg: Missing MIBATTRIBUTE conversion function.\n"); return(1); } /* ** Make sure that the second argument is "resultcode". If so, then ** fill in the specification for the "resultcode" argument. Make ** sure that the offset and length values are valid. Also, make sure ** that it is not a required argument. */ if (strcmp(arglist[2].name, "resultcode") != 0) { fprintf(stderr, "wlancfg: Second argument is not RESULTCODE.\n"); return(1); } spec->resptr = &arglist[2]; spec->resdid = spec->msgcode | P80211DID_MKITEM(2) | arglist[2].did; spec->resoff = p80211item_getoffset(msg_catlist, spec->resdid); spec->reslen = p80211item_maxdatalen(msg_catlist, spec->resdid); if (spec->resoff == 0xffffffff || spec->reslen == 0xffffffffUL) { fprintf(stderr, "wlancfg: Invalid RESULTCODE offset or length.\n"); return(1); } if ((P80211ITEM_ISREQUIRED(arglist[2].flags)) && (P80211ITEM_ISREQUEST(arglist[2].flags))) { fprintf(stderr, "wlancfg: RESULTCODE argument is required.\n"); return(1); } /* ** Set the message length. This should correspond to the "resultcode" ** argument. However, make the check general just in case the arguments ** were not defined as expected. */ spec->msglen = sizeof(p80211msg_t) + sizeof(p80211item_t); if (spec->resoff > spec->attoff) spec->msglen += spec->resoff + spec->reslen; else spec->msglen += spec->attoff + spec->attlen; return(0); } /***************************************************************** ** ** wlancfg_getvalue ** ** Get the value of the specified MIB. The value is returned as ** a name/value pair in the following syntax: ** ** name=value ** ** If the MIB is unsupported, then a 0-length string is returned. ** ** Returns: 0 - Success. ** 1 - Failure. */ static int wlancfg_getvalue( char *device, /* I: Device name. */ p80211meta_t *item, /* I: Pointer to MIB item. */ req_spec_t *mibget, /* I: "dot11req_mibget" request spec. */ int skt, /* I: ioctl() socket. */ p80211ioctl_req_t *req, /* I: ioctl() request structure. */ char *value) /* O: MIB value. */ { int result; p80211msgd_t *msg; /* ** Build the "dot11req_mibget" message. */ msg = (p80211msgd_t *) (req->data); result = wlancfg_build(device, mibget, item->name, msg); if (result != 0) return(1); /* ** Set up the ioctl request. */ req->len = msg->msglen; req->result = 0; result = ioctl(skt, P80211_IFREQ, req); if (result == -1) { perror("wlancfg"); return(1); } /* ** Convert the MIB value to a string. */ wlancfg_totext(item, mibget, msg, value); return(0); } /***************************************************************** ** ** wlancfg_setvalue ** ** Set the value of the specified MIB. The MIB must be specified as ** a name/value pair in the following syntax: ** ** name=value ** ** Returns: 0 - Success. ** 1 - Failure. */ static int wlancfg_setvalue( char *device, /* I: Device name. */ req_spec_t *mibset, /* I: "dot11req_mibset" request spec. */ int skt, /* I: ioctl() socket. */ p80211ioctl_req_t *req, /* I: ioctl() request structure. */ char *value) /* I: MIB name/value. */ { int result; p80211msgd_t *msg; p80211itemd_t *itmhdr; UINT8 tmpitem[MSG_BUFF_LEN]; UINT32 resultcode; /* ** Build the "dot11req_mibset" message. */ msg = (p80211msgd_t *) (req->data); result = wlancfg_build(device, mibset, value, msg); if (result != 0) return(1); /* ** Set up the ioctl request. */ req->len = msg->msglen; req->result = 0; result = ioctl(skt, P80211_IFREQ, req); if (result == -1) { perror("wlancfg"); return(1); } /* ** Get the result code and make sure that it has a value. */ itmhdr = (p80211itemd_t *) (msg->args + mibset->resoff); if (itmhdr->status != P80211ENUM_msgitem_status_data_ok) { p80211_error2text(itmhdr->status, tmpitem); fprintf(stderr, "wlancfg: %s resultcode=%s\n", value, tmpitem); return(1); } /* ** Make sure that the request worked. */ resultcode = *((UINT32 *) (itmhdr->data)); if (resultcode != P80211ENUM_resultcode_success) { p80211_error2text(resultcode, tmpitem); fprintf(stderr, "wlancfg: %s=%s\n", value, tmpitem); return(1); } return(0); } /***************************************************************** ** ** wlancfg_build ** ** Build the request message buffer for either "dot11req_mibget" ** or "dot11req_mibset". For "dot11req_mibget", "value" should be the ** name of the MIB. For "dot11req_mibset", "value" should be the ** MIB name/value pair (i.e. name=value). ** ** Returns: 0 - Success. ** 1 - Failure. */ static int wlancfg_build( char *device, /* I: Device name. */ req_spec_t *spec, /* I: Request specification. */ char *value, /* I: "mibattribute" argument value. */ p80211msgd_t *msg) /* O: Message buffer. */ { p80211meta_t *arg; char tmpstr[MSG_BUFF_LEN]; p80211itemd_t *itmhdr; /* ** Initialize the message buffer. */ msg->msgcode = spec->msgcode; msg->msglen = spec->msglen; strncpy(msg->devname, device, WLAN_DEVNAMELEN_MAX - 1); /* ** Add the "mibattribute" argument to the request buffer. Note that ** the "fromtextptr" conversion function looks for an "=" so we will ** need to create a value string that will keep it happy. Actually, ** what is expected is "mibattribute=....." but only the "=" is ** necessary. */ arg = spec->attptr; itmhdr = (p80211itemd_t *) (msg->args + spec->attoff); tmpstr[0] = '='; strcpy(tmpstr+1, value); memset(itmhdr, 0, sizeof(p80211item_t) + spec->attlen); (*(arg->fromtextptr))(msg_catlist, spec->attdid, (UINT8 *) itmhdr, tmpstr); if (itmhdr->status != (UINT16) P80211ENUM_msgitem_status_data_ok) { p80211_error2text(itmhdr->status, tmpstr); fprintf(stderr, "wlancfg: %s=%s\n", value, tmpstr); return(1); } /* ** Set the "resultcode" argument to "no value". */ itmhdr = (p80211itemd_t *) (msg->args + spec->resoff); itmhdr->did = spec->resdid; itmhdr->status = (UINT16) P80211ENUM_msgitem_status_no_value; itmhdr->len = (UINT16) (spec->reslen); memset(itmhdr->data, 0, spec->reslen); return(0); } /***************************************************************** ** ** wlancfg_totext ** ** Convert the MIB to a string. The value is returned as a name/value ** pair in the following syntax: ** ** name=value ** ** If the MIB cannot be converted for any reason, then a 0-length string is ** returned. */ static void wlancfg_totext( p80211meta_t *item, /* I: Pointer to MIB item. */ req_spec_t *mibget, /* I: "dot11req_mibget" request specification. */ p80211msgd_t *msg, /* I: Message buffer. */ char *value) /* O: Value string. */ { p80211itemd_t *itmhdr; UINT8 tmpitem[MSG_BUFF_LEN]; UINT32 resultcode; p80211meta_t *arg; char *eq; /* ** Initialize the string to a 0-length string just in case there ** is an error. */ value[0] = '\0'; /* ** Get the result code and make sure that it has a value. */ itmhdr = (p80211itemd_t *) (msg->args + mibget->resoff); if (itmhdr->status != P80211ENUM_msgitem_status_data_ok) { p80211_error2text(itmhdr->status, tmpitem); fprintf(stderr, "wlancfg: %s resultcode=%s\n", item->name, tmpitem); return; } /* ** If the result code is "not supported", then return the empty string ** with no error. Otherwise, there is an error. */ resultcode = *((UINT32 *) (itmhdr->data)); if (resultcode != P80211ENUM_resultcode_success) { if (resultcode != P80211ENUM_resultcode_not_supported) { p80211_error2text(resultcode, tmpitem); fprintf(stderr, "wlancfg: %s=%s\n", item->name, tmpitem); } return; } /* ** Get the MIB value and make sure that it has a value. */ arg = mibget->attptr; itmhdr = (p80211itemd_t *) (msg->args + mibget->attoff); if (itmhdr->status != P80211ENUM_msgitem_status_data_ok) { p80211_error2text(itmhdr->status, tmpitem); fprintf(stderr, "wlancfg: %s mibattribute=%s\n", item->name, tmpitem); return; } /* ** Convert the MIB to a string. This will have the form: ** ** mibattribute=name=value ** ** Extract everthing after the first '='. Something went wrong if ** there is no "="...just return the empty string. Also, in some ** cases where the value does not exist, "totextptr" appears to ** neglect to add the "=" after the MIB name. If this happens, then ** add the "=" ourselves. */ (*(arg->totextptr))(msg_catlist, mibget->attdid, (UINT8 *) itmhdr, tmpitem); eq = strchr(tmpitem, '='); if (eq != NULL) { strcpy(value, eq+1); if (strchr(value, '=') == NULL) strcat(value, "="); } return; } /***************************************************************** ** ** wlancfg_getreq ** ** Find a request and verify its arguments. ** ** Returns: 0 - Success. ** 1 - Failure. */ static int wlancfg_getreq( char *cat, /* I: Request catagory. */ char *name, /* I: Request name. */ int argcnt, /* I: Expected number of arguments. */ UINT32 *msgcode, /* O: Message code for request. */ p80211meta_t **arglist) /* O: Pointer to argument list. */ { grplistitem_t *grp; /* ** Find the request message code. */ *msgcode = p80211_text2did(msg_catlist, cat, name, NULL); if (*msgcode == P80211DID_INVALID) { fprintf(stderr, "wlancfg: Could not find \"%s\" request.\n", name); return(1); } /* ** Find find the argument metadata list for the request. */ grp = p80211_did2grp(msg_catlist, *msgcode); if (grp == NULL) { fprintf(stderr, "wlancfg: Could not find \"%s\" arguments.\n", name); return(1); } *arglist = grp->itemlist; /* ** Make sure that the number of arguments is correct. Note that the list ** size is 1 more than the argument count! */ if (GETMETASIZE(*arglist) != argcnt+1) { fprintf(stderr, "wlancfg: \"%s\" argument count is wrong.\n", name); return(1); } return(0); } linux-wlan-ng-0.2.9+dfsg/src/Makefile0000644000175000017500000000465511024763201016770 0ustar tormodtormod# src/Makefile # # Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. # -------------------------------------------------------------------- # # linux-wlan # # 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. # # 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. # # -------------------------------------------------------------------- # # Inquiries regarding the linux-wlan Open Source project can be # made directly to: # # AbsoluteValue Systems Inc. # info@linux-wlan.com # http://www.linux-wlan.com # # -------------------------------------------------------------------- # # Portions of the development of this software were funded by # Intersil Corporation as part of PRISM(R) chipset product development. # # -------------------------------------------------------------------- -include ../config.mk DIRS=mkmeta shared wlanctl nwepgen wlancfg p80211 prism2 ifneq ($(wildcard *.addon),) DIRS+=`cat *.addon` ALL_DIRS+=`cat *.addon` endif all: set -e; for d in $(DIRS); do $(MAKE) WLAN_SRC=$(WLAN_SRC) -C $$d ; done clean: set -e; for d in $(DIRS); do $(MAKE) WLAN_SRC=$(WLAN_SRC) -C $$d clean ; done rm -f core core.* *.o .*.o *.s *.a .depend tmp_make *~ tags set -e; for i in *_obj; do if [ -d $$i ]; then rm -fr $$i; fi; done rm -rf .tmp_versions install: set -e; for d in $(DIRS); do $(MAKE) WLAN_SRC=$(WLAN_SRC) -C $$d install ; done ifdef INSTALL_DEPMOD /sbin/depmod -a endif ctags: ctags -R linux-wlan-ng-0.2.9+dfsg/src/shared/0000755000175000017500000000000011026545443016574 5ustar tormodtormodlinux-wlan-ng-0.2.9+dfsg/src/shared/p80211metamsg.c0000644000175000017500000042044511024763162021160 0ustar tormodtormod/* src/shared/p80211metamsg.c * * Defines the metadata 802.11 message items * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- * * This file defines the metadata for message contents and argument * metadata. * * -------------------------------------------------------------------- */ /*================================================================*/ /* System Includes */ #include #include /*================================================================*/ /* Project Includes */ #include #include #include #include #include /*================================================================*/ /* Local Constants */ /*================================================================*/ /* Local Macros */ /*================================================================*/ /* Local Types */ /*================================================================*/ /* Local Static Definitions */ /*====================================================================*/ /* Message Argument Metadata */ /*====================================================================*/ /*--------------------------------------------------------------------*/ /* metadata for the mibget request message arguments */ extern UINT32 MKREQMETASIZE(dot11req_mibget); p80211meta_t MKREQMETANAME(dot11req_mibget)[] = { { /* name */ (char *)&(MKREQMETASIZE(dot11req_mibget)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("mibattribute"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ MAXLEN_MIBATTRIBUTE, /* minlen */ MAXLEN_MIBATTRIBUTE, /* enumptr */ NULL, /* totextptr */ p80211_totext_getmibattribute, /* fromtextptr */ p80211_fromtext_getmibattribute, /* validfunptr */ p80211_isvalid_getmibattribute }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of mibget request message metadata list */ UINT32 MKREQMETASIZE(dot11req_mibget) = sizeof(MKREQMETANAME(dot11req_mibget))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the dot11req_mibset request message arguments */ extern UINT32 MKREQMETASIZE(dot11req_mibset); p80211meta_t MKREQMETANAME(dot11req_mibset)[] = { { /* name */ (char *)&(MKREQMETASIZE(dot11req_mibset)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("mibattribute"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ MAXLEN_MIBATTRIBUTE, /* minlen */ MAXLEN_MIBATTRIBUTE, /* enumptr */ NULL, /* totextptr */ p80211_totext_setmibattribute, /* fromtextptr */ p80211_fromtext_setmibattribute, /* validfunptr */ p80211_isvalid_setmibattribute }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of dot11req_mibset request message metadata list */ UINT32 MKREQMETASIZE(dot11req_mibset) = sizeof(MKREQMETANAME(dot11req_mibset))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the dot11req_powermgmt request message arguments */ extern UINT32 MKREQMETASIZE(dot11req_powermgmt); p80211meta_t MKREQMETANAME(dot11req_powermgmt)[] = { { /* name */ (char *)&(MKREQMETASIZE(dot11req_powermgmt)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("powermgmtmode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(powermgmt), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("wakeup"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("receivedtims"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of dot11req_powermgmt request message metadata list */ UINT32 MKREQMETASIZE(dot11req_powermgmt) = sizeof(MKREQMETANAME(dot11req_powermgmt))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the dot11req_scan request message arguments */ extern UINT32 MKREQMETASIZE(dot11req_scan); p80211meta_t MKREQMETANAME(dot11req_scan)[] = { { /* name */ (char *)&(MKREQMETASIZE(dot11req_scan)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("bsstype"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(bsstype), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("bssid"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ MAXLEN_PSTR6, /* minlen */ MAXLEN_PSTR6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("ssid"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ MAXLEN_PSTR32, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_displaystr, /* fromtextptr */ p80211_fromtext_displaystr, /* validfunptr */ p80211_isvalid_displaystr }, { /* name */ MKITEMNAME("scantype"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(scantype), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("probedelay"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("channellist"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ MAXLEN_PSTR14, /* minlen */ 1, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("minchanneltime"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("maxchanneltime"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("numbss"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("append"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUEST, 0UL, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of dot11req_scan request message metadata list */ UINT32 MKREQMETASIZE(dot11req_scan) = sizeof(MKREQMETANAME(dot11req_scan))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the dot11req_scan_results request message arguments */ extern UINT32 MKREQMETASIZE(dot11req_scan_results); p80211meta_t MKREQMETANAME(dot11req_scan_results)[] = { { /* name */ (char *)&(MKREQMETASIZE(dot11req_scan_results)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("bssindex"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("signal"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("noise"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("bssid"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ MAXLEN_PSTR6, /* minlen */ MAXLEN_PSTR6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("ssid"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ MAXLEN_PSTR32, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_displaystr, /* fromtextptr */ p80211_fromtext_displaystr, /* validfunptr */ p80211_isvalid_displaystr }, { /* name */ MKITEMNAME("bsstype"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(bsstype), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("beaconperiod"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dtimperiod"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 1, /* max */ 255, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("timestamp"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("localtime"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("fhdwelltime"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 1, /* max */ 65535, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("fhhopset"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 1, /* max */ 255, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("fhhoppattern"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 255, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("fhhopindex"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 1, /* max */ 255, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dschannel"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 1, /* max */ 14, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("cfpcount"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("cfpperiod"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 255, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("cfpmaxduration"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 65535, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("cfpdurremaining"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("ibssatimwindow"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("cfpollable"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("cfpollreq"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("privacy"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("basicrate1"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("basicrate2"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("basicrate3"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("basicrate4"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("basicrate5"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("basicrate6"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("basicrate7"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("basicrate8"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("supprate1"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("supprate2"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("supprate3"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("supprate4"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("supprate5"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("supprate6"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("supprate7"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("supprate8"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, }; /* end of dot11req_scan_results metadata list */ UINT32 MKREQMETASIZE(dot11req_scan_results) = sizeof(MKREQMETANAME(dot11req_scan_results))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the dot11req_join request message arguments */ extern UINT32 MKREQMETASIZE(dot11req_join); p80211meta_t MKREQMETANAME(dot11req_join)[] = { { /* name */ (char *)&(MKREQMETASIZE(dot11req_join)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("bssid"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ MAXLEN_PSTR6, /* minlen */ MAXLEN_PSTR6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("joinfailuretimeout"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 1, /* max */ UINT32_MAX, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("basicrate1"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("basicrate2"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("basicrate3"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("basicrate4"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("basicrate5"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("basicrate6"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("basicrate7"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("basicrate8"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("operationalrate1"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("operationalrate2"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("operationalrate3"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("operationalrate4"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("operationalrate5"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("operationalrate6"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("operationalrate7"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("operationalrate8"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of dot11req_join request message metadata list */ UINT32 MKREQMETASIZE(dot11req_join) = sizeof(MKREQMETANAME(dot11req_join))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the dot11req_authenticate request message arguments */ extern UINT32 MKREQMETASIZE(dot11req_authenticate); p80211meta_t MKREQMETANAME(dot11req_authenticate)[] = { { /* name */ (char *)&(MKREQMETASIZE(dot11req_authenticate)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("peerstaaddress"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ MAXLEN_PSTR6, /* minlen */ MAXLEN_PSTR6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("authenticationtype"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(authalg), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("authenticationfailuretimeout"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 1, /* max */ UINT32_MAX, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of dot11req_authenticate request message metadata list */ UINT32 MKREQMETASIZE(dot11req_authenticate) = sizeof(MKREQMETANAME(dot11req_authenticate))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the dot11req_deauthenticate request message arguments */ extern UINT32 MKREQMETASIZE(dot11req_deauthenticate); p80211meta_t MKREQMETANAME(dot11req_deauthenticate)[] = { { /* name */ (char *)&(MKREQMETASIZE(dot11req_deauthenticate)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("peerstaaddress"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ MAXLEN_PSTR6, /* minlen */ MAXLEN_PSTR6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("reasoncode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(reason), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of dot11req_deauthenticate request message metadata list */ UINT32 MKREQMETASIZE(dot11req_deauthenticate) = sizeof(MKREQMETANAME(dot11req_deauthenticate))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the dot11req_associate request message arguments */ extern UINT32 MKREQMETASIZE(dot11req_associate); p80211meta_t MKREQMETANAME(dot11req_associate)[] = { { /* name */ (char *)&(MKREQMETASIZE(dot11req_associate)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("peerstaaddress"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ MAXLEN_PSTR6, /* minlen */ MAXLEN_PSTR6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("associatefailuretimeout"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 1, /* max */ UINT32_MAX, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("cfpollable"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("cfpollreq"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("privacy"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("listeninterval"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of dot11req_associate request message metadata list */ UINT32 MKREQMETASIZE(dot11req_associate) = sizeof(MKREQMETANAME(dot11req_associate))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the dot11req_reassociate request message arguments */ extern UINT32 MKREQMETASIZE(dot11req_reassociate); p80211meta_t MKREQMETANAME(dot11req_reassociate)[] = { { /* name */ (char *)&(MKREQMETASIZE(dot11req_reassociate)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("newapaddress"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ MAXLEN_PSTR6, /* minlen */ MAXLEN_PSTR6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("reassociatefailuretimeout"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 1, /* max */ UINT32_MAX, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("cfpollable"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("cfpollreq"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("privacy"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("listeninterval"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of dot11req_reassociate request message metadata list */ UINT32 MKREQMETASIZE(dot11req_reassociate) = sizeof(MKREQMETANAME(dot11req_reassociate))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the dot11req_disassociate request message arguments */ extern UINT32 MKREQMETASIZE(dot11req_disassociate); p80211meta_t MKREQMETANAME(dot11req_disassociate)[] = { { /* name */ (char *)&(MKREQMETASIZE(dot11req_disassociate)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("peerstaaddress"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ MAXLEN_PSTR6, /* minlen */ MAXLEN_PSTR6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("reasoncode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(reason), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of dot11req_disassociate request message metadata list */ UINT32 MKREQMETASIZE(dot11req_disassociate) = sizeof(MKREQMETANAME(dot11req_disassociate))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the dot11req_reset request message arguments */ extern UINT32 MKREQMETASIZE(dot11req_reset); p80211meta_t MKREQMETANAME(dot11req_reset)[] = { { /* name */ (char *)&(MKREQMETASIZE(dot11req_reset)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("setdefaultmib"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("macaddress"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ MAXLEN_PSTR6, /* minlen */ MAXLEN_PSTR6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of dot11req_reset request message metadata list */ UINT32 MKREQMETASIZE(dot11req_reset) = sizeof(MKREQMETANAME(dot11req_reset))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the dot11req_start request message arguments */ extern UINT32 MKREQMETASIZE(dot11req_start); p80211meta_t MKREQMETANAME(dot11req_start)[] = { { /* name */ (char *)&(MKREQMETASIZE(dot11req_start)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("ssid"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ MAXLEN_PSTR32, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_displaystr, /* fromtextptr */ p80211_fromtext_displaystr, /* validfunptr */ p80211_isvalid_displaystr }, { /* name */ MKITEMNAME("bsstype"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(bsstype), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("beaconperiod"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 1, /* max */ 65535, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dtimperiod"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 1, /* max */ 255, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("cfpperiod"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 0, /* max */ 255, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("cfpmaxduration"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 0, /* max */ 65535, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("fhdwelltime"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 1, /* max */ 65535, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("fhhopset"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 1, /* max */ 255, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("fhhoppattern"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 0, /* max */ 255, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dschannel"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 1, /* max */ 14, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("ibssatimwindow"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("probedelay"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("cfpollable"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("cfpollreq"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("basicrate1"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("basicrate2"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("basicrate3"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("basicrate4"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("basicrate5"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("basicrate6"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("basicrate7"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("basicrate8"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("operationalrate1"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("operationalrate2"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("operationalrate3"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("operationalrate4"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("operationalrate5"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("operationalrate6"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("operationalrate7"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("operationalrate8"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of dot11req_start request message metadata list */ UINT32 MKREQMETASIZE(dot11req_start) = sizeof(MKREQMETANAME(dot11req_start))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the dot11ind_authenticate indication message arguments */ extern UINT32 MKINDMETASIZE(dot11ind_authenticate); p80211meta_t MKINDMETANAME(dot11ind_authenticate)[] = { { /* name */ (char *)&(MKINDMETASIZE(dot11ind_authenticate)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("peerstaaddress"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ MAXLEN_PSTR6, /* minlen */ MAXLEN_PSTR6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("authenticationtype"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(authalg), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of dot11ind_authenticate indication metadata list */ UINT32 MKINDMETASIZE(dot11ind_authenticate) = sizeof(MKINDMETANAME(dot11ind_authenticate))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the authenticate indication message arguments */ extern UINT32 MKINDMETASIZE(dot11ind_deauthenticate); p80211meta_t MKINDMETANAME(dot11ind_deauthenticate)[] = { { /* name */ (char *)&(MKINDMETASIZE(dot11ind_deauthenticate)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("peerstaaddress"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ MAXLEN_PSTR6, /* minlen */ MAXLEN_PSTR6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("reasoncode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(reason), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of dot11ind_deauthenticate indication metadata list */ UINT32 MKINDMETASIZE(dot11ind_deauthenticate) = sizeof(MKINDMETANAME(dot11ind_deauthenticate))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the dot11ind_associate indication message arguments */ extern UINT32 MKINDMETASIZE(dot11ind_associate); p80211meta_t MKINDMETANAME(dot11ind_associate)[] = { { /* name */ (char *)&(MKINDMETASIZE(dot11ind_associate)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("peerstaaddress"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ MAXLEN_PSTR6, /* minlen */ MAXLEN_PSTR6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("aid"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 2003, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, }; /* end of dot11ind_associate indication metadata list */ UINT32 MKINDMETASIZE(dot11ind_associate) = sizeof(MKINDMETANAME(dot11ind_associate))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the reassociate indication message arguments */ extern UINT32 MKINDMETASIZE(dot11ind_reassociate); p80211meta_t MKINDMETANAME(dot11ind_reassociate)[] = { { /* name */ (char *)&(MKINDMETASIZE(dot11ind_reassociate)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("peerstaaddress"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ MAXLEN_PSTR6, /* minlen */ MAXLEN_PSTR6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("aid"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 2003, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("oldapaddress"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ MAXLEN_PSTR6, /* minlen */ MAXLEN_PSTR6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ }, }; /* end of dot11ind_reassociate indication metadata list */ UINT32 MKINDMETASIZE(dot11ind_reassociate) = sizeof(MKINDMETANAME(dot11ind_reassociate))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the dot11ind_disassociate indication message arguments */ extern UINT32 MKINDMETASIZE(dot11ind_disassociate); p80211meta_t MKINDMETANAME(dot11ind_disassociate)[] = { { /* name */ (char *)&(MKINDMETASIZE(dot11ind_disassociate)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("peerstaaddress"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ MAXLEN_PSTR6, /* minlen */ MAXLEN_PSTR6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("reasoncode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(reason), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of dot11ind_disassociate indication metadata list */ UINT32 MKINDMETASIZE(dot11ind_disassociate) = sizeof(MKINDMETANAME(dot11ind_disassociate))/sizeof(p80211meta_t); extern UINT32 MKINDMETASIZE(lnxind_roam); p80211meta_t MKINDMETANAME(lnxind_roam)[] = { { /* name */ (char *)&(MKINDMETASIZE(lnxind_roam)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("reason"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(lnxroam_reason), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of dot11ind_associate indication metadata list */ UINT32 MKINDMETASIZE(lnxind_roam) = sizeof(MKINDMETANAME(lnxind_roam))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the ifstate request message arguments */ extern UINT32 MKREQMETASIZE(lnxreq_ifstate); p80211meta_t MKREQMETANAME(lnxreq_ifstate)[] = { { /* name */ (char *)&(MKREQMETASIZE(lnxreq_ifstate)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("ifstate"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(ifstate), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of lnxreq_ifstate request metadata list */ UINT32 MKREQMETASIZE(lnxreq_ifstate) = sizeof(MKREQMETANAME(lnxreq_ifstate))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the commsquality request message arguments */ extern UINT32 MKREQMETASIZE(lnxreq_commsquality); p80211meta_t MKREQMETANAME(lnxreq_commsquality)[] = { { /* name */ (char *)&(MKREQMETASIZE(lnxreq_commsquality)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("dbm"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("link"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("level"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("noise"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, }; /* end of lnxreq_commsquality list */ UINT32 MKREQMETASIZE(lnxreq_commsquality) = sizeof(MKREQMETANAME(lnxreq_commsquality))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the hostwep request message arguments */ extern UINT32 MKREQMETASIZE(lnxreq_hostwep); p80211meta_t MKREQMETANAME(lnxreq_hostwep)[] = { { /* name */ (char *)&(MKREQMETASIZE(lnxreq_hostwep)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("decrypt"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("encrypt"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of lnxreq_hostwep list */ UINT32 MKREQMETASIZE(lnxreq_hostwep) = sizeof(MKREQMETANAME(lnxreq_hostwep))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the wlansnif request message arguments */ extern UINT32 MKREQMETASIZE(lnxreq_wlansniff); p80211meta_t MKREQMETANAME(lnxreq_wlansniff)[] = { { /* name */ (char *)&(MKREQMETASIZE(lnxreq_wlansniff)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("enable"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("channel"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 1, /* max */ 14, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("prismheader"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("wlanheader"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("keepwepflags"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("stripfcs"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("packet_trunc"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 0, /* max */ 2000, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of lnxreq_wlansniff request metadata list */ UINT32 MKREQMETASIZE(lnxreq_wlansniff) = sizeof(MKREQMETANAME(lnxreq_wlansniff))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the autojoin request message arguments */ extern UINT32 MKREQMETASIZE(lnxreq_autojoin); p80211meta_t MKREQMETANAME(lnxreq_autojoin)[] = { { /* name */ (char *)&(MKREQMETASIZE(lnxreq_autojoin)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("ssid"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ MAXLEN_PSTR32, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_displaystr, /* fromtextptr */ p80211_fromtext_displaystr, /* validfunptr */ p80211_isvalid_displaystr }, { /* name */ MKITEMNAME("authtype"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(authalg), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of lnxreq_autojoin request metadata list */ UINT32 MKREQMETASIZE(lnxreq_autojoin) = sizeof(MKREQMETANAME(lnxreq_autojoin))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the wlansniffrm indication message arguments */ extern UINT32 MKINDMETASIZE(lnxind_wlansniffrm); p80211meta_t MKINDMETANAME(lnxind_wlansniffrm)[] = { { /* name */ (char *)&(MKINDMETASIZE(lnxind_wlansniffrm)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("hosttime"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("mactime"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, 0UL, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("channel"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, 0UL, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("rssi"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, 0UL, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("sq"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, 0UL, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("signal"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, 0UL, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("noise"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, 0UL, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("rate"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, 0UL, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("istx"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("frmlen"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int } }; /* end of lnxind_wlansniffrm indication message */ UINT32 MKINDMETASIZE(lnxind_wlansniffrm) = sizeof(MKINDMETANAME(lnxind_wlansniffrm))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the p2req_join request message arguments */ extern UINT32 MKREQMETASIZE(p2req_join); p80211meta_t MKREQMETANAME(p2req_join)[] = { { /* name */ (char *)&(MKREQMETASIZE(p2req_join)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("bssid"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ MAXLEN_PSTR6, /* minlen */ MAXLEN_PSTR6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("basicrate1"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("basicrate2"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("basicrate3"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("basicrate4"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("basicrate5"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("basicrate6"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("basicrate7"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("basicrate8"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("operationalrate1"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("operationalrate2"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("operationalrate3"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("operationalrate4"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("operationalrate5"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("operationalrate6"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("operationalrate7"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("operationalrate8"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("ssid"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ MAXLEN_PSTR32, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_displaystr, /* fromtextptr */ p80211_fromtext_displaystr, /* validfunptr */ p80211_isvalid_displaystr }, { /* name */ MKITEMNAME("channel"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 1, /* max */ 14, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("authtype"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(authalg), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of p2req_join request message metadata list */ UINT32 MKREQMETASIZE(p2req_join) = sizeof(MKREQMETANAME(p2req_join))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the p2req_readpda request message arguments */ extern UINT32 MKREQMETASIZE(p2req_readpda); p80211meta_t MKREQMETANAME(p2req_readpda)[] = { { /* name */ (char *)&(MKREQMETASIZE(p2req_readpda)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("pda"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 1024, /* minlen */ 1024, /* enumptr */ NULL, /* totextptr */ NULL, /* data only used by program...*/ /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of p2req_readpda request metadata list */ UINT32 MKREQMETASIZE(p2req_readpda) = sizeof(MKREQMETANAME(p2req_readpda))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the p2req_readcis request message arguments */ extern UINT32 MKREQMETASIZE(p2req_readcis); p80211meta_t MKREQMETANAME(p2req_readcis)[] = { { /* name */ (char *)&(MKREQMETASIZE(p2req_readcis)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("cis"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 1024, /* minlen */ 1024, /* enumptr */ NULL, /* totextptr */ NULL, /* data only used by program...*/ /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of p2req_readcis request metadata list */ UINT32 MKREQMETASIZE(p2req_readcis) = sizeof(MKREQMETANAME(p2req_readcis))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the p2req_auxport_state request message arguments */ extern UINT32 MKREQMETASIZE(p2req_auxport_state); p80211meta_t MKREQMETANAME(p2req_auxport_state)[] = { { /* name */ (char *)&(MKREQMETASIZE(p2req_auxport_state)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("enable"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of p2req_auxport_state request metadata list */ UINT32 MKREQMETASIZE(p2req_auxport_state) = sizeof(MKREQMETANAME(p2req_auxport_state))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the p2req_auxport_read request message arguments */ extern UINT32 MKREQMETASIZE(p2req_auxport_read); p80211meta_t MKREQMETANAME(p2req_auxport_read)[] = { { /* name */ (char *)&(MKREQMETASIZE(p2req_auxport_read)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("addr"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("len"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("data"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 1024, /* minlen */ 1024, /* enumptr */ NULL, /* totextptr */ NULL, /* data only handled by programs */ /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of p2req_auxport_read request metadata list */ UINT32 MKREQMETASIZE(p2req_auxport_read) = sizeof(MKREQMETANAME(p2req_auxport_read))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the p2req_auxport_write request message arguments */ extern UINT32 MKREQMETASIZE(p2req_auxport_write); p80211meta_t MKREQMETANAME(p2req_auxport_write)[] = { { /* name */ (char *)&(MKREQMETASIZE(p2req_auxport_write)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("addr"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("len"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("data"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 1024, /* minlen */ 1024, /* enumptr */ NULL, /* totextptr */ NULL, /* data only handled by programs */ /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of p2req_auxport_write request metadata list */ UINT32 MKREQMETASIZE(p2req_auxport_write) = sizeof(MKREQMETANAME(p2req_auxport_write))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the p2req_low_level request message arguments */ extern UINT32 MKREQMETASIZE(p2req_low_level); p80211meta_t MKREQMETANAME(p2req_low_level)[] = { { /* name */ (char *)&(MKREQMETASIZE(p2req_low_level)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("command"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("param0"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("param1"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("param2"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("resp0"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("resp1"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("resp2"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } /* Lets add the status and resp register values. */ }; /* end of p2req_low_level request metadata list */ UINT32 MKREQMETASIZE(p2req_low_level) = sizeof(MKREQMETANAME(p2req_low_level))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the p2req_test_command request message arguments */ extern UINT32 MKREQMETASIZE(p2req_test_command); p80211meta_t MKREQMETANAME(p2req_test_command)[] = { { /* name */ (char *)&(MKREQMETASIZE(p2req_test_command)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("testcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("testparam"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("status"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("resp0"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("resp1"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("resp2"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int } /* Lets add the status and resp register values. */ }; /* end of p2req_test_command request metadata list */ UINT32 MKREQMETASIZE(p2req_test_command) = sizeof(MKREQMETANAME(p2req_test_command))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the p2req_mmi_read request message arguments */ extern UINT32 MKREQMETASIZE(p2req_mmi_read); p80211meta_t MKREQMETANAME(p2req_mmi_read)[] = { { /* name */ (char *)&(MKREQMETASIZE(p2req_mmi_read)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("addr"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("value"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of p2req_mmi_read request metadata list */ UINT32 MKREQMETASIZE(p2req_mmi_read) = sizeof(MKREQMETANAME(p2req_mmi_read))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the p2req_mmi_write request message arguments */ extern UINT32 MKREQMETASIZE(p2req_mmi_write); p80211meta_t MKREQMETANAME(p2req_mmi_write)[] = { { /* name */ (char *)&(MKREQMETASIZE(p2req_mmi_write)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("addr"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("data"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of p2req_mmi_write request metadata list */ UINT32 MKREQMETASIZE(p2req_mmi_write) = sizeof(MKREQMETANAME(p2req_mmi_write))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the p2req_ramdl_state request message arguments */ extern UINT32 MKREQMETASIZE(p2req_ramdl_state); p80211meta_t MKREQMETANAME(p2req_ramdl_state)[] = { { /* name */ (char *)&(MKREQMETASIZE(p2req_ramdl_state)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("enable"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("exeaddr"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of p2req_ramdl_state request metadata list */ UINT32 MKREQMETASIZE(p2req_ramdl_state) = sizeof(MKREQMETANAME(p2req_ramdl_state))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the p2req_ramdl_write request message arguments */ extern UINT32 MKREQMETASIZE(p2req_ramdl_write); p80211meta_t MKREQMETANAME(p2req_ramdl_write)[] = { { /* name */ (char *)&(MKREQMETASIZE(p2req_ramdl_write)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("addr"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("len"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("data"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 4096, /* minlen */ 4096, /* enumptr */ NULL, /* totextptr */ NULL, /* data only handled by programs */ /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of p2req_ramdl_write request metadata list */ UINT32 MKREQMETASIZE(p2req_ramdl_write) = sizeof(MKREQMETANAME(p2req_ramdl_write))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the p2req_flashdl_state request message arguments */ extern UINT32 MKREQMETASIZE(p2req_flashdl_state); p80211meta_t MKREQMETANAME(p2req_flashdl_state)[] = { { /* name */ (char *)&(MKREQMETASIZE(p2req_flashdl_state)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("enable"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of p2req_flashdl_state request metadata list */ UINT32 MKREQMETASIZE(p2req_flashdl_state) = sizeof(MKREQMETANAME(p2req_flashdl_state))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the p2req_flashdl_write request message arguments */ extern UINT32 MKREQMETASIZE(p2req_flashdl_write); p80211meta_t MKREQMETANAME(p2req_flashdl_write)[] = { { /* name */ (char *)&(MKREQMETASIZE(p2req_flashdl_write)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("addr"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("len"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("data"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 4096, /* minlen */ 4096, /* enumptr */ NULL, /* totextptr */ NULL, /* data only handled by programs */ /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of p2req_flashdl_write request metadata list */ UINT32 MKREQMETASIZE(p2req_flashdl_write) = sizeof(MKREQMETANAME(p2req_flashdl_write))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the p2req_mm_state request message arguments */ extern UINT32 MKREQMETASIZE(p2req_mm_state); p80211meta_t MKREQMETANAME(p2req_mm_state)[] = { { /* name */ (char *)&(MKREQMETASIZE(p2req_mm_state)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("enable"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of p2req_mm_state request metadata list */ UINT32 MKREQMETASIZE(p2req_mm_state) = sizeof(MKREQMETANAME(p2req_mm_state))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the p2req_dump_state request message arguments */ extern UINT32 MKREQMETASIZE(p2req_dump_state); p80211meta_t MKREQMETANAME(p2req_dump_state)[] = { { /* name */ (char *)&(MKREQMETASIZE(p2req_dump_state)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("level"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 0, /* max */ 63, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of p2req_dump_state request metadata list */ UINT32 MKREQMETASIZE(p2req_dump_state) = sizeof(MKREQMETANAME(p2req_dump_state))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the p2req_channel_info request message arguments */ extern UINT32 MKREQMETASIZE(p2req_channel_info); p80211meta_t MKREQMETANAME(p2req_channel_info)[] = { { /* name */ (char *)&(MKREQMETASIZE(p2req_channel_info)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("channellist"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 1, /* max */ 14, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_bitarray, /* fromtextptr */ p80211_fromtext_bitarray, /* validfunptr */ p80211_isvalid_bitarray }, { /* name */ MKITEMNAME("channeldwelltime"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(0UL, ISREQUEST, 0UL), /* min */ 1, /* max */ 65535, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("numchinfo"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int } }; /* end of p2req_channel_info request metadata list */ UINT32 MKREQMETASIZE(p2req_channel_info) = sizeof(MKREQMETANAME(p2req_channel_info))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the p2req_channel_info_results request message arguments */ extern UINT32 MKREQMETASIZE(p2req_channel_info_results); p80211meta_t MKREQMETANAME(p2req_channel_info_results)[] = { { /* name */ (char *)&(MKREQMETASIZE(p2req_channel_info_results)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("channel"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, ISREQUEST, 0UL), /* min */ 1, /* max */ 14, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("avgnoiselevel"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("peaknoiselevel"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("bssactive"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("pcfactive"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of p2req_channel_info_results request metadata list */ UINT32 MKREQMETASIZE(p2req_channel_info_results) = sizeof(MKREQMETANAME(p2req_channel_info_results))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* metadata for the p2req_enable request message arguments */ extern UINT32 MKREQMETASIZE(p2req_enable); p80211meta_t MKREQMETANAME(p2req_enable)[] = { { /* name */ (char *)&(MKREQMETASIZE(p2req_enable)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("resultcode"), /* did */ 0, /* flags */ P80211ITEM_SETFLAGS(ISREQUIRED, 0UL, ISCONFIRM), /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(resultcode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; /* end of p2req_enable request metadata list */ UINT32 MKREQMETASIZE(p2req_enable) = sizeof(MKREQMETANAME(p2req_enable))/sizeof(p80211meta_t); /*--------------------------------------------------------------------*/ /* Messages Group arrays */ extern UINT32 MKGRPMETASIZE(dot11req); grplistitem_t MKGRPMETANAME(dot11req)[] = { { (char *)&MKGRPMETASIZE(dot11req), NULL }, { "dot11req_mibget", MKREQMETANAME(dot11req_mibget) }, { "dot11req_mibset", MKREQMETANAME(dot11req_mibset) }, { "dot11req_powermgmt", MKREQMETANAME(dot11req_powermgmt) }, { "dot11req_scan", MKREQMETANAME(dot11req_scan) }, { "dot11req_scan_results", MKREQMETANAME(dot11req_scan_results) }, { "dot11req_join", MKREQMETANAME(dot11req_join) }, { "dot11req_authenticate", MKREQMETANAME(dot11req_authenticate) }, { "dot11req_deauthenticate", MKREQMETANAME(dot11req_deauthenticate) }, { "dot11req_associate", MKREQMETANAME(dot11req_associate) }, { "dot11req_reassociate", MKREQMETANAME(dot11req_reassociate) }, { "dot11req_disassociate", MKREQMETANAME(dot11req_disassociate) }, { "dot11req_reset", MKREQMETANAME(dot11req_reset) }, { "dot11req_start", MKREQMETANAME(dot11req_start) } }; UINT32 MKGRPMETASIZE(dot11req) =sizeof(MKGRPMETANAME(dot11req)) / sizeof(grplistitem_t); extern UINT32 MKGRPMETASIZE(dot11ind); grplistitem_t MKGRPMETANAME(dot11ind)[] = { { (char *)&MKGRPMETASIZE(dot11ind), NULL }, { "dot11ind_authenticate", MKINDMETANAME(dot11ind_authenticate) }, { "dot11ind_deauthenticate", MKINDMETANAME(dot11ind_deauthenticate) }, { "dot11ind_associate", MKINDMETANAME(dot11ind_associate) }, { "dot11ind_reassociate", MKINDMETANAME(dot11ind_reassociate) }, { "dot11ind_disassociate", MKINDMETANAME(dot11ind_disassociate) } }; UINT32 MKGRPMETASIZE(dot11ind) =sizeof(MKGRPMETANAME(dot11ind)) / sizeof(grplistitem_t); extern UINT32 MKGRPMETASIZE(lnxreq); grplistitem_t MKGRPMETANAME(lnxreq)[] = { { (char *)&MKGRPMETASIZE(lnxreq), NULL }, { "lnxreq_ifstate", MKREQMETANAME(lnxreq_ifstate) }, { "lnxreq_wlansniff", MKREQMETANAME(lnxreq_wlansniff) }, { "lnxreq_hostwep", MKREQMETANAME(lnxreq_hostwep) }, { "lnxreq_commsquality", MKREQMETANAME(lnxreq_commsquality) }, { "lnxreq_autojoin", MKREQMETANAME(lnxreq_autojoin) } }; UINT32 MKGRPMETASIZE(lnxreq) =sizeof(MKGRPMETANAME(lnxreq)) / sizeof(grplistitem_t); extern UINT32 MKGRPMETASIZE(lnxind); grplistitem_t MKGRPMETANAME(lnxind)[] = { { (char *)&MKGRPMETASIZE(lnxind), NULL }, { "lnxind_wlansniffrm", MKINDMETANAME(lnxind_wlansniffrm) }, { "lnxind_roam", MKINDMETANAME(lnxind_roam) }, }; UINT32 MKGRPMETASIZE(lnxind) =sizeof(MKGRPMETANAME(lnxind)) / sizeof(grplistitem_t); extern UINT32 MKGRPMETASIZE(p2req); grplistitem_t MKGRPMETANAME(p2req)[] = { { (char *)&MKGRPMETASIZE(p2req), NULL }, { "p2req_join", MKREQMETANAME(p2req_join) }, { "p2req_readpda", MKREQMETANAME(p2req_readpda) }, { "p2req_readcis", MKREQMETANAME(p2req_readcis) }, { "p2req_auxport_state", /* enable=true|false */ MKREQMETANAME(p2req_auxport_state) }, { "p2req_auxport_read", /* addr, len[2-1024], datap */ MKREQMETANAME(p2req_auxport_read) }, { "p2req_auxport_write", /* addr, len[2-1024], datap */ MKREQMETANAME(p2req_auxport_write) }, { "p2req_low_level", /* testcode=UINT32 testparam=UINT32 */ MKREQMETANAME(p2req_low_level) }, { "p2req_test_command", /* testcode=UINT32 testparam=UINT32 */ MKREQMETANAME(p2req_test_command) }, { "p2req_mmi_read", /* cmd_code=UINT32 register=UINT32 */ MKREQMETANAME(p2req_mmi_read) }, { "p2req_mmi_write", /* cmd_code=UINT32 register=UINT32 */ MKREQMETANAME(p2req_mmi_write) }, { "p2req_ramdl_state", /* enable=true|false, exeaddr=UINT32 */ MKREQMETANAME(p2req_ramdl_state) }, { "p2req_ramdl_write", /* addr, len[2-1024], datap */ MKREQMETANAME(p2req_ramdl_write) }, { "p2req_flashdl_state", /* enable=true|false */ MKREQMETANAME(p2req_flashdl_state) }, { "p2req_flashdl_write", /* addr, len[2-1024], datap */ MKREQMETANAME(p2req_flashdl_write) }, { "p2req_mm_state", /* enable=true|false, level=[0-3] */ MKREQMETANAME(p2req_mm_state) }, { "p2req_dump_state", /* level=0-63 */ MKREQMETANAME(p2req_dump_state) }, { "p2req_channel_info", /* channellist[1..14], channeldwelltime=UINT16 */ MKREQMETANAME(p2req_channel_info) }, { "p2req_channel_info_results", /* channel, asl, psl, bssactive, pcfactive */ MKREQMETANAME(p2req_channel_info_results) }, { "p2req_enable", MKREQMETANAME(p2req_enable) } }; UINT32 MKGRPMETASIZE(p2req) = sizeof(MKGRPMETANAME(p2req)) / sizeof(grplistitem_t); extern UINT32 msg_catlist_size; catlistitem_t msg_catlist[] = { { (char *)&msg_catlist_size, NULL }, { "dot11req", MKGRPMETANAME(dot11req) }, /* dot11cfm does not exist at this time */ { "dot11ind", MKGRPMETANAME(dot11ind) }, { "lnxreq", MKGRPMETANAME(lnxreq) }, { "lnxind", MKGRPMETANAME(lnxind) }, { "p2req", MKGRPMETANAME(p2req) } }; UINT32 msg_catlist_size = sizeof(msg_catlist)/sizeof(catlistitem_t); /*================================================================*/ /* Local Function Declarations */ /*================================================================*/ /* Function Definitions */ linux-wlan-ng-0.2.9+dfsg/src/shared/p80211meta.c0000644000175000017500000004756211024763162020456 0ustar tormodtormod/* src/shared/p80211meta.c * * Defines the functions for handling mib and msg metadata * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- * This file defines the metadata for both mib and message contents and * argument metadata. * * -------------------------------------------------------------------- */ /*================================================================*/ /* System Includes */ #include #include #include /*================================================================*/ /* Project Includes */ #include #include #include /*================================================================*/ /* Local Constants */ /*================================================================*/ /* Local Macros */ /*================================================================*/ /* Local Types */ /*================================================================*/ /* Local Static Definitions */ /*================================================================*/ /* Local Function Declarations */ /*================================================================*/ /* Function Definitions */ /*---------------------------------------------------------------- * p80211_text2did * * Returns the numeric DID value for any textual metadata name. * * Arguments: * catlist ptr to a category metadata list * catname string containing category name * grpname string containing group name * iitemname string containing item name * * Returns: * P80211DID_INVALID no match on name(s) * Valid DID success, returns a valid DID ----------------------------------------------------------------*/ UINT32 p80211_text2did(catlistitem_t *catlist, char *catname, char *grpname, char *itemname) { UINT32 catdid = 0UL; UINT32 grpdid = 0UL; UINT32 itemdid = 0UL; int c; int cat; int g; int grp; int i; int catsize; int grpsize; int itemsize; if ( (catname == NULL) && (grpname == NULL) && (itemname == NULL) ) { return P80211DID_INVALID; } else { /* traverse category metadata list */ catsize = GETMETASIZE(catlist); for ( c = 1; c < catsize; c++ ) { cat = c; if ( catname != NULL ){ if ( (catdid = p80211_text2catdid( catlist, catname)) != P80211DID_INVALID ) { cat = P80211DID_SECTION(catdid); /* printf("category %s found, cat = %d\n", catname, cat ); */ /* set loop counter to size of category list to stop further execution of loop */ c = catsize; } else { return catdid; } } /* traverse group metadata list */ grpsize = GETMETASIZE(catlist[cat].grplist); for ( g = 1; g < grpsize; g++ ) { grp = g; if ( grpname != NULL ){ if ( (grpdid = p80211_text2grpdid( catlist[cat].grplist, grpname)) != P80211DID_INVALID ) { if ( catdid == 0UL ) { catdid = P80211DID_MKSECTION(cat); } grp = P80211DID_GROUP(grpdid); /* printf("group %s found, cat = %d, grp=%d\n", grpname, cat, grp ); */ /* set category and group loop counters equal to list sizes to stop further execution of loops */ g = grpsize; c = catsize; } else { g = grpsize; continue; } } /* traverse item metadata list */ itemsize = GETMETASIZE(catlist[cat].grplist[grp].itemlist); for ( i = 1; i < itemsize; i++ ) { if ( itemname != NULL ){ if ( (itemdid = p80211_text2itemdid( catlist[cat].grplist[grp].itemlist, itemname)) != P80211DID_INVALID ) { if ( catdid == 0UL ) { catdid = P80211DID_MKSECTION(cat); } if ( grpdid == 0UL ) { grpdid = P80211DID_MKGROUP(grp); } /* printf("item %s found, cat = %d, grp=%d, item=%d\n", itemname, cat, grp, P80211DID_ITEM(itemdid) ); */ /* set category, group & items loop counters equal to list sizes to stop further execution of loops */ i = itemsize; g = grpsize; c = catsize; } else { i = itemsize; } } } } } } /* printf("catdid = 0x%08x, grpdid=0x%08x, itemdid=0x%08x\n", catdid, grpdid, itemdid); */ /* check to make sure each non-NULL string was found and assigned a did */ if ( (catname != NULL) && ((catdid == 0UL) || (catdid == P80211DID_INVALID)) ) { return P80211DID_INVALID; } if ( (grpname != NULL) && ((grpdid == 0UL) || (grpdid == P80211DID_INVALID)) ) { return P80211DID_INVALID; } if ( (itemname != NULL) && ((itemdid == 0UL) || (itemdid == P80211DID_INVALID)) ) { return P80211DID_INVALID; } return (catdid | grpdid | itemdid); } /*---------------------------------------------------------------- * p80211_text2catdid * * Returns the numeric DID value for a category metadata name. * * Arguments: * list ptr to a category metadata list * name string containing category name * * Returns: * P80211DID_INVALID no match on name * Valid DID success, returns a valid category DID ----------------------------------------------------------------*/ UINT32 p80211_text2catdid(catlistitem_t *list, char *name ) { UINT32 did; int i; int size; did = P80211DID_INVALID; size = GETMETASIZE(list); if ( (list != NULL) && (name != NULL) ) { for ( i = 1; i < size; i++ ) { if ( strcmp(list[i].name, name ) == 0 ) { did = P80211DID_MKSECTION(i); break; } } } return did; } /*---------------------------------------------------------------- * p80211_text2grpdid * * Returns the numeric DID value for a group metadata name. * * Arguments: * list ptr to a group metadata list * name string containing group name * * Returns: * P80211DID_INVALID no match on name * Valid DID success, returns a valid group DID ----------------------------------------------------------------*/ UINT32 p80211_text2grpdid(grplistitem_t *list, char *name ) { UINT32 did; int i; int size; did = P80211DID_INVALID; size = GETMETASIZE(list); if ( (list != NULL) && (name != NULL) ) { for ( i = 1; i < size; i++ ) { if ( strcmp(list[i].name, name ) == 0 ) { did = P80211DID_MKGROUP(i); break; } } } return did; } /*---------------------------------------------------------------- * p80211_text2itemdid * * Returns the numeric DID value for an item metadata name. * * Arguments: * list ptr to an item metadata list * name string containing item name * * Returns: * P80211DID_INVALID no match on name * Valid DID success, returns a valid item DID ----------------------------------------------------------------*/ UINT32 p80211_text2itemdid(p80211meta_t *list, char *name ) { UINT32 did; int i; int size; did = P80211DID_INVALID; size = GETMETASIZE(list); if ( (list != NULL) && (name != NULL) ) { for ( i = 1; i < size; i++ ) { if ( strcmp(list[i].name, name ) == 0 ) { did = list[i].did | P80211DID_MKITEM(i); break; } } } return did; } /*---------------------------------------------------------------- * p80211_isvalid_did * * Verifies whether the category, group and item portions of a did * are valid. * * Arguments: * catlist ptr to a category metadata list * did data id * * Returns: * P80211DID_INVALID if DID is an invalid DID * !P80211DID_INVALID if DID is a valid DID ----------------------------------------------------------------*/ UINT32 p80211_isvalid_did( catlistitem_t *catlist, UINT32 did ) { int result; result = p80211_isvalid_itemdid( catlist, did ); return result; } /*---------------------------------------------------------------- * p80211_isvalid_catdid * * Verifies whether the category portion of a did is valid. * * Arguments: * catlist ptr to a category metadata list * did data id * * Returns: * P80211DID_INVALID if DID is an invalid DID * !P80211DID_INVALID if DID is a valid DID ----------------------------------------------------------------*/ UINT32 p80211_isvalid_catdid( catlistitem_t *catlist, UINT32 did ) { int result; int cat; int size; result = P80211DID_INVALID; cat = P80211DID_SECTION(did); size = GETMETASIZE(catlist); if ( (cat > 0UL) && (cat < size) ) { result = P80211DID_VALID; } return result; } /*---------------------------------------------------------------- * p80211_isvalid_grpdid * * Verifies whether the group portion of a did is valid. * * Arguments: * catlist ptr to a category metadata list * did data id * * Returns: * P80211DID_INVALID if DID is an invalid DID * !P80211DID_INVALID if DID is a valid DID ----------------------------------------------------------------*/ UINT32 p80211_isvalid_grpdid( catlistitem_t *catlist, UINT32 did ) { int result; int cat; int grp; int size; result = P80211DID_INVALID; if ( (result = p80211_isvalid_catdid( catlist, did )) == P80211DID_VALID ) { cat = P80211DID_SECTION(did); grp = P80211DID_GROUP(did); size = GETMETASIZE(catlist[cat].grplist); if ( (grp > 0UL) && (grp < size) ) { result = P80211DID_VALID; } } return result; } /*---------------------------------------------------------------- * p80211_isvalid_itemdid * * Verifies whether the item portion of a did is valid. * * Arguments: * catlist ptr to a category metadata list * did data id * * Returns: * P80211DID_INVALID if DID is an invalid DID * !P80211DID_INVALID if DID is a valid DID ----------------------------------------------------------------*/ UINT32 p80211_isvalid_itemdid( catlistitem_t *catlist, UINT32 did ) { int result; int cat; int grp; int item; int size; result = P80211DID_INVALID; if ( (result = p80211_isvalid_catdid( catlist, did )) == P80211DID_VALID ) { if ( (result = p80211_isvalid_grpdid( catlist, did )) == P80211DID_VALID ) { cat = P80211DID_SECTION(did); grp = P80211DID_GROUP(did); size = GETMETASIZE(catlist[cat].grplist[grp].itemlist); item = P80211DID_ITEM(did); if ( (item > 0UL) && (item < size) ) { result = P80211DID_VALID; } } } return result; } /*---------------------------------------------------------------- * p80211_did2cat * * Returns address of a category in the category metadata list * * Arguments: * catlist ptr to a category metadata list * did data id * * Returns: * NULL if DID is an invalid DID * ptr to a category list item if DID is a valid DID ----------------------------------------------------------------*/ catlistitem_t *p80211_did2cat( catlistitem_t *catlist, UINT32 did ) { catlistitem_t *category; int result; category = NULL; result = P80211DID_INVALID; if ( (result = p80211_isvalid_catdid( catlist, did )) == P80211DID_VALID ) { category = &(catlist[P80211DID_SECTION(did)]); } return category; } /*---------------------------------------------------------------- * p80211_did2grp * * Returns address of a group in the group metadata list * * Arguments: * catlist ptr to a category metadata list * did data id * * Returns: * NULL if DID is an invalid DID * ptr to group list item if DID is a valid DID ----------------------------------------------------------------*/ grplistitem_t *p80211_did2grp( catlistitem_t *catlist, UINT32 did ) { grplistitem_t *group; int result; group = NULL; result = P80211DID_INVALID; if ( (result = p80211_isvalid_catdid( catlist, did )) == P80211DID_VALID ) { if ( (result = p80211_isvalid_grpdid( catlist, did )) == P80211DID_VALID ) { group = &(catlist[P80211DID_SECTION(did)]. grplist[P80211DID_GROUP(did)]); } } return group; } /*---------------------------------------------------------------- * p80211_did2item * * Returns address of an item in the item metadata list * * Arguments: * catlist ptr to a category metadata list * did data id * * Returns: * NULL if DID is an invalid DID * ptr to item list item if DID is a valid DID ----------------------------------------------------------------*/ p80211meta_t *p80211_did2item( catlistitem_t *catlist, UINT32 did ) { p80211meta_t *item; int result; item = NULL; result = P80211DID_INVALID; if ( (result = p80211_isvalid_catdid( catlist, did )) == P80211DID_VALID ) { if ( (result = p80211_isvalid_grpdid( catlist, did )) == P80211DID_VALID ) { if ( (result = p80211_isvalid_itemdid( catlist, did )) == P80211DID_VALID ) { item = &(catlist[P80211DID_SECTION(did)]. grplist[P80211DID_GROUP(did)]. itemlist[P80211DID_ITEM(did)]); } } } return item; } /*---------------------------------------------------------------- * p80211item_getoffset * * Returns the offset of the data item identified by a given DID. * This function assumes a valid did is passed to the function. * * Arguments: * did a valid, complete DID * * Returns: * 0xffffffff if the type from the did doesn't match a * known type * offset on success ----------------------------------------------------------------*/ UINT32 p80211item_getoffset( catlistitem_t *metalist, UINT32 did ) { UINT32 catgrp; UINT32 offset, len; UINT32 tmpdid; UINT32 item; INT i; p80211meta_t *alist=NULL; offset = 0UL; if ( (p80211_isvalid_did(metalist, did )) != P80211DID_INVALID ) { alist = metalist[P80211DID_SECTION(did)]. grplist[P80211DID_GROUP(did)].itemlist; item = P80211DID_ITEM(did); catgrp = P80211DID_MKSECTION(P80211DID_SECTION(did)) | P80211DID_MKGROUP(P80211DID_GROUP(did)); for ( i = 1; i < item; i++ ) { tmpdid = catgrp | P80211DID_MKITEM(i) | alist[i].did; len = p80211item_maxdatalen(metalist, tmpdid); if (len == 0xffffffffUL) { printf("Undefined data type for %s\n", alist[i].name ); offset = 0xffffffff; return offset; } offset += len + sizeof(p80211item_t); } /* for each arg meta data item up to current item */ } else { offset = 0xffffffff; } return offset; } /*---------------------------------------------------------------- * p80211item_gettype * * Returns the type of the item identified by a given DID. * * Arguments: * meta pointer to a metadata item * * Returns: * 0 Unrecognized type in metadata. * anything else Success, return value is item type. ----------------------------------------------------------------*/ int p80211item_gettype(p80211meta_t *meta) { int type; if (meta->totextptr == p80211_totext_octetstr) type = P80211_TYPE_OCTETSTR; else if (meta->totextptr == p80211_totext_displaystr) type = P80211_TYPE_DISPLAYSTR; else if (meta->totextptr == p80211_totext_int) type = P80211_TYPE_INT; else if (meta->totextptr == p80211_totext_enumint) type = P80211_TYPE_ENUMINT; else if (meta->totextptr == NULL || meta->totextptr == p80211_totext_getmibattribute || meta->totextptr == p80211_totext_setmibattribute) type = P80211_TYPE_UNKDATA; else if (meta->totextptr == p80211_totext_intarray) type = P80211_TYPE_INTARRAY; else if (meta->totextptr == p80211_totext_bitarray) type = P80211_TYPE_BITARRAY; else if (meta->totextptr == p80211_totext_macarray) type = P80211_TYPE_MACARRAY; else type = 0; return type; } /*---------------------------------------------------------------- * p80211item_getaccess * * Returns the access type (read, write or read-write) of the item * identified by a given DID. * * Arguments: * meta pointer to a metadata item * * Returns: * 0 Unrecognized access type in metadata. * 1 Read Only * 2 Write Only * 3 Read-Write ----------------------------------------------------------------*/ int p80211item_getaccess(p80211meta_t *meta) { int access_type; access_type = 0; return access_type; } /*---------------------------------------------------------------- * p80211item_maxdatalen * * Returns the total maximum data size of an item identified * by a given DID. This is the length of the data part of the * item triple. * * Arguments: * metalist pointer to a category metadata list * did A complete DID * * Returns: * 0xffffffff Bad DID or unrecognized type in metadata * anything else success, return value is maxdatalen ----------------------------------------------------------------*/ UINT32 p80211item_maxdatalen( catlistitem_t *metalist, UINT32 did ) { UINT32 maxlen; p80211meta_t *meta; if ( (meta = p80211_did2item(metalist, did)) != NULL ) { switch( p80211item_gettype(meta) ) { case P80211_TYPE_OCTETSTR: /* add size of pstr length byte */ maxlen = meta->maxlen + sizeof(UINT8); break; case P80211_TYPE_DISPLAYSTR: /* add size of pstr length byte */ maxlen = meta->maxlen + sizeof(UINT8); break; case P80211_TYPE_INT: case P80211_TYPE_ENUMINT: case P80211_TYPE_BITARRAY: /* all int types are 4 bytes */ maxlen = 4; break; case P80211_TYPE_INTARRAY: /* int types are 4 bytes */ maxlen = meta->maxlen * 4; break; case P80211_TYPE_MACARRAY: /* Addresses are 6 bytes, add a 4 byte count */ maxlen = (meta->maxlen * 6) + 4; break; case P80211_TYPE_UNKDATA: maxlen = meta->maxlen; break; default: maxlen = 0xffffffffUL; } } else { maxlen = 0xffffffffUL; } /* pad for 32-bit aligmnent. */ if (maxlen != 0xffffffffUL) if (maxlen % 4) maxlen += (4 - (maxlen % 4)); return maxlen; } /*---------------------------------------------------------------- * p80211_metaname2did * * Traverses the metadata looking for an item whose name matches * the given name. * * Arguments: * metalist pointer to a category metadata list * itemname buffer containing the name to search for. * * Returns: * 0 - name not found * ~0 - complete DID of item having "itemname" ----------------------------------------------------------------*/ UINT32 p80211_metaname2did(catlistitem_t *metalist, char *itemname) { UINT32 result = 0UL; int sec; int nsec; int grp; int ngrp; int item; int nitem; /* traverse the entire metadata for the item that matches */ nsec = GETMETASIZE(metalist); for ( sec = 1; (sec < nsec) && (result == 0); sec++) { if ( metalist[sec].grplist == NULL ) continue; ngrp = GETMETASIZE(metalist[sec].grplist); for ( grp = 1; (grp < ngrp) && (result == 0); grp++) { if ( metalist[sec].grplist[grp].itemlist == NULL ) continue; nitem = GETMETASIZE(metalist[sec].grplist[grp].itemlist); for (item = 1;(item < nitem) && (result == 0);item++) { if ( strcmp(itemname, metalist[sec].grplist [grp].itemlist[item].name) == 0 ) { /* found it */ result = P80211DID_MKID( sec, grp, item, 0, 0, 0); result |= metalist[sec].grplist [grp].itemlist[item].did; } } /* for all items */ } /* for all groups */ } /* for all sections */ return result; } linux-wlan-ng-0.2.9+dfsg/src/shared/p80211types.c0000644000175000017500000020003411024763162020655 0ustar tormodtormod/* src/shared/p80211types.c * * Defines globally used types in linux-wlan * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- * * This file defines the data and functions for handling the linux-wlan * globally recognized data types: OCTETSTR, DISPLAYSTR, INT, BOUNDEDINT, * ENUMINT, INTARRAY, BITARRY, and MACARRAY. * * For each type there is a collection of 3 functions, totext_, * fromtext_, and isvalid_. They all have identical * signatures: * * void p80211_totext_( UINT32 did, UINT8 *itembuf, char *textbuf ) * void p80211_fromtext_( UINT32 did, UINT8 *itembuf, char *textbuf ) * UINT32 p80211_isvalid_( UINT32 did, UINT8 *itembuf ) * * The idea is that these functions will be called via pointers stored * in the metadata for each item. * Here are some important notes for these functions: * - all of these functions assume: * - a valid complete DID as the first argument * - (for to/fromtext) a valid pointer to a buffer containing * sufficient memory. * - All textual representations are "=" * - All itembufs are pointing to a p80211item_t * - isvalid functions return: * 0 if item is invalid * non-zero if item is valid * * NOTE: these functions assume that the argument "itembuf" is a * data item and whose data field is always the maximum data * size (i.e. a PSTR255) with the exception of a collection. * In the case of a collection, the itembuf argument is a * pointer to a collection data item where the data value field * is itself a list of data items. * * * Additionally, there are functions for converting enumeration values * from text to binary and back. * -------------------------------------------------------------------- */ /*================================================================*/ /* System Includes */ #include #include #include #include /*================================================================*/ /* Project Includes */ #include #include #include #include #include /*================================================================*/ /* Local Constants */ /*================================================================*/ /* Local Macros */ /* the following depends on the following defines: P80211_NOINCLUDESTRINGS - ifdef, all metadata name fields are empty strings */ #define MKENUM(name) \ p80211enum_t MKENUMNAME(name) = \ { \ sizeof((p80211enumpair_ ## name)) / sizeof(p80211enumpair_t), \ (p80211enumpair_ ## name) \ } #ifdef P80211_NOINCLUDESTRINGS #define MKENUMPAIR(n,s) { (n), ("") } #else #define MKENUMPAIR(n,s) { (n), (s) } #endif #define MKENUMPAIRLIST(name) p80211enumpair_t p80211enumpair_ ## name [] = /*================================================================*/ /* Local Types */ /*================================================================*/ /* Local Static Definitions */ /* too much data in this file, we moved to the bottom for readability */ /*================================================================*/ /* Local Function Declarations */ /*================================================================*/ /* Function Definitions */ /*---------------------------------------------------------------- * p80211enum_text2int * * Returns the numeric value of an enum item given its textual * name and a ptr to the enum struct. * * Arguments: * ep ptr to enum metadata * text textual enum item name * * Returns: * P80211_ENUMBAD no match on name * !P80211_ENUMBAD success, return value is enum value ----------------------------------------------------------------*/ UINT32 p80211enum_text2int(p80211enum_t *ep, char *text) { UINT32 result = P80211ENUM_BAD; int i; for ( i = 0; i < ep->nitems; i++ ) { if ( strcmp(text, ep->list[i].name ) == 0 ) { result = ep->list[i].val; break; } } return result; } /*---------------------------------------------------------------- * p80211enum_int2text * * Fills a buffer with the name string for a given integer * quantity and a ptr to the enum struct. * * Arguments: * ep ptr to enum metadata * val integer value to convert * text (out)buffer to write enum name to * * Returns: * P80211_ENUMBAD no match on number * !P80211_ENUMBAD success * * Side effects: * Argument 'text' is filled with the textual name of the * enum value. If the lookup fails, 'text' is set to the * string P80211ENUM_BADSTR ----------------------------------------------------------------*/ UINT32 p80211enum_int2text(p80211enum_t *ep, UINT32 val, char *text) { UINT32 result = P80211ENUM_BAD; int i; strcpy(text, P80211ENUM_BADSTR); for ( i = 0; i < ep->nitems; i++) { if ( ep->list[i].val == val ) { strcpy( text, ep->list[i].name ); result = val; break; } } return result; } /*---------------------------------------------------------------- * p80211_totext_displaystr * * pstr ==> cstr * * Converts a pascal string to a C string appropriate for display. * The C string format is always "=". * * Arguments: * metalist pointer to a category metadata list * did complete, validated, DID. * itembuf item triple {DID, len, value}. * textbuf (out) character buffer to receive textual * representation. * * Returns: * nothing * * Side effects: * Writes the converted value to the buffer pointed at by * textbuf. ----------------------------------------------------------------*/ void p80211_totext_displaystr( catlistitem_t *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ) { p80211meta_t *meta = NULL; p80211itemd_t *item = (p80211itemd_t*)itembuf; p80211pstrd_t *pstr; *textbuf = '\0'; if ( (meta = p80211_did2item(metalist, did)) != NULL ) { /* collect the C string stored in the data item */ if ( item->status == P80211ENUM_msgitem_status_data_ok ) { pstr = (p80211pstrd_t*)item->data; if ( item->did != 0UL ) { sprintf( textbuf, "%s=\'", meta->name); strncat( textbuf, pstr->data, pstr->len); strncat( textbuf, "\'", 1); } else { sprintf( textbuf, "%s=\'%s\'", meta->name, NOT_SUPPORTED); } } else { char error_msg[MSG_BUFF_LEN]; p80211_error2text( item->status, error_msg); sprintf( textbuf, "%s=\'%s\'", meta->name, error_msg); } } else { char error_msg[MSG_BUFF_LEN]; p80211_error2text( P80211ENUM_msgitem_status_invalid_msg_did, error_msg); sprintf( textbuf, "0x%08x=\"%s\"", did, error_msg); } return; } /*---------------------------------------------------------------- * p80211_fromtext_displaystr * * cstr ==> pstr * * Converts a C string containing the "=" format * to a wlan data item triple. * * The C string format is always "=". * * Arguments: * metalist pointer to a category metadata list * did complete, validated, DID. * itembuf (out>item triple {DID, len, value}. * textbuf character buffer to receive textual * representation. * * Returns: * nothing * * Side effects: * Writes the converted value to the buffer pointed at by * itembuf. ----------------------------------------------------------------*/ void p80211_fromtext_displaystr( catlistitem_t *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ) { p80211meta_t *meta = NULL; p80211itemd_t *item = (p80211itemd_t*)itembuf; p80211pstrd_t *pstr; int len; /* set up the pascal string pointer, i.e. the display str data item */ pstr = (p80211pstrd_t*)item->data; /* collect the metadata item */ if ( (meta = p80211_did2item(metalist, did)) != NULL ) { /* set the DID and OR in the partial DID for safety */ item->did = did | meta->did; /* adding 1 to the metadata maxlen takes into account the first byte of the pascal string containing the actual number of data bytes. NOTE: the '\0' of a display string is included in the metadata maxlen */ item->len = p80211item_maxdatalen(metalist, item->did); /* skip past the item name to its value before converting */ textbuf = strchr(textbuf, '='); if ( textbuf != NULL ) { /* OK, got the '=', bump to the next */ textbuf++; len = strlen(textbuf); if ( len > meta->maxlen ) { item->status = P80211ENUM_msgitem_status_string_too_long; } else if ( len < meta->minlen ) { item->status = P80211ENUM_msgitem_status_string_too_short; } else { pstr->len = len; strncpy( pstr->data, textbuf, len); item->status = P80211ENUM_msgitem_status_data_ok; } } else { /* bogus text string, set the item to an empty string */ pstr->len = 0; item->status = P80211ENUM_msgitem_status_missing_itemdata; } } else { pstr->len = 0; pstr->data[0] = '\0'; item->did = did; item->len = pstr->len + 1; item->status = P80211ENUM_msgitem_status_invalid_itemname; } return; } /*---------------------------------------------------------------- * p80211_isvalid_displaystr * * Tests an item triple for valid range. Uses the validation * information in the metadata. Displaystr's are validated for * length. * * Arguments: * metalist pointer to a category metadata list * did complete, validated, DID. * itembuf item triple {DID, len, value}. * * Returns: * 0 - data in itembuf is invalid * ~0 - data in itembuf is valid ----------------------------------------------------------------*/ UINT32 p80211_isvalid_displaystr( catlistitem_t *metalist, UINT32 did, UINT8 *itembuf ) { UINT32 result = 0; p80211meta_t *meta; p80211itemd_t *item = (p80211itemd_t*)itembuf; p80211pstrd_t *pstr; if ( (item->status) == P80211ENUM_msgitem_status_data_ok ) { if ( (meta = p80211_did2item(metalist, did)) != NULL ) { /* set up the pointers */ pstr = (p80211pstrd_t*)item->data; if ( pstr->len < meta->minlen ) { item->status = P80211ENUM_msgitem_status_string_too_short; } else if ( pstr->len > meta->maxlen ) { item->status = P80211ENUM_msgitem_status_string_too_long; } else { result =1; } } else { item->status = P80211ENUM_msgitem_status_invalid_did; } } return result; } /*---------------------------------------------------------------- * p80211_totext_octetstr * * pstr ==> "xx:xx:..." * * Converts a pascal string to a hex represenation of its contents. * The C string format is always "=". * * Arguments: * metalist pointer to a category metadata list * did complete, validated, DID. * itembuf item triple {DID, len, value}. * textbuf (out) character buffer to receive textual * representation. * * Returns: * nothing * * Side effects: * Writes the converted value to the buffer pointed at by * textbuf. ----------------------------------------------------------------*/ void p80211_totext_octetstr( catlistitem_t *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ) { p80211meta_t *meta = NULL; p80211itemd_t *item = (p80211itemd_t*)itembuf; p80211pstrd_t *pstr; UINT8 *cstr; INT len; INT n; *textbuf = '\0'; /* collect the metadata item */ if ( (meta = p80211_did2item(metalist, did)) != NULL ) { if ( item->status == P80211ENUM_msgitem_status_data_ok ) { /* collect the C string stored in the data item */ pstr = (p80211pstrd_t*)item->data; if ( item->did != 0UL ) { len = pstr->len; cstr = pstr->data; sprintf( textbuf, "%s=", meta->name); for ( n=0; n < len; n++ ) { sprintf( &textbuf[strlen(textbuf)], "%02x:", (UINT)(cstr[n]) ); } /* get rid of trailing colon */ textbuf[strlen(textbuf) - 1] = '\0'; } else { sprintf( textbuf, "%s=%s", meta->name, NOT_SUPPORTED); } } else { char error_msg[MSG_BUFF_LEN]; p80211_error2text( item->status, error_msg); sprintf( textbuf, "%s=\"%s\"", meta->name, error_msg); } } else { char error_msg[MSG_BUFF_LEN]; p80211_error2text( P80211ENUM_msgitem_status_invalid_msg_did, error_msg); sprintf( textbuf, "0x%08x=\"%s\"", did, error_msg); } return; } /*---------------------------------------------------------------- * p80211_fromtext_octetstr * * "xx:xx:...." ==> pstr * * Converts a C string containing the "=" format * to a wlan data item triple. * * The C string format is always "=". * * Arguments: * metalist pointer to a category metadata list * did complete, validated, DID. * itembuf (out>item triple {DID, len, value}. * textbuf character buffer to receive textual * representation. * * Returns: * nothing * * Side effects: * Writes the converted value to the buffer pointed at by * itembuf. ----------------------------------------------------------------*/ void p80211_fromtext_octetstr( catlistitem_t *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ) { p80211meta_t *meta = NULL; p80211itemd_t *item = (p80211itemd_t*)itembuf; p80211pstrd_t *pstr; UINT hexnum; INT n; /* set up the pascal string pointer, i.e. the display str data item */ pstr = (p80211pstrd_t*)item->data; /* collect the metadata item */ if ( (meta = p80211_did2item(metalist, did)) != NULL ) { /* set the DID and OR in the partial DID for safety */ item->did = did | meta->did; /* adding 1 to the metadata maxlen takes into account the first byte of the pascal string containing the actual number of data bytes. NOTE: the '\0' of a display string is included in the metadata maxlen */ item->len = p80211item_maxdatalen(metalist, item->did); /* skip past the item name to its value before converting */ textbuf = strchr(textbuf, '='); if ( textbuf != NULL ) { item->status = P80211ENUM_msgitem_status_data_ok; for ( n=0, pstr->len = (UINT8)0; (textbuf != NULL) && (item->status == P80211ENUM_msgitem_status_data_ok); n++ ) { /* OK, got the '=' or ':', bump to the next char */ textbuf++; if ( pstr->len < meta->maxlen ) { if ( sscanf( textbuf, "%x", &hexnum) == 1 ) { pstr->data[n] = (UINT8)(hexnum); pstr->len = pstr->len + (UINT8)(1); } else { item->status = P80211ENUM_msgitem_status_invalid_itemdata; } } else { item->status = P80211ENUM_msgitem_status_string_too_long; } textbuf = strchr(textbuf, ':'); } if ( pstr->len < meta->minlen ) item->status = P80211ENUM_msgitem_status_string_too_short; } else { /* bogus text string, set the item to an empty string */ pstr->len = 1; pstr->data[0] = '\0'; item->status = P80211ENUM_msgitem_status_missing_itemdata; } } else { pstr->len = 1; pstr->data[0] = '\0'; item->did = did; item->len = pstr->len + 1; item->status = P80211ENUM_msgitem_status_invalid_itemname; } return; } /*---------------------------------------------------------------- * p80211_isvalid_octetstr * * Tests an item triple for valid range. Uses the validation * information in the metadata. Octetstr's are validated for * length. * * Arguments: * metalist pointer to a category metadata list * did complete, validated, DID. * itembuf item triple {DID, len, value}. * * Returns: * 0 - data in itembuf is invalid * ~0 - data in itembuf is valid ----------------------------------------------------------------*/ UINT32 p80211_isvalid_octetstr( catlistitem_t *metalist, UINT32 did, UINT8 *itembuf ) { UINT32 result = 0; p80211meta_t *meta; p80211itemd_t *item = (p80211itemd_t*)itembuf; p80211pstrd_t *pstr; if ( item->status == P80211ENUM_msgitem_status_data_ok ) { /* collect the metadata item */ if ( (meta = p80211_did2item(metalist, did)) != NULL ) { /* set up the pointers */ pstr = (p80211pstrd_t*)item->data; /* in the case of an octet string, the total number of raw data bytes must be equal or less than maximum length and equal or greater than minimum length specified in the metadata */ if ( pstr->len < meta->minlen ) { item->status = P80211ENUM_msgitem_status_string_too_short; } else if ( pstr->len > meta->maxlen ) { item->status = P80211ENUM_msgitem_status_string_too_long; } else { result =1; } } else { item->status = P80211ENUM_msgitem_status_invalid_did; } } return result; } /*---------------------------------------------------------------- * p80211_totext_int * * UINT32 ==> %d * * Converts a UINT32 to a C string appropriate for display. * The C string format is always "=". * Note: for now, this function is identical to totext_boundedint * * Arguments: * metalist pointer to a category metadata list * did complete, validated, DID. * itembuf item triple {DID, len, value}. * textbuf (out) character buffer to receive textual * representation. * * Returns: * nothing * * Side effects: * Writes the converted value to the buffer pointed at by * textbuf. ----------------------------------------------------------------*/ void p80211_totext_int( catlistitem_t *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ) { p80211meta_t *meta = NULL; p80211itemd_t *item = (p80211itemd_t*)itembuf; *textbuf = '\0'; /* collect the metadata item */ if ( (meta = p80211_did2item(metalist, did)) != NULL ) { if ( item->status == P80211ENUM_msgitem_status_data_ok ) { if ( item->did != 0UL ) { /* now, print the data item name and value into the textbuf */ sprintf( textbuf, "%s=%u", meta->name, *((UINT32 *)(item->data))); } else { sprintf( textbuf, "%s=%s", meta->name, NOT_SUPPORTED); } } else { char error_msg[MSG_BUFF_LEN]; p80211_error2text( item->status, error_msg); sprintf( textbuf, "%s=\"%s\"", meta->name, error_msg); } } else { char error_msg[MSG_BUFF_LEN]; p80211_error2text( P80211ENUM_msgitem_status_invalid_msg_did, error_msg); sprintf( textbuf, "0x%08x=\"%s\"", did, error_msg); } return; } /*---------------------------------------------------------------- * p80211_fromtext_int * * %d ==> UINT32 * * Converts a C string containing the "=" format * to a wlan data item triple. * * The C string format is always "=". * * Arguments: * metalist pointer to a category metadata list * did complete, validated, DID. * itembuf (out>item triple {DID, len, value}. * textbuf character buffer to receive textual * representation. * * Returns: * nothing * * Side effects: * Writes the converted value to the buffer pointed at by * itembuf. ----------------------------------------------------------------*/ void p80211_fromtext_int( catlistitem_t *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ) { p80211meta_t *meta = NULL; p80211itemd_t *item = (p80211itemd_t*)itembuf; /* collect the metadata item */ if ( (meta = p80211_did2item(metalist, did)) != NULL ) { /* set the DID and OR in the partial DID for safety */ item->did = did | meta->did; item->len = p80211item_maxdatalen(metalist, item->did); /* skip past the item name to its value before converting */ textbuf = strchr(textbuf, '='); if ( textbuf != NULL ) { /* OK, got the '=', bump to the next */ textbuf++; *((UINT32 *)(item->data)) = strtoul(textbuf, NULL, 0); item->status = P80211ENUM_msgitem_status_data_ok; } else { /* bogus text string, set the item data value to zero */ *((UINT32 *)(item->data)) = 0UL; item->status = P80211ENUM_msgitem_status_missing_itemdata; } } else { /* invalid did */ item->did = did; item->len = sizeof(int); item->status = P80211ENUM_msgitem_status_invalid_itemname; } return; } /*---------------------------------------------------------------- * p80211_isvalid_int * * Tests an item triple for valid range. Uses the validation * information in the metadata. All values are valid, so this * function always returns success. * * Arguments: * metalist pointer to a category metadata list * did complete, validated, DID. * itembuf item triple {DID, len, value}. * * Returns: * 0 - data in itembuf is invalid * ~0 - data in itembuf is valid ----------------------------------------------------------------*/ UINT32 p80211_isvalid_int( catlistitem_t *metalist, UINT32 did, UINT8 *itembuf ) { UINT32 result = 0; p80211meta_t *meta; p80211itemd_t *item = (p80211itemd_t*)itembuf; if ( item->status == P80211ENUM_msgitem_status_data_ok ) { /* collect the metadata item */ if ( (meta = p80211_did2item(metalist, did)) != NULL ) { /* if either min or max is non-zero, we are bound */ if (meta->min || meta->max) { if ( ((*((UINT32 *)(item->data))) >= meta->min) && ((*((UINT32 *)(item->data))) <= meta->max)) { result = 1; } else { item->status = P80211ENUM_msgitem_status_data_out_of_range; } } else { result = 1; } } else { item->status = P80211ENUM_msgitem_status_invalid_did; } } return result; } /*---------------------------------------------------------------- * p80211_totext_enumint * * UINT32 ==> * * Converts a enumerated integer item quantity to it a C string * appropriate for display. * The C string format is always "=". * * Arguments: * metalist pointer to a category metadata list * did complete, validated, DID. * itembuf item triple {DID, len, value}. * textbuf (out) character buffer to receive textual * representation. * * Returns: * nothing * * Side effects: * Writes the converted value to the buffer pointed at by * textbuf. ----------------------------------------------------------------*/ void p80211_totext_enumint( catlistitem_t *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ) { p80211meta_t *meta = NULL; p80211itemd_t *item = (p80211itemd_t*)itembuf; p80211enumpair_t *enumlist = NULL; INT nitems; INT n; INT found; *textbuf = '\0'; /* collect the metadata item */ if ( (meta = p80211_did2item(metalist, did)) != NULL ) { if ( item->status == P80211ENUM_msgitem_status_data_ok ) { nitems = meta->enumptr->nitems; enumlist = meta->enumptr->list; if ( item->did != 0UL ) { for ( n=0, found = 0; (!found) && (n < nitems); n++ ) { if ( enumlist[n].val == (*((UINT32 *)(item->data))) ) { /* now, print the data item name and enum text value into textbuf */ sprintf( textbuf, "%s=%s", meta->name, enumlist[n].name ); found = 1; } } if ( !found ) { char error_msg[MSG_BUFF_LEN]; p80211_error2text( P80211ENUM_msgitem_status_invalid_itemdata, error_msg); sprintf( textbuf, "%s=\"%s\"", meta->name, error_msg); } } else { sprintf( textbuf, "%s=%s", meta->name, NOT_SUPPORTED); } } else { char error_msg[MSG_BUFF_LEN]; p80211_error2text( item->status, error_msg); sprintf( textbuf, "%s=\"%s\"", meta->name, error_msg); } } else { char error_msg[MSG_BUFF_LEN]; p80211_error2text( P80211ENUM_msgitem_status_invalid_msg_did, error_msg); sprintf( textbuf, "0x%08x=\"%s\"", did, error_msg); } return; } /*---------------------------------------------------------------- * p80211_fromtext_enumint * * ==> UINT32 * * Converts a C string containing the "=" format * to a wlan data item triple. * * The C string format is always "=". * * Arguments: * metalist pointer to a category metadata list * did complete, validated, DID. * itembuf (out>item triple {DID, len, value}. * textbuf character buffer to receive textual * representation. * * Returns: * nothing * * Side effects: * Writes the converted value to the buffer pointed at by * itembuf. ----------------------------------------------------------------*/ void p80211_fromtext_enumint( catlistitem_t *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ) { p80211meta_t *meta = NULL; p80211itemd_t *item = (p80211itemd_t*)itembuf; p80211enumpair_t *enumlist = NULL; INT nitems; INT n; INT found; /* collect the metadata item */ if ( (meta = p80211_did2item(metalist, did)) != NULL ) { nitems = meta->enumptr->nitems; enumlist = meta->enumptr->list; /* set the DID and OR in the partial DID for safety */ item->did = did | meta->did; item->len = p80211item_maxdatalen(metalist, item->did); /* skip past the item name to its value before converting */ textbuf = strchr(textbuf, '='); if ( textbuf != NULL ) { /* OK, got the '=', bump to the next */ textbuf++; for ( n=0, found = 0; (!found) && (n < nitems); n++ ) { if ( strcmp(enumlist[n].name, textbuf) == 0 ) { *((UINT32 *)(item->data)) = enumlist[n].val; item->status = P80211ENUM_msgitem_status_data_ok; found = 1; } } if ( !found ) { *((UINT32 *)(item->data)) = P80211ENUM_BAD; item->status = P80211ENUM_msgitem_status_invalid_itemdata; } } else { /* bogus text string, set the item data value to zero */ *((UINT32 *)(item->data)) = 0UL; item->status = P80211ENUM_msgitem_status_missing_itemdata; } } else { item->did = did; item->len = sizeof(UINT32); item->status = P80211ENUM_msgitem_status_invalid_itemname; } return; } /*---------------------------------------------------------------- * p80211_isvalid_enumint * * Tests an item triple for valid range. Uses the validation * information in the metadata. Enumint's are validated against * their enumeration structure. * * Arguments: * metalist pointer to a category metadata list * did complete, validated, DID. * itembuf item triple {DID, len, value}. * * Returns: * 0 - data in itembuf is invalid * ~0 - data in itembuf is valid ----------------------------------------------------------------*/ UINT32 p80211_isvalid_enumint( catlistitem_t *metalist, UINT32 did, UINT8 *itembuf ) { UINT32 result = 0; p80211meta_t *meta; p80211itemd_t *item = (p80211itemd_t*)itembuf; if ( item->status == P80211ENUM_msgitem_status_data_ok ) { /* collect the metadata item */ if ( (meta = p80211_did2item(metalist, did)) != NULL ) { if ( (*((UINT32 *)(item->data))) != P80211ENUM_BAD ) { result = 1; } else { item->status = P80211ENUM_msgitem_status_invalid_itemdata; } } else { item->status = P80211ENUM_msgitem_status_invalid_did; } } return result; } /*---------------------------------------------------------------- * p80211_totext_getmibattribute * * Converts the mibattribute of a "mibget" message into * a text string. The DATA portion of the mibattribute's * "DID-LEN-DATA" triple is itself a "DID-LEN-DATA" triple storing * the mib item's did, length and data. In other words: * * DID-LEN-DATA * ^ * |__________ where DATA = DID-LEN-DATA for a MIB Item * * If message text format is: * "mibattribute==" * * Arguments: * metalist pointer to a category metadata list * did complete, validated, DID. * itembuf item triple {DID, len, value}. * textbuf (out) character buffer to receive textual * representation. * * Returns: * nothing * * Side effects: * Writes the converted mib value to the buffer pointed at by * textbuf. ----------------------------------------------------------------*/ void p80211_totext_getmibattribute( catlistitem_t *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ) { char tmpbuf[MSG_BUFF_LEN]; UINT32 mibdid; p80211meta_t *meta = NULL; p80211meta_t *mibmeta = NULL; p80211itemd_t *item = (p80211itemd_t*)itembuf; *textbuf = '\0'; /* get the metadata item */ if ( (meta = p80211_did2item(metalist, did)) != NULL ) { if ( item->status == P80211ENUM_msgitem_status_data_ok ) { mibdid = *((UINT32 *)(item->data)); if ( (mibmeta = p80211_did2item(mib_catlist,mibdid)) != NULL ) { if ( item->did != 0UL ) { if ( mibmeta->totextptr != NULL) { (*(mibmeta->totextptr)) (mib_catlist, mibdid, item->data, tmpbuf); /* now, print to the textbuf */ sprintf( textbuf, "%s=%s",meta->name, tmpbuf); } else { sprintf( textbuf, "%s=%s=%s", meta->name, mibmeta->name, NOT_SUPPORTED); } } else { sprintf( textbuf, "%s=%s=%s", meta->name, mibmeta->name, NOT_SUPPORTED); } } else { char error_msg[MSG_BUFF_LEN]; p80211_error2text( P80211ENUM_msgitem_status_invalid_mib_did, error_msg); sprintf( textbuf, "0x%08x=\"%s\"", mibdid, error_msg); } } else { char error_msg[MSG_BUFF_LEN]; p80211_error2text( item->status, error_msg); sprintf( textbuf, "%s=\"%s\"", meta->name, error_msg); } } else { char error_msg[MSG_BUFF_LEN]; p80211_error2text( P80211ENUM_msgitem_status_invalid_msg_did, error_msg); sprintf( textbuf, "0x%08x=\"%s\"", did, error_msg); } return; } /*---------------------------------------------------------------- * p80211_totext_setmibattribute * * Converts the mibattribute of a "mibset" message into * a text string. The DATA portion of the mibattribute's * "DID-LEN-DATA" triple is itself a "DID-LEN-DATA" triple storing * the mib item's did, length and data. In other words: * * DID-LEN-DATA * ^ * |__________ where DATA = DID-LEN-DATA for a MIB Item * * If message text format is: * "mibattribute==" * * Arguments: * metalist pointer to a category metadata list * did complete, validated, DID. * itembuf item triple {DID, len, value}. * textbuf (out) character buffer to receive textual * representation. * * Returns: * nothing * * Side effects: * Writes the converted mib value to the buffer pointed at by * textbuf. ----------------------------------------------------------------*/ void p80211_totext_setmibattribute( catlistitem_t *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ) { char tmpbuf[MSG_BUFF_LEN]; UINT32 mibdid; p80211meta_t *meta = NULL; p80211meta_t *mibmeta = NULL; p80211itemd_t *item = (p80211itemd_t*)itembuf; *textbuf = '\0'; /* get the metadata item */ if ( (meta = p80211_did2item(metalist, did)) != NULL ) { if ( item->status == P80211ENUM_msgitem_status_data_ok ) { mibdid = *((UINT32 *)(item->data)); if ( (mibmeta = p80211_did2item(mib_catlist,mibdid)) != NULL ) { if ( item->did != 0UL ) { if ( mibmeta->totextptr != NULL) { (*(mibmeta->totextptr)) (mib_catlist, mibdid, item->data, tmpbuf); /* now, print to the textbuf */ sprintf( textbuf, "%s=%s",meta->name, tmpbuf); } else { sprintf( textbuf, "%s=%s=%s", meta->name, mibmeta->name, NOT_SUPPORTED); } } else { sprintf( textbuf, "%s=%s=%s", meta->name, mibmeta->name, NOT_SUPPORTED); } } else { char error_msg[MSG_BUFF_LEN]; p80211_error2text( P80211ENUM_msgitem_status_invalid_mib_did, error_msg); sprintf( textbuf, "0x%08x=\"%s\"", mibdid, error_msg); } } else { char error_msg[MSG_BUFF_LEN]; p80211_error2text( item->status, error_msg); sprintf( textbuf, "%s=\"%s\"", meta->name, error_msg); } } else { char error_msg[MSG_BUFF_LEN]; p80211_error2text( P80211ENUM_msgitem_status_invalid_msg_did, error_msg); sprintf( textbuf, "0x%08x=\"%s\"", did, error_msg); } return; } /*---------------------------------------------------------------- * p80211_fromtext_getmibattribute * * If message is mibget, then the text format is: * "mibattribute=" * If message is mibset, then the text format is: * "mibattribute==" * * Takes the mibattribute argument of a "mibget" message, and coverts * the mib item name into a mib DID and converts the mib's value. * * The DATA portion of the mibattribute's "DID-LEN-DATA" triple is * itself a "DID-LEN-DATA" triple storing the mib item's did, length * and data. In other words: * * DID-LEN-DATA * ^ * |__________ where DATA = DID-LEN-DATA for a MIB Item * * Arguments: * metalist pointer to a category metadata list * did complete, validated, DID. * itembuf (out>item triple {DID, len, value}. * textbuf character buffer to receive textual * representation. * * Returns: * nothing * * Side effects: * Writes the MIB DID to the buffer pointed at by * itembuf. ----------------------------------------------------------------*/ void p80211_fromtext_getmibattribute( catlistitem_t *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ) { p80211meta_t *meta; p80211meta_t *mibmeta; p80211itemd_t *item = (p80211itemd_t*)itembuf; char *mibstr; UINT32 mibdid; /* collect the metadata item */ if ( (meta = p80211_did2item(metalist, did)) != NULL ) { /* set the DID (OR in the partial DID for safety) and set the length */ item->did = did | meta->did; item->len = p80211item_maxdatalen(metalist, item->did); /* collect the mib item name */ textbuf = strchr(textbuf, '='); if ( textbuf == NULL ) { *((UINT32 *)(item->data)) = 0UL; item->status = P80211ENUM_msgitem_status_missing_itemdata; return; } textbuf++; mibstr = textbuf; /* get DID of mib item based on mib name */ mibdid = p80211_metaname2did(mib_catlist,mibstr); if ( mibdid != 0UL ) { if ( (mibmeta = p80211_did2item(mib_catlist, mibdid)) != NULL ) { item= (p80211itemd_t *)(item->data); item->did = mibdid; if ( mibmeta-> maxlen > 0 ) { item->len = p80211item_maxdatalen( mib_catlist, item->did); } else { item->len = 4; } *((UINT32 *)(item->data)) = 0UL; item->status = P80211ENUM_msgitem_status_data_ok; } else { item->status = P80211ENUM_msgitem_status_invalid_mib_did; *((UINT32 *)(item->data)) = 0UL; return; } } else { item->status = P80211ENUM_msgitem_status_invalid_mib_did; *((UINT32 *)(item->data)) = 0UL; return; } } else { item->did = did; item->len = 4; *((UINT32 *)(item->data)) = 0UL; item->status = P80211ENUM_msgitem_status_invalid_itemname; } return; } /*---------------------------------------------------------------- * p80211_fromtext_setmibattribute * * If message is mibget, then the text format is: * "mibattribute=" * If message is mibset, then the text format is: * "mibattribute==" * * Takes the mibattribute argument of a "mibset" message, and coverts * the mib item name into a mib DID and converts the mib's value. * * The DATA portion of the mibattribute's "DID-LEN-DATA" triple is * itself a "DID-LEN-DATA" triple storing the mib item's did, length * and data. In other words: * * DID-LEN-DATA * ^ * |__________ where DATA = DID-LEN-DATA for a MIB Item * * Arguments: * metalist pointer to a category metadata list * did complete, validated, DID. * itembuf (out>item triple {DID, len, value}. * textbuf character buffer to receive textual * representation. * * Returns: * nothing * * Side effects: * Writes the MIB DID to the buffer pointed at by * itembuf. If message is "mibset", then the mib value is * coverted from text and stored after the DID and LEN ----------------------------------------------------------------*/ void p80211_fromtext_setmibattribute( catlistitem_t *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ) { p80211meta_t *meta; p80211meta_t *mibmeta; p80211itemd_t *item = (p80211itemd_t*)itembuf; char *mibstr; UINT32 mibdid; /* collect the metadata item */ meta = p80211_did2item(metalist, did); if (meta == NULL) { item->did = did; item->len = 4; *((UINT32 *)(item->data)) = 0UL; item->status = P80211ENUM_msgitem_status_invalid_msg_did; return; } /* set the DID (OR in the partial DID for safety) and set the length */ item->did = did | meta->did; item->len = p80211item_maxdatalen(metalist, item->did); /* collect the mib item name */ textbuf = strchr(textbuf, '='); if ( textbuf == NULL ) { *((UINT32 *)(item->data)) = 0UL; item->status = P80211ENUM_msgitem_status_missing_itemdata; return; } textbuf++; mibstr = textbuf; /* set the '=' between mib name and mib value to end of string character for call to metaname2did */ textbuf = strchr(textbuf, '='); if (textbuf == NULL) { *((UINT32 *)(item->data)) = 0UL; item->status = P80211ENUM_msgitem_status_incomplete_itemdata; return; } *textbuf = '\0'; /* get DID of mib item based on mib name */ mibdid = p80211_metaname2did(mib_catlist,mibstr); if (mibdid == 0UL) { *((UINT32 *)(item->data)) = 0UL; item->status = P80211ENUM_msgitem_status_invalid_mib_did; return; } /* put '=' back for call to mib's fromtext function */ *textbuf = '='; mibmeta = p80211_did2item(mib_catlist, mibdid); if (mibmeta == NULL) { *((UINT32 *)(item->data)) = 0UL; item->status = P80211ENUM_msgitem_status_invalid_mib_did; return; } if (mibmeta->fromtextptr == NULL) { *((UINT32 *)(item->data)) = 0UL; item->status = P80211ENUM_msgitem_status_missing_conv_func; return; } (*(mibmeta->fromtextptr)) (mib_catlist, mibdid, item->data, mibstr); item->status = ((p80211itemd_t *)(item->data))->status; return; } /*---------------------------------------------------------------- * p80211_isvalid_getmibattribute * * This function checks the validity of the data portion of the * mibattribute DID-LEN-DATA triple. The DATA portion of the * mibattribute's "DID-LEN-DATA" triple is itself a "DID-LEN-DATA" * triple storing the mib item's did, length and data, so it's this * "data" that is actually checked for validity. * * Arguments: * metalist pointer to a category metadata list * did complete, validated, DID. * itembuf item triple {DID, len, value}. * * Returns: * 0 - data in itembuf is invalid * ~0 - data in itembuf is valid ----------------------------------------------------------------*/ UINT32 p80211_isvalid_getmibattribute( catlistitem_t *metalist, UINT32 did, UINT8 *itembuf ) { UINT32 result = 0; p80211meta_t *msgmeta = NULL; p80211meta_t *mibmeta = NULL; p80211itemd_t *item = (p80211itemd_t*)itembuf; p80211itemd_t *mibitem; if ( item->status == P80211ENUM_msgitem_status_data_ok ) { if ( (msgmeta = p80211_did2item(metalist, did)) != NULL ) { /* set up the pointers */ mibitem = (p80211itemd_t *)(item->data); if ( (mibmeta = p80211_did2item(mib_catlist, mibitem->did)) != NULL ) { result = 1; } else { item->status = P80211ENUM_msgitem_status_invalid_mib_did; } } else { item->status = P80211ENUM_msgitem_status_invalid_msg_did; } } return result; } /*---------------------------------------------------------------- * p80211_isvalid_setmibattribute * * This function checks the validity of the data portion of the * mibattribute DID-LEN-DATA triple. The DATA portion of the * mibattribute's "DID-LEN-DATA" triple is itself a "DID-LEN-DATA" * triple storing the mib item's did, length and data, so it's this * "data" that is actually checked for validity. * * Arguments: * metalist pointer to a category metadata list * did complete, validated, DID. * itembuf item triple {DID, len, value}. * * Returns: * 0 - data in itembuf is invalid * ~0 - data in itembuf is valid ----------------------------------------------------------------*/ UINT32 p80211_isvalid_setmibattribute( catlistitem_t *metalist, UINT32 did, UINT8 *itembuf ) { UINT32 result = 0; p80211meta_t *msgmeta = NULL; p80211meta_t *mibmeta = NULL; p80211itemd_t *item = (p80211itemd_t*)itembuf; p80211itemd_t *mibitem; if ( item->status == P80211ENUM_msgitem_status_data_ok ) { if ( (msgmeta = p80211_did2item(metalist, did)) != NULL ) { /* set up the pointers */ mibitem = (p80211itemd_t *)(item->data); if ( (mibmeta = p80211_did2item(mib_catlist, mibitem->did)) != NULL ) { /* call the valid function for the mib */ if ( mibmeta->validfunptr != NULL ) { if ( (*(mibmeta->validfunptr)) (mib_catlist, mibitem->did, (UINT8 *)mibitem) ) { result = 1; } else if ( (mibitem->status) != P80211ENUM_msgitem_status_data_ok ) { item->status = mibitem->status; } } else { item->status = P80211ENUM_msgitem_status_missing_valid_func; } } else { item->status = P80211ENUM_msgitem_status_invalid_mib_did; } } else { item->status = P80211ENUM_msgitem_status_invalid_msg_did; } } return result; } /*---------------------------------------------------------------- * p80211_totext_intarray * * UINT32[] ==> %d,%d,%d,... * * Converts an array of UINT32's to a comma-separated list. The number * of array elements is taken from the "maxlen" field of the DID metadata. * * Arguments: * metalist pointer to a category metadata list * did complete, validated, DID. * itembuf item triple {DID, len, value}. * textbuf (out) character buffer to receive textual * representation. * * Returns: * nothing * * Side effects: * Writes the converted value to the buffer pointed at by * textbuf. ----------------------------------------------------------------*/ void p80211_totext_intarray( catlistitem_t *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ) { p80211meta_t *meta; p80211itemd_t *item; UINT32 *data; int i; char *buf, error_msg[MSG_BUFF_LEN]; *textbuf = '\0'; item = (p80211itemd_t *) itembuf; data = (UINT32 *) item->data; meta = p80211_did2item(metalist, did); if (meta == NULL) { p80211_error2text(P80211ENUM_msgitem_status_invalid_msg_did, error_msg); sprintf(textbuf, "0x%08x=\"%s\"", did, error_msg); return; } if (item->status != P80211ENUM_msgitem_status_data_ok) { p80211_error2text(item->status, error_msg); sprintf(textbuf, "%s=\"%s\"", meta->name, error_msg); return; } if (item->did == 0UL) { sprintf(textbuf, "%s=%s", meta->name, NOT_SUPPORTED); return; } buf = textbuf + sprintf(textbuf, "%s=", meta->name); for (i = 0; i < meta->maxlen; i++) buf += sprintf(buf, (i == 0) ? "%u" : ",%u", data[i]); return; } /*---------------------------------------------------------------- * p80211_fromtext_intarray * * %d,%d,%d,... ==> UINT32[] * * Converts a C string containing the "=,,..." format * to a wlan data item triple. The "values" must be integers. The number * of array elements is taken from the "maxlen" field of the DID metadata. * There must be at least 1 element in the array. * * Arguments: * metalist pointer to a category metadata list * did complete, validated, DID. * itembuf (out) item triple {DID, len, value}. * textbuf character buffer containing textual representation. * * Returns: * nothing * * Side effects: * Writes the converted value to the buffer pointed at by * itembuf. ----------------------------------------------------------------*/ void p80211_fromtext_intarray( catlistitem_t *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ) { p80211meta_t *meta; p80211itemd_t *item; UINT32 *data; int cnt; char *buf, *end, dlm; item = (p80211itemd_t *) itembuf; data = (UINT32 *) item->data; meta = p80211_did2item(metalist, did); if (meta == NULL) { item->did = did; item->len = sizeof(int); item->status = P80211ENUM_msgitem_status_invalid_itemname; return; } /* ** Set the DID and OR in the partial DID for safety. */ item->did = did | meta->did; item->len = p80211item_maxdatalen(metalist, item->did); /* ** Skip past the item name to its value before converting. The ** delimiter will be '='. */ dlm = '='; buf = strchr(textbuf, dlm); if (buf == NULL) { memset(data, 0, item->len); item->status = P80211ENUM_msgitem_status_missing_itemdata; return; } /* ** Keep reading array elements... */ cnt = 0; while (1) { /* ** Quit if we now have all array elements. */ if (cnt >= meta->maxlen) break; /* ** If we're not pointing at the delimiter, then something went ** wrong. Note that the first delimiter will be '=' and all ** subsequent delimiters will be ','. Skip past the delimiter ** and any following whitespace. */ if (*buf != dlm) goto invalid; dlm = ','; buf++; buf += strspn(buf, " \t\n\r\f\v"); /* ** Get the next array element. Make sure that at least ** something was found (i.e. end != buf). Skip any trailing ** whitespace. This should leave us at either the next ',' or ** at '\0'. */ data[cnt] = strtol(buf, &end, 10); if (end == buf) goto invalid; cnt++; buf = end + strspn(end, " \t\n\r\f\v"); } /* ** Make sure there is no left-over stuff at the end of the sting. */ if (*buf != '\0') goto invalid; item->status = P80211ENUM_msgitem_status_data_ok; return; invalid: memset(data, 0, item->len); item->status = P80211ENUM_msgitem_status_invalid_itemdata; return; } /*---------------------------------------------------------------- * p80211_isvalid_intarray * * Tests an item triple for valid range. Uses the validation * information in the metadata. All values are valid, so this * function always returns success. * * Arguments: * metalist pointer to a category metadata list * did complete, validated, DID. * itembuf item triple {DID, len, value}. * * Returns: * 0 - data in itembuf is invalid * ~0 - data in itembuf is valid ----------------------------------------------------------------*/ UINT32 p80211_isvalid_intarray( catlistitem_t *metalist, UINT32 did, UINT8 *itembuf ) { UINT32 result = 0; p80211meta_t *meta; p80211itemd_t *item = (p80211itemd_t*)itembuf; if ( item->status == P80211ENUM_msgitem_status_data_ok ) { /* collect the metadata item */ if ( (meta = p80211_did2item(metalist, did)) != NULL ) { /* since integers aren't bounded, there's nothing to check */ result = 1; } else { item->status = P80211ENUM_msgitem_status_invalid_did; } } return result; } /*---------------------------------------------------------------- * p80211_totext_bitarray * * UINT32 ==> %d,%d,%d,... * * Converts the first "maxlen" bits of a UINT32 to a comma-separated list * of bit numbers of the bits which are set. Other bits are ignored. * * Arguments: * metalist pointer to a category metadata list * did complete, validated, DID. * itembuf item triple {DID, len, value}. * textbuf (out) character buffer to receive textual * representation. * * Returns: * nothing * * Side effects: * Writes the converted value to the buffer pointed at by * textbuf. ----------------------------------------------------------------*/ void p80211_totext_bitarray( catlistitem_t *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ) { p80211meta_t *meta; p80211itemd_t *item; UINT32 array; int found, i; char *buf, error_msg[MSG_BUFF_LEN]; *textbuf = '\0'; item = (p80211itemd_t *) itembuf; meta = p80211_did2item(metalist, did); if (meta == NULL) { p80211_error2text(P80211ENUM_msgitem_status_invalid_msg_did, error_msg); sprintf(textbuf, "0x%08x=\"%s\"", did, error_msg); return; } if (item->status != P80211ENUM_msgitem_status_data_ok) { p80211_error2text(item->status, error_msg); sprintf(textbuf, "%s=\"%s\"", meta->name, error_msg); return; } if (item->did == 0UL) { sprintf(textbuf, "%s=%s", meta->name, NOT_SUPPORTED); return; } array = *((UINT32 *) item->data); buf = textbuf + sprintf(textbuf, "%s=", meta->name); found = 0; for (i = meta->min; i <= meta->max; i++) if (array & (0x1 << i)) { found = 1; buf += sprintf(buf, "%u,", (UINT32) i); } if (found != 0) *(buf-1) = '\0'; return; } /*---------------------------------------------------------------- * p80211_fromtext_bitarray * * %d,%d,%d,... ==> UINT32 * * Converts a C string containing the "=,,..." format * to a wlan data item triple. Bit numbers must be less than "maxlen". * * The C string format is always "=,,,...". * * Arguments: * metalist pointer to a category metadata list * did complete, validated, DID. * itembuf (out) item triple {DID, len, value}. * textbuf character buffer containing textual representation. * * Returns: * nothing * * Side effects: * Writes the converted value to the buffer pointed at by * itembuf. ----------------------------------------------------------------*/ void p80211_fromtext_bitarray( catlistitem_t *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ) { p80211meta_t *meta; p80211itemd_t *item; UINT32 array, value; item = (p80211itemd_t *) itembuf; meta = p80211_did2item(metalist, did); if (meta == NULL) { item->did = did; item->len = sizeof(int); item->status = P80211ENUM_msgitem_status_invalid_itemname; return; } /* ** Set the DID and OR in the partial DID for safety. */ item->did = did | meta->did; item->len = p80211item_maxdatalen(metalist, item->did); /* ** Skip past the item name to its value before converting. */ textbuf = strchr(textbuf, '='); if (textbuf == NULL) { *((UINT32 *) item->data) = 0; item->status = P80211ENUM_msgitem_status_missing_itemdata; return; } array = 0; while (textbuf != NULL) { /* OK, got the '=' or ',', bump to the next char */ textbuf++; if (textbuf[0] == '\0') break; if (sscanf(textbuf, "%u", &value) != 1) { *((UINT32 *) item->data) = 0; item->status = P80211ENUM_msgitem_status_invalid_itemdata; return; } if (value < meta->min || value > meta->max) { *((UINT32 *) item->data) = 0; item->status = P80211ENUM_msgitem_status_invalid_itemdata; return; } array |= 0x1 << value; textbuf = strchr(textbuf, ','); } *((UINT32 *) item->data) = array; item->status = P80211ENUM_msgitem_status_data_ok; return; } /*---------------------------------------------------------------- * p80211_isvalid_bitarray * * Tests an item triple for valid range. Uses the validation * information in the metadata. * * Arguments: * metalist pointer to a category metadata list * did complete, validated, DID. * itembuf item triple {DID, len, value}. * * Returns: * 0 - data in itembuf is invalid * ~0 - data in itembuf is valid ----------------------------------------------------------------*/ UINT32 p80211_isvalid_bitarray( catlistitem_t *metalist, UINT32 did, UINT8 *itembuf ) { UINT32 result = 0; p80211meta_t *meta; p80211itemd_t *item = (p80211itemd_t*)itembuf; UINT32 i, value, mask; if ( item->status == P80211ENUM_msgitem_status_data_ok ) { /* collect the metadata item */ if ( (meta = p80211_did2item(metalist, did)) != NULL ) { mask = 0; for (i = meta->min; i <= meta->max; i++) mask |= 1 << i; value = *((UINT32 *)(item->data)); if ( value == (value & mask) ) { result = 1; } else { item->status = P80211ENUM_msgitem_status_invalid_itemdata; } } else { item->status = P80211ENUM_msgitem_status_invalid_did; } } return result; } /*---------------------------------------------------------------- * p80211_totext_macarray * * Converts an array of MAC addresses to a comma-separated list. * * Arguments: * metalist pointer to a category metadata list * did complete, validated, DID. * itembuf item triple {DID, len, value}. * textbuf (out) character buffer to receive textual * representation. * * Returns: * nothing * * Side effects: * Writes the converted value to the buffer pointed at by * textbuf. ----------------------------------------------------------------*/ void p80211_totext_macarray( catlistitem_t *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ) { p80211meta_t *meta; p80211itemd_t *item; p80211macarray_t *macarray; int i, cnt; char error_msg[MSG_BUFF_LEN]; *textbuf = '\0'; item = (p80211itemd_t *) itembuf; meta = p80211_did2item(metalist, did); if (meta == NULL) { p80211_error2text(P80211ENUM_msgitem_status_invalid_msg_did, error_msg); sprintf(textbuf, "0x%08x=\"%s\"", did, error_msg); return; } if (item->status != P80211ENUM_msgitem_status_data_ok) { p80211_error2text(item->status, error_msg); sprintf(textbuf, "%s=\"%s\"", meta->name, error_msg); return; } if (item->did == 0UL) { sprintf(textbuf, "%s=%s", meta->name, NOT_SUPPORTED); return; } macarray = (p80211macarray_t *) item->data; cnt = sprintf(textbuf, "%s=", meta->name); for (i = 0; i < macarray->cnt; i++) cnt += sprintf(textbuf+cnt, (i==0) ? "%02x:%02x:%02x:%02x:%02x:%02x" : ",%02x:%02x:%02x:%02x:%02x:%02x", (UINT) macarray->data[i][0], (UINT) macarray->data[i][1], (UINT) macarray->data[i][2], (UINT) macarray->data[i][3], (UINT) macarray->data[i][4], (UINT) macarray->data[i][5]); return; } /*---------------------------------------------------------------- * p80211_fromtext_macarray * * Converts a C string containing the "=,,..." format * to a wlan data item triple. * * The C string format is always "=,,,...". * * Arguments: * metalist pointer to a category metadata list * did complete, validated, DID. * itembuf (out) item triple {DID, len, value}. * textbuf character buffer containing textual representation. * * Returns: * nothing * * Side effects: * Writes the converted value to the buffer pointed at by * itembuf. ----------------------------------------------------------------*/ void p80211_fromtext_macarray( catlistitem_t *metalist, UINT32 did, UINT8 *itembuf, char *textbuf ) { p80211meta_t *meta; p80211itemd_t *item; p80211macarray_t *macarray; int cnt, x1, x2, x3, x4, x5, x6; item = (p80211itemd_t *) itembuf; meta = p80211_did2item(metalist, did); if (meta == NULL) { item->did = did; item->len = sizeof(int); item->status = P80211ENUM_msgitem_status_invalid_itemname; return; } /* ** Set the DID and OR in the partial DID for safety. */ item->did = did | meta->did; item->len = p80211item_maxdatalen(metalist, item->did); /* ** Skip past the item name to its value before converting. */ macarray = (p80211macarray_t *) item->data; macarray->cnt = 0; textbuf = strchr(textbuf, '='); if (textbuf == NULL) { item->status = P80211ENUM_msgitem_status_missing_itemdata; return; } cnt = 0; while (textbuf != NULL) { /* OK, got the '=' or ',', bump to the next char */ textbuf++; if (textbuf[0] == '\0') break; if (cnt >= meta->maxlen) { item->status = P80211ENUM_msgitem_status_invalid_itemdata; return; } if (sscanf(textbuf, "%x:%x:%x:%x:%x:%x", &x1, &x2, &x3, &x4, &x5, &x6) != 6) { item->status = P80211ENUM_msgitem_status_invalid_itemdata; return; } macarray->data[cnt][0] = (UINT8) x1; macarray->data[cnt][1] = (UINT8) x2; macarray->data[cnt][2] = (UINT8) x3; macarray->data[cnt][3] = (UINT8) x4; macarray->data[cnt][4] = (UINT8) x5; macarray->data[cnt][5] = (UINT8) x6; cnt++; textbuf = strchr(textbuf, ','); } macarray->cnt = cnt; item->status = P80211ENUM_msgitem_status_data_ok; return; } /*---------------------------------------------------------------- * p80211_isvalid_macarray * * Tests an item triple for valid range. Uses the validation * information in the metadata. All values are valid, so this * function always returns success. * * Arguments: * metalist pointer to a category metadata list * did complete, validated, DID. * itembuf item triple {DID, len, value}. * * Returns: * 0 - data in itembuf is invalid * ~0 - data in itembuf is valid ----------------------------------------------------------------*/ UINT32 p80211_isvalid_macarray( catlistitem_t *metalist, UINT32 did, UINT8 *itembuf ) { UINT32 result = 0; p80211meta_t *meta; p80211itemd_t *item = (p80211itemd_t*)itembuf; if ( item->status == P80211ENUM_msgitem_status_data_ok ) { /* collect the metadata item */ if ( (meta = p80211_did2item(metalist, did)) != NULL ) { /* since integers aren't bounded, there's nothing to check */ result = 1; } else { item->status = P80211ENUM_msgitem_status_invalid_did; } } return result; } /*---------------------------------------------------------------- * p80211_error2text * * This function converts an error code into an appropriate error * string. * * Arguments: * err_code error code reflecting index into * the error enumerated list. * err_str (out) will contain the appropriate * error string. * * Returns: * Nothing ----------------------------------------------------------------*/ void p80211_error2text( int err_code, char *err_str ) { p80211enum_int2text(&MKENUMNAME(msgitem_status), err_code, err_str); } /*--------------------------------------------------------------------*/ /* Item enumerations */ /* The following arrays list the numbers and names for each of the */ /* enumerations present in the 802.11 MIB and MLME. */ MKENUMPAIRLIST(truth) { MKENUMPAIR( 0, "false" ), MKENUMPAIR( 1, "true") }; MKENUM(truth); MKENUMPAIRLIST(ifstate) { MKENUMPAIR( 0, "disable" ), MKENUMPAIR( 1, "fwload"), MKENUMPAIR( 2, "enable") }; MKENUM(ifstate); MKENUMPAIRLIST(powermgmt) { MKENUMPAIR( 1, "active" ), MKENUMPAIR( 2, "powersave" ) }; MKENUM(powermgmt); MKENUMPAIRLIST(bsstype) { MKENUMPAIR( 1, "infrastructure" ), MKENUMPAIR( 2, "independent" ), MKENUMPAIR( 3, "any" ) }; MKENUM(bsstype); MKENUMPAIRLIST(authalg) { MKENUMPAIR( 1, "opensystem" ), MKENUMPAIR( 2, "sharedkey" ), MKENUMPAIR( 3, "not_set" ) }; MKENUM(authalg); MKENUMPAIRLIST(phytype) { MKENUMPAIR( 1, "fhss" ), MKENUMPAIR( 2, "dsss" ), MKENUMPAIR( 3, "irbaseband" ) }; MKENUM(phytype); MKENUMPAIRLIST(temptype) { MKENUMPAIR( 1, "commercial" ), MKENUMPAIR( 2, "industrial" ) }; MKENUM(temptype); MKENUMPAIRLIST(regdomain) { MKENUMPAIR( 0x10, "fcc" ), MKENUMPAIR( 0x20, "doc" ), MKENUMPAIR( 0x30, "etsi" ), MKENUMPAIR( 0x31, "spain" ), MKENUMPAIR( 0x32, "france" ), MKENUMPAIR( 0x40, "mkk" ) }; MKENUM(regdomain); MKENUMPAIRLIST(ccamode) { MKENUMPAIR( 0x01, "edonly" ), MKENUMPAIR( 0x02, "csonly" ), MKENUMPAIR( 0x04, "edandcs" ), MKENUMPAIR( 0x08, "cswithtimer" ), MKENUMPAIR( 0x0f, "hrcsanded" ) }; MKENUM(ccamode); MKENUMPAIRLIST(diversity) { MKENUMPAIR( 1, "fixedlist" ), MKENUMPAIR( 2, "notsupported" ), MKENUMPAIR( 3, "dynamic" ) }; MKENUM(diversity); MKENUMPAIRLIST(scantype) { MKENUMPAIR( 1, "active" ), MKENUMPAIR( 2, "passive" ), MKENUMPAIR( 3, "both" ), }; MKENUM(scantype); MKENUMPAIRLIST(resultcode) { MKENUMPAIR( P80211ENUM_resultcode_success, "success" ), MKENUMPAIR( P80211ENUM_resultcode_invalid_parameters, "invalid_parameters" ), MKENUMPAIR( P80211ENUM_resultcode_not_supported, "not_supported" ), MKENUMPAIR( P80211ENUM_resultcode_timeout, "timeout" ), MKENUMPAIR( P80211ENUM_resultcode_too_many_req, "too_many_req" ), MKENUMPAIR( P80211ENUM_resultcode_refused, "refused" ), MKENUMPAIR( P80211ENUM_resultcode_bss_already, "bss_already" ), MKENUMPAIR( P80211ENUM_resultcode_invalid_access, "invalid_access" ), MKENUMPAIR( P80211ENUM_resultcode_invalid_mibattribute, "invalid_mibattribute" ), MKENUMPAIR( P80211ENUM_resultcode_cant_set_readonly_mib, "cant_set_readonly_mib" ), MKENUMPAIR( P80211ENUM_resultcode_implementation_failure, "implementation_failure" ), MKENUMPAIR( P80211ENUM_resultcode_cant_get_writeonly_mib, "cant_get_writeonly_mib" ) }; MKENUM(resultcode); /*--------------------------------------------------------------------*/ /* Note: the following names are from the 802.11 SDL, the comment */ /* lists the 802.11 Chapter 7 description. */ MKENUMPAIRLIST(reason) { MKENUMPAIR( 1, "unspec_reason" ), /* Unspecified Reason */ MKENUMPAIR( 2, "auth_not_valid" ), /* Previous authentication no longer valid */ MKENUMPAIR( 3, "deauth_lv_ss" ), /* Deauthenticated because sending station is leaving (has left) IBSS or ESS */ MKENUMPAIR( 4, "inactivity" ), /* Disassociated due to inactivity */ MKENUMPAIR( 5, "ap_overload" ), /* Disassociated because AP is unable to handle all currently associated stations */ MKENUMPAIR( 6, "class23_err" ), /* Class 2 or 3 frame received from nonauthenticated station */ MKENUMPAIR( 7, "class3_err" ), /* Class 3 frame received from nonassociated station */ MKENUMPAIR( 8, "disas_lv_ss" ), /* Disassociated because sending station is leaving (has left BSS) */ MKENUMPAIR( 9, "asoc_not_auth" ) /* Station requesting (re)association is not authenticated with responding station */ }; MKENUM(reason); /*--------------------------------------------------------------------*/ /* Note: the following names are from the 802.11 SDL, the comment */ /* lists the 802.11 Chapter 7 description. */ MKENUMPAIRLIST(status) { MKENUMPAIR( 0, "successful" ), /* Successful */ MKENUMPAIR( 1, "unspec_failure" ), /* Unspecified failure */ MKENUMPAIR( 10, "unsup_cap" ), /* Cannot support all requested capabilities in Capability Information field */ MKENUMPAIR( 11, "reasoc_no_asoc" ), /* Reassociation denied due to inability to confirm that association exists */ MKENUMPAIR( 12, "fail_other" ), /* Association denied due to to reason outside scope of this standard */ MKENUMPAIR( 13, "unspt_alg" ), /* Responding station does not support the specified authentication algorithm */ MKENUMPAIR( 14, "auth_seq_fail" ), /* Received and authentication frame with authentication transaction sequence number out of expected sequence */ MKENUMPAIR( 15, "chlng_fail" ), /* Authentication rejected because of challenge failure */ MKENUMPAIR( 16, "auth_timeout" ), /* Authentication rejected due to timeout waiting for next frame in sequence */ MKENUMPAIR( 17, "ap_full" ), /* Association denied because AP is unable to handle additional associated stations */ MKENUMPAIR( 18, "unsup_rate" ) /* Association denied due to requesting station not supporting all of the data rates in the BSSBasicRateSet parameter */ }; MKENUM(status); /*--------------------------------------------------------------------*/ /* Note: the following are various error codes for command line input */ MKENUMPAIRLIST(msgitem_status) { MKENUMPAIR( 1, "no_value"), /* the argument data doesn't have a value; it wasn't set */ MKENUMPAIR( 2, "argument_item_name_is_invalid" ), /* the argument name doesn't exist in any item name */ MKENUMPAIR( 3, "argument_item_data_is_invalid" ), /* the argument data isn't valid */ MKENUMPAIR( 4, "argument_item_data_is_missing" ), /* the argument data is missing */ MKENUMPAIR( 5, "argument_item_data_is_incomplete" ), /* the argument data is incomplete */ MKENUMPAIR( 6, "invalid_message_did_for_item" ), /* the message did is invalid for argument name */ MKENUMPAIR( 7, "invalid_mib_did_for_item" ), /* the mib did is invalid for argument name */ MKENUMPAIR( 8, "conversion_function_missing_for_item" ), /* a conversion function for the item doesn't exist */ MKENUMPAIR( 9, "data_string_too_long" ), /* the data string exceeds maximum allowed length */ MKENUMPAIR( 10, "data_out_of_range" ), /* the data is out of the allowed range */ MKENUMPAIR( 11, "data_string_too_short" ), /* the data string less than required length */ MKENUMPAIR( 12, "validity_function_missing_for_item" ), /* a validity function for the item doesn't exist */ MKENUMPAIR( 13, "invalid_for_unknown_reason" ), /* data or message is invalid for an unknown reason not caught */ MKENUMPAIR( 14, "invalid_did" ), /* invalid did; not certain if it's a msg or mib did */ MKENUMPAIR( 15, "print_function_missing_for_item" ) /* a print function for the item doesn't exist */ }; MKENUM(msgitem_status); MKENUMPAIRLIST(lnxroam_reason) { MKENUMPAIR(0, "unknown"), MKENUMPAIR(1, "beacon"), MKENUMPAIR(2, "signal"), MKENUMPAIR(3, "txretry"), MKENUMPAIR(4, "notjoined") }; MKENUM(lnxroam_reason); MKENUMPAIRLIST(p2preamble) { MKENUMPAIR( 0, "long"), MKENUMPAIR( 2, "short"), MKENUMPAIR( 3, "mixed") }; MKENUM(p2preamble); linux-wlan-ng-0.2.9+dfsg/src/shared/p80211metamib.c0000644000175000017500000041507611024763162021145 0ustar tormodtormod/* src/shared/p80211metamib.c * * Defines the metadata for the MIB items * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- * * This file contains the arrays defining the metadata for each 802.11 * MIB items. * * This file contains only initialized variable definitions, no functions. * -------------------------------------------------------------------- * * The following MIB's are read-write according to the IEEE 802.11 standard * but seem to be read-only with the Prism2. They have been made read-only * here: * * dot11AssociationResponseTimeOut * dot11ShortRetryLimit * dot11LongRetryLimit * dot11MaxTransmitMSDULifetime * dot11MaxReceiveLifetime * dot11CurrentChannel * dot11CurrentCCAMode * * The following MIB's do not seem to be implemented by the Prism2. They * have been flagged as unimplemented (i.e. neither read nor write) here: * * dot11AuthenticationResponseTimeOut (Station) * dot11MediumOccupancyLimit (AP) * dot11CFPPeriod (AP) * dot11CFPMaxDuration (AP) * p2EarlyBeacon (AP) * p2CnfMediumOccupancyLimit (AP) * p2CnfCFPPeriod (AP) * p2CnfCFPMaxDuration (AP) * p2CnfCFPFlags (AP) * p2CnfPriorityQUsage (Station & AP) * p2CnfTIMCtrl (Station & AP) * p2CnfThirty2Tally (Station & AP) * p2CnfExcludeLongPreamble (AP) * p2CnfAuthenticationRspTO (Station) */ /*================================================================*/ /* System Includes */ #include /*================================================================*/ /* Project Includes */ #include #include #include #include /*================================================================*/ /* Local Constants */ /*================================================================*/ /* Local Macros */ /*================================================================*/ /* Local Types */ /*================================================================*/ /* Local Static Definitions */ extern UINT32 MKMIBMETASIZE(p80211Table); p80211meta_t MKMIBMETANAME(p80211Table)[] = { { /* name */ (char *)&(MKMIBMETASIZE(p80211Table)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("p80211_ifstate"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(ifstate), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, }; UINT32 MKMIBMETASIZE(p80211Table) = sizeof(MKMIBMETANAME(p80211Table)) / sizeof(p80211meta_t); extern UINT32 MKMIBMETASIZE(dot11StationConfigTable); p80211meta_t MKMIBMETANAME(dot11StationConfigTable)[] = { { /* name */ (char *)&(MKMIBMETASIZE(dot11StationConfigTable)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("dot11StationID"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* ??????? Appears to be not supported by Prism2! ??????? */ /* name */ MKITEMNAME("dot11MediumOccupancyLimit"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 1000, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11CFPollable"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* ??????? Appears to be not supported by Prism2! ??????? */ /* name */ MKITEMNAME("dot11CFPPeriod"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 255, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* ??????? Appears to be not supported by Prism2! ??????? */ /* name */ MKITEMNAME("dot11CFPMaxDuration"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 65535, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* ??????? Appears to be not supported by Prism2! ??????? */ /* name */ MKITEMNAME("dot11AuthenticationResponseTimeOut"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11PrivacyOptionImplemented"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("dot11PowerManagementMode"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(powermgmt), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("dot11DesiredSSID"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 32, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_displaystr, /* fromtextptr */ p80211_fromtext_displaystr, /* validfunptr */ p80211_isvalid_displaystr }, { /* name */ MKITEMNAME("dot11DesiredBSSType"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(bsstype), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("dot11OperationalRateSet"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 126, /* minlen */ 1, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11BeaconPeriod"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 1, /* max */ 65535, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11DTIMPeriod"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 1, /* max */ 255, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* ??????? Read-write in 802.11 but read-only for Prism2! ??????? */ /* name */ MKITEMNAME("dot11AssociationResponseTimeOut"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11DisassociateReason"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 1, /* max */ 9, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11DisassociateStation"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11DeauthenticateReason"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 1, /* max */ 9, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11DeauthenticateStation"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11AuthenticateFailStatus"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 1, /* max */ 18, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11AuthenticateFailStation"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr } }; UINT32 MKMIBMETASIZE(dot11StationConfigTable) = sizeof(MKMIBMETANAME(dot11StationConfigTable)) / sizeof(p80211meta_t); extern UINT32 MKMIBMETASIZE(dot11AuthenticationAlgorithmsTable); p80211meta_t MKMIBMETANAME(dot11AuthenticationAlgorithmsTable)[] = { { /* name */ (char *)&(MKMIBMETASIZE(dot11AuthenticationAlgorithmsTable)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("dot11AuthenticationAlgorithm1"), /* did */ P80211DID_ACCESS_READ | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(authalg), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("dot11AuthenticationAlgorithmsEnable1"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("dot11AuthenticationAlgorithm2"), /* did */ P80211DID_ACCESS_READ | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(authalg), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("dot11AuthenticationAlgorithmsEnable2"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("dot11AuthenticationAlgorithm3"), /* did */ P80211DID_ACCESS_READ | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(authalg), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("dot11AuthenticationAlgorithmsEnable3"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("dot11AuthenticationAlgorithm4"), /* did */ P80211DID_ACCESS_READ | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(authalg), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("dot11AuthenticationAlgorithmsEnable4"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("dot11AuthenticationAlgorithm5"), /* did */ P80211DID_ACCESS_READ | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(authalg), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("dot11AuthenticationAlgorithmsEnable5"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("dot11AuthenticationAlgorithm6"), /* did */ P80211DID_ACCESS_READ | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(authalg), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("dot11AuthenticationAlgorithmsEnable6"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; UINT32 MKMIBMETASIZE(dot11AuthenticationAlgorithmsTable) = sizeof(MKMIBMETANAME(dot11AuthenticationAlgorithmsTable)) / sizeof(p80211meta_t); extern UINT32 MKMIBMETASIZE(dot11WEPDefaultKeysTable); p80211meta_t MKMIBMETANAME(dot11WEPDefaultKeysTable)[] = { { /* name */ (char *)&(MKMIBMETASIZE(dot11WEPDefaultKeysTable)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("dot11WEPDefaultKey0"), /* did */ P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 13, /* minlen */ 5, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11WEPDefaultKey1"), /* did */ P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 13, /* minlen */ 5, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11WEPDefaultKey2"), /* did */ P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 13, /* minlen */ 5, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11WEPDefaultKey3"), /* did */ P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 13, /* minlen */ 5, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr } }; UINT32 MKMIBMETASIZE(dot11WEPDefaultKeysTable) = sizeof(MKMIBMETANAME(dot11WEPDefaultKeysTable)) / sizeof(p80211meta_t); extern UINT32 MKMIBMETASIZE(dot11WEPKeyMappingsTable); p80211meta_t MKMIBMETANAME(dot11WEPKeyMappingsTable)[] = { { /* name */ (char *)&(MKMIBMETASIZE(dot11WEPKeyMappingsTable)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("dot11WEPKeyMappingIndex"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11WEPKeyMappingAddress"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11WEPKeyMappingWEPOn"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("dot11WEPKeyMappingValue"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 13, /* minlen */ 5, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr } }; UINT32 MKMIBMETASIZE(dot11WEPKeyMappingsTable) = sizeof(MKMIBMETANAME(dot11WEPKeyMappingsTable)) / sizeof(p80211meta_t); extern UINT32 MKMIBMETASIZE(dot11PrivacyTable); p80211meta_t MKMIBMETANAME(dot11PrivacyTable)[] = { { /* name */ (char *)&(MKMIBMETASIZE(dot11PrivacyTable)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("dot11PrivacyInvoked"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("dot11WEPDefaultKeyID"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 3, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11WEPKeyMappingLength"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11ExcludeUnencrypted"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("dot11WEPICVErrorCount"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11WEPExcludedCount"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int } }; UINT32 MKMIBMETASIZE(dot11PrivacyTable) = sizeof(MKMIBMETANAME(dot11PrivacyTable)) / sizeof(p80211meta_t); extern UINT32 MKGRPMETASIZE(dot11smt); grplistitem_t MKGRPMETANAME(dot11smt)[] = { { (char *)&MKGRPMETASIZE(dot11smt), NULL }, { "p80211Table", MKMIBMETANAME(p80211Table), }, { "dot11StationConfigTable", MKMIBMETANAME(dot11StationConfigTable), }, { "dot11AuthenticationAlgorithmsTable", MKMIBMETANAME(dot11AuthenticationAlgorithmsTable) }, { "dot11WEPDefaultKeysTable", MKMIBMETANAME(dot11WEPDefaultKeysTable) }, { "dot11WEPKeyMappingsTable", MKMIBMETANAME(dot11WEPKeyMappingsTable) }, { "dot11PrivacyTable", MKMIBMETANAME(dot11PrivacyTable) } }; UINT32 MKGRPMETASIZE(dot11smt) = sizeof(MKGRPMETANAME(dot11smt)) / sizeof(grplistitem_t); extern UINT32 MKMIBMETASIZE(dot11OperationTable); p80211meta_t MKMIBMETANAME(dot11OperationTable)[] = { { /* name */ (char *)&(MKMIBMETASIZE(dot11OperationTable)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("dot11MACAddress"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11RTSThreshold"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 2347, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* ??????? Read-write in 802.11 but read-only for Prism2! ??????? */ /* name */ MKITEMNAME("dot11ShortRetryLimit"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 1, /* max */ 255, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* ??????? Read-write in 802.11 but read-only for Prism2! ??????? */ /* name */ MKITEMNAME("dot11LongRetryLimit"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 1, /* max */ 255, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11FragmentationThreshold"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 256, /* max */ 2346, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* ??????? Read-write in 802.11 but read-only for Prism2! ??????? */ /* name */ MKITEMNAME("dot11MaxTransmitMSDULifetime"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* ??????? Read-write in 802.11 but read-only for Prism2! ??????? */ /* name */ MKITEMNAME("dot11MaxReceiveLifetime"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11ManufacturerID"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 128, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_displaystr, /* fromtextptr */ p80211_fromtext_displaystr, /* validfunptr */ p80211_isvalid_displaystr }, { /* name */ MKITEMNAME("dot11ProductID"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 128, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_displaystr, /* fromtextptr */ p80211_fromtext_displaystr, /* validfunptr */ p80211_isvalid_displaystr } }; UINT32 MKMIBMETASIZE(dot11OperationTable) = sizeof(MKMIBMETANAME(dot11OperationTable)) / sizeof(p80211meta_t); extern UINT32 MKMIBMETASIZE(dot11CountersTable); p80211meta_t MKMIBMETANAME(dot11CountersTable)[] = { { /* name */ (char *)&(MKMIBMETASIZE(dot11CountersTable)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("dot11TransmittedFragmentCount"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11MulticastTransmittedFrameCount"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11FailedCount"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11RetryCount"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11MultipleRetryCount"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11FrameDuplicateCount"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11RTSSuccessCount"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11RTSFailureCount"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11ACKFailureCount"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11ReceivedFragmentCount"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11MulticastReceivedFrameCount"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11FCSErrorCount"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11TransmittedFrameCount"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11WEPUndecryptableCount"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int } }; UINT32 MKMIBMETASIZE(dot11CountersTable) = sizeof(MKMIBMETANAME(dot11CountersTable)) / sizeof(p80211meta_t); extern UINT32 MKMIBMETASIZE(dot11GroupAddressesTable); p80211meta_t MKMIBMETANAME(dot11GroupAddressesTable)[] = { { /* name */ (char *)&(MKMIBMETASIZE(dot11GroupAddressesTable)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("dot11Address1"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11Address2"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11Address3"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11Address4"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11Address5"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11Address6"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11Address7"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11Address8"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11Address9"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11Address10"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11Address11"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11Address12"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11Address13"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11Address14"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11Address15"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11Address16"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11Address17"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11Address18"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11Address19"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11Address20"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11Address21"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11Address22"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11Address23"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11Address24"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11Address25"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11Address26"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11Address27"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11Address28"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11Address29"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11Address30"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11Address31"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("dot11Address32"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr } }; UINT32 MKMIBMETASIZE(dot11GroupAddressesTable) = sizeof(MKMIBMETANAME(dot11GroupAddressesTable)) / sizeof(p80211meta_t); extern UINT32 MKGRPMETASIZE(dot11mac); grplistitem_t MKGRPMETANAME(dot11mac)[] = { { (char *)&MKGRPMETASIZE(dot11mac), NULL }, { "dot11OperationTable", MKMIBMETANAME(dot11OperationTable) }, { "dot11CountersTable", MKMIBMETANAME(dot11CountersTable) }, { "dot11GroupAddressesTable", MKMIBMETANAME(dot11GroupAddressesTable) } }; UINT32 MKGRPMETASIZE(dot11mac) = sizeof(MKGRPMETANAME(dot11mac)) / sizeof(grplistitem_t); extern UINT32 MKMIBMETASIZE(dot11PhyOperationTable); p80211meta_t MKMIBMETANAME(dot11PhyOperationTable)[] = { { /* name */ (char *)&(MKMIBMETASIZE(dot11PhyOperationTable)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("dot11PHYType"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(phytype), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("dot11CurrentRegDomain"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(regdomain), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("dot11TempType"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(temptype), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("dot11ChannelAgilityPresent"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("dot11ChannelAgilityEnabled"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("dot11ShortPreambleEnabled"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, }; UINT32 MKMIBMETASIZE(dot11PhyOperationTable) = sizeof(MKMIBMETANAME(dot11PhyOperationTable)) / sizeof(p80211meta_t); extern UINT32 MKMIBMETASIZE(dot11PhyAntennaTable); p80211meta_t MKMIBMETANAME(dot11PhyAntennaTable)[] = { { /* name */ (char *)&(MKMIBMETASIZE(dot11PhyAntennaTable)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("dot11CurrentTxAntenna"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 1, /* max */ 255, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11DiversitySupport"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(diversity), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("dot11CurrentRxAntenna"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 1, /* max */ 255, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int } }; UINT32 MKMIBMETASIZE(dot11PhyAntennaTable) = sizeof(MKMIBMETANAME(dot11PhyAntennaTable)) / sizeof(p80211meta_t); extern UINT32 MKMIBMETASIZE(dot11PhyTxPowerTable); p80211meta_t MKMIBMETANAME(dot11PhyTxPowerTable)[] = { { /* name */ (char *)&(MKMIBMETASIZE(dot11PhyTxPowerTable)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("dot11NumberSupportedPowerLevels"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 1, /* max */ 8, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11TxPowerLevel1"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 10000, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11TxPowerLevel2"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 10000, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11TxPowerLevel3"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 10000, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11TxPowerLevel4"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 10000, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11TxPowerLevel5"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 10000, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11TxPowerLevel6"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 10000, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11TxPowerLevel7"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 10000, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11TxPowerLevel8"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 10000, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11CurrentTxPowerLevel"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 1, /* max */ 8, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int } }; UINT32 MKMIBMETASIZE(dot11PhyTxPowerTable) = sizeof(MKMIBMETANAME(dot11PhyTxPowerTable)) / sizeof(p80211meta_t); extern UINT32 MKMIBMETASIZE(dot11PhyFHSSTable); p80211meta_t MKMIBMETANAME(dot11PhyFHSSTable)[] = { { /* name */ (char *)&(MKMIBMETASIZE(dot11PhyFHSSTable)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("dot11HopTime"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11CurrentChannelNumber"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 99, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11MaxDwellTime"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 1, /* max */ 65535, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11CurrentDwellTime"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 1, /* max */ 65535, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11CurrentSet"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 1, /* max */ 255, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11CurrentPattern"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 255, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11CurrentIndex"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 1, /* max */ 255, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int } }; UINT32 MKMIBMETASIZE(dot11PhyFHSSTable) = sizeof(MKMIBMETANAME(dot11PhyFHSSTable)) / sizeof(p80211meta_t); extern UINT32 MKMIBMETASIZE(dot11PhyDSSSTable); p80211meta_t MKMIBMETANAME(dot11PhyDSSSTable)[] = { { /* name */ (char *)&(MKMIBMETASIZE(dot11PhyDSSSTable)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* ??????? Read-write in 802.11 but read-only for Prism2! ??????? */ /* name */ MKITEMNAME("dot11CurrentChannel"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 1, /* max */ 14, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11CCAModeSupported"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11CurrentCCAMode"), /* ??????? Read-write in 802.11 but read-only for Prism2! ??????? */ /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(ccamode), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("dot11EDThreshold"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11ShortPreambleOptionImplemented"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("dot11PBCCOptionImplemented"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; UINT32 MKMIBMETASIZE(dot11PhyDSSSTable) = sizeof(MKMIBMETANAME(dot11PhyDSSSTable)) / sizeof(p80211meta_t); extern UINT32 MKMIBMETASIZE(dot11PhyIRTable); p80211meta_t MKMIBMETANAME(dot11PhyIRTable)[] = { { /* name */ (char *)&(MKMIBMETASIZE(dot11PhyIRTable)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("dot11CCAWatchdogTimerMax"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11CCAWatchdogCountMax"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11CCAWatchdogTimerMin"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11CCAWatchdogCountMin"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int } }; UINT32 MKMIBMETASIZE(dot11PhyIRTable) = sizeof(MKMIBMETANAME(dot11PhyIRTable)) / sizeof(p80211meta_t); extern UINT32 MKMIBMETASIZE(dot11RegDomainsSupportedTable); p80211meta_t MKMIBMETANAME(dot11RegDomainsSupportedTable)[] = { { /* name */ (char *)&(MKMIBMETASIZE(dot11RegDomainsSupportedTable)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("dot11RegDomainsSupportIndex"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 1, /* max */ 8, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11RegDomainsSupportValue"), /* did */ P80211DID_ACCESS_READ | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(regdomain), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; UINT32 MKMIBMETASIZE(dot11RegDomainsSupportedTable) = sizeof(MKMIBMETANAME(dot11RegDomainsSupportedTable)) / sizeof(p80211meta_t); extern UINT32 MKMIBMETASIZE(dot11AntennasListTable); p80211meta_t MKMIBMETANAME(dot11AntennasListTable)[] = { { /* name */ (char *)&(MKMIBMETASIZE(dot11AntennasListTable)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("dot11AntennaListIndex"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 1, /* max */ 255, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11SupportedTxAntenna"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("dot11SupportedRxAntenna"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("dot11DiversitySelectionRx"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint } }; UINT32 MKMIBMETASIZE(dot11AntennasListTable) = sizeof(MKMIBMETANAME(dot11AntennasListTable)) / sizeof(p80211meta_t); extern UINT32 MKMIBMETASIZE(dot11SupportedDataRatesTxTable); p80211meta_t MKMIBMETANAME(dot11SupportedDataRatesTxTable)[] = { { /* name */ (char *)&(MKMIBMETASIZE(dot11SupportedDataRatesTxTable)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("dot11SupportedDataRatesTxIndex"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 1, /* max */ 8, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11SupportedDataRatesTxValue"), /* did */ P80211DID_ACCESS_READ | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int } }; UINT32 MKMIBMETASIZE(dot11SupportedDataRatesTxTable) = sizeof(MKMIBMETANAME(dot11SupportedDataRatesTxTable)) / sizeof(p80211meta_t); extern UINT32 MKMIBMETASIZE(dot11SupportedDataRatesRxTable); p80211meta_t MKMIBMETANAME(dot11SupportedDataRatesRxTable)[] = { { /* name */ (char *)&(MKMIBMETASIZE(dot11SupportedDataRatesRxTable)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("dot11SupportedDataRatesRxIndex"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 1, /* max */ 8, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("dot11SupportedDataRatesRxValue"), /* did */ P80211DID_ACCESS_READ | P80211DID_MKISTABLE(P80211DID_ISTABLE_TRUE), /* flags */ 0, /* min */ 2, /* max */ 127, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int } }; UINT32 MKMIBMETASIZE(dot11SupportedDataRatesRxTable) = sizeof(MKMIBMETANAME(dot11SupportedDataRatesRxTable)) / sizeof(p80211meta_t); extern UINT32 MKGRPMETASIZE(dot11phy); grplistitem_t MKGRPMETANAME(dot11phy)[] = { { (char *)&MKGRPMETASIZE(dot11phy), NULL }, { "dot11PhyOperationTable", MKMIBMETANAME(dot11PhyOperationTable) }, { "dot11PhyAntennaTable", MKMIBMETANAME(dot11PhyAntennaTable) }, { "dot11PhyTxPowerTable", MKMIBMETANAME(dot11PhyTxPowerTable) }, { "dot11PhyFHSSTable", MKMIBMETANAME(dot11PhyFHSSTable) }, { "dot11PhyDSSSTable", MKMIBMETANAME(dot11PhyDSSSTable) }, { "dot11PhyIRTable", MKMIBMETANAME(dot11PhyIRTable) }, { "dot11RegDomainsSupportedTable", MKMIBMETANAME(dot11RegDomainsSupportedTable) }, { "dot11AntennasListTable", MKMIBMETANAME(dot11AntennasListTable) }, { "dot11SupportedDataRatesTxTable", MKMIBMETANAME(dot11SupportedDataRatesTxTable) }, { "dot11SupportedDataRatesRxTable", MKMIBMETANAME(dot11SupportedDataRatesRxTable) } }; UINT32 MKGRPMETASIZE(dot11phy) = sizeof(MKGRPMETANAME(dot11phy)) / sizeof(grplistitem_t); extern UINT32 MKMIBMETASIZE(p2Table); p80211meta_t MKMIBMETANAME(p2Table)[] = { { /* name */ (char *)&(MKMIBMETASIZE(p2Table)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("p2MMTx"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* ??????? Appears to be not supported by Prism2! ??????? */ /* name */ MKITEMNAME("p2EarlyBeacon"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("p2ReceivedFrameStatistics"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 31, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_intarray, /* fromtextptr */ p80211_fromtext_intarray, /* validfunptr */ p80211_isvalid_intarray }, { /* name */ MKITEMNAME("p2CommunicationTallies"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 21, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_intarray, /* fromtextptr */ p80211_fromtext_intarray, /* validfunptr */ p80211_isvalid_intarray }, { /* name */ MKITEMNAME("p2Authenticated"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 60, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_macarray, /* fromtextptr */ p80211_fromtext_macarray, /* validfunptr */ p80211_isvalid_macarray }, { /* name */ MKITEMNAME("p2Associated"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 60, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_macarray, /* fromtextptr */ p80211_fromtext_macarray, /* validfunptr */ p80211_isvalid_macarray }, { /* name */ MKITEMNAME("p2PowerSaveUserCount"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2Comment"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 80, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_displaystr, /* fromtextptr */ p80211_fromtext_displaystr, /* validfunptr */ p80211_isvalid_displaystr }, { /* name */ MKITEMNAME("p2AccessMode"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 1, /* max */ 3, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2AccessAllow"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 60, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_macarray, /* fromtextptr */ p80211_fromtext_macarray, /* validfunptr */ p80211_isvalid_macarray }, { /* name */ MKITEMNAME("p2AccessDeny"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 60, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_macarray, /* fromtextptr */ p80211_fromtext_macarray, /* validfunptr */ p80211_isvalid_macarray }, { /* name */ MKITEMNAME("p2ChannelInfoResults"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 70, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_intarray, /* fromtextptr */ p80211_fromtext_intarray, /* validfunptr */ p80211_isvalid_intarray } }; UINT32 MKMIBMETASIZE(p2Table) = sizeof(MKMIBMETANAME(p2Table)) / sizeof(p80211meta_t); extern UINT32 MKMIBMETASIZE(p2Static); p80211meta_t MKMIBMETANAME(p2Static)[] = { { /* name */ (char *)&(MKMIBMETASIZE(p2Static)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("p2CnfPortType"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 1, /* max */ 6, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2CnfOwnMACAddress"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("p2CnfDesiredSSID"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 32, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_displaystr, /* fromtextptr */ p80211_fromtext_displaystr, /* validfunptr */ p80211_isvalid_displaystr }, { /* name */ MKITEMNAME("p2CnfOwnChannel"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 14, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2CnfOwnSSID"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 32, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_displaystr, /* fromtextptr */ p80211_fromtext_displaystr, /* validfunptr */ p80211_isvalid_displaystr }, { /* name */ MKITEMNAME("p2CnfOwnATIMWindow"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 100, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2CnfSystemScale"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 1, /* max */ 3, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2CnfMaxDataLength"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 350, /* max */ 2312, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2CnfWDSAddress"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("p2CnfPMEnabled"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("p2CnfPMEPS"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("p2CnfMulticastReceive"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("p2CnfMaxSleepDuration"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 1, /* max */ 65535, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2CnfPMHoldoverDuration"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 1, /* max */ 1000, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2CnfOwnName"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 32, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_displaystr, /* fromtextptr */ p80211_fromtext_displaystr, /* validfunptr */ p80211_isvalid_displaystr }, { /* name */ MKITEMNAME("p2CnfOwnDTIMPeriod"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 1, /* max */ 65535, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2CnfWDSAddress1"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("p2CnfWDSAddress2"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("p2CnfWDSAddress3"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("p2CnfWDSAddress4"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("p2CnfWDSAddress5"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("p2CnfWDSAddress6"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("p2CnfMulticastPMBuffering"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("p2CnfWEPDefaultKeyID"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 3, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2CnfWEPDefaultKey0"), /* did */ P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 13, /* minlen */ 5, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("p2CnfWEPDefaultKey1"), /* did */ P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 13, /* minlen */ 5, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("p2CnfWEPDefaultKey2"), /* did */ P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 13, /* minlen */ 5, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("p2CnfWEPDefaultKey3"), /* did */ P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 13, /* minlen */ 5, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("p2CnfWEPFlags"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 7, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_bitarray, /* fromtextptr */ p80211_fromtext_bitarray, }, { /* name */ MKITEMNAME("p2CnfAuthentication"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 1, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_bitarray, /* fromtextptr */ p80211_fromtext_bitarray, /* validfunptr */ p80211_isvalid_bitarray }, { /* name */ MKITEMNAME("p2CnfMaxAssociatedStations"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 65535, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2CnfTxControl"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 65535, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2CnfRoamingMode"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 1, /* max */ 3, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2CnfHostAuthentication"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("p2CnfRcvCrcError"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 1, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_bitarray, /* fromtextptr */ p80211_fromtext_bitarray, /* validfunptr */ p80211_isvalid_bitarray }, { /* name */ MKITEMNAME("p2CnfAltRetryCount"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 65535, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2CnfBeaconInterval"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* ??????? Appears to be not supported by Prism2! ??????? */ /* name */ MKITEMNAME("p2CnfMediumOccupancyLimit"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 1000, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* ??????? Appears to be not supported by Prism2! ??????? */ /* name */ MKITEMNAME("p2CnfCFPPeriod"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* ??????? Appears to be not supported by Prism2! ??????? */ /* name */ MKITEMNAME("p2CnfCFPMaxDuration"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* ??????? Appears to be not supported by Prism2! ??????? */ /* name */ MKITEMNAME("p2CnfCFPFlags"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 15, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_bitarray, /* fromtextptr */ p80211_fromtext_bitarray, /* validfunptr */ p80211_isvalid_bitarray }, { /* name */ MKITEMNAME("p2CnfSTAPCFInfo"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 2, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* ??????? Appears to be not supported by Prism2! ??????? */ /* name */ MKITEMNAME("p2CnfPriorityQUsage"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 2, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_intarray, /* fromtextptr */ p80211_fromtext_intarray, /* validfunptr */ p80211_isvalid_intarray }, { /* ??????? Appears to be not supported by Prism2! ??????? */ /* name */ MKITEMNAME("p2CnfTIMCtrl"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* ??????? Appears to be not supported by Prism2! ??????? */ /* name */ MKITEMNAME("p2CnfThirty2Tally"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("p2CnfEnhSecurity"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 1, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_bitarray, /* fromtextptr */ p80211_fromtext_bitarray, /* validfunptr */ p80211_isvalid_bitarray }, { /* name */ MKITEMNAME("p2CnfShortPreamble"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(p2preamble), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* ??????? Appears to be not supported by Prism2! ??????? */ /* name */ MKITEMNAME("p2CnfExcludeLongPreamble"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("p2CnfAuthenticationRspTO"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 20, /* max */ 65535, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2CnfBasicRates"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 3, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_bitarray, /* fromtextptr */ p80211_fromtext_bitarray, /* validfunptr */ p80211_isvalid_bitarray }, { /* name */ MKITEMNAME("p2CnfSupportedRates"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 3, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_bitarray, /* fromtextptr */ p80211_fromtext_bitarray, /* validfunptr */ p80211_isvalid_bitarray } }; UINT32 MKMIBMETASIZE(p2Static) = sizeof(MKMIBMETANAME(p2Static)) / sizeof(p80211meta_t); extern UINT32 MKMIBMETASIZE(p2Dynamic); p80211meta_t MKMIBMETANAME(p2Dynamic)[] = { { /* name */ (char *)&(MKMIBMETASIZE(p2Dynamic)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("p2CreateIBSS"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("p2FragmentationThreshold"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 256, /* max */ 2346, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2RTSThreshold"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 3000, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2TxRateControl"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 3, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_bitarray, /* fromtextptr */ p80211_fromtext_bitarray, /* validfunptr */ p80211_isvalid_bitarray }, { /* name */ MKITEMNAME("p2PromiscuousMode"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ &MKENUMNAME(truth), /* totextptr */ p80211_totext_enumint, /* fromtextptr */ p80211_fromtext_enumint, /* validfunptr */ p80211_isvalid_enumint }, { /* name */ MKITEMNAME("p2FragmentationThreshold0"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 256, /* max */ 2346, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2FragmentationThreshold1"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 256, /* max */ 2346, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2FragmentationThreshold2"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 256, /* max */ 2346, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2FragmentationThreshold3"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 256, /* max */ 2346, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2FragmentationThreshold4"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 256, /* max */ 2346, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2FragmentationThreshold5"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 256, /* max */ 2346, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2FragmentationThreshold6"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 256, /* max */ 2346, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2RTSThreshold0"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 3000, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2RTSThreshold1"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 3000, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2RTSThreshold2"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 3000, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2RTSThreshold3"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 3000, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2RTSThreshold4"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 3000, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2RTSThreshold5"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 3000, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2RTSThreshold6"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 3000, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2TxRateControl0"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 3, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_bitarray, /* fromtextptr */ p80211_fromtext_bitarray, /* validfunptr */ p80211_isvalid_bitarray }, { /* name */ MKITEMNAME("p2TxRateControl1"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 3, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_bitarray, /* fromtextptr */ p80211_fromtext_bitarray, /* validfunptr */ p80211_isvalid_bitarray }, { /* name */ MKITEMNAME("p2TxRateControl2"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 3, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_bitarray, /* fromtextptr */ p80211_fromtext_bitarray, /* validfunptr */ p80211_isvalid_bitarray }, { /* name */ MKITEMNAME("p2TxRateControl3"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 3, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_bitarray, /* fromtextptr */ p80211_fromtext_bitarray, /* validfunptr */ p80211_isvalid_bitarray }, { /* name */ MKITEMNAME("p2TxRateControl4"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 3, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_bitarray, /* fromtextptr */ p80211_fromtext_bitarray, /* validfunptr */ p80211_isvalid_bitarray }, { /* name */ MKITEMNAME("p2TxRateControl5"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 3, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_bitarray, /* fromtextptr */ p80211_fromtext_bitarray, /* validfunptr */ p80211_isvalid_bitarray }, { /* name */ MKITEMNAME("p2TxRateControl6"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 3, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_bitarray, /* fromtextptr */ p80211_fromtext_bitarray, /* validfunptr */ p80211_isvalid_bitarray } }; UINT32 MKMIBMETASIZE(p2Dynamic) = sizeof(MKMIBMETANAME(p2Dynamic)) / sizeof(p80211meta_t); extern UINT32 MKMIBMETASIZE(p2Behavior); p80211meta_t MKMIBMETANAME(p2Behavior)[] = { { /* name */ (char *)&(MKMIBMETASIZE(p2Behavior)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("p2TickTime"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 65535, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int } }; UINT32 MKMIBMETASIZE(p2Behavior) = sizeof(MKMIBMETANAME(p2Behavior)) / sizeof(p80211meta_t); extern UINT32 MKMIBMETASIZE(p2NIC); p80211meta_t MKMIBMETANAME(p2NIC)[] = { { /* name */ (char *)&(MKMIBMETASIZE(p2NIC)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("p2MaxLoadTime"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2DLBufferPage"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 65535, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2DLBufferOffset"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 65535, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2DLBufferLength"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 65535, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2PRIIdentity"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 4, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_intarray, /* fromtextptr */ p80211_fromtext_intarray, /* validfunptr */ p80211_isvalid_intarray }, { /* name */ MKITEMNAME("p2PRISupRange"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 5, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_intarray, /* fromtextptr */ p80211_fromtext_intarray, /* validfunptr */ p80211_isvalid_intarray }, { /* name */ MKITEMNAME("p2CFIActRanges"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 5, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_intarray, /* fromtextptr */ p80211_fromtext_intarray, /* validfunptr */ p80211_isvalid_intarray }, { /* name */ MKITEMNAME("p2NICSerialNumber"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 12, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_displaystr, /* fromtextptr */ p80211_fromtext_displaystr, /* validfunptr */ p80211_isvalid_displaystr }, { /* name */ MKITEMNAME("p2NICIdentity"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 4, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_intarray, /* fromtextptr */ p80211_fromtext_intarray, /* validfunptr */ p80211_isvalid_intarray }, { /* name */ MKITEMNAME("p2MFISupRange"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 5, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_intarray, /* fromtextptr */ p80211_fromtext_intarray, /* validfunptr */ p80211_isvalid_intarray }, { /* name */ MKITEMNAME("p2CFISupRange"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 5, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_intarray, /* fromtextptr */ p80211_fromtext_intarray, /* validfunptr */ p80211_isvalid_intarray }, { /* name */ MKITEMNAME("p2ChannelList"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 13, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_bitarray, /* fromtextptr */ p80211_fromtext_bitarray, /* validfunptr */ p80211_isvalid_bitarray }, { /* name */ MKITEMNAME("p2RegulatoryDomains"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 10, /* minlen */ 10, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("p2TempType"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2STAIdentity"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 4, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_intarray, /* fromtextptr */ p80211_fromtext_intarray, /* validfunptr */ p80211_isvalid_intarray }, { /* name */ MKITEMNAME("p2STASupRange"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 5, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_intarray, /* fromtextptr */ p80211_fromtext_intarray, /* validfunptr */ p80211_isvalid_intarray }, { /* name */ MKITEMNAME("p2MFIActRanges"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 5, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_intarray, /* fromtextptr */ p80211_fromtext_intarray, /* validfunptr */ p80211_isvalid_intarray }, { /* name */ MKITEMNAME("p2STACFIActRanges"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 5, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_intarray, /* fromtextptr */ p80211_fromtext_intarray, /* validfunptr */ p80211_isvalid_intarray }, { /* name */ MKITEMNAME("p2BuildSequence"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 2, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_intarray, /* fromtextptr */ p80211_fromtext_intarray, /* validfunptr */ p80211_isvalid_intarray }, { /* name */ MKITEMNAME("p2PrimaryFWID"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 13, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_displaystr, /* fromtextptr */ p80211_fromtext_displaystr, /* validfunptr */ p80211_isvalid_displaystr }, { /* name */ MKITEMNAME("p2SecondaryFWID"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 13, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_displaystr, /* fromtextptr */ p80211_fromtext_displaystr, /* validfunptr */ p80211_isvalid_displaystr }, { /* name */ MKITEMNAME("p2TertiaryFWID"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 13, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_displaystr, /* fromtextptr */ p80211_fromtext_displaystr, /* validfunptr */ p80211_isvalid_displaystr } }; UINT32 MKMIBMETASIZE(p2NIC) = sizeof(MKMIBMETANAME(p2NIC)) / sizeof(p80211meta_t); extern UINT32 MKMIBMETASIZE(p2MAC); p80211meta_t MKMIBMETANAME(p2MAC)[] = { { /* name */ (char *)&(MKMIBMETASIZE(p2MAC)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("p2PortStatus"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2CurrentSSID"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 32, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_displaystr, /* fromtextptr */ p80211_fromtext_displaystr, /* validfunptr */ p80211_isvalid_displaystr }, { /* name */ MKITEMNAME("p2CurrentBSSID"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("p2CommsQuality"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 3, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_intarray, /* fromtextptr */ p80211_fromtext_intarray, /* validfunptr */ p80211_isvalid_intarray }, { /* name */ MKITEMNAME("p2CommsQualityCQ"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 65535, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2CommsQualityASL"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 65535, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2CommsQualityANL"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 65535, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2dbmCommsQuality"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 3, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_intarray, /* fromtextptr */ p80211_fromtext_intarray, /* validfunptr */ p80211_isvalid_intarray }, { /* name */ MKITEMNAME("p2dbmCommsQualityCQ"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 65535, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2dbmCommsQualityASL"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 65535, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2dbmCommsQualityANL"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 65535, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2CurrentTxRate"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2CurrentBeaconInterval"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2StaCurrentScaleThresholds"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_intarray, /* fromtextptr */ p80211_fromtext_intarray, /* validfunptr */ p80211_isvalid_intarray }, { /* name */ MKITEMNAME("p2APCurrentScaleThresholds"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 3, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_intarray, /* fromtextptr */ p80211_fromtext_intarray, /* validfunptr */ p80211_isvalid_intarray }, { /* name */ MKITEMNAME("p2ProtocolRspTime"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2ShortRetryLimit"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2LongRetryLimit"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2MaxTransmitLifetime"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2MaxReceiveLifetime"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2CFPollable"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2AuthenticationAlgorithms"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 2, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_intarray, /* fromtextptr */ p80211_fromtext_intarray, /* validfunptr */ p80211_isvalid_intarray }, { /* name */ MKITEMNAME("p2PrivacyOptionImplemented"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2CurrentTxRate1"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2CurrentTxRate2"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2CurrentTxRate3"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2CurrentTxRate4"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2CurrentTxRate5"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2CurrentTxRate6"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2OwnMACAddress"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 6, /* minlen */ 6, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr } }; UINT32 MKMIBMETASIZE(p2MAC) = sizeof(MKMIBMETANAME(p2MAC)) / sizeof(p80211meta_t); extern UINT32 MKMIBMETASIZE(p2Modem); p80211meta_t MKMIBMETANAME(p2Modem)[] = { { /* name */ (char *)&(MKMIBMETASIZE(p2Modem)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("p2PHYType"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2CurrentChannel"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2CurrentPowerState"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2CCAMode"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, { /* name */ MKITEMNAME("p2SupportedDataRates"), /* did */ P80211DID_ACCESS_READ, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 10, /* minlen */ 10, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, { /* name */ MKITEMNAME("p2TxPowerMax"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 30, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_int, /* fromtextptr */ p80211_fromtext_int, /* validfunptr */ p80211_isvalid_int }, }; UINT32 MKMIBMETASIZE(p2Modem) = sizeof(MKMIBMETANAME(p2Modem)) / sizeof(p80211meta_t); extern UINT32 MKGRPMETASIZE(p2); grplistitem_t MKGRPMETANAME(p2)[] = { { (char *)&MKGRPMETASIZE(p2), NULL }, { "p2Table", MKMIBMETANAME(p2Table) }, { "p2Static", MKMIBMETANAME(p2Static) }, { "p2Dynamic", MKMIBMETANAME(p2Dynamic) }, { "p2Behavior", MKMIBMETANAME(p2Behavior) }, { "p2NIC", MKMIBMETANAME(p2NIC) }, { "p2MAC", MKMIBMETANAME(p2MAC) }, { "p2Modem", MKMIBMETANAME(p2Modem) } }; UINT32 MKGRPMETASIZE(p2) = sizeof(MKGRPMETANAME(p2)) / sizeof(grplistitem_t); extern UINT32 MKMIBMETASIZE(lnxConfigTable); p80211meta_t MKMIBMETANAME(lnxConfigTable)[] = { { /* name */ (char *)&(MKMIBMETASIZE(lnxConfigTable)), /* did */ 0, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 0, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ NULL, /* fromtextptr */ NULL, /* validfunptr */ NULL }, { /* name */ MKITEMNAME("lnxRSNAIE"), /* did */ P80211DID_ACCESS_READ | P80211DID_ACCESS_WRITE, /* flags */ 0, /* min */ 0, /* max */ 0, /* maxlen */ 256, /* minlen */ 0, /* enumptr */ NULL, /* totextptr */ p80211_totext_octetstr, /* fromtextptr */ p80211_fromtext_octetstr, /* validfunptr */ p80211_isvalid_octetstr }, }; UINT32 MKMIBMETASIZE(lnxConfigTable) = sizeof(MKMIBMETANAME(lnxConfigTable)) / sizeof(p80211meta_t); extern UINT32 MKGRPMETASIZE(lnx); grplistitem_t MKGRPMETANAME(lnx)[] = { { (char *)&MKGRPMETASIZE(lnx), NULL }, { "lnxConfigTable", MKMIBMETANAME(lnxConfigTable), }, }; UINT32 MKGRPMETASIZE(lnx) = sizeof(MKGRPMETANAME(lnx)) / sizeof(grplistitem_t); extern UINT32 mib_catlist_size; catlistitem_t mib_catlist[] = { { (char *)&mib_catlist_size, NULL }, { "dot11smt", MKGRPMETANAME(dot11smt) }, { "dot11mac", MKGRPMETANAME(dot11mac) }, { "dot11phy", MKGRPMETANAME(dot11phy) }, { "lnx", MKGRPMETANAME(lnx) }, { "p2", MKGRPMETANAME(p2) } }; UINT32 mib_catlist_size = sizeof(mib_catlist)/sizeof(catlistitem_t); /*================================================================*/ /* Local Function Declarations */ /*================================================================*/ /* Function Definitions */ linux-wlan-ng-0.2.9+dfsg/src/shared/Makefile0000644000175000017500000000403211024763162020231 0ustar tormodtormod# src/shared/Makefile # # Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. # -------------------------------------------------------------------- # # linux-wlan # # 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. # # 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. # # -------------------------------------------------------------------- # # Inquiries regarding the linux-wlan Open Source project can be # made directly to: # # AbsoluteValue Systems Inc. # info@linux-wlan.com # http://www.linux-wlan.com # # -------------------------------------------------------------------- # # Portions of the development of this software were funded by # Intersil Corporation as part of PRISM(R) chipset product development. # # -------------------------------------------------------------------- -include ../../config.mk all: @echo "Nothing to do..." install: @echo "Nothing to do..." clean: rm -f core core.* *.o .*.o *.s *.a .depend tmp_make *~ tags for i in *_obj; do if [ -d $$i ]; then rm -fr $$i; fi; done linux-wlan-ng-0.2.9+dfsg/src/version.h.in0000644000175000017500000000447711024763201017575 0ustar tormodtormod/* src/include/wlan/version.h * * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- */ #ifndef _WLAN_VERSION_H #define _WLAN_VERSION_H #ifndef KERNEL_VERSION #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) #endif /* WLAN_HOSTIF (generally set on the command line, not detected) */ #define WLAN_NONE 0 #define WLAN_PCMCIA 1 #define WLAN_ISA 2 #define WLAN_PCI 3 #define WLAN_USB 4 #define WLAN_PLX 5 #define WLAN_SLAVE 6 linux-wlan-ng-0.2.9+dfsg/src/p80211/0000755000175000017500000000000011026545443016161 5ustar tormodtormodlinux-wlan-ng-0.2.9+dfsg/src/p80211/p80211wep.c0000644000175000017500000002536211024763163017703 0ustar tormodtormod/* src/p80211/p80211wep.c * * WEP encode/decode for P80211. * * Copyright (C) 2002 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- */ /*================================================================*/ /* System Includes */ #include #include #include #include #include #include #include // #define WEP_DEBUG /*================================================================*/ /* Project Includes */ #include #include #include #include #include #include /*================================================================*/ /* Local Constants */ #define SSWAP(a,b) {UINT8 tmp = s[a]; s[a] = s[b]; s[b] = tmp;} #define WEP_KEY(x) (((x) & 0xC0) >> 6) /*================================================================*/ /* Local Macros */ /*================================================================*/ /* Local Types */ /*================================================================*/ /* Local Static Definitions */ static const UINT32 wep_crc32_table[256] = { 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L, 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L, 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL, 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L, 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L, 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L, 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL, 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L, 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL, 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L, 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L, 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L, 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL, 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL, 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L, 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL, 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L, 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L, 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L, 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL, 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L, 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L, 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL, 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L, 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L, 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L, 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L, 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L, 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL, 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL, 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L, 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L, 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL, 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL, 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L, 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL, 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L, 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL, 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L, 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL, 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L, 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L, 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL, 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L, 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L, 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L, 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L, 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L, 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L, 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL, 0x2d02ef8dL }; /*================================================================*/ /* Local Function Declarations */ /*================================================================*/ /* Function Definitions */ /* keylen in bytes! */ int wep_change_key(wlandevice_t *wlandev, int keynum, UINT8* key, int keylen) { if (keylen < 0) return -1; if (keylen >= MAX_KEYLEN) return -1; if (key == NULL) return -1; if (keynum < 0) return -1; if (keynum >= NUM_WEPKEYS) return -1; #ifdef WEP_DEBUG printk(KERN_DEBUG "WEP key %d len %d = %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n", keynum, keylen, key[0], key[1], key[2], key[3], key[4], key[5], key[6], key[7]); #endif wlandev->wep_keylens[keynum] = keylen; memcpy(wlandev->wep_keys[keynum], key, keylen); return 0; } /* 4-byte IV at start of buffer, 4-byte ICV at end of buffer. if successful, buf start is payload begin, length -= 8; */ int wep_decrypt(wlandevice_t *wlandev, UINT8 *buf, UINT32 len, int key_override, UINT8 *iv, UINT8 *icv) { UINT32 i, j, k, crc, keylen; UINT8 s[256], key[64], c_crc[4]; UINT8 keyidx; /* Needs to be at least 8 bytes of payload */ if (len <= 0) return -1; /* initialize the first bytes of the key from the IV */ key[0] = iv[0]; key[1] = iv[1]; key[2] = iv[2]; keyidx = WEP_KEY(iv[3]); if (key_override >= 0) keyidx = key_override; if (keyidx >= NUM_WEPKEYS) return -2; keylen = wlandev->wep_keylens[keyidx]; if (keylen == 0) return -3; /* copy the rest of the key over from the designated key */ memcpy(key+3, wlandev->wep_keys[keyidx], keylen); keylen+=3; /* add in IV bytes */ #ifdef WEP_DEBUG printk(KERN_DEBUG "D %d: %02x %02x %02x (%d %d) %02x:%02x:%02x:%02x:%02x\n", len, key[0], key[1], key[2], keyidx, keylen, key[3], key[4], key[5], key[6], key[7]); #endif /* set up the RC4 state */ for (i = 0; i < 256; i++) s[i] = i; j = 0; for (i = 0; i < 256; i++) { j = (j + s[i] + key[i % keylen]) & 0xff; SSWAP(i,j); } /* Apply the RC4 to the data, update the CRC32 */ crc = ~0; i = j = 0; for (k = 0; k < len; k++) { i = (i+1) & 0xff; j = (j+s[i]) & 0xff; SSWAP(i,j); buf[k] ^= s[(s[i] + s[j]) & 0xff]; crc = wep_crc32_table[(crc ^ buf[k]) & 0xff] ^ (crc >> 8); } crc = ~crc; /* now let's check the crc */ c_crc[0] = crc; c_crc[1] = crc >> 8; c_crc[2] = crc >> 16; c_crc[3] = crc >> 24; for (k = 0; k < 4; k++) { i = (i + 1) & 0xff; j = (j+s[i]) & 0xff; SSWAP(i,j); if ((c_crc[k] ^ s[(s[i] + s[j]) & 0xff]) != icv[k]) return -(4 | (k << 4)) ; /* ICV mismatch */ } return 0; } /* encrypts in-place. */ int wep_encrypt(wlandevice_t *wlandev, UINT8 *buf, UINT8 *dst, UINT32 len, int keynum, UINT8 *iv, UINT8 *icv) { UINT32 i, j, k, crc, keylen; UINT8 s[256], key[64]; /* no point in WEPping an empty frame */ if (len <= 0) return -1; /* we need to have a real key.. */ if (keynum >= NUM_WEPKEYS) return -2; keylen = wlandev->wep_keylens[keynum]; if (keylen <= 0) return -3; /* use a random IV. And skip known weak ones. */ get_random_bytes(iv, 3); while ((iv[1] == 0xff) && (iv[0] >= 3) && (iv[0] < keylen)) get_random_bytes(iv, 3); iv[3] = (keynum & 0x03) << 6; key[0] = iv[0]; key[1] = iv[1]; key[2] = iv[2]; /* copy the rest of the key over from the designated key */ memcpy(key+3, wlandev->wep_keys[keynum], keylen); keylen+=3; /* add in IV bytes */ #ifdef WEP_DEBUG printk(KERN_DEBUG "E %d (%d/%d %d) %02x %02x %02x %02x:%02x:%02x:%02x:%02x\n", len, iv[3], keynum, keylen, key[0], key[1], key[2], key[3], key[4], key[5], key[6], key[7]); #endif /* set up the RC4 state */ for (i = 0; i < 256; i++) s[i] = i; j = 0; for (i = 0; i < 256; i++) { j = (j + s[i] + key[i % keylen]) & 0xff; SSWAP(i,j); } /* Update CRC32 then apply RC4 to the data */ crc = ~0; i = j = 0; for (k = 0; k < len; k++) { crc = wep_crc32_table[(crc ^ buf[k]) & 0xff] ^ (crc >> 8); i = (i+1) & 0xff; j = (j+s[i]) & 0xff; SSWAP(i,j); dst[k] = buf[k] ^ s[(s[i] + s[j]) & 0xff]; } crc = ~crc; /* now let's encrypt the crc */ icv[0] = crc; icv[1] = crc >> 8; icv[2] = crc >> 16; icv[3] = crc >> 24; for (k = 0; k < 4; k++) { i = (i + 1) & 0xff; j = (j+s[i]) & 0xff; SSWAP(i,j); icv[k] ^= s[(s[i] + s[j]) & 0xff]; } return 0; } linux-wlan-ng-0.2.9+dfsg/src/p80211/p80211req.c0000644000175000017500000002275611024763163017703 0ustar tormodtormod/* src/p80211/p80211req.c * * Request/Indication/MacMgmt interface handling functions * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- * * This file contains the functions, types, and macros to support the * MLME request interface that's implemented via the device ioctls. * * -------------------------------------------------------------------- */ /*================================================================*/ /* System Includes */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include /*================================================================*/ /* Project Includes */ #include #include #include #include #include #include #include #include #include #include /*================================================================*/ /* Local Constants */ /* Maximum amount of time we'll wait for a request to complete */ #define P80211REQ_MAXTIME 3*HZ /* 3 seconds */ /*================================================================*/ /* Local Macros */ /*================================================================*/ /* Local Types */ /*================================================================*/ /* Local Static Definitions */ /*================================================================*/ /* Local Function Declarations */ static void p80211req_handlemsg( wlandevice_t *wlandev, p80211msg_t *msg); static int p80211req_mibset_mibget(wlandevice_t *wlandev, p80211msg_dot11req_mibget_t *mib_msg, int isget); /*================================================================*/ /* Function Definitions */ /*---------------------------------------------------------------- * p80211req_dorequest * * Handles an MLME reqest/confirm message. * * Arguments: * wlandev WLAN device struct * msgbuf Buffer containing a request message * * Returns: * 0 on success, an errno otherwise * * Call context: * Potentially blocks the caller, so it's a good idea to * not call this function from an interrupt context. ----------------------------------------------------------------*/ int p80211req_dorequest( wlandevice_t *wlandev, UINT8 *msgbuf) { int result = 0; p80211msg_t *msg = (p80211msg_t*)msgbuf; DBFENTER; /* Check to make sure the MSD is running */ if ( !((wlandev->msdstate == WLAN_MSD_HWPRESENT && msg->msgcode == DIDmsg_lnxreq_ifstate) || wlandev->msdstate == WLAN_MSD_RUNNING || wlandev->msdstate == WLAN_MSD_FWLOAD) ) { return -ENODEV; } /* Check Permissions */ if (!capable(CAP_NET_ADMIN) && (msg->msgcode != DIDmsg_dot11req_mibget)) { WLAN_LOG_ERROR("%s: only dot11req_mibget allowed for non-root.\n", wlandev->name); return -EPERM; } /* Check for busy status */ if ( test_and_set_bit(1, &(wlandev->request_pending))) { return -EBUSY; } /* Allow p80211 to look at msg and handle if desired. */ /* So far, all p80211 msgs are immediate, no waitq/timer necessary */ /* This may change. */ p80211req_handlemsg(wlandev, msg); /* Pass it down to wlandev via wlandev->mlmerequest */ if ( wlandev->mlmerequest != NULL ) wlandev->mlmerequest(wlandev, msg); clear_bit( 1, &(wlandev->request_pending)); DBFEXIT; return result; /* if result==0, msg->status still may contain an err */ } /*---------------------------------------------------------------- * p80211req_handlemsg * * p80211 message handler. Primarily looks for messages that * belong to p80211 and then dispatches the appropriate response. * TODO: we don't do anything yet. Once the linuxMIB is better * defined we'll need a get/set handler. * * Arguments: * wlandev WLAN device struct * msg message structure * * Returns: * nothing (any results are set in the status field of the msg) * * Call context: * Process thread ----------------------------------------------------------------*/ static void p80211req_handlemsg( wlandevice_t *wlandev, p80211msg_t *msg) { DBFENTER; switch (msg->msgcode) { case DIDmsg_lnxreq_hostwep: { p80211msg_lnxreq_hostwep_t *req = (p80211msg_lnxreq_hostwep_t*) msg; wlandev->hostwep &= ~(HOSTWEP_DECRYPT|HOSTWEP_ENCRYPT); if (req->decrypt.data == P80211ENUM_truth_true) wlandev->hostwep |= HOSTWEP_DECRYPT; if (req->encrypt.data == P80211ENUM_truth_true) wlandev->hostwep |= HOSTWEP_ENCRYPT; break; } case DIDmsg_dot11req_mibget: case DIDmsg_dot11req_mibset: { int isget = (msg->msgcode == DIDmsg_dot11req_mibget); p80211msg_dot11req_mibget_t *mib_msg = (p80211msg_dot11req_mibget_t *) msg; p80211req_mibset_mibget (wlandev, mib_msg, isget); } default: // XXX do nothing! ; } /* switch msg->msgcode */ DBFEXIT; return; } static int p80211req_mibset_mibget(wlandevice_t *wlandev, p80211msg_dot11req_mibget_t *mib_msg, int isget) { p80211itemd_t *mibitem = (p80211itemd_t *) mib_msg->mibattribute.data; p80211pstrd_t *pstr = (p80211pstrd_t*) mibitem->data; UINT8 *key = mibitem->data + sizeof(p80211pstrd_t); DBFENTER; switch (mibitem->did) { case DIDmib_dot11smt_p80211Table_p80211_ifstate: { UINT32 *data = (UINT32 *) mibitem->data; if (isget) switch (wlandev->msdstate) { case WLAN_MSD_HWPRESENT: *data = P80211ENUM_ifstate_disable; break; case WLAN_MSD_FWLOAD: *data = P80211ENUM_ifstate_fwload; break; case WLAN_MSD_RUNNING: *data = P80211ENUM_ifstate_enable; break; default: *data = P80211ENUM_ifstate_enable; } break; } case DIDmib_dot11phy_dot11PhyOperationTable_dot11ShortPreambleEnabled: { UINT32 *data = (UINT32 *) mibitem->data; if (isget) *data = wlandev->shortpreamble; else wlandev->shortpreamble = *data; break; } case DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey0: { if (!isget) wep_change_key(wlandev, 0, key, pstr->len); break; } case DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey1: { if (!isget) wep_change_key(wlandev, 1, key, pstr->len); break; } case DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey2: { if (!isget) wep_change_key(wlandev, 2, key, pstr->len); break; } case DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey3: { if (!isget) wep_change_key(wlandev, 3, key, pstr->len); break; } case DIDmib_dot11smt_dot11PrivacyTable_dot11WEPDefaultKeyID: { UINT32 *data = (UINT32 *) mibitem->data; if (isget) { *data = wlandev->hostwep & HOSTWEP_DEFAULTKEY_MASK; } else { wlandev->hostwep &= ~(HOSTWEP_DEFAULTKEY_MASK); wlandev->hostwep |= (*data & HOSTWEP_DEFAULTKEY_MASK); } break; } case DIDmib_dot11smt_dot11PrivacyTable_dot11PrivacyInvoked: { UINT32 *data = (UINT32 *) mibitem->data; if (isget) { if (wlandev->hostwep & HOSTWEP_PRIVACYINVOKED) *data = P80211ENUM_truth_true; else *data = P80211ENUM_truth_false; } else { wlandev->hostwep &= ~(HOSTWEP_PRIVACYINVOKED); if (*data == P80211ENUM_truth_true) wlandev->hostwep |= HOSTWEP_PRIVACYINVOKED; } break; } case DIDmib_dot11smt_dot11PrivacyTable_dot11ExcludeUnencrypted: { UINT32 *data = (UINT32 *) mibitem->data; if (isget) { if (wlandev->hostwep & HOSTWEP_EXCLUDEUNENCRYPTED) *data = P80211ENUM_truth_true; else *data = P80211ENUM_truth_false; } else { wlandev->hostwep &= ~(HOSTWEP_EXCLUDEUNENCRYPTED); if (*data == P80211ENUM_truth_true) wlandev->hostwep |= HOSTWEP_EXCLUDEUNENCRYPTED; } break; } default: // XXXX do nothing! ; } DBFEXIT; return 0; } linux-wlan-ng-0.2.9+dfsg/src/p80211/p80211mod.c0000644000175000017500000001331211024763163017657 0ustar tormodtormod/* src/p80211/p80211mod.c * * Module entry and exit for p80211 * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- * * This file contains the p80211.o entry and exit points defined for linux * kernel modules. * * Notes: * - all module parameters for p80211.o should be defined here. * * -------------------------------------------------------------------- */ /*================================================================*/ /* System Includes */ #include #include #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,25)) #include #endif #include #include #include #include #include #include #include /*================================================================*/ /* Project Includes */ #include #include #include #include #include #include #include /*================================================================*/ /* Local Constants */ /*================================================================*/ /* Local Macros */ /*================================================================*/ /* Local Types */ /*================================================================*/ /* Local Static Definitions */ static char *version = "p80211.o: " WLAN_RELEASE; /*----------------------------------------------------------------*/ /* --Module Parameters */ int wlan_watchdog = 5000; module_param(wlan_watchdog, int, 0644); MODULE_PARM_DESC(wlan_watchdog, "transmit timeout in milliseconds"); int wlan_wext_write = 1; #if WIRELESS_EXT > 12 module_param(wlan_wext_write, int, 0644); MODULE_PARM_DESC(wlan_wext_write, "enable write wireless extensions"); #endif #ifdef WLAN_INCLUDE_DEBUG int wlan_debug=0; module_param(wlan_debug, int, 0644); MODULE_PARM_DESC(wlan_debug, "p80211 debug level"); #endif MODULE_LICENSE("Dual MPL/GPL"); /*================================================================*/ /* Local Function Declarations */ int init_module(void); void cleanup_module(void); /*================================================================*/ /* Function Definitions */ /*---------------------------------------------------------------- * init_module * * Module initialization routine, called once at module load time. * * Arguments: * none * * Returns: * 0 - success * ~0 - failure, module is unloaded. * * Side effects: * TODO: define * * Call context: * process thread (insmod or modprobe) ----------------------------------------------------------------*/ int init_module(void) { DBFENTER; #if 0 printk(KERN_NOTICE "%s (%s) Loaded\n", version, WLAN_BUILD_DATE); #endif p80211netdev_startup(); #ifdef CONFIG_HOTPLUG p80211_run_sbin_hotplug(NULL, WLAN_HOTPLUG_STARTUP); #endif DBFEXIT; return 0; } /*---------------------------------------------------------------- * cleanup_module * * Called at module unload time. This is our last chance to * clean up after ourselves. * * Arguments: * none * * Returns: * nothing * * Side effects: * TODO: define * * Call context: * process thread * ----------------------------------------------------------------*/ void cleanup_module(void) { DBFENTER; #ifdef CONFIG_HOTPLUG p80211_run_sbin_hotplug(NULL, WLAN_HOTPLUG_SHUTDOWN); #endif p80211netdev_shutdown(); printk(KERN_NOTICE "%s Unloaded\n", version); DBFEXIT; return; } EXPORT_SYMBOL(p80211netdev_hwremoved); EXPORT_SYMBOL(register_wlandev); EXPORT_SYMBOL(p80211netdev_rx); EXPORT_SYMBOL(unregister_wlandev); EXPORT_SYMBOL(wlan_setup); EXPORT_SYMBOL(wlan_unsetup); EXPORT_SYMBOL(p80211_suspend); EXPORT_SYMBOL(p80211_resume); EXPORT_SYMBOL(p80211skb_free); EXPORT_SYMBOL(p80211skb_rxmeta_attach); EXPORT_SYMBOL(p80211wext_event_associated); EXPORT_SYMBOL(wlan_wext_write); EXPORT_SYMBOL(p80211_allow_ioctls); linux-wlan-ng-0.2.9+dfsg/src/p80211/Makefile0000644000175000017500000000663211024763163017627 0ustar tormodtormod# Makefile # # Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. # -------------------------------------------------------------------- # # linux-wlan # # 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. # # 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. # # -------------------------------------------------------------------- # # Inquiries regarding the linux-wlan Open Source project can be # made directly to: # # AbsoluteValue Systems Inc. # info@linux-wlan.com # http://www.linux-wlan.com # # -------------------------------------------------------------------- # # Portions of the development of this software were funded by # Intersil Corporation as part of PRISM(R) chipset product development. # # -------------------------------------------------------------------- ifneq ($(WLAN_SRC),) -include $(WLAN_SRC)/../config.mk else -include ../../config.mk endif # Build options (just comment out the ones you don't want) WLAN_EXTRA_DEFINE := -DWLAN_TXMGMT_MINBRATE -DRSN_INTERNAL_ROAM -DWLAN_HOSTIF=WLAN_NONE ifeq ($(WLAN_DEBUG), y) WLAN_EXTRA_DEFINE += -DWLAN_INCLUDE_DEBUG endif obj-m := ifeq ($(KERN_25), y) # kbuild 2.5/2.6 obj-m := p80211.o p80211-objs := p80211mod.o \ p80211conv.o \ p80211req.o \ p80211wep.o \ p80211wext.o \ p80211netdev.o else # kbuild 2.4 O_TARGET := p80211.o obj-m := $(O_TARGET) obj-y := p80211mod.o \ p80211conv.o \ p80211req.o \ p80211wep.o \ p80211wext.o \ p80211netdev.o export-objs := p80211mod.o endif # kbuild switch ifneq ($(KERNELRELEASE),) EXTRA_CFLAGS += -I$(WLAN_SRC)/include $(WLAN_EXTRA_DEFINE) ifneq ($(KERN_25), y) include $(TOPDIR)/Rules.make endif else # KERNRELEASE is set PWD := $(shell pwd) default: ifeq ($(KERN_25), y) ifeq ($(KERN_2_6_5), y) ifeq ($(KERN_2_6_17), y) # >= 2.6.17 $(MAKE) -C $(LINUX_SRC) M='$(PWD)' WLAN_SRC=$(WLAN_SRC) modules else # 2.6.5 <-> 2.6.16 $(MAKE) -C $(LINUX_SRC) M='$(WLAN_SRC) $(PWD)' WLAN_SRC=$(WLAN_SRC) modules endif else # < 2.6.5 $(MAKE) -C $(LINUX_SRC) SUBDIRS='$(WLAN_SRC) $(PWD)' WLAN_SRC=$(WLAN_SRC) modules endif else # kbuild 2.4 $(MAKE) -C $(LINUX_SRC) SUBDIRS=$(PWD) WLAN_SRC=$(WLAN_SRC) modules endif # kbuild switch endif #KERNELRELEASE clean: rm -Rf *.o *.ko .*.cmd *.mod.c *.flags .*.flags .tmp_versions Module*.symvers install: mkdir -p $(TARGET_MODDIR) ifeq ($(KERN_25), y) cp $(obj-m:.o=.ko) $(TARGET_MODDIR) else cp $(obj-m) $(TARGET_MODDIR) endif linux-wlan-ng-0.2.9+dfsg/src/p80211/p80211netdev.c0000644000175000017500000011604611024763163020375 0ustar tormodtormod/* src/p80211/p80211knetdev.c * * Linux Kernel net device interface * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- * * The functions required for a Linux network device are defined here. * * -------------------------------------------------------------------- */ /*================================================================*/ /* System Includes */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef SIOCETHTOOL #include #endif #if WIRELESS_EXT > 12 #include #endif /*================================================================*/ /* Project Includes */ #include #include #include #include #include #include #include #include #include #include #include #include /*================================================================*/ /* Local Constants */ /*================================================================*/ /* Local Macros */ /*================================================================*/ /* Local Types */ /*================================================================*/ /* Local Static Definitions */ #define __NO_VERSION__ /* prevent the static definition */ #ifdef CONFIG_PROC_FS static struct proc_dir_entry *proc_p80211; #endif /*================================================================*/ /* Local Function Declarations */ /* Support functions */ static void p80211netdev_rx_bh(unsigned long arg); /* netdevice method functions */ static int p80211knetdev_init( netdevice_t *netdev); static struct net_device_stats* p80211knetdev_get_stats(netdevice_t *netdev); static int p80211knetdev_open( netdevice_t *netdev); static int p80211knetdev_stop( netdevice_t *netdev ); static int p80211knetdev_hard_start_xmit( struct sk_buff *skb, netdevice_t *netdev); static void p80211knetdev_set_multicast_list(netdevice_t *dev); static int p80211knetdev_do_ioctl(netdevice_t *dev, struct ifreq *ifr, int cmd); static int p80211knetdev_set_mac_address(netdevice_t *dev, void *addr); static void p80211knetdev_tx_timeout(netdevice_t *netdev); static int p80211_rx_typedrop( wlandevice_t *wlandev, UINT16 fc); #ifdef CONFIG_PROC_FS static int p80211netdev_proc_read( char *page, char **start, off_t offset, int count, int *eof, void *data); #endif /*================================================================*/ /* Function Definitions */ /*---------------------------------------------------------------- * p80211knetdev_startup * * Initialize the wlandevice/netdevice part of 802.11 services at * load time. * * Arguments: * none * * Returns: * nothing ----------------------------------------------------------------*/ void p80211netdev_startup(void) { DBFENTER; #ifdef CONFIG_PROC_FS if (PROC_NET != NULL) { proc_p80211 = create_proc_entry( "p80211", (S_IFDIR|S_IRUGO|S_IXUGO), PROC_NET); } #endif DBFEXIT; return; } /*---------------------------------------------------------------- * p80211knetdev_shutdown * * Shutdown the wlandevice/netdevice part of 802.11 services at * unload time. * * Arguments: * none * * Returns: * nothing ----------------------------------------------------------------*/ void p80211netdev_shutdown(void) { DBFENTER; #ifdef CONFIG_PROC_FS if (proc_p80211 != NULL) { remove_proc_entry("p80211", PROC_NET); } #endif DBFEXIT; } /*---------------------------------------------------------------- * p80211knetdev_init * * Init method for a Linux netdevice. Called in response to * register_netdev. * * Arguments: * none * * Returns: * nothing ----------------------------------------------------------------*/ static int p80211knetdev_init( netdevice_t *netdev) { DBFENTER; /* Called in response to register_netdev */ /* This is usually the probe function, but the probe has */ /* already been done by the MSD and the create_kdev */ /* function. All we do here is return success */ DBFEXIT; return 0; } /*---------------------------------------------------------------- * p80211knetdev_get_stats * * Statistics retrieval for linux netdevices. Here we're reporting * the Linux i/f level statistics. Hence, for the primary numbers, * we don't want to report the numbers from the MIB. Eventually, * it might be useful to collect some of the error counters though. * * Arguments: * netdev Linux netdevice * * Returns: * the address of the statistics structure ----------------------------------------------------------------*/ static struct net_device_stats* p80211knetdev_get_stats(netdevice_t *netdev) { wlandevice_t *wlandev = (wlandevice_t*)netdev->priv; DBFENTER; /* TODO: review the MIB stats for items that correspond to linux stats */ DBFEXIT; return &(wlandev->linux_stats); } /*---------------------------------------------------------------- * p80211knetdev_open * * Linux netdevice open method. Following a successful call here, * the device is supposed to be ready for tx and rx. In our * situation that may not be entirely true due to the state of the * MAC below. * * Arguments: * netdev Linux network device structure * * Returns: * zero on success, non-zero otherwise ----------------------------------------------------------------*/ static int p80211knetdev_open( netdevice_t *netdev ) { int result = 0; /* success */ wlandevice_t *wlandev = (wlandevice_t*)(netdev->priv); DBFENTER; /* Check to make sure the MSD is running */ if ( wlandev->msdstate != WLAN_MSD_RUNNING ) { return -ENODEV; } /* Tell the MSD to open */ if ( wlandev->open != NULL) { result = wlandev->open(wlandev); if ( result == 0 ) { #if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,3,43) ) netdev->interrupt = 0; #endif p80211netdev_start_queue(wlandev); wlandev->state = WLAN_DEVICE_OPEN; } } else { result = -EAGAIN; } DBFEXIT; return result; } /*---------------------------------------------------------------- * p80211knetdev_stop * * Linux netdevice stop (close) method. Following this call, * no frames should go up or down through this interface. * * Arguments: * netdev Linux network device structure * * Returns: * zero on success, non-zero otherwise ----------------------------------------------------------------*/ static int p80211knetdev_stop( netdevice_t *netdev ) { int result = 0; wlandevice_t *wlandev = (wlandevice_t*)(netdev->priv); DBFENTER; if ( wlandev->close != NULL ) { result = wlandev->close(wlandev); } p80211netdev_stop_queue(wlandev); wlandev->state = WLAN_DEVICE_CLOSED; DBFEXIT; return result; } /*---------------------------------------------------------------- * p80211netdev_rx * * Frame receive function called by the mac specific driver. * * Arguments: * wlandev WLAN network device structure * skb skbuff containing a full 802.11 frame. * Returns: * nothing * Side effects: * ----------------------------------------------------------------*/ void p80211netdev_rx(wlandevice_t *wlandev, struct sk_buff *skb ) { DBFENTER; /* Enqueue for post-irq processing */ skb_queue_tail(&wlandev->nsd_rxq, skb); tasklet_schedule(&wlandev->rx_bh); DBFEXIT; return; } /*---------------------------------------------------------------- * p80211netdev_rx_bh * * Deferred processing of all received frames. * * Arguments: * wlandev WLAN network device structure * skb skbuff containing a full 802.11 frame. * Returns: * nothing * Side effects: * ----------------------------------------------------------------*/ static void p80211netdev_rx_bh(unsigned long arg) { wlandevice_t *wlandev = (wlandevice_t *) arg; struct sk_buff *skb = NULL; netdevice_t *dev = wlandev->netdev; p80211_hdr_a3_t *hdr; UINT16 fc; DBFENTER; /* Let's empty our our queue */ while ( (skb = skb_dequeue(&wlandev->nsd_rxq)) ) { if (wlandev->state == WLAN_DEVICE_OPEN) { if (dev->type != ARPHRD_ETHER) { /* RAW frame; we shouldn't convert it */ // XXX Append the Prism Header here instead. /* set up various data fields */ skb->dev = dev; skb_reset_mac_header(skb); skb->ip_summed = CHECKSUM_NONE; skb->pkt_type = PACKET_OTHERHOST; skb->protocol = htons(ETH_P_80211_RAW); dev->last_rx = jiffies; wlandev->linux_stats.rx_packets++; wlandev->linux_stats.rx_bytes += skb->len; netif_rx_ni(skb); continue; } else { hdr = (p80211_hdr_a3_t *)skb->data; fc = ieee2host16(hdr->fc); if (p80211_rx_typedrop(wlandev, fc)) { dev_kfree_skb(skb); continue; } /* perform mcast filtering */ if (wlandev->netdev->flags & IFF_ALLMULTI) { /* allow my local address through */ if (memcmp(hdr->a1, wlandev->netdev->dev_addr, WLAN_ADDR_LEN) != 0) { /* but reject anything else that isn't multicast */ if (!(hdr->a1[0] & 0x01)) { dev_kfree_skb(skb); continue; } } } if ( skb_p80211_to_ether(wlandev, wlandev->ethconv, skb) == 0 ) { skb->dev->last_rx = jiffies; wlandev->linux_stats.rx_packets++; wlandev->linux_stats.rx_bytes += skb->len; netif_rx_ni(skb); continue; } WLAN_LOG_DEBUG(1, "p80211_to_ether failed.\n"); } } dev_kfree_skb(skb); } DBFEXIT; } /*---------------------------------------------------------------- * p80211knetdev_hard_start_xmit * * Linux netdevice method for transmitting a frame. * * Arguments: * skb Linux sk_buff containing the frame. * netdev Linux netdevice. * * Side effects: * If the lower layers report that buffers are full. netdev->tbusy * will be set to prevent higher layers from sending more traffic. * * Note: If this function returns non-zero, higher layers retain * ownership of the skb. * * Returns: * zero on success, non-zero on failure. ----------------------------------------------------------------*/ static int p80211knetdev_hard_start_xmit( struct sk_buff *skb, netdevice_t *netdev) { int result = 0; int txresult = -1; wlandevice_t *wlandev = (wlandevice_t*)netdev->priv; p80211_hdr_t p80211_hdr; p80211_metawep_t p80211_wep; DBFENTER; if (skb == NULL) { return 0; } if (wlandev->state != WLAN_DEVICE_OPEN) { result = 1; goto failed; } memset(&p80211_hdr, 0, sizeof(p80211_hdr_t)); memset(&p80211_wep, 0, sizeof(p80211_metawep_t)); #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,38) ) if ( test_and_set_bit(0, (void*)&(netdev->tbusy)) != 0 ) { /* We've been called w/ tbusy set, has the tx */ /* path stalled? */ WLAN_LOG_DEBUG(1, "called when tbusy set\n"); result = 1; goto failed; } #else if ( netif_queue_stopped(netdev) ) { WLAN_LOG_DEBUG(1, "called when queue stopped.\n"); result = 1; goto failed; } netif_stop_queue(netdev); /* No timeout handling here, 2.3.38+ kernels call the * timeout function directly. * TODO: Add timeout handling. */ #endif /* Check to see that a valid mode is set */ switch( wlandev->macmode ) { case WLAN_MACMODE_IBSS_STA: case WLAN_MACMODE_ESS_STA: case WLAN_MACMODE_ESS_AP: break; default: /* Mode isn't set yet, just drop the frame * and return success . * TODO: we need a saner way to handle this */ if(skb->protocol != ETH_P_80211_RAW) { p80211netdev_start_queue(wlandev); WLAN_LOG_NOTICE( "Tx attempt prior to association, frame dropped.\n"); wlandev->linux_stats.tx_dropped++; result = 0; goto failed; } break; } /* Check for raw transmits */ if(skb->protocol == ETH_P_80211_RAW) { if (!capable(CAP_NET_ADMIN)) { result = 1; goto failed; } /* move the header over */ memcpy(&p80211_hdr, skb->data, sizeof(p80211_hdr_t)); skb_pull(skb, sizeof(p80211_hdr_t)); } else { if ( skb_ether_to_p80211(wlandev, wlandev->ethconv, skb, &p80211_hdr, &p80211_wep) != 0 ) { /* convert failed */ WLAN_LOG_DEBUG(1, "ether_to_80211(%d) failed.\n", wlandev->ethconv); result = 1; goto failed; } } if ( wlandev->txframe == NULL ) { result = 1; goto failed; } netdev->trans_start = jiffies; wlandev->linux_stats.tx_packets++; /* count only the packet payload */ wlandev->linux_stats.tx_bytes += skb->len; txresult = wlandev->txframe(wlandev, skb, &p80211_hdr, &p80211_wep); if ( txresult == 0) { /* success and more buf */ /* avail, re: hw_txdata */ p80211netdev_wake_queue(wlandev); result = 0; } else if ( txresult == 1 ) { /* success, no more avail */ WLAN_LOG_DEBUG(3, "txframe success, no more bufs\n"); /* netdev->tbusy = 1; don't set here, irqhdlr */ /* may have already cleared it */ result = 0; } else if ( txresult == 2 ) { /* alloc failure, drop frame */ WLAN_LOG_DEBUG(3, "txframe returned alloc_fail\n"); result = 1; } else { /* buffer full or queue busy, drop frame. */ WLAN_LOG_DEBUG(3, "txframe returned full or busy\n"); result = 1; } failed: /* Free up the WEP buffer if it's not the same as the skb */ if ((p80211_wep.data) && (p80211_wep.data != skb->data)) kfree(p80211_wep.data); /* we always free the skb here, never in a lower level. */ if (!result) dev_kfree_skb(skb); DBFEXIT; return result; } /*---------------------------------------------------------------- * p80211knetdev_set_multicast_list * * Called from higher lavers whenever there's a need to set/clear * promiscuous mode or rewrite the multicast list. * * Arguments: * none * * Returns: * nothing ----------------------------------------------------------------*/ static void p80211knetdev_set_multicast_list(netdevice_t *dev) { wlandevice_t *wlandev = (wlandevice_t*)dev->priv; DBFENTER; /* TODO: real multicast support as well */ if (wlandev->set_multicast_list) wlandev->set_multicast_list(wlandev, dev); DBFEXIT; } #ifdef SIOCETHTOOL static int p80211netdev_ethtool(wlandevice_t *wlandev, void __user *useraddr) { UINT32 ethcmd; struct ethtool_drvinfo info; struct ethtool_value edata; memset(&info, 0, sizeof(info)); memset(&edata, 0, sizeof(edata)); if (copy_from_user(ðcmd, useraddr, sizeof(ethcmd))) return -EFAULT; switch (ethcmd) { case ETHTOOL_GDRVINFO: info.cmd = ethcmd; snprintf(info.driver, sizeof(info.driver), "p80211_%s", wlandev->nsdname); snprintf(info.version, sizeof(info.version), "%s", WLAN_RELEASE); // info.fw_version // info.bus_info if (copy_to_user(useraddr, &info, sizeof(info))) return -EFAULT; return 0; #ifdef ETHTOOL_GLINK case ETHTOOL_GLINK: edata.cmd = ethcmd; if (wlandev->linkstatus && (wlandev->macmode != WLAN_MACMODE_NONE)) { edata.data = 1; } else { edata.data = 0; } if (copy_to_user(useraddr, &edata, sizeof(edata))) return -EFAULT; return 0; } #endif return -EOPNOTSUPP; } #endif /*---------------------------------------------------------------- * p80211knetdev_do_ioctl * * Handle an ioctl call on one of our devices. Everything Linux * ioctl specific is done here. Then we pass the contents of the * ifr->data to the request message handler. * * Arguments: * dev Linux kernel netdevice * ifr Our private ioctl request structure, typed for the * generic struct ifreq so we can use ptr to func * w/o cast. * * Returns: * zero on success, a negative errno on failure. Possible values: * -ENETDOWN Device isn't up. * -EBUSY cmd already in progress * -ETIME p80211 cmd timed out (MSD may have its own timers) * -EFAULT memory fault copying msg from user buffer * -ENOMEM unable to allocate kernel msg buffer * -ENOSYS bad magic, it the cmd really for us? * -EINTR sleeping on cmd, awakened by signal, cmd cancelled. * * Call Context: * Process thread (ioctl caller). TODO: SMP support may require * locks. ----------------------------------------------------------------*/ static int p80211knetdev_do_ioctl(netdevice_t *dev, struct ifreq *ifr, int cmd) { int result = 0; p80211ioctl_req_t *req = (p80211ioctl_req_t*)ifr; wlandevice_t *wlandev = (wlandevice_t*)dev->priv; UINT8 *msgbuf; DBFENTER; WLAN_LOG_DEBUG(2, "rx'd ioctl, cmd=%d, len=%d\n", cmd, req->len); mutex_lock(&wlandev->ioctl_lock); #if WIRELESS_EXT < 13 /* Is this a wireless extensions ioctl? */ if ((cmd >= SIOCIWFIRST) && (cmd <= SIOCIWLAST)) { if ((result = p80211wext_support_ioctl(dev, ifr, cmd)) != (-EOPNOTSUPP)) { goto bail; } } #endif #ifdef SIOCETHTOOL if (cmd == SIOCETHTOOL) { result = p80211netdev_ethtool(wlandev, (void __user *) ifr->ifr_data); goto bail; } #endif /* Test the magic, assume ifr is good if it's there */ if ( req->magic != P80211_IOCTL_MAGIC ) { result = -ENOSYS; goto bail; } if ( cmd == P80211_IFTEST ) { result = 0; goto bail; } else if ( cmd != P80211_IFREQ ) { result = -ENOSYS; goto bail; } /* Allocate a buf of size req->len */ if ((msgbuf = kmalloc( req->len, GFP_KERNEL))) { if ( copy_from_user( msgbuf, (void __user *) req->data, req->len) ) { result = -EFAULT; } else { result = p80211req_dorequest( wlandev, msgbuf); } if ( result == 0 ) { if ( copy_to_user( (void __user *) req->data, msgbuf, req->len)) { result = -EFAULT; } } kfree(msgbuf); } else { result = -ENOMEM; } bail: mutex_unlock(&wlandev->ioctl_lock); DBFEXIT; return result; /* If allocate,copyfrom or copyto fails, return errno */ } /*---------------------------------------------------------------- * p80211knetdev_set_mac_address * * Handles the ioctl for changing the MACAddress of a netdevice * * references: linux/netdevice.h and drivers/net/net_init.c * * NOTE: [MSM] We only prevent address changes when the netdev is * up. We don't control anything based on dot11 state. If the * address is changed on a STA that's currently associated, you * will probably lose the ability to send and receive data frames. * Just be aware. Therefore, this should usually only be done * prior to scan/join/auth/assoc. * * Arguments: * dev netdevice struct * addr the new MACAddress (a struct) * * Returns: * zero on success, a negative errno on failure. Possible values: * -EBUSY device is bussy (cmd not possible) * -and errors returned by: p80211req_dorequest(..) * * by: Collin R. Mulliner ----------------------------------------------------------------*/ static int p80211knetdev_set_mac_address(netdevice_t *dev, void *addr) { struct sockaddr *new_addr = addr; p80211msg_dot11req_mibset_t dot11req; p80211item_unk392_t *mibattr; p80211item_pstr6_t *macaddr; p80211item_uint32_t *resultcode; int result = 0; DBFENTER; /* If we're running, we don't allow MAC address changes */ #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,38) ) if ( dev->start) { return -EBUSY; } #else if (netif_running(dev)) { return -EBUSY; } #endif /* Set up some convenience pointers. */ mibattr = &dot11req.mibattribute; macaddr = (p80211item_pstr6_t*)&mibattr->data; resultcode = &dot11req.resultcode; /* Set up a dot11req_mibset */ memset(&dot11req, 0, sizeof(p80211msg_dot11req_mibset_t)); dot11req.msgcode = DIDmsg_dot11req_mibset; dot11req.msglen = sizeof(p80211msg_dot11req_mibset_t); memcpy(dot11req.devname, ((wlandevice_t*)(dev->priv))->name, WLAN_DEVNAMELEN_MAX - 1); /* Set up the mibattribute argument */ mibattr->did = DIDmsg_dot11req_mibset_mibattribute; mibattr->status = P80211ENUM_msgitem_status_data_ok; mibattr->len = sizeof(mibattr->data); macaddr->did = DIDmib_dot11mac_dot11OperationTable_dot11MACAddress; macaddr->status = P80211ENUM_msgitem_status_data_ok; macaddr->len = sizeof(macaddr->data); macaddr->data.len = WLAN_ADDR_LEN; memcpy(&macaddr->data.data, new_addr->sa_data, WLAN_ADDR_LEN); /* Set up the resultcode argument */ resultcode->did = DIDmsg_dot11req_mibset_resultcode; resultcode->status = P80211ENUM_msgitem_status_no_value; resultcode->len = sizeof(resultcode->data); resultcode->data = 0; /* now fire the request */ result = p80211req_dorequest(dev->priv, (UINT8*)&dot11req); /* If the request wasn't successful, report an error and don't * change the netdev address */ if ( result != 0 || resultcode->data != P80211ENUM_resultcode_success) { WLAN_LOG_ERROR( "Low-level driver failed dot11req_mibset(dot11MACAddress).\n"); result = -EADDRNOTAVAIL; } else { /* everything's ok, change the addr in netdev */ memcpy(dev->dev_addr, new_addr->sa_data, dev->addr_len); } DBFEXIT; return result; } static int wlan_change_mtu(netdevice_t *dev, int new_mtu) { DBFENTER; // 2312 is max 802.11 payload, 20 is overhead, (ether + llc +snap) // and another 8 for wep. if ( (new_mtu < 68) || (new_mtu > (2312 - 20 - 8))) return -EINVAL; dev->mtu = new_mtu; DBFEXIT; return 0; } /*---------------------------------------------------------------- * wlan_setup * * Roughly matches the functionality of ether_setup. Here * we set up any members of the wlandevice structure that are common * to all devices. Additionally, we allocate a linux 'struct device' * and perform the same setup as ether_setup. * * Note: It's important that the caller have setup the wlandev->name * ptr prior to calling this function. * * Arguments: * wlandev ptr to the wlandev structure for the * interface. * Returns: * zero on success, non-zero otherwise. * Call Context: * Should be process thread. We'll assume it might be * interrupt though. When we add support for statically * compiled drivers, this function will be called in the * context of the kernel startup code. ----------------------------------------------------------------*/ int wlan_setup(wlandevice_t *wlandev) { int result = 0; netdevice_t *dev; DBFENTER; /* Set up the wlandev */ wlandev->state = WLAN_DEVICE_CLOSED; wlandev->ethconv = WLAN_ETHCONV_8021h; wlandev->macmode = WLAN_MACMODE_NONE; /* Set up the rx queue */ skb_queue_head_init(&wlandev->nsd_rxq); tasklet_init(&wlandev->rx_bh, p80211netdev_rx_bh, (unsigned long)wlandev); /* Allocate and initialize the struct device */ dev = kmalloc(sizeof(netdevice_t), GFP_ATOMIC); if ( dev == NULL ) { WLAN_LOG_ERROR("Failed to alloc netdev.\n"); result = 1; } else { memset( dev, 0, sizeof(netdevice_t)); ether_setup(dev); wlandev->netdev = dev; dev->priv = wlandev; dev->hard_start_xmit = p80211knetdev_hard_start_xmit; dev->get_stats = p80211knetdev_get_stats; mutex_init(&wlandev->ioctl_lock); /* block ioctls until fully initialised. Don't forget to call allow_ioctls at some point!*/ mutex_lock(&wlandev->ioctl_lock); #ifdef HAVE_PRIVATE_IOCTL dev->do_ioctl = p80211knetdev_do_ioctl; #endif #ifdef HAVE_MULTICAST dev->set_multicast_list = p80211knetdev_set_multicast_list; #endif dev->init = p80211knetdev_init; dev->open = p80211knetdev_open; dev->stop = p80211knetdev_stop; #if defined(CONFIG_NET_WIRELESS) || defined(WIRELESS_EXT) #if (WIRELESS_EXT < 17) dev->get_wireless_stats = p80211wext_get_wireless_stats; #endif #if WIRELESS_EXT > 12 dev->wireless_handlers = &p80211wext_handler_def; #endif #endif #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) ) dev->nd_net = &init_net; #endif #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,38) ) dev->tbusy = 1; dev->start = 0; #else netif_stop_queue(dev); #endif #ifdef HAVE_CHANGE_MTU dev->change_mtu = wlan_change_mtu; #endif #ifdef HAVE_SET_MAC_ADDR dev->set_mac_address = p80211knetdev_set_mac_address; #endif #ifdef HAVE_TX_TIMEOUT dev->tx_timeout = &p80211knetdev_tx_timeout; dev->watchdog_timeo = (wlan_watchdog * HZ) / 1000; #endif netif_carrier_off(dev); } DBFEXIT; return result; } /*---------------------------------------------------------------- * wlan_unsetup * * This function is paired with the wlan_setup routine. It should * be called after unregister_wlandev. Basically, all it does is * free the 'struct device' that's associated with the wlandev. * We do it here because the 'struct device' isn't allocated * explicitly in the driver code, it's done in wlan_setup. To * do the free in the driver might seem like 'magic'. * * Arguments: * wlandev ptr to the wlandev structure for the * interface. * Returns: * zero on success, non-zero otherwise. * Call Context: * Should be process thread. We'll assume it might be * interrupt though. When we add support for statically * compiled drivers, this function will be called in the * context of the kernel startup code. ----------------------------------------------------------------*/ int wlan_unsetup(wlandevice_t *wlandev) { int result = 0; DBFENTER; tasklet_kill(&wlandev->rx_bh); if (wlandev->netdev == NULL ) { WLAN_LOG_ERROR("called without wlandev->netdev set.\n"); result = 1; } else { free_netdev(wlandev->netdev); wlandev->netdev = NULL; } DBFEXIT; return 0; } /*---------------------------------------------------------------- * register_wlandev * * Roughly matches the functionality of register_netdev. This function * is called after the driver has successfully probed and set up the * resources for the device. It's now ready to become a named device * in the Linux system. * * First we allocate a name for the device (if not already set), then * we call the Linux function register_netdevice. * * Arguments: * wlandev ptr to the wlandev structure for the * interface. * Returns: * zero on success, non-zero otherwise. * Call Context: * Can be either interrupt or not. ----------------------------------------------------------------*/ int register_wlandev(wlandevice_t *wlandev) { int i = 0; netdevice_t *dev = wlandev->netdev; DBFENTER; i = dev_alloc_name(wlandev->netdev, "wlan%d"); if (i >= 0) { i = register_netdev(wlandev->netdev); } if (i != 0) { return -EIO; } #if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) ) dev->name = wlandev->name; #else strcpy(wlandev->name, dev->name); #endif #ifdef CONFIG_PROC_FS if (proc_p80211) { wlandev->procdir = proc_mkdir(wlandev->name, proc_p80211); if ( wlandev->procdir ) wlandev->procwlandev = create_proc_read_entry("wlandev", 0, wlandev->procdir, p80211netdev_proc_read, wlandev); if (wlandev->nsd_proc_read) create_proc_read_entry("nsd", 0, wlandev->procdir, wlandev->nsd_proc_read, wlandev); } #endif if (wlan_wext_write) { /* // fake out a call to ifstate_enable! p80211msg_lnxreq_ifstate_t msg; memset(&msg, 0, sizeof(msg)); msg.msgcode = DIDmsg_lnxreq_ifstate; msg.msglen = sizeof(msg); msg.ifstate.status = P80211ENUM_msgitem_status_data_ok; msg.ifstate.data = P80211ENUM_ifstate_enable; p80211req_dorequest(wlandev, &msg); */ } else { #ifdef CONFIG_HOTPLUG p80211_run_sbin_hotplug(wlandev, WLAN_HOTPLUG_REGISTER); #endif } DBFEXIT; return 0; } /*---------------------------------------------------------------- * unregister_wlandev * * Roughly matches the functionality of unregister_netdev. This * function is called to remove a named device from the system. * * First we tell linux that the device should no longer exist. * Then we remove it from the list of known wlan devices. * * Arguments: * wlandev ptr to the wlandev structure for the * interface. * Returns: * zero on success, non-zero otherwise. * Call Context: * Can be either interrupt or not. ----------------------------------------------------------------*/ int unregister_wlandev(wlandevice_t *wlandev) { struct sk_buff *skb; DBFENTER; #ifdef CONFIG_HOTPLUG p80211_run_sbin_hotplug(wlandev, WLAN_HOTPLUG_REMOVE); #endif #ifdef CONFIG_PROC_FS if ( wlandev->procwlandev ) { remove_proc_entry("wlandev", wlandev->procdir); } if ( wlandev->nsd_proc_read ) { remove_proc_entry("nsd", wlandev->procdir); } if (wlandev->procdir) { remove_proc_entry(wlandev->name, proc_p80211); } #endif unregister_netdev(wlandev->netdev); /* Now to clean out the rx queue */ while ( (skb = skb_dequeue(&wlandev->nsd_rxq)) ) { dev_kfree_skb(skb); } DBFEXIT; return 0; } #ifdef CONFIG_PROC_FS /*---------------------------------------------------------------- * proc_read * * Read function for /proc/net/p80211//wlandev * * Arguments: * buf * start * offset * count * eof * data * Returns: * zero on success, non-zero otherwise. * Call Context: * Can be either interrupt or not. ----------------------------------------------------------------*/ static int p80211netdev_proc_read( char *page, char **start, off_t offset, int count, int *eof, void *data) { char *p = page; wlandevice_t *wlandev = (wlandevice_t *) data; DBFENTER; if (offset != 0) { *eof = 1; goto exit; } p += sprintf(p, "p80211 version: %s (%s)\n\n", WLAN_RELEASE, WLAN_BUILD_DATE); p += sprintf(p, "name : %s\n", wlandev->name); p += sprintf(p, "nsd name : %s\n", wlandev->nsdname); p += sprintf(p, "address : %02x:%02x:%02x:%02x:%02x:%02x\n", wlandev->netdev->dev_addr[0], wlandev->netdev->dev_addr[1], wlandev->netdev->dev_addr[2], wlandev->netdev->dev_addr[3], wlandev->netdev->dev_addr[4], wlandev->netdev->dev_addr[5]); p += sprintf(p, "nsd caps : %s%s%s%s%s%s%s%s%s%s\n", (wlandev->nsdcaps & P80211_NSDCAP_HARDWAREWEP) ? "wep_hw " : "", (wlandev->nsdcaps & P80211_NSDCAP_TIEDWEP) ? "wep_tied " : "", (wlandev->nsdcaps & P80211_NSDCAP_NOHOSTWEP) ? "wep_hw_only " : "", (wlandev->nsdcaps & P80211_NSDCAP_PBCC) ? "pbcc " : "", (wlandev->nsdcaps & P80211_NSDCAP_SHORT_PREAMBLE) ? "short_preamble " : "", (wlandev->nsdcaps & P80211_NSDCAP_AGILITY) ? "agility " : "", (wlandev->nsdcaps & P80211_NSDCAP_AP_RETRANSMIT) ? "ap_retransmit " : "", (wlandev->nsdcaps & P80211_NSDCAP_HWFRAGMENT) ? "hw_frag " : "", (wlandev->nsdcaps & P80211_NSDCAP_AUTOJOIN) ? "autojoin " : "", (wlandev->nsdcaps & P80211_NSDCAP_NOSCAN) ? "" : "scan "); p += sprintf(p, "bssid : %02x:%02x:%02x:%02x:%02x:%02x\n", wlandev->bssid[0], wlandev->bssid[1], wlandev->bssid[2], wlandev->bssid[3], wlandev->bssid[4], wlandev->bssid[5]); p += sprintf(p, "Enabled : %s%s\n", (wlandev->shortpreamble) ? "short_preamble " : "", (wlandev->hostwep & HOSTWEP_PRIVACYINVOKED) ? "privacy" : ""); p += sprintf(p, "msdstate=%d\n", wlandev->msdstate); exit: DBFEXIT; return (p - page); } #endif /*---------------------------------------------------------------- * p80211netdev_hwremoved * * Hardware removed notification. This function should be called * immediately after an MSD has detected that the underlying hardware * has been yanked out from under us. The primary things we need * to do are: * - Mark the wlandev * - Prevent any further traffic from the knetdev i/f * - Prevent any further requests from mgmt i/f * - If there are any waitq'd mgmt requests or mgmt-frame exchanges, * shut them down. * - Call the MSD hwremoved function. * * The remainder of the cleanup will be handled by unregister(). * Our primary goal here is to prevent as much tickling of the MSD * as possible since the MSD is already in a 'wounded' state. * * TODO: As new features are added, this function should be * updated. * * Arguments: * wlandev WLAN network device structure * Returns: * nothing * Side effects: * * Call context: * Usually interrupt. ----------------------------------------------------------------*/ void p80211netdev_hwremoved(wlandevice_t *wlandev) { DBFENTER; wlandev->hwremoved = 1; if ( wlandev->state == WLAN_DEVICE_OPEN) { p80211netdev_stop_queue(wlandev); } netif_device_detach(wlandev->netdev); DBFEXIT; } /*---------------------------------------------------------------- * p80211_rx_typedrop * * Classifies the frame, increments the appropriate counter, and * returns 0|1|2 indicating whether the driver should handle, ignore, or * drop the frame * * Arguments: * wlandev wlan device structure * fc frame control field * * Returns: * zero if the frame should be handled by the driver, * one if the frame should be ignored * anything else means we drop it. * * Side effects: * * Call context: * interrupt ----------------------------------------------------------------*/ static int p80211_rx_typedrop( wlandevice_t *wlandev, UINT16 fc) { UINT16 ftype; UINT16 fstype; int drop = 0; /* Classify frame, increment counter */ ftype = WLAN_GET_FC_FTYPE(fc); fstype = WLAN_GET_FC_FSTYPE(fc); #if 0 WLAN_LOG_DEBUG(4, "rx_typedrop : ftype=%d fstype=%d.\n", ftype, fstype); #endif switch ( ftype ) { case WLAN_FTYPE_MGMT: if ((wlandev->netdev->flags & IFF_PROMISC) || (wlandev->netdev->flags & IFF_ALLMULTI)) { drop = 1; break; } WLAN_LOG_DEBUG(3, "rx'd mgmt:\n"); wlandev->rx.mgmt++; switch( fstype ) { case WLAN_FSTYPE_ASSOCREQ: /* printk("assocreq"); */ wlandev->rx.assocreq++; break; case WLAN_FSTYPE_ASSOCRESP: /* printk("assocresp"); */ wlandev->rx.assocresp++; break; case WLAN_FSTYPE_REASSOCREQ: /* printk("reassocreq"); */ wlandev->rx.reassocreq++; break; case WLAN_FSTYPE_REASSOCRESP: /* printk("reassocresp"); */ wlandev->rx.reassocresp++; break; case WLAN_FSTYPE_PROBEREQ: /* printk("probereq"); */ wlandev->rx.probereq++; break; case WLAN_FSTYPE_PROBERESP: /* printk("proberesp"); */ wlandev->rx.proberesp++; break; case WLAN_FSTYPE_BEACON: /* printk("beacon"); */ wlandev->rx.beacon++; break; case WLAN_FSTYPE_ATIM: /* printk("atim"); */ wlandev->rx.atim++; break; case WLAN_FSTYPE_DISASSOC: /* printk("disassoc"); */ wlandev->rx.disassoc++; break; case WLAN_FSTYPE_AUTHEN: /* printk("authen"); */ wlandev->rx.authen++; break; case WLAN_FSTYPE_DEAUTHEN: /* printk("deauthen"); */ wlandev->rx.deauthen++; break; default: /* printk("unknown"); */ wlandev->rx.mgmt_unknown++; break; } /* printk("\n"); */ drop = 2; break; case WLAN_FTYPE_CTL: if ((wlandev->netdev->flags & IFF_PROMISC) || (wlandev->netdev->flags & IFF_ALLMULTI)) { drop = 1; break; } WLAN_LOG_DEBUG(3, "rx'd ctl:\n"); wlandev->rx.ctl++; switch( fstype ) { case WLAN_FSTYPE_PSPOLL: /* printk("pspoll"); */ wlandev->rx.pspoll++; break; case WLAN_FSTYPE_RTS: /* printk("rts"); */ wlandev->rx.rts++; break; case WLAN_FSTYPE_CTS: /* printk("cts"); */ wlandev->rx.cts++; break; case WLAN_FSTYPE_ACK: /* printk("ack"); */ wlandev->rx.ack++; break; case WLAN_FSTYPE_CFEND: /* printk("cfend"); */ wlandev->rx.cfend++; break; case WLAN_FSTYPE_CFENDCFACK: /* printk("cfendcfack"); */ wlandev->rx.cfendcfack++; break; default: /* printk("unknown"); */ wlandev->rx.ctl_unknown++; break; } /* printk("\n"); */ drop = 2; break; case WLAN_FTYPE_DATA: wlandev->rx.data++; switch( fstype ) { case WLAN_FSTYPE_DATAONLY: wlandev->rx.dataonly++; break; case WLAN_FSTYPE_DATA_CFACK: wlandev->rx.data_cfack++; break; case WLAN_FSTYPE_DATA_CFPOLL: wlandev->rx.data_cfpoll++; break; case WLAN_FSTYPE_DATA_CFACK_CFPOLL: wlandev->rx.data__cfack_cfpoll++; break; case WLAN_FSTYPE_NULL: WLAN_LOG_DEBUG(3, "rx'd data:null\n"); wlandev->rx.null++; break; case WLAN_FSTYPE_CFACK: WLAN_LOG_DEBUG(3, "rx'd data:cfack\n"); wlandev->rx.cfack++; break; case WLAN_FSTYPE_CFPOLL: WLAN_LOG_DEBUG(3, "rx'd data:cfpoll\n"); wlandev->rx.cfpoll++; break; case WLAN_FSTYPE_CFACK_CFPOLL: WLAN_LOG_DEBUG(3, "rx'd data:cfack_cfpoll\n"); wlandev->rx.cfack_cfpoll++; break; default: /* printk("unknown"); */ wlandev->rx.data_unknown++; break; } break; } return drop; } #ifdef CONFIG_HOTPLUG /* Notify userspace when a netdevice event occurs, * by running '/sbin/hotplug net' with certain * environment variables set. */ int p80211_run_sbin_hotplug(wlandevice_t *wlandev, char *action) { char *argv[3], *envp[7], ifname[12 + IFNAMSIZ], action_str[32]; char nsdname[32], wlan_wext[32]; int i; if (wlandev) { sprintf(ifname, "INTERFACE=%s", wlandev->name); sprintf(nsdname, "NSDNAME=%s", wlandev->nsdname); } else { sprintf(ifname, "INTERFACE=null"); sprintf(nsdname, "NSDNAME=null"); } sprintf(wlan_wext, "WLAN_WEXT=%s", wlan_wext_write ? "y" : ""); sprintf(action_str, "ACTION=%s", action); i = 0; argv[i++] = hotplug_path; argv[i++] = "wlan"; argv[i] = NULL; i = 0; /* minimal command environment */ envp [i++] = "HOME=/"; envp [i++] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin"; envp [i++] = ifname; envp [i++] = action_str; envp [i++] = nsdname; envp [i++] = wlan_wext; envp [i] = NULL; #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,62)) return call_usermodehelper(argv [0], argv, envp); #else return call_usermodehelper(argv [0], argv, envp, 0); #endif } #endif void p80211_suspend(wlandevice_t *wlandev) { DBFENTER; #ifdef CONFIG_HOTPLUG p80211_run_sbin_hotplug(wlandev, WLAN_HOTPLUG_SUSPEND); #endif DBFEXIT; } void p80211_resume(wlandevice_t *wlandev) { DBFENTER; #ifdef CONFIG_HOTPLUG p80211_run_sbin_hotplug(wlandev, WLAN_HOTPLUG_RESUME); #endif DBFEXIT; } static void p80211knetdev_tx_timeout( netdevice_t *netdev) { wlandevice_t *wlandev = (wlandevice_t*)netdev->priv; DBFENTER; if (wlandev->tx_timeout) { wlandev->tx_timeout(wlandev); } else { WLAN_LOG_WARNING("Implement tx_timeout for %s\n", wlandev->nsdname); p80211netdev_wake_queue(wlandev); } DBFEXIT; } void p80211_allow_ioctls(wlandevice_t *wlandev) { mutex_unlock(&wlandev->ioctl_lock); } linux-wlan-ng-0.2.9+dfsg/src/p80211/p80211conv.c0000644000175000017500000005117511024763163020056 0ustar tormodtormod/* src/p80211/p80211conv.c * * Ether/802.11 conversions and packet buffer routines * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- * * This file defines the functions that perform Ethernet to/from * 802.11 frame conversions. * * -------------------------------------------------------------------- */ /*================================================================*/ /* System Includes */ #define __NO_VERSION__ /* prevent the static definition */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include /*================================================================*/ /* Project Includes */ #include #include #include #include #include #include #include #include /*================================================================*/ /* Local Constants */ /*================================================================*/ /* Local Macros */ /*================================================================*/ /* Local Types */ /*================================================================*/ /* Local Static Definitions */ static UINT8 oui_rfc1042[] = {0x00, 0x00, 0x00}; static UINT8 oui_8021h[] = {0x00, 0x00, 0xf8}; /*================================================================*/ /* Local Function Declarations */ /*================================================================*/ /* Function Definitions */ /*---------------------------------------------------------------- * p80211pb_ether_to_80211 * * Uses the contents of the ether frame and the etherconv setting * to build the elements of the 802.11 frame. * * We don't actually set * up the frame header here. That's the MAC's job. We're only handling * conversion of DIXII or 802.3+LLC frames to something that works * with 802.11. * * Note -- 802.11 header is NOT part of the skb. Likewise, the 802.11 * FCS is also not present and will need to be added elsewhere. * * Arguments: * ethconv Conversion type to perform * skb skbuff containing the ether frame * p80211_hdr 802.11 header * * Returns: * 0 on success, non-zero otherwise * * Call context: * May be called in interrupt or non-interrupt context ----------------------------------------------------------------*/ int skb_ether_to_p80211( wlandevice_t *wlandev, UINT32 ethconv, struct sk_buff *skb, p80211_hdr_t *p80211_hdr, p80211_metawep_t *p80211_wep) { UINT16 fc; UINT16 proto; wlan_ethhdr_t e_hdr; wlan_llc_t *e_llc; wlan_snap_t *e_snap; int foo; DBFENTER; memcpy(&e_hdr, skb->data, sizeof(e_hdr)); if (skb->len <= 0) { WLAN_LOG_DEBUG(1, "zero-length skb!\n"); return 1; } if ( ethconv == WLAN_ETHCONV_ENCAP ) { /* simplest case */ WLAN_LOG_DEBUG(3, "ENCAP len: %d\n", skb->len); /* here, we don't care what kind of ether frm. Just stick it */ /* in the 80211 payload */ /* which is to say, leave the skb alone. */ } else { /* step 1: classify ether frame, DIX or 802.3? */ proto = ntohs(e_hdr.type); if ( proto <= 1500 ) { WLAN_LOG_DEBUG(3, "802.3 len: %d\n", skb->len); /* codes <= 1500 reserved for 802.3 lengths */ /* it's 802.3, pass ether payload unchanged, */ /* trim off ethernet header */ skb_pull(skb, WLAN_ETHHDR_LEN); /* leave off any PAD octets. */ skb_trim(skb, proto); } else { WLAN_LOG_DEBUG(3, "DIXII len: %d\n", skb->len); /* it's DIXII, time for some conversion */ /* trim off ethernet header */ skb_pull(skb, WLAN_ETHHDR_LEN); /* tack on SNAP */ e_snap = (wlan_snap_t *) skb_push(skb, sizeof(wlan_snap_t)); e_snap->type = htons(proto); if ( ethconv == WLAN_ETHCONV_8021h && p80211_stt_findproto(proto) ) { memcpy( e_snap->oui, oui_8021h, WLAN_IEEE_OUI_LEN); } else { memcpy( e_snap->oui, oui_rfc1042, WLAN_IEEE_OUI_LEN); } /* tack on llc */ e_llc = (wlan_llc_t *) skb_push(skb, sizeof(wlan_llc_t)); e_llc->dsap = 0xAA; /* SNAP, see IEEE 802 */ e_llc->ssap = 0xAA; e_llc->ctl = 0x03; } } /* Set up the 802.11 header */ /* It's a data frame */ fc = host2ieee16( WLAN_SET_FC_FTYPE(WLAN_FTYPE_DATA) | WLAN_SET_FC_FSTYPE(WLAN_FSTYPE_DATAONLY)); switch ( wlandev->macmode ) { case WLAN_MACMODE_IBSS_STA: memcpy(p80211_hdr->a3.a1, &e_hdr.daddr, WLAN_ADDR_LEN); memcpy(p80211_hdr->a3.a2, wlandev->netdev->dev_addr, WLAN_ADDR_LEN); memcpy(p80211_hdr->a3.a3, wlandev->bssid, WLAN_ADDR_LEN); break; case WLAN_MACMODE_ESS_STA: fc |= host2ieee16(WLAN_SET_FC_TODS(1)); memcpy(p80211_hdr->a3.a1, wlandev->bssid, WLAN_ADDR_LEN); memcpy(p80211_hdr->a3.a2, wlandev->netdev->dev_addr, WLAN_ADDR_LEN); memcpy(p80211_hdr->a3.a3, &e_hdr.daddr, WLAN_ADDR_LEN); break; case WLAN_MACMODE_ESS_AP: fc |= host2ieee16(WLAN_SET_FC_FROMDS(1)); memcpy(p80211_hdr->a3.a1, &e_hdr.daddr, WLAN_ADDR_LEN); memcpy(p80211_hdr->a3.a2, wlandev->bssid, WLAN_ADDR_LEN); memcpy(p80211_hdr->a3.a3, &e_hdr.saddr, WLAN_ADDR_LEN); break; default: WLAN_LOG_ERROR("Error: Converting eth to wlan in unknown mode.\n"); return 1; break; } p80211_wep->data = NULL; if ((wlandev->hostwep & HOSTWEP_PRIVACYINVOKED) && (wlandev->hostwep & HOSTWEP_ENCRYPT)) { // XXXX need to pick keynum other than default? #if 1 p80211_wep->data = kmalloc(skb->len, GFP_ATOMIC); #else p80211_wep->data = skb->data; #endif if ((foo = wep_encrypt(wlandev, skb->data, p80211_wep->data, skb->len, (wlandev->hostwep & HOSTWEP_DEFAULTKEY_MASK), p80211_wep->iv, p80211_wep->icv))) { WLAN_LOG_WARNING("Host en-WEP failed, dropping frame (%d).\n", foo); return 2; } fc |= host2ieee16(WLAN_SET_FC_ISWEP(1)); } // skb->nh.raw = skb->data; p80211_hdr->a3.fc = fc; p80211_hdr->a3.dur = 0; p80211_hdr->a3.seq = 0; DBFEXIT; return 0; } /* jkriegl: from orinoco, modified */ static void orinoco_spy_gather(wlandevice_t *wlandev, char *mac, p80211_rxmeta_t *rxmeta) { int i; /* Gather wireless spy statistics: for each packet, compare the * source address with out list, and if match, get the stats... */ for (i = 0; i < wlandev->spy_number; i++) { if (!memcmp(wlandev->spy_address[i], mac, ETH_ALEN)) { memcpy(wlandev->spy_address[i], mac, ETH_ALEN); wlandev->spy_stat[i].level = rxmeta->signal; wlandev->spy_stat[i].noise = rxmeta->noise; wlandev->spy_stat[i].qual = (rxmeta->signal > rxmeta->noise) ? \ (rxmeta->signal - rxmeta->noise) : 0; wlandev->spy_stat[i].updated = 0x7; } } } /*---------------------------------------------------------------- * p80211pb_80211_to_ether * * Uses the contents of a received 802.11 frame and the etherconv * setting to build an ether frame. * * This function extracts the src and dest address from the 802.11 * frame to use in the construction of the eth frame. * * Arguments: * ethconv Conversion type to perform * skb Packet buffer containing the 802.11 frame * * Returns: * 0 on success, non-zero otherwise * * Call context: * May be called in interrupt or non-interrupt context ----------------------------------------------------------------*/ int skb_p80211_to_ether( wlandevice_t *wlandev, UINT32 ethconv, struct sk_buff *skb) { netdevice_t *netdev = wlandev->netdev; UINT16 fc; UINT payload_length; UINT payload_offset; UINT8 daddr[WLAN_ETHADDR_LEN]; UINT8 saddr[WLAN_ETHADDR_LEN]; p80211_hdr_t *w_hdr; wlan_ethhdr_t *e_hdr; wlan_llc_t *e_llc; wlan_snap_t *e_snap; int foo; DBFENTER; payload_length = skb->len - WLAN_HDR_A3_LEN - WLAN_CRC_LEN; payload_offset = WLAN_HDR_A3_LEN; w_hdr = (p80211_hdr_t *) skb->data; /* setup some vars for convenience */ fc = ieee2host16(w_hdr->a3.fc); if ( (WLAN_GET_FC_TODS(fc) == 0) && (WLAN_GET_FC_FROMDS(fc) == 0) ) { memcpy(daddr, w_hdr->a3.a1, WLAN_ETHADDR_LEN); memcpy(saddr, w_hdr->a3.a2, WLAN_ETHADDR_LEN); } else if( (WLAN_GET_FC_TODS(fc) == 0) && (WLAN_GET_FC_FROMDS(fc) == 1) ) { memcpy(daddr, w_hdr->a3.a1, WLAN_ETHADDR_LEN); memcpy(saddr, w_hdr->a3.a3, WLAN_ETHADDR_LEN); } else if( (WLAN_GET_FC_TODS(fc) == 1) && (WLAN_GET_FC_FROMDS(fc) == 0) ) { memcpy(daddr, w_hdr->a3.a3, WLAN_ETHADDR_LEN); memcpy(saddr, w_hdr->a3.a2, WLAN_ETHADDR_LEN); } else { payload_offset = WLAN_HDR_A4_LEN; payload_length -= ( WLAN_HDR_A4_LEN - WLAN_HDR_A3_LEN ); if (payload_length < 0 ) { WLAN_LOG_ERROR("A4 frame too short!\n"); return 1; } memcpy(daddr, w_hdr->a4.a3, WLAN_ETHADDR_LEN); memcpy(saddr, w_hdr->a4.a4, WLAN_ETHADDR_LEN); } /* perform de-wep if necessary.. */ if ((wlandev->hostwep & HOSTWEP_PRIVACYINVOKED) && WLAN_GET_FC_ISWEP(fc) && (wlandev->hostwep & HOSTWEP_DECRYPT)) { if (payload_length <= 8) { WLAN_LOG_ERROR("WEP frame too short (%u).\n", skb->len); return 1; } if ((foo = wep_decrypt(wlandev, skb->data + payload_offset + 4, payload_length - 8, -1, skb->data + payload_offset, skb->data + payload_offset + payload_length - 4))) { /* de-wep failed, drop skb. */ WLAN_LOG_DEBUG(1, "Host de-WEP failed, dropping frame (%d).\n", foo); wlandev->rx.decrypt_err++; return 2; } /* subtract the IV+ICV length off the payload */ payload_length -= 8; /* chop off the IV */ skb_pull(skb, 4); /* chop off the ICV. */ skb_trim(skb, skb->len - 4); wlandev->rx.decrypt++; } e_hdr = (wlan_ethhdr_t *) (skb->data + payload_offset); e_llc = (wlan_llc_t *) (skb->data + payload_offset); e_snap = (wlan_snap_t *) (skb->data + payload_offset + sizeof(wlan_llc_t)); /* Test for the various encodings */ if ( (payload_length >= sizeof(wlan_ethhdr_t)) && ( e_llc->dsap != 0xaa || e_llc->ssap != 0xaa ) && ((memcmp(daddr, e_hdr->daddr, WLAN_ETHADDR_LEN) == 0) || (memcmp(saddr, e_hdr->saddr, WLAN_ETHADDR_LEN) == 0))) { WLAN_LOG_DEBUG(3, "802.3 ENCAP len: %d\n", payload_length); /* 802.3 Encapsulated */ /* Test for an overlength frame */ if ( payload_length > (netdev->mtu + WLAN_ETHHDR_LEN)) { /* A bogus length ethfrm has been encap'd. */ /* Is someone trying an oflow attack? */ WLAN_LOG_ERROR("ENCAP frame too large (%d > %d)\n", payload_length, netdev->mtu + WLAN_ETHHDR_LEN); return 1; } /* Chop off the 802.11 header. it's already sane. */ skb_pull(skb, payload_offset); /* chop off the 802.11 CRC */ skb_trim(skb, skb->len - WLAN_CRC_LEN); } else if ((payload_length >= sizeof(wlan_llc_t) + sizeof(wlan_snap_t)) && (e_llc->dsap == 0xaa) && (e_llc->ssap == 0xaa) && (e_llc->ctl == 0x03) && (((memcmp( e_snap->oui, oui_rfc1042, WLAN_IEEE_OUI_LEN)==0) && (ethconv == WLAN_ETHCONV_8021h) && (p80211_stt_findproto(ieee2host16(e_snap->type)))) || (memcmp( e_snap->oui, oui_rfc1042, WLAN_IEEE_OUI_LEN)!=0))) { WLAN_LOG_DEBUG(3, "SNAP+RFC1042 len: %d\n", payload_length); /* it's a SNAP + RFC1042 frame && protocol is in STT */ /* build 802.3 + RFC1042 */ /* Test for an overlength frame */ if ( payload_length > netdev->mtu ) { /* A bogus length ethfrm has been sent. */ /* Is someone trying an oflow attack? */ WLAN_LOG_ERROR("SNAP frame too large (%d > %d)\n", payload_length, netdev->mtu); return 1; } /* chop 802.11 header from skb. */ skb_pull(skb, payload_offset); /* create 802.3 header at beginning of skb. */ e_hdr = (wlan_ethhdr_t *) skb_push(skb, WLAN_ETHHDR_LEN); memcpy(e_hdr->daddr, daddr, WLAN_ETHADDR_LEN); memcpy(e_hdr->saddr, saddr, WLAN_ETHADDR_LEN); e_hdr->type = htons(payload_length); /* chop off the 802.11 CRC */ skb_trim(skb, skb->len - WLAN_CRC_LEN); } else if ((payload_length >= sizeof(wlan_llc_t) + sizeof(wlan_snap_t)) && (e_llc->dsap == 0xaa) && (e_llc->ssap == 0xaa) && (e_llc->ctl == 0x03) ) { WLAN_LOG_DEBUG(3, "802.1h/RFC1042 len: %d\n", payload_length); /* it's an 802.1h frame || (an RFC1042 && protocol is not in STT) */ /* build a DIXII + RFC894 */ /* Test for an overlength frame */ if ((payload_length - sizeof(wlan_llc_t) - sizeof(wlan_snap_t)) > netdev->mtu) { /* A bogus length ethfrm has been sent. */ /* Is someone trying an oflow attack? */ WLAN_LOG_ERROR("DIXII frame too large (%ld > %d)\n", (long int) (payload_length - sizeof(wlan_llc_t) - sizeof(wlan_snap_t)), netdev->mtu); return 1; } /* chop 802.11 header from skb. */ skb_pull(skb, payload_offset); /* chop llc header from skb. */ skb_pull(skb, sizeof(wlan_llc_t)); /* chop snap header from skb. */ skb_pull(skb, sizeof(wlan_snap_t)); /* create 802.3 header at beginning of skb. */ e_hdr = (wlan_ethhdr_t *) skb_push(skb, WLAN_ETHHDR_LEN); e_hdr->type = e_snap->type; memcpy(e_hdr->daddr, daddr, WLAN_ETHADDR_LEN); memcpy(e_hdr->saddr, saddr, WLAN_ETHADDR_LEN); /* chop off the 802.11 CRC */ skb_trim(skb, skb->len - WLAN_CRC_LEN); } else { WLAN_LOG_DEBUG(3, "NON-ENCAP len: %d\n", payload_length); /* any NON-ENCAP */ /* it's a generic 80211+LLC or IPX 'Raw 802.3' */ /* build an 802.3 frame */ /* allocate space and setup hostbuf */ /* Test for an overlength frame */ if ( payload_length > netdev->mtu ) { /* A bogus length ethfrm has been sent. */ /* Is someone trying an oflow attack? */ WLAN_LOG_ERROR("OTHER frame too large (%d > %d)\n", payload_length, netdev->mtu); return 1; } /* Chop off the 802.11 header. */ skb_pull(skb, payload_offset); /* create 802.3 header at beginning of skb. */ e_hdr = (wlan_ethhdr_t *) skb_push(skb, WLAN_ETHHDR_LEN); memcpy(e_hdr->daddr, daddr, WLAN_ETHADDR_LEN); memcpy(e_hdr->saddr, saddr, WLAN_ETHADDR_LEN); e_hdr->type = htons(payload_length); /* chop off the 802.11 CRC */ skb_trim(skb, skb->len - WLAN_CRC_LEN); } /* * Note that eth_type_trans() expects an skb w/ skb->data pointing * at the MAC header, it then sets the following skb members: * skb->mac_header, * skb->data, and * skb->pkt_type. * It then _returns_ the value that _we're_ supposed to stuff in * skb->protocol. This is nuts. */ skb->protocol = eth_type_trans(skb, netdev); /* jkriegl: process signal and noise as set in hfa384x_int_rx() */ /* jkriegl: only process signal/noise if requested by iwspy */ if (wlandev->spy_number) orinoco_spy_gather(wlandev, eth_hdr(skb)->h_source, P80211SKB_RXMETA(skb)); /* Free the metadata */ p80211skb_rxmeta_detach(skb); DBFEXIT; return 0; } /*---------------------------------------------------------------- * p80211_stt_findproto * * Searches the 802.1h Selective Translation Table for a given * protocol. * * Arguments: * proto protocl number (in host order) to search for. * * Returns: * 1 - if the table is empty or a match is found. * 0 - if the table is non-empty and a match is not found. * * Call context: * May be called in interrupt or non-interrupt context ----------------------------------------------------------------*/ int p80211_stt_findproto(UINT16 proto) { /* Always return found for now. This is the behavior used by the */ /* Zoom Win95 driver when 802.1h mode is selected */ /* TODO: If necessary, add an actual search we'll probably need this to match the CMAC's way of doing things. Need to do some testing to confirm. */ if (proto == 0x80f3) /* APPLETALK */ return 1; return 0; } /*---------------------------------------------------------------- * p80211skb_rxmeta_detach * * Disconnects the frmmeta and rxmeta from an skb. * * Arguments: * wlandev The wlandev this skb belongs to. * skb The skb we're attaching to. * * Returns: * 0 on success, non-zero otherwise * * Call context: * May be called in interrupt or non-interrupt context ----------------------------------------------------------------*/ void p80211skb_rxmeta_detach(struct sk_buff *skb) { p80211_rxmeta_t *rxmeta; p80211_frmmeta_t *frmmeta; DBFENTER; /* Sanity checks */ if ( skb==NULL ) { /* bad skb */ WLAN_LOG_DEBUG(1, "Called w/ null skb.\n"); goto exit; } frmmeta = P80211SKB_FRMMETA(skb); if ( frmmeta == NULL ) { /* no magic */ WLAN_LOG_DEBUG(1, "Called w/ bad frmmeta magic.\n"); goto exit; } rxmeta = frmmeta->rx; if ( rxmeta == NULL ) { /* bad meta ptr */ WLAN_LOG_DEBUG(1, "Called w/ bad rxmeta ptr.\n"); goto exit; } /* Free rxmeta */ kfree(rxmeta); /* Clear skb->cb */ memset(skb->cb, 0, sizeof(skb->cb)); exit: DBFEXIT; return; } /*---------------------------------------------------------------- * p80211skb_rxmeta_attach * * Allocates a p80211rxmeta structure, initializes it, and attaches * it to an skb. * * Arguments: * wlandev The wlandev this skb belongs to. * skb The skb we're attaching to. * * Returns: * 0 on success, non-zero otherwise * * Call context: * May be called in interrupt or non-interrupt context ----------------------------------------------------------------*/ int p80211skb_rxmeta_attach(struct wlandevice *wlandev, struct sk_buff *skb) { int result = 0; p80211_rxmeta_t *rxmeta; p80211_frmmeta_t *frmmeta; DBFENTER; /* If these already have metadata, we error out! */ if (P80211SKB_RXMETA(skb) != NULL) { WLAN_LOG_ERROR("%s: RXmeta already attached!\n", wlandev->name); result = 0; goto exit; } /* Allocate the rxmeta */ rxmeta = kmalloc(sizeof(p80211_rxmeta_t), GFP_ATOMIC); if ( rxmeta == NULL ) { WLAN_LOG_ERROR("%s: Failed to allocate rxmeta.\n", wlandev->name); result = 1; goto exit; } /* Initialize the rxmeta */ memset(rxmeta, 0, sizeof(p80211_rxmeta_t)); rxmeta->wlandev = wlandev; rxmeta->hosttime = jiffies; /* Overlay a frmmeta_t onto skb->cb */ memset(skb->cb, 0, sizeof(p80211_frmmeta_t)); frmmeta = (p80211_frmmeta_t*)(skb->cb); frmmeta->magic = P80211_FRMMETA_MAGIC; frmmeta->rx = rxmeta; exit: DBFEXIT; return result; } /*---------------------------------------------------------------- * p80211skb_free * * Frees an entire p80211skb by checking and freeing the meta struct * and then freeing the skb. * * Arguments: * wlandev The wlandev this skb belongs to. * skb The skb we're attaching to. * * Returns: * 0 on success, non-zero otherwise * * Call context: * May be called in interrupt or non-interrupt context ----------------------------------------------------------------*/ void p80211skb_free(struct wlandevice *wlandev, struct sk_buff *skb) { p80211_frmmeta_t *meta; DBFENTER; meta = P80211SKB_FRMMETA(skb); if ( meta && meta->rx) { p80211skb_rxmeta_detach(skb); } else { WLAN_LOG_ERROR("Freeing an skb (%p) w/ no frmmeta.\n", skb); } dev_kfree_skb(skb); DBFEXIT; return; } linux-wlan-ng-0.2.9+dfsg/src/p80211/p80211wext.c0000644000175000017500000015277411024763163020107 0ustar tormodtormod/* src/p80211/p80211wext.c * * Glue code to make linux-wlan-ng a happy wireless extension camper. * * original author: Reyk Floeter * Completely re-written by Solomon Peachy * * Copyright (C) 2002 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- */ /*================================================================*/ /* System Includes */ #include #include #include #include #include #include #include #include #if WIRELESS_EXT > 12 #include #endif #include #include #include #include /*================================================================*/ /* Project Includes */ #include #include #include #include #include #include #include #include #include #include #include #include static int p80211wext_giwrate(netdevice_t *dev, struct iw_request_info *info, struct iw_param *rrq, char *extra); static int p80211wext_giwessid(netdevice_t *dev, struct iw_request_info *info, struct iw_point *data, char *essid); /* compatibility to wireless extensions */ #ifdef WIRELESS_EXT static UINT8 p80211_mhz_to_channel(UINT16 mhz) { if (mhz >= 5000) { return ((mhz - 5000) / 5); } if (mhz == 2482) return 14; if (mhz >= 2407) { return ((mhz - 2407) / 5); } return 0; } static UINT16 p80211_channel_to_mhz(UINT8 ch, int dot11a) { if (ch == 0) return 0; if (ch > 200) return 0; /* 5G */ if (dot11a) { return (5000 + (5 * ch)); } /* 2.4G */ if (ch == 14) return 2484; if ((ch < 14) && (ch > 0)) { return (2407 + (5 * ch)); } return 0; } /* taken from orinoco.c ;-) */ static const long p80211wext_channel_freq[] = { 2412, 2417, 2422, 2427, 2432, 2437, 2442, 2447, 2452, 2457, 2462, 2467, 2472, 2484 }; #define NUM_CHANNELS (sizeof(p80211wext_channel_freq) / sizeof(p80211wext_channel_freq[0])) /* steal a spare bit to store the shared/opensystems state. should default to open if not set */ #define HOSTWEP_SHAREDKEY BIT3 /** function declarations =============== */ static int qual_as_percent(int snr ) { if ( snr <= 0 ) return 0; if ( snr <= 40 ) return snr*5/2; return 100; } static inline int invalid_state(wlandevice_t *wlandev ) { return wlandev->msdstate != WLAN_MSD_RUNNING; } static int p80211wext_dorequest(wlandevice_t *wlandev, UINT32 did, UINT32 data) { p80211msg_dot11req_mibset_t msg; p80211item_uint32_t mibitem; int result; DBFENTER; msg.msgcode = DIDmsg_dot11req_mibset; mibitem.did = did; mibitem.data = data; memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); result = p80211req_dorequest(wlandev, (UINT8*)&msg); DBFEXIT; return result; } static int p80211wext_autojoin(wlandevice_t *wlandev) { p80211msg_lnxreq_autojoin_t msg; struct iw_point data; char ssid[IW_ESSID_MAX_SIZE]; int result; int err = 0; DBFENTER; if ( invalid_state(wlandev) ) { WLAN_LOG_DEBUG(1,"called from invalid state [%d]\n",wlandev->msdstate); err = -EBUSY; goto exit; } /* Get ESSID */ result = p80211wext_giwessid(wlandev->netdev, NULL, &data, ssid); if (result) { err = -EFAULT; goto exit; } if ( wlandev->hostwep & HOSTWEP_SHAREDKEY ) msg.authtype.data = P80211ENUM_authalg_sharedkey; else msg.authtype.data = P80211ENUM_authalg_opensystem; msg.msgcode = DIDmsg_lnxreq_autojoin; /* Trim the last '\0' to fit the SSID format */ if (data.length && ssid[data.length-1] == '\0') { data.length = data.length - 1; } memcpy(msg.ssid.data.data, ssid, data.length); msg.ssid.data.len = data.length; result = p80211req_dorequest(wlandev, (UINT8*)&msg); if (result) { err = -EFAULT; goto exit; } exit: DBFEXIT; return err; } /* called by /proc/net/wireless */ struct iw_statistics* p80211wext_get_wireless_stats (netdevice_t *dev) { p80211msg_lnxreq_commsquality_t quality; wlandevice_t *wlandev = (wlandevice_t*)dev->priv; struct iw_statistics* wstats = &wlandev->wstats; int retval; DBFENTER; /* Check */ if ( (wlandev == NULL) || (wlandev->msdstate != WLAN_MSD_RUNNING) ) return NULL; /* XXX Only valid in station mode */ wstats->status = 0; /* build request message */ quality.msgcode = DIDmsg_lnxreq_commsquality; quality.dbm.data = P80211ENUM_truth_true; quality.dbm.status = P80211ENUM_msgitem_status_data_ok; /* send message to nsd */ if ( wlandev->mlmerequest == NULL ) return NULL; retval = wlandev->mlmerequest(wlandev, (p80211msg_t*) &quality); wstats->qual.qual = qual_as_percent(quality.link.data); /* overall link quality */ wstats->qual.level = quality.level.data; /* instant signal level */ wstats->qual.noise = quality.noise.data; /* instant noise level */ #if WIRELESS_EXT > 18 wstats->qual.updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM; #else wstats->qual.updated = 7; #endif wstats->discard.code = wlandev->rx.decrypt_err; wstats->discard.nwid = 0; wstats->discard.misc = 0; #if WIRELESS_EXT > 11 wstats->discard.fragment = 0; // incomplete fragments wstats->discard.retries = 0; // tx retries. wstats->miss.beacon = 0; #endif DBFEXIT; return wstats; } static int p80211wext_giwname(netdevice_t *dev, struct iw_request_info *info, char *name, char *extra) { struct iw_param rate; int result; int err = 0; DBFENTER; result = p80211wext_giwrate(dev, NULL, &rate, NULL); if (result) { err = -EFAULT; goto exit; } switch (rate.value) { case 1000000: case 2000000: strcpy(name, "IEEE 802.11-DS"); break; case 5500000: case 11000000: strcpy(name, "IEEE 802.11-b"); break; } exit: DBFEXIT; return err; } static int p80211wext_giwfreq(netdevice_t *dev, struct iw_request_info *info, struct iw_freq *freq, char *extra) { wlandevice_t *wlandev = (wlandevice_t*)dev->priv; p80211item_uint32_t mibitem; p80211msg_dot11req_mibset_t msg; int result; int err = 0; DBFENTER; if ( invalid_state(wlandev) ) { WLAN_LOG_DEBUG(1,"called from invalid state [%d]\n",wlandev->msdstate); err = -EBUSY; goto exit; } msg.msgcode = DIDmsg_dot11req_mibget; mibitem.did = DIDmib_dot11phy_dot11PhyDSSSTable_dot11CurrentChannel; memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); result = p80211req_dorequest(wlandev, (UINT8*)&msg); if (result) { err = -EFAULT; goto exit; } memcpy(&mibitem, &msg.mibattribute.data, sizeof(mibitem)); if (mibitem.data > NUM_CHANNELS) { err = -EFAULT; goto exit; } /* convert into frequency instead of a channel */ freq->e = 1; freq->m = p80211_channel_to_mhz(mibitem.data, 0) * 100000; exit: DBFEXIT; return err; } static int p80211wext_siwfreq(netdevice_t *dev, struct iw_request_info *info, struct iw_freq *freq, char *extra) { wlandevice_t *wlandev = (wlandevice_t*)dev->priv; p80211item_uint32_t mibitem; p80211msg_dot11req_mibset_t msg; int result; int err = 0; DBFENTER; if ( invalid_state(wlandev) ) { WLAN_LOG_DEBUG(1,"called from invalid state [%d]\n",wlandev->msdstate); err = -EBUSY; goto exit; } if (!wlan_wext_write) { err = (-EOPNOTSUPP); goto exit; } msg.msgcode = DIDmsg_dot11req_mibset; mibitem.did = DIDmib_dot11phy_dot11PhyDSSSTable_dot11CurrentChannel; mibitem.status = P80211ENUM_msgitem_status_data_ok; if ( (freq->e == 0) && (freq->m <= 1000) ) mibitem.data = freq->m; else mibitem.data = p80211_mhz_to_channel(freq->m); memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); result = p80211req_dorequest(wlandev, (UINT8*)&msg); if (result) { err = -EFAULT; goto exit; } exit: DBFEXIT; return err; } #if WIRELESS_EXT > 8 static int p80211wext_giwmode(netdevice_t *dev, struct iw_request_info *info, __u32 *mode, char *extra) { wlandevice_t *wlandev = (wlandevice_t*)dev->priv; DBFENTER; switch (wlandev->macmode) { case WLAN_MACMODE_IBSS_STA: *mode = IW_MODE_ADHOC; break; case WLAN_MACMODE_ESS_STA: *mode = IW_MODE_INFRA; break; case WLAN_MACMODE_ESS_AP: *mode = IW_MODE_MASTER; break; default: /* Not set yet. */ *mode = IW_MODE_AUTO; } DBFEXIT; return 0; } static int p80211wext_siwmode(netdevice_t *dev, struct iw_request_info *info, __u32 *mode, char *extra) { wlandevice_t *wlandev = (wlandevice_t*)dev->priv; p80211item_uint32_t mibitem; p80211msg_dot11req_mibset_t msg; int result; int err = 0; DBFENTER; if ( invalid_state(wlandev) ) { WLAN_LOG_DEBUG(1,"called from invalid state [%d]\n",wlandev->msdstate); err = -EBUSY; goto exit; } if (!wlan_wext_write) { err = (-EOPNOTSUPP); goto exit; } if (*mode != IW_MODE_ADHOC && *mode != IW_MODE_INFRA && *mode != IW_MODE_MASTER) { err = (-EOPNOTSUPP); goto exit; } /* Operation mode is the same with current mode */ if (*mode == wlandev->macmode) goto exit; switch (*mode) { case IW_MODE_ADHOC: wlandev->macmode = WLAN_MACMODE_IBSS_STA; break; case IW_MODE_INFRA: wlandev->macmode = WLAN_MACMODE_ESS_STA; break; case IW_MODE_MASTER: wlandev->macmode = WLAN_MACMODE_ESS_AP; break; default: /* Not set yet. */ WLAN_LOG_INFO("Operation mode: %d not support\n", *mode); return -EOPNOTSUPP; } /* Set Operation mode to the PORT TYPE RID */ #warning "get rid of p2mib here" msg.msgcode = DIDmsg_dot11req_mibset; mibitem.did = DIDmib_p2_p2Static_p2CnfPortType; mibitem.data = (*mode == IW_MODE_ADHOC) ? 0 : 1; memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); result = p80211req_dorequest(wlandev, (UINT8*)&msg); if (result) err = -EFAULT; exit: DBFEXIT; return err; } static int p80211wext_giwrange(netdevice_t *dev, struct iw_request_info *info, struct iw_point *data, char *extra) { struct iw_range *range = (struct iw_range *) extra; int i, val; DBFENTER; // for backward compatability set size & zero everything we don't understand data->length = sizeof(*range); memset(range,0,sizeof(*range)); #if WIRELESS_EXT > 9 range->txpower_capa = IW_TXPOW_DBM; // XXX what about min/max_pmp, min/max_pmt, etc. #endif #if WIRELESS_EXT > 10 range->we_version_compiled = WIRELESS_EXT; range->we_version_source = 13; range->retry_capa = IW_RETRY_LIMIT; range->retry_flags = IW_RETRY_LIMIT; range->min_retry = 0; range->max_retry = 255; #endif /* WIRELESS_EXT > 10 */ #if WIRELESS_EXT > 16 range->event_capa[0] = (IW_EVENT_CAPA_K_0 | //mode/freq/ssid IW_EVENT_CAPA_MASK(SIOCGIWAP) | IW_EVENT_CAPA_MASK(SIOCGIWSCAN)); range->event_capa[1] = IW_EVENT_CAPA_K_1; //encode range->event_capa[4] = (IW_EVENT_CAPA_MASK(IWEVQUAL) | IW_EVENT_CAPA_MASK(IWEVCUSTOM) ); #endif range->num_channels = NUM_CHANNELS; /* XXX need to filter against the regulatory domain &| active set */ val = 0; for (i = 0; i < NUM_CHANNELS ; i++) { range->freq[val].i = i + 1; range->freq[val].m = p80211wext_channel_freq[i] * 100000; range->freq[val].e = 1; val++; } range->num_frequency = val; /* Max of /proc/net/wireless */ range->max_qual.qual = 100; range->max_qual.level = 0; range->max_qual.noise = 0; range->sensitivity = 3; // XXX these need to be nsd-specific! range->min_rts = 0; range->max_rts = 2347; range->min_frag = 256; range->max_frag = 2346; range->max_encoding_tokens = NUM_WEPKEYS; range->num_encoding_sizes = 2; range->encoding_size[0] = 5; range->encoding_size[1] = 13; // XXX what about num_bitrates/throughput? range->num_bitrates = 0; /* estimated max throughput */ // XXX need to cap it if we're running at ~2Mbps.. range->throughput = 5500000; DBFEXIT; return 0; } #endif static int p80211wext_giwap(netdevice_t *dev, struct iw_request_info *info, struct sockaddr *ap_addr, char *extra) { wlandevice_t *wlandev = (wlandevice_t*)dev->priv; DBFENTER; memcpy(ap_addr->sa_data, wlandev->bssid, WLAN_BSSID_LEN); ap_addr->sa_family = ARPHRD_ETHER; DBFEXIT; return 0; } #if WIRELESS_EXT > 8 static int p80211wext_giwencode(netdevice_t *dev, struct iw_request_info *info, struct iw_point *erq, char *key) { wlandevice_t *wlandev = (wlandevice_t*)dev->priv; int err = 0; int i; DBFENTER; i = (erq->flags & IW_ENCODE_INDEX) - 1; erq->flags = 0; if (wlandev->hostwep & HOSTWEP_PRIVACYINVOKED) erq->flags |= IW_ENCODE_ENABLED; else erq->flags |= IW_ENCODE_DISABLED; if (wlandev->hostwep & HOSTWEP_EXCLUDEUNENCRYPTED) erq->flags |= IW_ENCODE_RESTRICTED; else erq->flags |= IW_ENCODE_OPEN; if (i == -1) i = wlandev->hostwep & HOSTWEP_DEFAULTKEY_MASK; if ((i < 0) || (i >= NUM_WEPKEYS)) { err = -EINVAL; goto exit; } erq->flags |= i + 1; /* copy the key from the driver cache as the keys are read-only MIBs */ erq->length = wlandev->wep_keylens[i]; memcpy(key, wlandev->wep_keys[i], erq->length); exit: DBFEXIT; return err; } static int p80211wext_siwencode(netdevice_t *dev, struct iw_request_info *info, struct iw_point *erq, char *key) { wlandevice_t *wlandev = (wlandevice_t*)dev->priv; p80211msg_dot11req_mibset_t msg; p80211item_pstr32_t pstr; int err = 0; int result = 0; int i; DBFENTER; if ( invalid_state(wlandev) ) { WLAN_LOG_DEBUG(1,"called from invalid state [%d]\n",wlandev->msdstate); err = -EBUSY; goto exit; } if (!wlan_wext_write) { err = (-EOPNOTSUPP); goto exit; } /* Check the Key index first. */ if((i = (erq->flags & IW_ENCODE_INDEX))) { if ((i < 1) || (i > NUM_WEPKEYS)) { err = -EINVAL; goto exit; } else { i--; } /* Set current key number only if no keys are given */ if (erq->flags & IW_ENCODE_NOKEY) { result = p80211wext_dorequest(wlandev, DIDmib_dot11smt_dot11PrivacyTable_dot11WEPDefaultKeyID, i); if (result) { err = -EFAULT; goto exit; } } } else { // Use defaultkey if no Key Index i = wlandev->hostwep & HOSTWEP_DEFAULTKEY_MASK; } /* Check if there is no key information in the iwconfig request */ if((erq->flags & IW_ENCODE_NOKEY) == 0 ) { /*------------------------------------------------------------ * If there is WEP Key for setting, check the Key Information * and then set it to the firmware. -------------------------------------------------------------*/ if (erq->length > 0) { /* copy the key from the driver cache as the keys are read-only MIBs */ wlandev->wep_keylens[i] = erq->length; memcpy(wlandev->wep_keys[i], key, erq->length); /* Prepare data struture for p80211req_dorequest. */ memcpy(pstr.data.data, key, erq->length); pstr.data.len = erq->length; switch(i) { case 0: pstr.did = DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey0; break; case 1: pstr.did = DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey1; break; case 2: pstr.did = DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey2; break; case 3: pstr.did = DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey3; break; default: err = -EINVAL; goto exit; } msg.msgcode = DIDmsg_dot11req_mibset; memcpy(&msg.mibattribute.data, &pstr, sizeof(pstr)); result = p80211req_dorequest(wlandev, (UINT8*)&msg); if (result) { err = -EFAULT; goto exit; } } } /* Check the PrivacyInvoked flag */ if (erq->flags & IW_ENCODE_DISABLED) { result = p80211wext_dorequest(wlandev, DIDmib_dot11smt_dot11PrivacyTable_dot11PrivacyInvoked, P80211ENUM_truth_false); } else { result = p80211wext_dorequest(wlandev, DIDmib_dot11smt_dot11PrivacyTable_dot11PrivacyInvoked, P80211ENUM_truth_true); } if (result) { err = -EFAULT; goto exit; } /* The security mode may be open or restricted, and its meaning depends on the card used. With most cards, in open mode no authentication is used and the card may also accept non- encrypted sessions, whereas in restricted mode only encrypted sessions are accepted and the card will use authentication if available. */ if (erq->flags & IW_ENCODE_RESTRICTED) { result = p80211wext_dorequest(wlandev, DIDmib_dot11smt_dot11PrivacyTable_dot11ExcludeUnencrypted, P80211ENUM_truth_true); // wlandev->hostwep |= HOSTWEP_SHAREDKEY; } else if (erq->flags & IW_ENCODE_OPEN) { result = p80211wext_dorequest(wlandev, DIDmib_dot11smt_dot11PrivacyTable_dot11ExcludeUnencrypted, P80211ENUM_truth_false); // wlandev->hostwep &= ~HOSTWEP_SHAREDKEY; } if (result) { err = -EFAULT; goto exit; } exit: DBFEXIT; return err; } static int p80211wext_giwessid(netdevice_t *dev, struct iw_request_info *info, struct iw_point *data, char *essid) { wlandevice_t *wlandev = (wlandevice_t*)dev->priv; DBFENTER; if (wlandev->ssid.len) { data->length = wlandev->ssid.len; data->flags = 1; memcpy(essid, wlandev->ssid.data, data->length); essid[data->length] = 0; #if (WIRELESS_EXT < 21) data->length++; #endif } else { memset(essid, 0, sizeof(wlandev->ssid.data)); data->length = 0; data->flags = 0; } DBFEXIT; return 0; } static int p80211wext_siwessid(netdevice_t *dev, struct iw_request_info *info, struct iw_point *data, char *essid) { wlandevice_t *wlandev = (wlandevice_t*)dev->priv; p80211msg_lnxreq_autojoin_t msg; int result; int err = 0; int length = data->length; DBFENTER; if ( invalid_state(wlandev) ) { WLAN_LOG_DEBUG(1,"called from invalid state [%d]\n",wlandev->msdstate); err = -EBUSY; goto exit; } if (!wlan_wext_write) { err = (-EOPNOTSUPP); goto exit; } if ( wlandev->hostwep & HOSTWEP_SHAREDKEY ) msg.authtype.data = P80211ENUM_authalg_sharedkey; else msg.authtype.data = P80211ENUM_authalg_opensystem; msg.msgcode = DIDmsg_lnxreq_autojoin; #if (WIRELESS_EXT < 21) if (length) length--; #endif /* Trim the last '\0' to fit the SSID format */ if (length && essid[length-1] == '\0') { length--; } memcpy(msg.ssid.data.data, essid, length); msg.ssid.data.len = length; WLAN_LOG_DEBUG(1,"autojoin_ssid for %s \n",essid); result = p80211req_dorequest(wlandev, (UINT8*)&msg); WLAN_LOG_DEBUG(1,"autojoin_ssid %d\n",result); if (result) { err = -EFAULT; goto exit; } exit: DBFEXIT; return err; } static int p80211wext_siwcommit(netdevice_t *dev, struct iw_request_info *info, struct iw_point *data, char *essid) { wlandevice_t *wlandev = (wlandevice_t*)dev->priv; int err = 0; DBFENTER; if ( invalid_state(wlandev) ) { WLAN_LOG_DEBUG(1,"called from invalid state [%d]\n",wlandev->msdstate); err = -EBUSY; goto exit; } if (!wlan_wext_write) { err = (-EOPNOTSUPP); goto exit; } /* Auto Join */ err = p80211wext_autojoin(wlandev); exit: DBFEXIT; return err; } static int p80211wext_giwrate(netdevice_t *dev, struct iw_request_info *info, struct iw_param *rrq, char *extra) { wlandevice_t *wlandev = (wlandevice_t*)dev->priv; p80211item_uint32_t mibitem; p80211msg_dot11req_mibset_t msg; int result; int err = 0; DBFENTER; if ( invalid_state(wlandev) ) { WLAN_LOG_DEBUG(1,"called from invalid state [%d]\n",wlandev->msdstate); err = -EBUSY; goto exit; } msg.msgcode = DIDmsg_dot11req_mibget; mibitem.did = DIDmib_p2_p2MAC_p2CurrentTxRate; memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); result = p80211req_dorequest(wlandev, (UINT8*)&msg); if (result) { err = -EFAULT; goto exit; } memcpy(&mibitem, &msg.mibattribute.data, sizeof(mibitem)); rrq->fixed = 0; /* can it change? */ rrq->disabled = 0; rrq->value = 0; #define HFA384x_RATEBIT_1 ((UINT16)1) #define HFA384x_RATEBIT_2 ((UINT16)2) #define HFA384x_RATEBIT_5dot5 ((UINT16)4) #define HFA384x_RATEBIT_11 ((UINT16)8) switch (mibitem.data) { case HFA384x_RATEBIT_1: rrq->value = 1000000; break; case HFA384x_RATEBIT_2: rrq->value = 2000000; break; case HFA384x_RATEBIT_5dot5: rrq->value = 5500000; break; case HFA384x_RATEBIT_11: rrq->value = 11000000; break; default: err = -EINVAL; } exit: DBFEXIT; return err; } static int p80211wext_giwrts(netdevice_t *dev, struct iw_request_info *info, struct iw_param *rts, char *extra) { wlandevice_t *wlandev = (wlandevice_t*)dev->priv; p80211item_uint32_t mibitem; p80211msg_dot11req_mibset_t msg; int result; int err = 0; DBFENTER; if ( invalid_state(wlandev) ) { WLAN_LOG_DEBUG(1,"called from invalid state [%d]\n",wlandev->msdstate); err = -EBUSY; goto exit; } msg.msgcode = DIDmsg_dot11req_mibget; mibitem.did = DIDmib_dot11mac_dot11OperationTable_dot11RTSThreshold; memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); result = p80211req_dorequest(wlandev, (UINT8*)&msg); if (result) { err = -EFAULT; goto exit; } memcpy(&mibitem, &msg.mibattribute.data, sizeof(mibitem)); rts->value = mibitem.data; rts->disabled = (rts->value == 2347); rts->fixed = 1; exit: DBFEXIT; return err; } static int p80211wext_siwrts(netdevice_t *dev, struct iw_request_info *info, struct iw_param *rts, char *extra) { wlandevice_t *wlandev = (wlandevice_t*)dev->priv; p80211item_uint32_t mibitem; p80211msg_dot11req_mibset_t msg; int result; int err = 0; DBFENTER; if ( invalid_state(wlandev) ) { WLAN_LOG_DEBUG(1,"called from invalid state [%d]\n",wlandev->msdstate); err = -EBUSY; goto exit; } if (!wlan_wext_write) { err = (-EOPNOTSUPP); goto exit; } msg.msgcode = DIDmsg_dot11req_mibget; mibitem.did = DIDmib_dot11mac_dot11OperationTable_dot11RTSThreshold; if (rts->disabled) mibitem.data = 2347; else mibitem.data = rts->value; memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); result = p80211req_dorequest(wlandev, (UINT8*)&msg); if (result) { err = -EFAULT; goto exit; } exit: DBFEXIT; return err; } static int p80211wext_giwfrag(netdevice_t *dev, struct iw_request_info *info, struct iw_param *frag, char *extra) { wlandevice_t *wlandev = (wlandevice_t*)dev->priv; p80211item_uint32_t mibitem; p80211msg_dot11req_mibset_t msg; int result; int err = 0; DBFENTER; if ( invalid_state(wlandev) ) { WLAN_LOG_DEBUG(1,"called from invalid state [%d]\n",wlandev->msdstate); err = -EBUSY; goto exit; } msg.msgcode = DIDmsg_dot11req_mibget; mibitem.did = DIDmib_dot11mac_dot11OperationTable_dot11FragmentationThreshold; memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); result = p80211req_dorequest(wlandev, (UINT8*)&msg); if (result) { err = -EFAULT; goto exit; } memcpy(&mibitem, &msg.mibattribute.data, sizeof(mibitem)); frag->value = mibitem.data; frag->disabled = (frag->value == 2346); frag->fixed = 1; exit: DBFEXIT; return err; } static int p80211wext_siwfrag(netdevice_t *dev, struct iw_request_info *info, struct iw_param *frag, char *extra) { wlandevice_t *wlandev = (wlandevice_t*)dev->priv; p80211item_uint32_t mibitem; p80211msg_dot11req_mibset_t msg; int result; int err = 0; DBFENTER; if ( invalid_state(wlandev) ) { WLAN_LOG_DEBUG(1,"called from invalid state [%d]\n",wlandev->msdstate); err = -EBUSY; goto exit; } if (!wlan_wext_write) { err = (-EOPNOTSUPP); goto exit; } msg.msgcode = DIDmsg_dot11req_mibset; mibitem.did = DIDmib_dot11mac_dot11OperationTable_dot11FragmentationThreshold; if (frag->disabled) mibitem.data = 2346; else mibitem.data = frag->value; memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); result = p80211req_dorequest(wlandev, (UINT8*)&msg); if (result) { err = -EFAULT; goto exit; } exit: DBFEXIT; return err; } #endif /* WIRELESS_EXT > 8 */ #if WIRELESS_EXT > 10 #ifndef IW_RETRY_LONG #define IW_RETRY_LONG IW_RETRY_MAX #endif #ifndef IW_RETRY_SHORT #define IW_RETRY_SHORT IW_RETRY_MIN #endif static int p80211wext_giwretry(netdevice_t *dev, struct iw_request_info *info, struct iw_param *rrq, char *extra) { wlandevice_t *wlandev = (wlandevice_t*)dev->priv; p80211item_uint32_t mibitem; p80211msg_dot11req_mibset_t msg; int result; int err = 0; UINT16 shortretry, longretry, lifetime; DBFENTER; if ( invalid_state(wlandev) ) { WLAN_LOG_DEBUG(1,"called from invalid state [%d]\n",wlandev->msdstate); err = -EBUSY; goto exit; } msg.msgcode = DIDmsg_dot11req_mibget; mibitem.did = DIDmib_dot11mac_dot11OperationTable_dot11ShortRetryLimit; memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); result = p80211req_dorequest(wlandev, (UINT8*)&msg); if (result) { err = -EFAULT; goto exit; } memcpy(&mibitem, &msg.mibattribute.data, sizeof(mibitem)); shortretry = mibitem.data; mibitem.did = DIDmib_dot11mac_dot11OperationTable_dot11LongRetryLimit; memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); result = p80211req_dorequest(wlandev, (UINT8*)&msg); if (result) { err = -EFAULT; goto exit; } memcpy(&mibitem, &msg.mibattribute.data, sizeof(mibitem)); longretry = mibitem.data; mibitem.did = DIDmib_dot11mac_dot11OperationTable_dot11MaxTransmitMSDULifetime; memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); result = p80211req_dorequest(wlandev, (UINT8*)&msg); if (result) { err = -EFAULT; goto exit; } memcpy(&mibitem, &msg.mibattribute.data, sizeof(mibitem)); lifetime = mibitem.data; rrq->disabled = 0; if ((rrq->flags & IW_RETRY_TYPE) == IW_RETRY_LIFETIME) { rrq->flags = IW_RETRY_LIFETIME; rrq->value = lifetime * 1024; } else { if (rrq->flags & IW_RETRY_LONG) { rrq->flags = IW_RETRY_LIMIT | IW_RETRY_LONG; rrq->value = longretry; } else { rrq->flags = IW_RETRY_LIMIT; rrq->value = shortretry; if (shortretry != longretry) rrq->flags |= IW_RETRY_SHORT; } } exit: DBFEXIT; return err; } static int p80211wext_siwretry(netdevice_t *dev, struct iw_request_info *info, struct iw_param *rrq, char *extra) { wlandevice_t *wlandev = (wlandevice_t*)dev->priv; p80211item_uint32_t mibitem; p80211msg_dot11req_mibset_t msg; int result; int err = 0; DBFENTER; if ( invalid_state(wlandev) ) { WLAN_LOG_DEBUG(1,"called from invalid state [%d]\n",wlandev->msdstate); err = -EBUSY; goto exit; } if (!wlan_wext_write) { err = (-EOPNOTSUPP); goto exit; } if (rrq->disabled) { err = -EINVAL; goto exit; } msg.msgcode = DIDmsg_dot11req_mibset; if ((rrq->flags & IW_RETRY_TYPE) == IW_RETRY_LIFETIME) { mibitem.did = DIDmib_dot11mac_dot11OperationTable_dot11MaxTransmitMSDULifetime; mibitem.data = rrq->value /= 1024; memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); result = p80211req_dorequest(wlandev, (UINT8*)&msg); if (result) { err = -EFAULT; goto exit; } } else { if (rrq->flags & IW_RETRY_LONG) { mibitem.did = DIDmib_dot11mac_dot11OperationTable_dot11LongRetryLimit; mibitem.data = rrq->value; memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); result = p80211req_dorequest(wlandev, (UINT8*)&msg); if (result) { err = -EFAULT; goto exit; } } if (rrq->flags & IW_RETRY_SHORT) { mibitem.did = DIDmib_dot11mac_dot11OperationTable_dot11ShortRetryLimit; mibitem.data = rrq->value; memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); result = p80211req_dorequest(wlandev, (UINT8*)&msg); if (result) { err = -EFAULT; goto exit; } } } exit: DBFEXIT; return err; } #endif /* WIRELESS_EXT > 10 */ #if WIRELESS_EXT > 9 static int p80211wext_siwtxpow(netdevice_t *dev, struct iw_request_info *info, struct iw_param *rrq, char *extra) { wlandevice_t *wlandev = (wlandevice_t*)dev->priv; p80211item_uint32_t mibitem; p80211msg_dot11req_mibset_t msg; int result; int err = 0; DBFENTER; if ( invalid_state(wlandev) ) { WLAN_LOG_DEBUG(1,"called from invalid state [%d]\n",wlandev->msdstate); err = -EBUSY; goto exit; } if (!wlan_wext_write) { err = (-EOPNOTSUPP); goto exit; } msg.msgcode = DIDmsg_dot11req_mibset; switch (rrq->value) { case 1 : mibitem.did = DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel1; break; case 2 : mibitem.did = DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel2; break; case 3 : mibitem.did = DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel3; break; case 4 : mibitem.did = DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel4; break; case 5 : mibitem.did = DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel5; break; case 6 : mibitem.did = DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel6; break; case 7 : mibitem.did = DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel7; break; case 8 : mibitem.did = DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel8; break; default: mibitem.did = DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel8; break; } memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); result = p80211req_dorequest(wlandev, (UINT8*)&msg); if (result) { err = -EFAULT; goto exit; } exit: DBFEXIT; return err; } static int p80211wext_giwtxpow(netdevice_t *dev, struct iw_request_info *info, struct iw_param *rrq, char *extra) { wlandevice_t *wlandev = (wlandevice_t*)dev->priv; p80211item_uint32_t mibitem; p80211msg_dot11req_mibset_t msg; int result; int err = 0; DBFENTER; if ( invalid_state(wlandev) ) { WLAN_LOG_DEBUG(1,"called from invalid state [%d]\n",wlandev->msdstate); err = -EBUSY; goto exit; } msg.msgcode = DIDmsg_dot11req_mibget; mibitem.did = DIDmib_dot11phy_dot11PhyTxPowerTable_dot11CurrentTxPowerLevel; memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); result = p80211req_dorequest(wlandev, (UINT8*)&msg); if (result) { err = -EFAULT; goto exit; } memcpy(&mibitem, &msg.mibattribute.data, sizeof(mibitem)); // XXX handle OFF by setting disabled = 1; rrq->flags = 0; // IW_TXPOW_DBM; rrq->disabled = 0; rrq->fixed = 0; rrq->value = mibitem.data; exit: DBFEXIT; return err; } #endif /* WIRELESS_EXT > 9 */ static int p80211wext_siwspy(netdevice_t *dev, struct iw_request_info *info, struct iw_point *srq, char *extra) { wlandevice_t *wlandev = (wlandevice_t*)dev->priv; struct sockaddr address[IW_MAX_SPY]; int number = srq->length; int i; DBFENTER; /* Copy the data from the input buffer */ memcpy(address, extra, sizeof(struct sockaddr)*number); wlandev->spy_number = 0; if (number > 0) { /* extract the addresses */ for (i = 0; i < number; i++) { memcpy(wlandev->spy_address[i], address[i].sa_data, ETH_ALEN); } /* reset stats */ memset(wlandev->spy_stat, 0, sizeof(struct iw_quality) * IW_MAX_SPY); /* set number of addresses */ wlandev->spy_number = number; } DBFEXIT; return 0; } /* jkriegl: from orinoco, modified */ static int p80211wext_giwspy(netdevice_t *dev, struct iw_request_info *info, struct iw_point *srq, char *extra) { wlandevice_t *wlandev = (wlandevice_t*)dev->priv; struct sockaddr address[IW_MAX_SPY]; struct iw_quality spy_stat[IW_MAX_SPY]; int number; int i; DBFENTER; number = wlandev->spy_number; if (number > 0) { /* populate address and spy struct's */ for (i = 0; i < number; i++) { memcpy(address[i].sa_data, wlandev->spy_address[i], ETH_ALEN); address[i].sa_family = AF_UNIX; memcpy(&spy_stat[i], &wlandev->spy_stat[i], sizeof(struct iw_quality)); } /* reset update flag */ for (i=0; i < number; i++) wlandev->spy_stat[i].updated = 0; } /* push stuff to user space */ srq->length = number; memcpy(extra, address, sizeof(struct sockaddr)*number); memcpy(extra+sizeof(struct sockaddr)*number, spy_stat, sizeof(struct iw_quality)*number); DBFEXIT; return 0; } static int prism2_result2err (int prism2_result) { int err = 0; switch (prism2_result) { case P80211ENUM_resultcode_invalid_parameters: err = -EINVAL; break; case P80211ENUM_resultcode_implementation_failure: err = -EIO; break; case P80211ENUM_resultcode_not_supported: err = -EOPNOTSUPP; break; default: err = 0; break; } return err; } #if WIRELESS_EXT > 13 static int p80211wext_siwscan(netdevice_t *dev, struct iw_request_info *info, struct iw_point *srq, char *extra) { wlandevice_t *wlandev = (wlandevice_t*)dev->priv; p80211msg_dot11req_scan_t msg; int result; int err = 0; int i = 0; DBFENTER; if ( invalid_state(wlandev) ) { WLAN_LOG_DEBUG(1,"called from invalid state [%d]\n",wlandev->msdstate); err = -EBUSY; goto exit; } if (wlandev->macmode == WLAN_MACMODE_ESS_AP) { WLAN_LOG_ERROR("Can't scan in AP mode\n"); err = (-EOPNOTSUPP); goto exit; } memset(&msg, 0x00, sizeof(p80211msg_dot11req_scan_t)); msg.msgcode = DIDmsg_dot11req_scan; msg.bsstype.data = P80211ENUM_bsstype_any; memset(&(msg.bssid.data), 0xFF, sizeof (p80211item_pstr6_t)); msg.bssid.data.len = 6; msg.scantype.data = P80211ENUM_scantype_active; msg.probedelay.data = 0; for (i = 1; i <= 14; i++) msg.channellist.data.data[i-1] = i; msg.channellist.data.len = 14; msg.maxchanneltime.data = 250; msg.minchanneltime.data = 200; result = p80211req_dorequest(wlandev, (UINT8*)&msg); if (result) err = prism2_result2err (msg.resultcode.data); exit: DBFEXIT; return err; } /* Helper to translate scan into Wireless Extensions scan results. * Inspired by the prism54 code, which was in turn inspired by the * airo driver code. */ static char * wext_translate_bss(char *current_ev, char *end_buf, p80211msg_dot11req_scan_results_t *bss) { struct iw_event iwe; /* Temporary buffer */ /* The first entry must be the MAC address */ memcpy(iwe.u.ap_addr.sa_data, bss->bssid.data.data, WLAN_BSSID_LEN); iwe.u.ap_addr.sa_family = ARPHRD_ETHER; iwe.cmd = SIOCGIWAP; current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, IW_EV_ADDR_LEN); /* The following entries will be displayed in the same order we give them */ /* The ESSID. */ if (bss->ssid.data.len > 0) { char essid[IW_ESSID_MAX_SIZE + 1]; int size; size = wlan_min(IW_ESSID_MAX_SIZE, bss->ssid.data.len); memset(&essid, 0, sizeof (essid)); memcpy(&essid, bss->ssid.data.data, size); WLAN_LOG_DEBUG(1, " essid size = %d\n", size); iwe.u.data.length = size; iwe.u.data.flags = 1; iwe.cmd = SIOCGIWESSID; current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, &essid[0]); WLAN_LOG_DEBUG(1, " essid size OK.\n"); } switch (bss->bsstype.data) { case P80211ENUM_bsstype_infrastructure: iwe.u.mode = IW_MODE_MASTER; break; case P80211ENUM_bsstype_independent: iwe.u.mode = IW_MODE_ADHOC; break; default: iwe.u.mode = 0; break; } iwe.cmd = SIOCGIWMODE; if (iwe.u.mode) current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, IW_EV_UINT_LEN); /* Encryption capability */ if (bss->privacy.data == P80211ENUM_truth_true) iwe.u.data.flags = IW_ENCODE_ENABLED | IW_ENCODE_NOKEY; else iwe.u.data.flags = IW_ENCODE_DISABLED; iwe.u.data.length = 0; iwe.cmd = SIOCGIWENCODE; current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, NULL); /* Add frequency. (short) bss->channel is the frequency in MHz */ iwe.u.freq.m = bss->dschannel.data; iwe.u.freq.e = 0; iwe.cmd = SIOCGIWFREQ; current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, IW_EV_FREQ_LEN); /* Add quality statistics */ iwe.u.qual.level = bss->signal.data; iwe.u.qual.noise = bss->noise.data; /* do a simple SNR for quality */ iwe.u.qual.qual = qual_as_percent(bss->signal.data - bss->noise.data); iwe.cmd = IWEVQUAL; current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, IW_EV_QUAL_LEN); return current_ev; } static int p80211wext_giwscan(netdevice_t *dev, struct iw_request_info *info, struct iw_point *srq, char *extra) { wlandevice_t *wlandev = (wlandevice_t*)dev->priv; p80211msg_dot11req_scan_results_t msg; int result = 0; int err = 0; int i = 0; int scan_good = 0; char *current_ev = extra; DBFENTER; if ( invalid_state(wlandev) ) { WLAN_LOG_DEBUG(1,"called from invalid state [%d]\n",wlandev->msdstate); err = -EBUSY; goto exit; } /* Since wireless tools doesn't really have a way of passing how * many scan results results there were back here, keep grabbing them * until we fail. */ do { memset(&msg, 0, sizeof(msg)); msg.msgcode = DIDmsg_dot11req_scan_results; msg.bssindex.data = i; result = p80211req_dorequest(wlandev, (UINT8*)&msg); if ((result != 0) || (msg.resultcode.data != P80211ENUM_resultcode_success)) { break; } current_ev = wext_translate_bss(current_ev, extra + IW_SCAN_MAX_DATA, &msg); scan_good = 1; i++; } while (i < IW_MAX_AP); srq->length = (current_ev - extra); srq->flags = 0; /* todo */ if (result && !scan_good) err = prism2_result2err (msg.resultcode.data); exit: DBFEXIT; return err; } #endif /*****************************************************/ //extra wireless extensions stuff to support NetworkManager (I hope) #if WIRELESS_EXT > 17 /* SIOCSIWENCODEEXT */ static int p80211wext_set_encodeext(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { wlandevice_t *wlandev = (wlandevice_t*)dev->priv; struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; p80211msg_dot11req_mibset_t msg; p80211item_pstr32_t *pstr; int result = 0; struct iw_point *encoding = &wrqu->encoding; int idx = encoding->flags & IW_ENCODE_INDEX; DBFENTER; if ( invalid_state(wlandev) ) { WLAN_LOG_DEBUG(1,"called from invalid state [%d]\n",wlandev->msdstate); result = -EBUSY; goto exit; } WLAN_LOG_DEBUG(1,"set_encode_ext flags[%d] alg[%d] keylen[%d]\n",ext->ext_flags,(int)ext->alg,(int)ext->key_len); if ( ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY ) { // set default key ? I'm not sure if this the the correct thing to do here if ( idx ) { if (idx < 1 || idx > NUM_WEPKEYS) { return -EINVAL; } else idx--; } WLAN_LOG_DEBUG(1,"setting default key (%d)\n",idx); result = p80211wext_dorequest(wlandev, DIDmib_dot11smt_dot11PrivacyTable_dot11WEPDefaultKeyID, idx); if ( result ) return -EFAULT; } if ( ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY ) { if ( ! ext->alg & IW_ENCODE_ALG_WEP) { WLAN_LOG_DEBUG(1,"asked to set a non wep key :("); return -EINVAL; } if (idx) { if (idx <1 || idx > NUM_WEPKEYS) return -EINVAL; else idx--; } WLAN_LOG_DEBUG(1,"Set WEP key (%d)\n",idx); wlandev->wep_keylens[idx] = ext->key_len; memcpy(wlandev->wep_keys[idx], ext->key, ext->key_len); memset( &msg,0,sizeof(msg)); pstr = (p80211item_pstr32_t*)&msg.mibattribute.data; memcpy(pstr->data.data, ext->key,ext->key_len); pstr->data.len = ext->key_len; switch (idx) { case 0: pstr->did = DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey0; break; case 1: pstr->did = DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey1; break; case 2: pstr->did = DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey2; break; case 3: pstr->did = DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey3; break; default: break; } msg.msgcode = DIDmsg_dot11req_mibset; result = p80211req_dorequest(wlandev,(UINT8*)&msg); WLAN_LOG_DEBUG(1,"result (%d)\n",result); } exit: DBFEXIT; return result; } /* SIOCGIWENCODEEXT */ static int p80211wext_get_encodeext(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { wlandevice_t *wlandev = (wlandevice_t*)dev->priv; struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; struct iw_point *encoding = &wrqu->encoding; int result = 0; int max_len; int idx; DBFENTER; if ( invalid_state(wlandev) ) { WLAN_LOG_DEBUG(1,"called from invalid state [%d]\n",wlandev->msdstate); result = -EBUSY; goto exit; } WLAN_LOG_DEBUG(1,"get_encode_ext flags[%d] alg[%d] keylen[%d]\n",ext->ext_flags,(int)ext->alg,(int)ext->key_len); max_len = encoding->length - sizeof(*ext); if ( max_len <= 0) { WLAN_LOG_DEBUG(1,"get_encodeext max_len [%d] invalid\n",max_len); result = -EINVAL; goto exit; } idx = encoding->flags & IW_ENCODE_INDEX; WLAN_LOG_DEBUG(1,"get_encode_ext index [%d]\n",idx); if (idx) { if (idx < 1 || idx > NUM_WEPKEYS ) { WLAN_LOG_DEBUG(1,"get_encode_ext invalid key index [%d]\n",idx); result = -EINVAL; goto exit; } idx--; } else { /* default key ? not sure what to do */ /* will just use key[0] for now ! FIX ME */ } encoding->flags = idx + 1; memset(ext,0,sizeof(*ext)); ext->alg = IW_ENCODE_ALG_WEP; ext->key_len = wlandev->wep_keylens[idx]; memcpy( ext->key, wlandev->wep_keys[idx] , ext->key_len ); encoding->flags |= IW_ENCODE_ENABLED; exit: DBFEXIT; return result; } /* SIOCSIWAUTH */ static int p80211_wext_set_iwauth (struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { wlandevice_t *wlandev = (wlandevice_t*)dev->priv; struct iw_param *param = &wrqu->param; int result =0; DBFENTER; if ( invalid_state(wlandev) ) { WLAN_LOG_DEBUG(1,"called from invalid state [%d]\n",wlandev->msdstate); result = -EBUSY; goto exit; } WLAN_LOG_DEBUG(1,"set_iwauth flags[%d]\n",(int)param->flags & IW_AUTH_INDEX ); switch (param->flags & IW_AUTH_INDEX) { case IW_AUTH_DROP_UNENCRYPTED: WLAN_LOG_DEBUG(1,"drop_unencrypted %d\n",param->value); if (param->value) result = p80211wext_dorequest(wlandev, DIDmib_dot11smt_dot11PrivacyTable_dot11ExcludeUnencrypted, P80211ENUM_truth_true); else result = p80211wext_dorequest(wlandev, DIDmib_dot11smt_dot11PrivacyTable_dot11ExcludeUnencrypted, P80211ENUM_truth_false); break; case IW_AUTH_PRIVACY_INVOKED: WLAN_LOG_DEBUG(1,"privacy invoked %d\n",param->value); if ( param->value) result = p80211wext_dorequest(wlandev, DIDmib_dot11smt_dot11PrivacyTable_dot11PrivacyInvoked, P80211ENUM_truth_true); else result = p80211wext_dorequest(wlandev, DIDmib_dot11smt_dot11PrivacyTable_dot11PrivacyInvoked, P80211ENUM_truth_false); break; case IW_AUTH_80211_AUTH_ALG: if ( param->value & IW_AUTH_ALG_OPEN_SYSTEM ) { WLAN_LOG_DEBUG(1,"set open_system\n"); wlandev->hostwep &= ~HOSTWEP_SHAREDKEY; } else if ( param->value & IW_AUTH_ALG_SHARED_KEY) { WLAN_LOG_DEBUG(1,"set shared key\n"); wlandev->hostwep |= HOSTWEP_SHAREDKEY; } else { /* don't know what to do know :( */ WLAN_LOG_DEBUG(1,"unknown AUTH_ALG (%d)\n",param->value); result = -EINVAL; } break; default: break; } exit: DBFEXIT; return result; } /* SIOCSIWAUTH */ static int p80211_wext_get_iwauth (struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { wlandevice_t *wlandev = (wlandevice_t*)dev->priv; struct iw_param *param = &wrqu->param; int result =0; DBFENTER; WLAN_LOG_DEBUG(1,"get_iwauth flags[%d]\n",(int)param->flags & IW_AUTH_INDEX ); switch (param->flags & IW_AUTH_INDEX) { case IW_AUTH_DROP_UNENCRYPTED: param->value = wlandev->hostwep & HOSTWEP_EXCLUDEUNENCRYPTED?1:0; break; case IW_AUTH_PRIVACY_INVOKED: param->value = wlandev->hostwep & HOSTWEP_PRIVACYINVOKED?1:0; break; case IW_AUTH_80211_AUTH_ALG: param->value = wlandev->hostwep & HOSTWEP_SHAREDKEY?IW_AUTH_ALG_SHARED_KEY:IW_AUTH_ALG_OPEN_SYSTEM; break; default: break; } DBFEXIT; return result; } #endif /*****************************************************/ /* typedef int (*iw_handler)(netdevice_t *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra); */ #if WIRELESS_EXT > 12 static iw_handler p80211wext_handlers[] = { (iw_handler) p80211wext_siwcommit, /* SIOCSIWCOMMIT */ (iw_handler) p80211wext_giwname, /* SIOCGIWNAME */ (iw_handler) NULL, /* SIOCSIWNWID */ (iw_handler) NULL, /* SIOCGIWNWID */ (iw_handler) p80211wext_siwfreq, /* SIOCSIWFREQ */ (iw_handler) p80211wext_giwfreq, /* SIOCGIWFREQ */ (iw_handler) p80211wext_siwmode, /* SIOCSIWMODE */ (iw_handler) p80211wext_giwmode, /* SIOCGIWMODE */ (iw_handler) NULL, /* SIOCSIWSENS */ (iw_handler) NULL, /* SIOCGIWSENS */ (iw_handler) NULL, /* not used */ /* SIOCSIWRANGE */ (iw_handler) p80211wext_giwrange, /* SIOCGIWRANGE */ (iw_handler) NULL, /* not used */ /* SIOCSIWPRIV */ (iw_handler) NULL, /* kernel code */ /* SIOCGIWPRIV */ (iw_handler) NULL, /* not used */ /* SIOCSIWSTATS */ (iw_handler) NULL, /* kernel code */ /* SIOCGIWSTATS */ (iw_handler) p80211wext_siwspy, /* SIOCSIWSPY */ (iw_handler) p80211wext_giwspy, /* SIOCGIWSPY */ (iw_handler) NULL, /* -- hole -- */ (iw_handler) NULL, /* -- hole -- */ (iw_handler) NULL, /* SIOCSIWAP */ (iw_handler) p80211wext_giwap, /* SIOCGIWAP */ (iw_handler) NULL, /* -- hole -- */ (iw_handler) NULL, /* SIOCGIWAPLIST */ #if WIRELESS_EXT > 13 (iw_handler) p80211wext_siwscan, /* SIOCSIWSCAN */ (iw_handler) p80211wext_giwscan, /* SIOCGIWSCAN */ #else /* WIRELESS_EXT > 13 */ (iw_handler) NULL, /* null */ /* SIOCSIWSCAN */ (iw_handler) NULL, /* null */ /* SIOCGIWSCAN */ #endif /* WIRELESS_EXT > 13 */ (iw_handler) p80211wext_siwessid, /* SIOCSIWESSID */ (iw_handler) p80211wext_giwessid, /* SIOCGIWESSID */ (iw_handler) NULL, /* SIOCSIWNICKN */ (iw_handler) p80211wext_giwessid, /* SIOCGIWNICKN */ (iw_handler) NULL, /* -- hole -- */ (iw_handler) NULL, /* -- hole -- */ (iw_handler) NULL, /* SIOCSIWRATE */ (iw_handler) p80211wext_giwrate, /* SIOCGIWRATE */ (iw_handler) p80211wext_siwrts, /* SIOCSIWRTS */ (iw_handler) p80211wext_giwrts, /* SIOCGIWRTS */ (iw_handler) p80211wext_siwfrag, /* SIOCSIWFRAG */ (iw_handler) p80211wext_giwfrag, /* SIOCGIWFRAG */ (iw_handler) p80211wext_siwtxpow, /* SIOCSIWTXPOW */ (iw_handler) p80211wext_giwtxpow, /* SIOCGIWTXPOW */ (iw_handler) p80211wext_siwretry, /* SIOCSIWRETRY */ (iw_handler) p80211wext_giwretry, /* SIOCGIWRETRY */ (iw_handler) p80211wext_siwencode, /* SIOCSIWENCODE */ (iw_handler) p80211wext_giwencode, /* SIOCGIWENCODE */ (iw_handler) NULL, /* SIOCSIWPOWER */ (iw_handler) NULL, /* SIOCGIWPOWER */ #if WIRELESS_EXT > 17 /* WPA operations */ (iw_handler) NULL, /* -- hole -- */ (iw_handler) NULL, /* -- hole -- */ (iw_handler) NULL, /* SIOCSIWGENIE set generic IE */ (iw_handler) NULL, /* SIOCGIWGENIE get generic IE */ (iw_handler) p80211_wext_set_iwauth, /* SIOCSIWAUTH set authentication mode params */ (iw_handler) p80211_wext_get_iwauth, /* SIOCGIWAUTH get authentication mode params */ (iw_handler) p80211wext_set_encodeext, /* SIOCSIWENCODEEXT set encoding token & mode */ (iw_handler) p80211wext_get_encodeext, /* SIOCGIWENCODEEXT get encoding token & mode */ (iw_handler) NULL, /* SIOCSIWPMKSA PMKSA cache operation */ #endif }; struct iw_handler_def p80211wext_handler_def = { .num_standard = sizeof(p80211wext_handlers) / sizeof(iw_handler), .num_private = 0, .num_private_args = 0, .standard = p80211wext_handlers, .private = NULL, .private_args = NULL, #if WIRELESS_EXT > 16 .get_wireless_stats = p80211wext_get_wireless_stats #endif }; #endif /* wireless extensions' ioctls */ int p80211wext_support_ioctl(netdevice_t *dev, struct ifreq *ifr, int cmd) { wlandevice_t *wlandev = (wlandevice_t*)dev->priv; #if WIRELESS_EXT < 13 struct iwreq *iwr = (struct iwreq*)ifr; #endif p80211item_uint32_t mibitem; int err = 0; DBFENTER; mibitem.status = P80211ENUM_msgitem_status_data_ok; if ( wlandev->msdstate != WLAN_MSD_RUNNING ) { err = -ENODEV; goto exit; } WLAN_LOG_DEBUG(1, "Received wireless extension ioctl #%d.\n", cmd); switch (cmd) { #if WIRELESS_EXT < 13 case SIOCSIWNAME: /* unused */ err = (-EOPNOTSUPP); break; case SIOCGIWNAME: /* get name == wireless protocol */ err = p80211wext_giwname(dev, NULL, (char *) &iwr->u, NULL); break; case SIOCSIWNWID: case SIOCGIWNWID: err = (-EOPNOTSUPP); break; case SIOCSIWFREQ: /* set channel */ err = p80211wext_siwfreq(dev, NULL, &(iwr->u.freq), NULL); break; case SIOCGIWFREQ: /* get channel */ err = p80211wext_giwfreq(dev, NULL, &(iwr->u.freq), NULL); break; case SIOCSIWRANGE: case SIOCSIWPRIV: case SIOCSIWAP: /* set access point MAC addresses (BSSID) */ err = (-EOPNOTSUPP); break; case SIOCGIWAP: /* get access point MAC addresses (BSSID) */ err = p80211wext_giwap(dev, NULL, &(iwr->u.ap_addr), NULL); break; #if WIRELESS_EXT > 8 case SIOCSIWMODE: /* set operation mode */ case SIOCSIWESSID: /* set SSID (network name) */ case SIOCSIWRATE: /* set default bit rate (bps) */ err = (-EOPNOTSUPP); break; case SIOCGIWMODE: /* get operation mode */ err = p80211wext_giwmode(dev, NULL, &iwr->u.mode, NULL); break; case SIOCGIWNICKN: /* get node name/nickname */ case SIOCGIWESSID: /* get SSID */ if(iwr->u.essid.pointer) { char ssid[IW_ESSID_MAX_SIZE+1]; memset(ssid, 0, sizeof(ssid)); err = p80211wext_giwessid(dev, NULL, &iwr->u.essid, ssid); if(copy_to_user(iwr->u.essid.pointer, ssid, sizeof(ssid))) err = (-EFAULT); } break; case SIOCGIWRATE: err = p80211wext_giwrate(dev, NULL, &iwr->u.bitrate, NULL); break; case SIOCGIWRTS: err = p80211wext_giwrts(dev, NULL, &iwr->u.rts, NULL); break; case SIOCGIWFRAG: err = p80211wext_giwfrag(dev, NULL, &iwr->u.rts, NULL); break; case SIOCGIWENCODE: if (!capable(CAP_NET_ADMIN)) err = -EPERM; else if (iwr->u.encoding.pointer) { char keybuf[MAX_KEYLEN]; err = p80211wext_giwencode(dev, NULL, &iwr->u.encoding, keybuf); if (copy_to_user(iwr->u.encoding.pointer, keybuf, iwr->u.encoding.length)) err = -EFAULT; } break; case SIOCGIWAPLIST: case SIOCSIWRTS: case SIOCSIWFRAG: case SIOCSIWSENS: case SIOCGIWSENS: case SIOCSIWNICKN: /* set node name/nickname */ case SIOCSIWENCODE: /* set encoding token & mode */ case SIOCSIWSPY: case SIOCGIWSPY: case SIOCSIWPOWER: case SIOCGIWPOWER: case SIOCGIWPRIV: err = (-EOPNOTSUPP); break; case SIOCGIWRANGE: if(iwr->u.data.pointer != NULL) { struct iw_range range; err = p80211wext_giwrange(dev, NULL, &iwr->u.data, (char *) &range); /* Push that up to the caller */ if (copy_to_user(iwr->u.data.pointer, &range, sizeof(range))) err = -EFAULT; } break; #endif /* WIRELESS_EXT > 8 */ #if WIRELESS_EXT > 9 case SIOCSIWTXPOW: err = (-EOPNOTSUPP); break; case SIOCGIWTXPOW: err = p80211wext_giwtxpow(dev, NULL, &iwr->u.txpower, NULL); break; #endif /* WIRELESS_EXT > 9 */ #if WIRELESS_EXT > 10 case SIOCSIWRETRY: err = (-EOPNOTSUPP); break; case SIOCGIWRETRY: err = p80211wext_giwretry(dev, NULL, &iwr->u.retry, NULL); break; #endif /* WIRELESS_EXT > 10 */ #endif /* WIRELESS_EXT <= 12 */ default: err = (-EOPNOTSUPP); break; } exit: DBFEXIT; return (err); } int p80211wext_event_associated(wlandevice_t *wlandev, int assoc) { union iwreq_data data; DBFENTER; #if WIRELESS_EXT > 13 /* Send the association state first */ data.ap_addr.sa_family = ARPHRD_ETHER; if (assoc) { memcpy(data.ap_addr.sa_data, wlandev->bssid, WLAN_ADDR_LEN); } else { memset(data.ap_addr.sa_data, 0, WLAN_ADDR_LEN); } if (wlan_wext_write) wireless_send_event(wlandev->netdev, SIOCGIWAP, &data, NULL); if (!assoc) goto done; // XXX send association data, like IEs, etc etc. #endif done: DBFEXIT; return 0; } #endif /* compatibility to wireless extensions */ linux-wlan-ng-0.2.9+dfsg/CHANGES0000644000175000017500000020347111024763205015535 0ustar tormodtormod* CHANGES * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- 0.2.9 - Reduce stack usage in prism2mib_priv (Richard Kennedy) - WEXT functions should return -EBUSY when the hardware is still being initialized (Richard Kennedy) - Use round_jiffies wherever possible (Richard Kennedy) - Disallow ioctls from running until the hardware probe function has finished. (Richard Kennedy) - Fix userspace scripts to work on Fedora 8 (Chris Rankin) - Perform the hardware reset/init sequence *before* we register the netdevice. (Karl Renton) - Always do an ifstate_disable before a firmware load cycle. - Default to wireless extension mode. - Make the SIWENCODE behaivor more closely match the spec. (Tormod Volden) - Apply a patch from Karl Relton that improves USB reliability. - When in wlan_wext_write=1 mode, auto-transition to ifstate_enable and bypass userspace firmware load altogether. - Fix bug in the GIWENCODE handler (Richard Kennedy & Tormod Volden) - Support 2.6.24 kernels (modified patch from Tormod Volden) - Support 2.6.23 kernels. (With apologies to Martin Dauskardt for a misapplied patch) - Support "Intersil Americas USB 802.11b WLAN DEVICE" (Peter Levart) - Tweaks to support Fedora 7 (Dan Williams) - Support 2.6.22 kernels 0.2.8 - Fix up a pile of sparse warnings (Pavel Roskin) - Support 2.6.20 kernels (Pavel Roskin) - Tweaks to the udev rules (Richard Kennedy) - Silence a large pile of warnings with GCC4.1 - pt_regs is gone for USB as well on 2.6.19+ (Chris Rankin) - Large WEXT patch that allows use of NetworkManager. (Richard Kennedy) 0.2.7 - Fix license text in prism2dl.c (it is in fact MPL/GPL) - Fix oops in wext_autojoin (Richard Kennedy) - Report use of dBm for WEXT requests (Richard Kennedy) - Configure script better handles PREEMPT kernels (Chris Rankin) - 2.6.19+ uses a different IRQ handler function prototype. - linux/config.h is no more on 2.6.19+ kernels. 0.2.6 - Fix another error that affected <2.6.15 builds on some compilers - Fix a cut-n-paste error that broke 2.6.18 builds. 0.2.5 - 2.6.18-rc fixes. - A few tweaks for Wireless-Extensions-21 - Fix an interrupt-related race that could lead to a crash on shutdown. - Tweaks to the prism2_usb code to improve suspendability on 2.6.15+ - Silence many warnings under GCC 4.1 - prism2_cs support for 2.6.16+ (untested) - Makefile fixes for 2.6.17+ - udev support for USB targets (Richard Kennedy) - semaphores are deprecated as of 2.6.16 (Chris Rankin) - prism2_usb build fix for 2.6.16 - Patches from Debian (via Victor Seva) - Fix bugs in /etc/wlan/shared, including a security hole - Fix build on 2.4.27 kernel - Added man page for prism2dl - Generate a WEXT Event when we gain/lose association. - Make prism2_defer query ssid and bssid, as IBSS mode has this change. - Clean up prism2_defer_timer a bit. - Propogate linkstatus into p80211, and make ethtool aware of it. - Eliminate wland and entire indication infrastructure. If you want to play with it, use 0.2.4. We can put it back in if necessary. 0.2.4 - USB Build fix from Chris Rankin. - Add ability to install prism2 firmware seperately. (Petteri Raty) - Theoretically the per-frame signal/noise figures are now in dBm. 0.2.3 - WEXT 16+ fixes, which came to a head with v2.6.14+ kernels. - Fix a circular symbol dependency glitch - Fix a potential panic when receiving unknown CONTROL frames. - get rid of p80211frm.c entirely; it's all unused code. - Fix prototype for pci_suspend functions to match 2.6.11+ APIs. - Build fixes for 2.6.14+ - Change the type of 'request_pending' to take care of warnings. - Fixes for warnings generated by the 'sparse' tool (Richard Kennedy) - Add an explicit README.firmware containing copyright information on the firmware images. - Compile fixes for 2.6.8 (Victor Seva Lopez) 0.2.2 - Fix an array overflow in the hotplug helper function. 0.2.1-final - Added in-kernel devicetable for 2.6.13+ pcmcia - Updates to bring prism2_cs into the newer 2.6 kernel APIs. - Fixes in the hotplug invocation with WEXT (Pavel Roskin) - Experimentally try using usb_reset_device on 2.4 kernels too - use usb_reset_device() on 2.6 kernels (Andreas Schulte) - Included kludged 1.8.4 PCI/PCMCIA firmware (Pavel Roskin) - PCMCIA card Ident fixes to coexist with orinioco driver (Pavel Roskin) - Ignore unexpected ctlx responses. (Chris Rankin) - Fix an off-by-one in scan results. - Change some log priorities - [usb] Fix a memory leak (Chris Rankin * Eroc Koenders) - [usb] clean up the PDA Read function a bit. (Chris Rankin) - [usb] Don't overwrite current CTLX URB before we're done with it. (Eric Koenders & Chris Rankin) - Fix a byte-order problem when parsing scan results (Eroc Koenders) - Added a mib item (lnxRSNAIE) to get/set the WPA/RSNA IE. - Applied a patch from Chris Rankin which should solve the hangs with kernel preemption turned on. - Cleaned up some compile warnings with GCC 3.4.x - Add a background thread to fetch comms quality from hardware. - Fixed a series of bad memsets in prism2dl - Added id for Viewsonic USB widget (Ekin Meroglu) - Eliminate the extra frame copy in the usb rx path. - When issuing a start/join, set MACMODE to none as to disable transmits through the hardware. - Get rid of the prism2_pci/plx 2.2.x compatibility code (Pavel Roskin) - Change default behaivor of top-level Makefile (Pavel Roskin) - Get rid of the #ifndef DECLARE_TASKLET cases; 2.4+ supports it. - Fetch the BSSID when we get an AP_CHANGE event - netif_carrier_off/netif_carrier_on at appropriate times - Hook up the dot11CurrentTxPowerLevel MIB in the prism2 code. - Add a default TMPDIR in case it isn't set. - Removed some 2.2.x cruft - CommsQuality now does the right thing with dBm values. - More makefile work from Pavel Roskin - A major USB patch from Chris Rankin. This rewrites the command-queueing code to something considerably more sane. - A few more Makefile tweaks - Further compile warning fixes on 64-bit targets (Pavel Roskin) - Fix prism2_cs on 64-bit targets (Pavel Roskin) - Fix the 2.4 build (whoops) -pre26 - Fix the "no hardware found" bug in 2.6.10+ kernels - Cleanups in the Makefiles and build system - Fix a typo in the shared.prism2 script (Chris Rankin) - Clean up build warnings with gcc 3.3 (and possibly older too) - Fix a nice race condition on device registration. - Don't stop the netdev when we hit ifstate_disable. - hw->state wasn't being set properly on drvr_stop, nor were we clearing the port status in all cases. - Fix the "Debug: sleeping function called from invalid context" under 2.6 with prism2_usb (Chris Rankin) - Wireless extension SCAN support (Dan Williams) - 2.6 sysfs support in the form of SET_NETDEV_DEV (Dan Willimas) -pre25 - Fix a brown-paper bag bug in the register_wlandev code. (Giacomo Lozito) - Patch for the Sitecom WL-022 widget (Armijn Hemel) - Build fix for ancient ETHTOOL versions - build fix for old 2.4.x kernels -pre24 - Fix build on 2.6.10-rc - Fix USB build on 2.6.x (x < 7) - Suspend the USB driver cleanly (Colin Leroy) - Fix more USB badness (Colin Leroy) - scan_timeout WAY too long. (Wolfram Gloger) - dev_get is no more, as of 2.6.10-rc2 -- switch to dev_alloc_name instead, which is present in older kernels. (reported by Colin Leroy) -pre23 - Fix badness in 2.6.10-rc1 (Colin Leroy) - Compile fix for 2.6.9-rc4+ (Jeff Chua) -pre22 - Add support for x86-64 (and possibly other 64-bit targets) (J.D. Cole) - Fix linkstate if driver reset without unloading. (Shiro Ninomiya) - Rename the man pages to have a .1 extension - Tweak the Configure script; change the default kernel build directory - put a 'sleep 1' in the firmware load sequence to improve reliability. (Arnold Liu) - Add Linksys WUSB11 card ident -pre21 - Add a per frame rx structure for OOB data to be passed to p80211 This is a step in the right direction for a major overhaul of internal frame representation. The prism2 driver shouldn't care about sniff headers or any of that crap; it should always pass everything to p80211 (via this metadata) and the p80211conv_* functions should do that work. It's also needed to eventually support different encryption types. - Added in beginnings of IWSPY support via patch from Josef Kriegl - Install modules to $MOD_DIR/linux-wlan-ng instead of $MOD_DIR/kernel - Primary/Secondary firmware (finally) bundled with the driver. - Convert to newer 2.6 module parameter code. - Fix an inverted test in GIWENCODE wireless extension (Shiro Ninomiya) - Minor script fix for SSF cards (Pavel Roskin) - Card idents. - Fixes for SSF PCI cards; default to x16 SRAM as that's more common. (download script now automatically detects hardware type) - Fix script problems that result in a failed init returning success. - Fix an endian-ness buglet in prism2sta.c (Federico Pellegrin) - Compile fixes for 2.2.x kernels. (no tasklets or spin_lock_bh) - Fix up pci resources on card init failure on plx card. -pre20 - Fix up pci resources on card init failure - Ident for "ROPEX FreeLan 802.11b USB Adapter" (Francesco Bochicchio) - ETHTOOL support now optional, fixes build on older kernels. - Fix prism2dl to not use kernel headers to fix 2.6.3 build (Pavel Roskin) -pre19 - Add a 'lnxind_roam' indication. - minor typo in the nwepgen makefile (Pavel Roskin) - More makefile fixes (Pavel Roskin) -pre18a - brown-paper-bag fix for the 2.4 build. And it no longer builds on 2.2 thanks to an accidental makefile commit. -pre18 - Fix broken makefiles so that prism2dl and the rc script install - Get rid of the txfid lock, it's not necessary. - Tasklet-driven RX handlers. - Further work towards a Wireless Extension-enabled future. - SIWFRAG, SIWRETRY, SIWFREQ, SIWRTS implemented - SIWENCODE, SIWESSID taken from zdsta-1.0.3 (needs work) - SIWCOMMIT Implemented ala autojoin. - write support defaults to disabled, override via module parameter - fix a warning in the wireless extension code. - hfa384x.h header updates - Fix prism2dl to handle the S7 record being elsewhere in the image. (Pavel Roskin) - Fix up brown paper bag script error for SSF hardware. -pre17 - Spruce up the GIWNAME wireless extension ioctl. (Natsakis Konstantinos) - Added in basic ethtool support; for link status reflection. - Fixed a double-locked spinlock which deadlocked on SMP boxes. - /proc/net/p80211/wlanX/nsd now has useful information about the prism2 hardware/firmware revisions. - eliminate the unused 'collptr' from the mib structures. - Fix a bug with the pcmcia script and scanning (Dan Noe) - Fix a crash on a VCC mismatch. - Split out most pci/plx/pcmcia/usb specific code into their own .c files. - Make prism2_cs build on 2.6.2-rc - Changes to support SSF hardware. - Card ident for D-Link DWL-650P1 - Move the prism2 link notification handler operate in scheduler context to avoid a hang in softirq context. - Melco WLI-USB-KB11 USB widget added (Bela Fenyvessy) - Add in x86-64 support, plus other cleanups in wlan_compat.h - Support the Netgear MA311 PCI card. (Steve Berry) -pre16 - Implement wireless extension SETCHANNEL. (SIOCSIWFREQ) - Currently broken. :) - Fix several sniffing-related bugs: - disable when we're already disabled - no longer perform a full h/w reset when we're already enabled - Vastly reduce CPU usage on channel hop. - Fix a crash on unload for pci/plx widgets (Pavel Roskin) -pre15 - Minor fix for the shared script (Jeff Chua) - fix "bad: schedule while atomic" bug introduced by recent 2.6.0-test kernels and wireless extensions. - Switch to using spin_[un]lock_bh for the cmdlock; this way we disable the transmit bh from running while issuing a card command. Also have the txframe function obtain the lock. - Hawking HighDB USB Widget (Allan Claghorn) - Fix a double-lock in hfa384x_cmd_notify - Identity for "T-Sinus 111 USB WlAN Adapter" (Roman Koutny) - Fix up alignment problems on frame rx. (Ranjit Deshpande) -pre14 - Update the HAS_HOTPLUG test to something considerably more foolproof - Add ids for the Airvast Prism3 USB widget - bap locking was broken when illegal parameters were passed. (Andre McCurdy) - Don't use jiffies for timeouts when interrupts are disabled. (Andre McCurdy) - Make the Configure script a little saner. - Remove the Zydas 1201 USB widget. Use the Zydas modified linux-wlan-ng release instead (we hope to merge it in eventually) -pre13 - Fix two big-endian bugs in the scan code. - Hotplug agent executes '/sbin/ifup INTERFACE' if possible. - Planex GW-US11H USB adaptor (Henry Ip) - Averatec USB Wlan Adapter (Stephan Miller) - D-Link DWL-122 USB widget (Andrew Beresford) - ASUS-WL140 Wireless USB widget - Fix the WLAN_LOG_NOTICE macro for gcc 2.95.x -pre12 - Fix up endian bugs in lnxerq_commsquality. - Get rid of the pcmcia release timer for >2.6.0-test5 - Card ident for 'ZyDAS ZD1201 Wireless USB Adapter' (Albert Pauw) - More tweaks for 2.6.0-test4 - fix some bash-isms in /etc/wlan/shared (Daniel Song) - Collapsed the BOUNDEDINT and INT types into one. - Eliminated the WLAN_LOG_***0() macros at long last thanks to CPP trickery. Also eliminated more cruft from wlan_compat.h - Card ident for the Samsung SWL-2210P PCI card - Try not to schedule a USB endpoint reset if there's one already pending. (Chris Rankin) - Fix pci/plx operation on architechures with >32bit physical address sizes. (namely mips64 & some mips32) - get rid of save_flags/cli/restore_flags in prism2_cs on >2.2 builds (tweaked from patch by Pavel Roskin) - pci_device_id tables should not be marked __devinitdata -pre11 - support genesis mode for RAM download of primary fimware - prism2_usb now builds on 2.5/2.6. - endpoint numeration removed. - hfa384x_usb_corereset unimplemented for 2.5/2.6 - hfa384x.h updates. - p80211conv_* functions should work with netdev->mtu, not MAX_ETHFRM. - Simply erase the bogus '3rdparty' drivers on Mandrake systems. - Card idents for Adaptec AWN-8030/AWN-8020, and Netgear MA111 - Strip out all 2.2.x stuff from prism2_usb, it doesn't work. - add proper __devinit/__devexit/etc tags to prism2sta.c - Minor USB janitorial patch from Chris Rankin. - Make most card commands require superuser access (exception is mibget) (Original patch by Pavel Roskin) -pre10 - Make the wakeup flag in the usbctlx structure volatile, as well as other wait condition variables. - Make the rx_urb buffer dynamically allocated so we can re-post the URB as soon as possible. - Get rid of completion.h - More wlan_compat updates. - Disable TXEX reporting on USB as well as TXOK. should improve stability a tad. - Further 2.5 USB work. Not quite there yet. -pre9 - Properly initialize the prism2_cs release timer (Pavel Roskin) - Eliminate the CONFIG_ISA requirement for prism2_cs (Pavel Roskin) - netlink build fixes for 2.5.71 - Hopefully fix the 2.2.x build. - More USB fixes (Chris Rankin) - Compile fixes for < 2.4.20 -pre8 - Fix the pcmcia breakage introduced in -pre2. - On USB widgets, only signal txcomplete if there was a tx error. - Minor cleanups in the PCMCIA code. -pre7 - Add in the 'JVC MP-XP7250" USB Widget. - Don't call ev_alloc on tx_complete event; only the tx urb completion. - Minor tweaks to tx_timeout code - More USB updates; primarily with error-handling. (Chris Rankin) -pre6 - On USB transmits, don't return 'success' if the tx_urb is still pending. Also don't wake the netdev queue if the tx fails. - Hook up the tx watchdog timer and add a p80211-level handler. - Fix compilation with older (<= 2.4.18) kernels. - Another massive USB+other patch from Chris Rankin: - a separate list for "finished" CTLX objects. - correct (hopefully!) handling of -EPIPE errors, shamelessly copied from^W^Winspired by David Brownell's usbnet driver. - finished support for asynchronous commands, with proper tracking through the CTLX lifecycle, clean-up etc. Each asynchronous command now completes in its own tasklet. - CTLX cancellation and error handling. - further work on the timers and spin locks. - clean up setconfig16() and setconfig32() functions so that they take appropriate value parameters, even if the underlying setconfig() commands don't. - use an asynchronous command in setmulticast(). (CS, PCI and PLX are still synchronous; they just pretend not to be.) - further clean up in the disconnect() handler. However, it's still not a good idea to remove the adapter while the prism2sta_inf_hostscanresults() function is sleeping, and the wlandevice struct could easily have been freed before the p80211req_dorequest() function manages to clear the request_pending bit. It would be nice if we could cancel both of these operations when we call prism2sta_ifstate(P80211ENUM_ifstate_disable). - extra support for Linux 2.5 (task queue -> work queue). - reset the link status when we stop the driver. - Some work on module locking. Not there yet, but getting better. - Remove magic numbers from USB endpoint probe (Chris Rankin) - Eliminate useless timer in p80211do_request, as all calls are synchronous. Also clena up more function pointers, and a few other doodads. (Modified from patch by Chris Rankin) - Track the current SSID in the wlandev; Make the WEXT stuff key from this. Update the SSID when we get a linkstatus_connect notification. - A couple of misc cleanups from Chris Wilson - Cleanups in the 2.5 makefile code. (Pavel Roskin) - Add in another PCI device ID, to handle Sony VAIO PCG-V505AP - Make sure CONFIG_ISA is enabled for the prism2_cs build. (x86 only) -pre5 - Get rid of generic manfids in /etc/pcmcia/wlan.conf (Pavel Roskin) - Fix the 'make install' target. - only call flush_scheduled_tasks() if DECLARE_TASKLET not defined. (fixes 2.5.x compile) -pre4 - More script work; mostly cleanups and other enhancements. - Substantial prism2_usb patch from Chris Rankin. - using 2 Linux lists for CTLXs - remove race condition and double-free with CTLXs in disconnect() - initialise URBs correctly (vital for Linux 2.5+) - separate callbacks for data/CTLX OUT URBs - flush task queue on shutdown - more thorough use of spinlocks with CTLXs - set the ASYNC_UNLINK flag when it is time to unlink an URB asynchronously, and not before. - ensure we stop submitting URBs once the disconnect function is called. - More USB idents (Jeff Chua) - Scan now uses active scans only; should speed things up a bit. - Proper module init/cleanup in prism2sta.c, plus more work for 2.5.69 - Added in descriptions for module parameters. - Major overhaul of the hotplug stuff. Now we use our own hotplug event class, and use that to kick off configuration and whatnot. All device types (pci/plx/pcmcia/usb) now use this mechanism. Also brings us things like unified power management (suspend/resume) - Supress spurious output when setting WEP parameters. - Only query PrivacyOptionImplemented if wep was enabled in the config Works around an apparent firmware bug, see http://bugs.debian.org/190851 - Eliminate hw->name. - Card ident for NL-2511CD Plus pcmcia card. - Minor tweak on pcmcia removal. - Fix the USB compile on <2.4.20 -pre3 - get rid of wlandev_get_index and whatnot. - URB cleanup in the USB code. (Chris Rankin) - Moved host auth sequence out of interrupt context. - USB paranoia checks (Chris Rankin) - Partial rewrite of the USB shutdown sequence - eliminate wlandev->hwremovedfn(). - Minor tweaks to the mib. - Get rid of the horridly outdated skeleton driver. -pre2 - Fix a crash-on-unload affecting pci and plx adapters - have the init script load the module if needed. - Handle the new 2.5.69+ irq handler semantics - Fix 2.5 with pcmcia (Pavel Roskin) - Massive cleanup of the prism2/driver/Makefile (Pavel Roskin) - Don't wrap the [un]register_netdevice() calls in rtnl_[un]lock() And use the [un]register_netdev() calls instead. - Call the hwremoved() functions on pci/plx_remove - Eliminate the prism2sta_priv_t structure. - Fix a memory leak on ifstate_disable - Minor changes to the USB driver - Widget id for "Melco WLI-USB-KS11G" (Ichiro Doi) - Function pointer syntax cleanup (Chris Rankin) - Push the multicast/promisc set into the prism2 driver. - Move type/multicast filtering into the p80211 layer. - Format fix for p802addr_to_str (Pavel Roskin) - Add a check for non-Intersil firmware. - Fix a infinite recursion in the usb lowlevel code. (Chris Rankin) -pre1 - Header updates. - Add a card ident for the USR 1120 USB widget (Juan Conde) - Cleaner shutdown; fixed a possible leak and a race condition. - Another rearrangement of the command locks, to eliminate use of the spin_is_locked() call. - Fix a rare deadlock with cmd_initialize (Pavel Roskin) - Add a Lucent-compatible key-generator in add-ons/lwepgen - Fix a stack overflow problem. (Pavel Roskin) - Further monitor mode fix for control frames (Pavel Roskin) - Cleanups in the dependency generation code - Initial 2.5 support. USB currently broken. - Minor build system cleanups. 0.2.0 - Use PSUEDOIBSS mode for monitor mode; this should eliminate spurious beacon generation. (Ryan Veety) - Don't drop "unrecognized" frame types in monitor mode. - Added ident for the Linksys WUSB12 (Brad Davidson) - Eliminated most of the WLAN_LOG_???n macros. - Minor fixups in /etc/wlan/shared - Cleaned up some of the error messages in the conversion code. - changed the "Host de-WEP failed" error to a debug message, as the /proc/net/wireless stats are updated to reflect undecryptable frames -pre10 - Added the p2TxPowerMax MIB item to specify the TxPower level. 0-30 dBm. Needs STA>=1.7.0 or AP>=1.4.0. - Clean up some spurious warnings in prism2sta.c (Pavel Roskin) - A series of patches from Pavel Kankovsky, somewhat tweaked. :) - Properly set skb->mac.raw in non-monitor mode - Enhancments to the p80211 frame conversion code - Handle A4 frames. - Don't issue linkstatus notifications in monitor mode - Supress Linkstatus messages in monitor mode - hfa384x.h updates for latest firmware. -pre9 - ZyXEL ZyAir B200 Wireless USB widget ID added (Paul Lacatus) - Only enable interrupts in one place (hfa384x_drvr_start) - Fix the startup scripts to disable WEP completely if not enabled. - ALLNET 0193 USB widget ID (Kurt Huwig) - Disable the hfa384x port before issuing the autojoin stuff. - Fixed a subtle flaw in the 802.11->802.3 conversion code. - Updates to hfa384x.h - Add productinfo for dlink DRC650 from Petr Slansky. - Minor changes to the rfmon code. - Only notify us on linkstatus changes if it actually changes. - Fixed the path the manpages were installed to. -pre8 - Properly reset the hardware state after a flash/ram download. - Patch to allow escaped characters in the scan list (Derek Atkins) - Re-added the txfid queue locking which somehow got dropped. - Added DellTrueMobile 1180 USB ident. (Michael Hackett) - Changed linkstatus messages to INFO level reporting. - Ident info for the Intel Anypoint II 802.11b PCMCIA card. - Added support for the SH architechure and many changes necessary for 2.5 support. Modified from the patches by Ryan Veety. - Compile fixes for 2.2.x introduced as part of the new hotplug support. - Added man pages contributed by Joey Hess - Add ident info for the Z-Com 725/726 USB Widgets. - Fixes to silence GCC 3.2 warnings. (Pavel Roskin) -pre7 - Patch to fix int array mib manipulation. (Pavel Roskin) - Minor improvements to the build system. - Moved RX processing to a bottom half instead of hard irq context. - Further script improvements: signal strength filtering, and some space handling stuff. The latter is not complete yet. - lnxreq_commsquality wasn't setting the status field properly on the response messages. - Workaround for spurious interrupts generated before initialization is complete. (Clay Jones) - hotplug script now invokes 'ifup $DEVICE' if present. - Minor cleanups (Pavel Roskin) - Tenative SPARC support. (Olivier Bornet) - After leaving monitor mode, disable the port if we had to enable it. - Updates to hfa384x.h -pre6 - Further script enhancements; automatically use scan mode on hardware that is known to support it properly. - Fixed errors in the hotplug script, and other misc fixes. - 2.2.x fixes for the new proc stuff and deferred processing stuff. - Add support for the new sniff frame capture. (doc/capturefrm.txt) - Get rid of some bitrot with the sniffing code. - Populate the tx dropped frames statistics. -pre5 - Fixes for host scan when not currently joined. - /proc support; some informational stuff is kept in /proc/wlandev/wlanX - Complete rewrite of the configuration files and startup scripts. hotplug(pci+usb), pcmcia, rc, everything uses same config file(s). per-network configuration supports scanning and automatically choosing a network from a set. - Fix the TMD7160/ncp130 support so it acually works. :) - Make the BUG() call in cmd_access enabled only in debug builds. - Minor makefile fixes. - Microsoft MN520 PCMCIA ident info added. - p2cnfShortPreamble is not a boolean value. (Clay Jones) -pre4 - BAP access fixes for PCI platforms. This mostly affects SMP arrangements. - Back out W200 USB ident info; it's not prism-based. - Patch from Tom Prado to make 'keygen' more user-friendly. - bap_timeout parameter only valid on non-usb platforms -pre3 - Added Ident info for the USB Compaq/Intel W200 widget - dot11req_scan requires firmware >=1.3.2. - Added the "Acer Warplink USB Adapter" id. - Rework the prism2sta_inf_linkstatus call to defer processing of results until outside interrupt context. Should fix the SMP deadlocks seen on some machines. - Rework the usb_disconnect code to hopefully alleviate the occasional crash-on-disconnect some people see. Solution is not SMP-safe yet. - Add the D-Link DCF-660W ident info. -pre2 - New parameter, 'prism2_bap_timeout' to specify the timeout on bap setup. timeout*10 == timeout in microseconds. Note that this timeout occurs in spinlock context, so increasing it arbitrarily is BAD! Defaults to 1000, ie 10000us. - compile fix for prism2sta in debug mode. - Only prompt for pcmcia sources if we're using non-kernel pcmcia. (original patch by Beat Bolli, rewritten a bit..) - Add the Linksys WCF12 CF ident info. - A bunch of compile fixes for older versions of wireless extensions. - Added implementations of GIWTXPOWER and GIWRETRY - Some fixes to the wireless extension code (thanks to Jean Tourrilhes) -pre1 - wland was incorrectly using kernel headers in its compile. - Adhoc mode was auto-roaming onto "any" SSID. Fixed. - Implemented the dot11req_scan & dot11req_scan_results functions. This, combined with more intelligent startup scripts, will allow you per-network profiles. Scripts are unwritten as yet. :) - hfa384x.h and MIB updates. - Rewrote the wireless extension support code; moved to p80211 layer. Now we're compatible with at least v6-v14, and everything inbetween. We hook up to the new iw_request structure, which makes further wireless extension support much easier to add. - Add the Microsoft MN510 USB device ID. - Finally fix the 'crash on unload' problem for 2.2.x kernels with PCI. Turns out the kcompat24 code wasn't quite complete. (Matthew Rush) - Cleaned up our usage of __FUNCTION__ to make gcc 3.x happy. - Fix a typo in the prism2 makefile. 0.1.15 - Fix an obscure PCMCIA build problem. (modversions disabled but header present, and using non-kernel pcmcia) -pre8 - Added code to optionally truncate packets in monitor mode. (Clay Jones) - Fix a polarity problem with the stripfcs argument to monitor mode. - Add a test to make sure wireless.h is included. - Netgear MA401A card ident. - Further cleanups of the build system (Makefiles) -pre7 - Include wireless.h so wireless extensions work again. :) - Work around the braindead RedHat kernel build system. - Fix a class of unaligned accesses in the message structures (kernel driver) and user space parsers (wlanctl-ng, etc) - Fix an unpacked struct problem that affected ARM platforms (thanks to Clay Jones for spotting this one) -pre6 - Support the new auto-unknown mode present in firmware >1.3.3 When issuing an autojoin, we try to join a BSS, then an IBSS, and if all fails, we create a new IBSS with the given parameters. *note* currently disabled. - Updates to hfa384x.h to reflect latest documentation - Build system mini-enema. Automagically detect kernel version, pcmcia status, and modversions. Pick up the kernel compile flags. - Hopefully fixed the 'crash on unload' for 2.2.x kernels and PCI. - 'p2req_join' command, see doc/wlanctl-ng.p2req_join.txt This lets you join a specific SSID. Thanks to Clay Jones. - A couple more pcmcia/cf card idents - More deletions/fixes in wlan_compat.h -pre5 - Due to new hotplug code, atmel device detection removed - Further cleanups in wlan_compat.h and non-kernel makefiles - Debian package stuff yanked in favor of the "official" deb packages - Rearranged the wireless extension support code a bit - A fix for the promisc/allmulti stuff on USB devices -pre4 - Hotplug support for PCI/PLX/USB widgets - A compile fix for 2.2.x (x < 18) kernels and PCI adapters - Support for TMD7160-based "almost but not quite PLX" boards - HP-PA support. In theory. Anyone care to test? - pcmcia script cleanups - Add ident info for the "Intel PRO/Wireless 2011B LAN USB Device" - Include an almost-sane fix to the modversion madness - Tweak the init order of the PCI driver structs -pre3 - Added ident info for ASUS WL-110/WL-100 cards - Support for PCI power managment - Fixed a wep hang on the transmit side - Compile fixes; mainly for 2.2 kernels - Add support for the SIOCGIWRATE wireless extension -pre2 - Restructured the driver locking. SMP should be MUCH better now. - Stripped out more dead code. (mainly FID_STACK) - Fix an skb access after we call netif_rx - Fixes for XScale CPUs. - Added added a MiniUSB ident info - Restructure of the docmd_* functions -pre1 - Host-based WEP decryption and encryption - Partial rewrite of copy_to_bap. - Debian package metadata updated to 3.0-STABLE. (David Everley) - Stripped out a lot of crap from wlan_compat.h - More atmel adapters added to the USB exclude list. - James Goodwin's patch to fix a bug in the 80211conv code. - The 3COM AirConnect board is a PLX adapter. 0.1.14 - Added PCI ident info for the 3Com AirConnect PCI. - FCS toggle now (really) defaults to false. - Added PCMCIA ident info for the 3Com AirConnect 3CRW737A/3CRW777A - David Everly's patch to kernel detection in the Configure script - David Everly's patch to add better debian packaging bits. -pre7 - Added kernel tags stuff. - Added PCMCIA ident info for the Actiontec 802CI2 card. - Added PCMCIA ident info for the Proxim RangeLAN-DS/LAN card. - Endian "fixes" for PCI PowerMacs. This fix may be relevant for other BigEndian/PCI (and PLX) platforms. - FCS in monitor mode now optional; defaults to off. - Populate the monitor channel in the prismheader. -pre6 - monitor mode now works on USB widgets. - Fix an alignment bug in the rx path. - Fix a brown-paper-bag bug in the usb flash code. - Explicitly enumerate the USB widget endpoints, and use 'em. - REALLY fix the wlan.conf overwriting. - More minor cleanups in the PCI/PLX init code. - endian-ness fixes in the monitor code - Applied a patch from David Everly to fix another 2.2.x compile problem. -pre5 - Add USB entries for the "Melco WLI-USB-S11 11Mbps WLAN Adapter" - Don't overwrite /etc/wlan.conf if it already exists. - Compile sniffing code if packet socket is modularized. - Fix a typo with the init script. - Fix a compile problem with 2.2.x kernels -pre4 - First bits of the SMP/locking fixes. - Partial rewrite of the PCI/PLX/USB driver internals. - Added a makefile for the 'addons/keygen' tool. - Fixed a race condition in the USB code. - Applied Godmar Back's "SSIDs with spaces" patch. -pre3 - Applied pizza's patch to remove the pb_t structure and make all 802.11<->ether conversions happen in-place. Noticeably reduces cpu load. Also includes a few misc bugfixes to the conversion code. - Workaround for the kernel panic on bringing up a USB interface - Applied Mike Klar's USB patch that adds support for the MIPS target and should, among other things, fix WEP under USB. - Added Remy Cool's patch to add the Dynalink prism2 card ids. - Tim Miller's pcmcia script install path patch - Applied Tim Fletcher's patch to allow compilation against the newest versions of the wireless extensions. (V13) - Added jwyatt's patch for the Compaq Evo N600C USB adapter thing. - Per mwelk's suggestion, changed the displaystring totext to single quote the strings. Hopefully this will take care of some of the "SSID w/ space" problems. -pre2 - tseward's ID code patch for Siemens SpeedStream USB adapters. - pizza's patch for dropping/ignoring frames in promisc and allmulti modes. - crankin's new Actiontec USB IDs. - crankin's fix for wext /proc zero vs. garbage problem. -pre1 - pizza's chkconfig comment in rc.wlan. - pizza's patch to add true promiscious support to 0.1.13. Also includes Experimental ALLMULTI support. - pizza's patch to add PF_PACKET capture and raw transmit to 0.1.13-pre2, (with toggles for WEP in sniffing and prism header) NOTE: this patch _removes_ the old netlink monitor mode (sniff) interface. If you're sniffing, you need to use the latest libpcap (v7.2-pre..from CVS), you'll also need to build your own ethereal (0.9.0 or greater) using the latest libpcap. - bhuang's fix for the hfa384x_test_command() function. 0.1.13 -pre4 - crankin's revised USB ID patch. - Fixed a little buggage in the p80211knetdev_set_mac_address() function. -pre3 - crankin's patch for a bug in usb rrid, DBFENTER/EXIT, and Actiontec USB IDs. - hmuurimaa's ID patch for the Omnibook500 integrated USB adapter - proskin's patch for MODULE_LICENSE conditional - dstates (JediElite) submission (others submitted it too) for the NDC PLX card. - crankin's patch for src/prism2/driver/Makefile. PCI and USB were linking with PLX's prism2wext.o file. DOH! -pre2 - Synch'd the etc/pcmcia/wlan-ng scripts with the etc/wlan* scripts. This should help PCI/PLX/USB Adhoc users. - Added cmulliner's patch for set_mac_address(). Also changed it to use dot11StationID instead of the prism2 specific mib item...Oh Yeah, I also changed to comments to /*...*/ ;-) - Fixed PDA reads and PDA validation. - KNOWNBUG: prism2_usb + linux-2.4.17 + uhci.o : Very slow performance. We need to look into having multiple posted tx and rx urbs (this is also a TODO). - KNOWNBUG: prism2_usb + linux-2.2.20 + uhci.o : Physically disconnecting the device causes a Panic. The logs look like the usbdev is still holding some buffers (urbs?) associated with the device despite the fact that I've explicitly unlinked them. This problem does not occur on 2.4.17 and, unfortunately, I don't have time to debug 2.2.20 this time around. - Made all corereset() calls dependent on the prism2_doreset module argument. - Added corereset() support for all device types. - Added the lnxreq_ifstate request message. This request is used to bring the device up to an operable state _after_ the [hostbus]_probe() function is finished. It can also be used to shutdown and/or restart the driver+device. This takes the place of the "activate hardware on ifconfig up" code that was introduced in 0.1.11. This is the change that should fix most of our dhcp client problems. - Massive changes/cleanups to the driver init/shutdown code for all device types (pcmcia|pci|plx|usb). - Removed the add-ons/mibedit application from the linux-wlan-ng package. We'll be re-releasing it as a separate tarball. - Modified hfa384x_usb.c per dbrownell's suggestion to mark the request urb's with the USB_ASYNC_UNLINK flag. This because we're calling unlink_urb() from the timer callback (intterupt context). - Added arichter's patch for the RRID framelength. It's a good catch to make things truly correct. Unfortunately, I don't think it will have any effect. Because of the 64-byte minimum, the actual RID value is being transferred regardless. Also, I don't think the RRID handler in the MAC even looks at the framelen field of RRID frames. - Added mwelwarsky's patch for the tx path that may fix some of the "queue empty" errors. Had to update it for 0.1.13. - Added new PLX device IDs from cyokoyama's patch, but deferred the rest until we can get a clean patch against the latest release. - Added pizza's v2.1 NETLINK enable/disable patch. Note that this whole NETLINK enable/disable thing is only barely tested by me. I _always_ have netlink available so maintaining a separate kernel setup just to test this feature is a pain. - Added jdiedrich's pcmcia card ids for the Compaq ipaq PCMCIA card. - Added crankin's patch fixing some more wext induced problems and adding the Actiontec USB ids. - Added abridgett's patch for PRIV_GENSTRING handling. - Added emckee's malloc.h -> slab.h patch and made the mods to the usb and wext files he missed. Some kind list soul told me that the change to slab.h goes way back in the 2.2.x history, so we should be OK. If this change proves to be a problem for someone with an old kernel, please submit a patch with ifdefs for the version where things changed (not just the version you're using....thanks). - Added jtourrhiles patch for wext reporting level and noise in dbm. To enable the reporting in dbm, you must add "#define WEXT_IN_DB" to the top of src/prism2/driver/prism2wext.c. - Added support for the dbm-normalized RID for CommsQuality in prep for working with Jean's patch. The mibs are called p2dbmCommsQuality*. Note that this will only work for secondary firmware versions 1.2.0 and higher. Earlier versions will return with a 'resultcode=implementation_failure'. Note also: The values returned are signed 16-bit integers that have been stuffed into unsigned 32-bit integers for the trip up to userland. The following shell expression will convert them back to the signed quantity you want: if [ $val -lt 32767 ]; then echo $1 else echo $[ $1 | 0xffff0000 ] fi - Added mkershaw's suggestion to lengthen the wait interval for commands in hfa384x.c. - Added a note to the README about dleffler's observation regarding netlink troubles and using 'make mrproper'. - Added gback's patch to initialize wireless extensions for non-pcmcia targets. -pre1 - Fixed a patch induced (not sure which patch) Makefile syntax error. - Added rfloeter's cool Wireless Extensions patch which was kindly updated to 0.1.12 by pizza. Note that my own testing of this patch has been minimal but I've had reports of folks who are using it successfully. NOTE: The addition of this patch adds the requirement that Wireless Extensions (version >= 10) be compiled into one's kernel. - DOH! some somewhat kind soul on the lists pointed out that the keygen program wasn't in the distributed tarball. Basically, I forgot to check it into CVS, therefore the distribution build script couldn't find it. Ahem...it's now in CVS and should be included in the tarballs. - Added pizza's patch fixing the "netlink disable" patch. The p80211ind_* functions need to be handled individually instead of two giant #if's, but that's a task for another day. - Added theBS's patch for making the /etc stuff installation relative and installing the FIXINST scripts for USB. - Added crankin's SMP deadlock fix patch. 0.1.12 - Added dlyddy's string.h includes and comma fix. Changing all malloc.h's to slab.h's will have to wait until I figure which kernel version marks the switch so we can ifdef it. - Added bgertfield's Corega support patch. - I added a check to Configure so we add the CONFIG_NETLINK symbol on the compile command line if necessary. - proskin's patches for netlink disable when not configured in kernel, mkprintstr fix, and turn off skeleton install. The netlink patch pointed out something that might be the root cause of some problems with the _cs driver. pcmcia_cs now strips the kernel CONFIG items it cares about and puts them in it's own include/linux/config.h (which is symlinked to include/pcmcia/config.h). - Added mtaylor's suggested close() to do_ioctl() in wlanctl. - Added mkarmak's suggested change for the GL24110P device ID as PCI_DEVICE_GL24110P_ALT and an additional item in the device table for PLX devices. - Added crankin's suggested MODULE_LICENSE statements. Had to figure out the version ifdefs myself though. ;-) - Added vragor's patch for arm updates to the Makefiles and Configure. - Added jsuhr's patch of the PLX9052 irq enable code from the orinoco driver. Note: PLX contributions are highly valued here because we rarely use these devices ourselves. - Added cfang's PCMCIA ident info for AirEZY card. - Made USB port reset in open() an option, DEFAULT IS OFF. - Cleaned up the top edge of hfa384x*.c (needs some more). - Added the notion of CMD vs. AUX format MAC chip addresses. - Modified isgoodpdr() to accept anything less than 0x1000. - Updated the wlan-ng scripts for the new open/close behavior. - Fixed a bunch of issues that caused bad breakage for hot-plugging the USB module. - Added a module argument to enable/disable the MAC (or usbport) reset performed in prism2sta_open(). - Moved the port reset corereset() and the call to the open(). This gets the port reset out of the probe_usb() context and appears to solve the recursive probe problem in some cases. - Cleaned up the overlength usb packet problems - Added rmemreq/resp and wmemreq/resp support - Fixed some of the 64-byte packet problems in a few commands. 0.1.11-usbonly - Note: hfa384x*.c are currently undergoing some changes. I believe these changes have broken some things for pcmcia/pci/plx support. I'm not certain since I haven't tested them. As such, this is a USB ONLY release. - Cleaned up the use of hfa384x_drvr_*() vs. hfa384x_cmd_*() a little. This is a work in progress. - Rewrote the USB request/response machine again. - Added tnewsham's keygen program to the add-ons directory. I don't include it in the overall build because I'm not comfortable with making this package dependent on openssl right now. It is supposed to generate keys in a manner identical to the windows software. I have not personally verified this. If someone wants to contribute more complete build instructions for this program, please do. - IMPORTANT! Note that we've changed the up/down behavior. You now must 'up' the linux netdevice interface (e.g. ifconfig wlan0 up) prior to using wlanctl-ng. Also, wlanctl commands aren't available after "ifconfig down". From a low-level perspective, this is how most linux netdevices work. We originally started trying to create a setup where "ifconfig up" on an interface that wasn't associated would fail. With PCI and even more so with USB, that has proven unworkable. The idea now is: Step 1: ifconfig wlan0 up Enables the hardware so it's ready to handle wlanctl-ng commands. Step 2: wlanctl-ng , repeat Set up the dot11 configuration and get yourself associated or whatever. Step 3: ifconfig wlan0
After getting a "real" 802.11 connection, assign the address to the interface (via static numbers, dhcp or whatever). Note that it is very important that you do _not_ down the interface between the initial 'ifconfig up' and the later ifconfig that assigns the address. 'ifconfig down' will shut down and reset the hardware. If you down the interface, all that good work in step 2 will be lost. - Rewrote the USB request/response machine - Moved all memmapped/irq interface elements from prism2*.c to hfa384x.c in preparation for adding USB support. - Fixed 'make clean' so it doesn't generate .depend files. - Removed some leftover pcmcia-cs dependencies for non-pcmcia targets. 0.1.10 - Added module param "prism2_ignorevcc". If set to non-zero, we just accept the Voltage we get from pcmcia-cs without checking. USE WITH CAUTION!!!! - Changed the voltage setting code such that we never try to change it. - Added NETGEAR PCI info. - Fixed a problem with the interrrupt enable in mlme_start(). - Fixed the netdevice_t problem. - Added some new CIS entries. - Fixed some byte order things re: dblythe's patch. The problem went a little farther than the patch so I had to change some things. - Added lye's fix for the netdevice_t problem on various targets. - Added an Ad-Hoc support patch from ????? (please identify yourself, it's a nice bit of code and stays within the spirit of things). Adhoc still needs work though. Remember, only the _first_ STA in an IBSS should issue an MLME-Start.request. All the rest should scan/join - Re-added the monitor mode stuff. At this point I guess Intersil won't be taking it out. Many thanks to those who maintained the patches and my apologies for the hassle. 0.1.9 - As part of the PCI stuff, rewrote the scripts for 'fixed' (i.e. non- hotswappable) cards like the ISL3874 and PLX based PCI adapters. - Added support for the dot11req_reset command. It should perform a complete reset of the MAC and driver. Note that the MAC needs to be completely reconfigured from userland after the reset has occurred. Also added an internal call to the reset function when unloading a PCI or PLX driver. We need this reset to make sure that the card is no longer generating interrupts. Fixed this problem: If the driver is unloaded, the card is still generating interrupts, and another active device+driver is using the same interrupt....system locks up. DDT. - Rewrote the PCI support for PLX and ISL3874. The rewrite was targeted at 2.4.7 with additional code to provide backward compatibility for 2.2.x. NOTE: the PCI code still doesn't support the PCI power management stuff. It will probably need more work when laptops w/ the ISL3874 based mini-PCI cards show up. - Whoops, forgot to put this in the original 0.1.9 release 0.1.9-pre1 - Added support for the ISL3874 based mini-pci card. Also cleaned up some of the PLX stuff (needs more work though). 0.1.8 - Fixed some script bugs relating to WEP and generated keys. - Fixed the autojoin auth type control - Added/Changed some PDR numbers (thanks to BroMax for supplying hardware) - Received a large patch from bjames of Rebel Computing. Here's a summary in his words: > Minor bugs (not already found in 0.1.8-pre10): > > 1. p80211metamsg.c: > - Wrong conversion functions for "p2req_mmi_read" (value). enumint ==> > int > > 2. prism2sta.c: > - "dot11_desired_bss_type" in "priv" structure left at 0 (i.e. an > invalid value) after initialization so mibget could not retrieve a value > unless the network was started. Initialized to 1. > > 3. prism2mgmt.c: > - "prism2mgmt_channel_info()" uses HFA384x_RID_SCANREQUEST_LEN instead > of ...CHANNELINFOREQUEST... (However, they're the same size.) > > 4. prism2mgmt.c: > - "prism2mgmt_auxport_read()" did not set the resultcode to "success" if > the read succeeded. > > 5. p80211types.c: > - "p80211_fromtext_displaystr()" tests for length < maxlen. This > probably should have been <= maxlen (i.e. excluding the \0), based on > the maxlen values in "p80211metamib.c" and based in what > "p80211_isvalid_displaystr()" checks. Also, > "p80211_isvalid_displaystr()" assumes that "pstr->len" includes the \0 > when it does the minlen check. It probably shouldn't do this. > > 6. p80211metamsg.c: > - dot11_reassociate command has a "dot11req_reassociatefailuretimeout" > argument which should probably be "reassociatefailuretimeout". > > 7. prism2sta.c: > - WLAN_PCI ==> WLAN_PLX in "init_module()". > > Enhancements: > > 1. All Prism2 RIDs are now accessible. Unfortunately, rather a lot was > changed to do this: > - Rather than cut and paste many more cases into the monster > "prism2mib.c" switch statement, "prism2mib.c" was completely reworked to > be table-driven with a bunch of semi-generic processing functions. That > made it a lot easier to add new DIDs. Several RID lengths in hfa384x.h > had to be changed from 0 to their actual value since more of the lengths > get used, now. (Changed: prism2mib.c, hfa384x.h) > - 2 new data types were added to "p80211types.c". One to handle integer > arrays (i.e. multi-word RID records...so that a DID didn't need to be > added for each element) and bit arrays (just to make them easier to deal > with). However, there wasn't enough room in the packed DID to add new > types, so the type was removed from the DID (and from P80211DID_MKID) > and a function written to determine the type based on the conversion > functions. (Changed: p80211meta.h, p80211types.h, p80211meta.c, > p80211types.c, mkmetastruct.c, p80211metamib.c p80211metamsg.c, > wlanctl/help.c) > Integer arrays look like: p2PRIIdentity=21,0,0,3 > "meta->maxlen" specifies the number of integers. > Bit arrays look like: p2ChannelList=0,1,2,3,4,5,6,7,8,9,10 > for bits 0-10. "meta->min" and "meta->max" give the range of bits > allowed. > - The "p2Table" DIDs were split into p2Static, p2Dynamic, p2Behavior, > etc., in order to correspond with the Prism Driver Programmer's Manual. > A few of the names were also changed in order to correspond to the > manual. (Changed: p80211metamib.c, prism2mib.c) The changed names (of > the supported DIDs) are: > p2SystemScale ==> p2CnfSystemScale > p2MaxDataLen ==> p2CnfMaxDataLength > p2EnhancePowerSaveMode ==> p2CnfPMEPS > p2MaxSleepDurection ==> p2CnfMaxSleepDuration > p2PMHoldoverDuration ==> p2CnfPMHoldoverDuration > p2OwnName ==> p2CnfOwnName > p2McastPMBuffer ==> p2CnfMulticastPMBuffering > p2TxControlDepth ==>p2CnfTxControl > p2RoamingMode ==> p2CnfRoamingMode > p2MMLife ==> p2CnfMMLife > p2AltRetryCount ==> p2CnfAltRetryCount > p2ReserveDuration ==> p2CnfAPPCFInfo (bit 1) > p2ExcludeLongPreamble ==> p2CnfExcludeLongPreamble > - Added new RIDS from the Prism Driver Programmer's Manual 1.70 > (2000-11-29). Added p2CnfPriorityQUsage, p2CnfTimCtrl, > p2CnfThirty2Tally, p2CnfEnhSecurity. Added "algorithm" to AuthRequest. > > 2. A user utility program was written to do such things as query all > read-able MIBs, query all write-able MIBs, set all write-able MIBs, > etc. A "p2req_enable" command was added (similar to the > "dot11req_start" command but without requiring all the 802.11 > arguments). This allows the driver to be started in a straight forward > manner, simply by setting all write-able MIBs and then enabling it. > (Changed: p80211metamsg.c, prism2sta.c, prism2mgmt.c, prism2mgmt.h) > > 3. Support added for Prism2 CommTallies and a DID added to query the > values. The values will come back as an array of integers. Support > also added for 32-bit tallies (i.e. p2CnfThirty2Tally). (Changed: > prism2mib.c, prism2sta.c, prism2mgmt.h, p80211metamib.c, hfa384x.h) > > 4. Access Point support: > - Added support for maintaining a list of authenticated/associated > stations and a DID added to query the list. (Changed: prism2mib.c, > prism2sta.c, prism2mgmt.h, p80211metamib.c) > - Added support for host control of authentications (allowed and denied > lists) and a DID added to set and query the lists. Support for Prism2 > AuthenticationRequest information frames. Not tested yet. (Changed: > prism2mib.c, prism2sta.c, prism2mgmt.h, p80211metamib.c) > - Added support for Prism2 PowerSaveUserCount information frames and a > DID added to query the value. (Changed: prism2mib.c, prism2sta.c, > prism2mgmt.h, p80211metamib.c) > - Added a new data type to "p80211types.c" to handle arrays of MAC > address (used to set/query the above lists). (Changed: p80211types.h, > p80211types.c, mkmetastruct.c, wlanctl/help.c) > Address arrays look like: > p2Authenticated=00:50:51:52:53:54,00:60:61:62:63:64,00:70:71:72:73:74 > "meta->maxlen" specifies the maximum number of addresses. > - Unforetunately, all these lists are limited in length by the length of > the mibattribute parameter in mibget/mibset. This is not very nice but > it was the quickest/easiest way to implement it. > > 5. Changed maximum mibattribute length from 256 to 384 to support > querying commtallies and MAC address arrays. (Changed: p80211types.h) > > 6. 128-bit WEP key support: > - Rather than creating different MIB's for 64-bit and 128-bit WEP keys, > the "octetstr" definition for dot11WEPDefaultKey0, etc., was changed to > allow for a range of lengths (e.g. from 5 to 13). The > dot11WEP128DefaultKey0, etc., MIBs were removed. (Changed: > p80211meta.c, p80211types.c, p80211metamib.c, p80211metamsg.c, > mkmetastruct.c, wlanctl/help.c) > - WLAN_WEP_KEYLEN changed to WLAN_WEP_MAXKEYLEN and set to 13. > (Changed: p80211hdr.h) > - Optional "length" argument added to "nwepgen.c" so that either 5 or 13 > byte keys can be handled. (Changed: nwepgen.c) > - 128-bit-specific parts of "etc/pcmcia/wlan-ng" are no longer > necessary. Genstr changes to handle generation of 13-byte keys using > nwepgen. (Changed: etc/pcmcia/wlan-ng) > - WEPDefaultKey's were made write-only. A new > "P80211ENUM_resultcode_cant_get_writeonly_mib" was added. (Changed: > p80211types.h, p80211types.c, p80211metamib.c, prism2mib.c) > > 7. Access code in DID: > - This was changed from a single bit flag (P80211DID_ACCESS_READONLY and > P80211DID_ACCESS_READWRITE) to a pair of flags (P80211DID_ACCESS_READ > and P80211DID_ACCESS_WRITE) since some MIBs are read/write, some are > read-only, and some are write-only (e.g. WEP keys). This makes it > easier to determine which MIBs are read-able and write-able without > having to go all the way to the driver and then interpret a failure > error code. (Changed: p80211types.h, p80211metamib.c) > > 8. It was a bit of a hassle switching between the station driver and the > AP driver...which we seemed to be doing a lot. The additional cost was > not particulary high to simply compile in both station functionality and > AP functionality. A change was made so that "prism2sta_initmac()" set > an "ap" flag when it detected AP firmware. "prism2mgmt.c" then uses the > flag to determine whether or not to allow station-only or AP-only > commands to be executed. "prism2mib.c" also uses this to handle the > mode-specific MIBs. This made it possible for the same module to > support either stations or APs, thereby simplifying the "make", the > install, and switching between stations and APs. The only thing that > needs to change, is the value of "IS_AP" in "wlan-ng.opts". > > 9. Miscellaneous small additions: > - Network state (stopped, started) added and a DID to query it. > - User-settable comment string added and a DID to set/query it. > - Some event logging (authentications, associations, etc.) can be > enabled/disabled at run time rather than only at compile time. A DID > was added to set/query it. > - A "p2req_readcis" command (similar to "p2req_readpda") was added. > > 10. Small changes: > - Added bounds checking to "p80211item_fromtext_boundedint". This was > the only "fromtext" function that did not already do complete > validation. It should no longer be necessary to call the "isvalid" > function if "fromtext" has just been called. The call to "isvalid" was > removed from "wlanctl". (Changed: p80211types.c, wlanctl.c) > - "p80211item_maxitemlen()" wasn't really adding much of value so it was > amalgamated into "p80211item_getoffset()". The DID type is now only > checked once instead of three times. (Changed: p80211meta.h, > p80211meta.c) > - "hfa384x_drvr_setconfig16()" and "hfa384x_drvr_setconfig32()" changed > their input parameters when converting to hf384x byte order. Potential > source of bugs. Changed to use a local variable. (Changed: hfa384x.c) > - ScanRequest, JoinRequest, etc., moved from the "Information Record" > section to the "Configuration Record" section. (Changed: hfa384x.h) > - Re-worked "p80211_fromtext_setmibattribute()" to make it a little > easier to follow the logic. (Changed: p80211types.c) > - Type of "channellist" argument in "p2req_channel_info" command changed > from "octetstr" to "bitarray" to make it easier to deal with (can > specify a variable number of channels and don't need to use hex > values). (Changed: p80211metamsg.c, prism2mgmt.c) > - "auxctl" parameter set to HFA384x_AUX_CTL_EXTDS in > "prism2mgmt_auxport_read()" and "prism2mgmt_auxport_write()" so that > they are still compatible with 0.1.7. (Changed: prism2mgmt.c) > - Re-worked "prism2mgmt_set_grpaddr()" and added comments so that it's > more obvious what is going on. Also, deleted the check which produced > an error if an attempt was made to delete an address from an empty > list. This makes things more consistent and predictable (i.e. the same > as attempting to delete an address which is above the last group > address...the attempt is simply ignored). Replaced the "memcpy()" call > with "memmove()" since "memcpy()" is not guaranteed to work with > overlapping ranges. (Changed: prism2mib.c) > - Minimum length of "dot11OperationRateSet" changed from 126 to 1 to > match the 802.11 standard. (Changed: p80211metamib.c) - Fixed some ci/co related problems pointed out by wbinjie. - Added ygalayda's startup scripts for PCI in the directory ./etc/wlan_pci. They aren't installed, that will have to be done by hand. I have not tested these scripts myself. - Added sbaer's 'NULL check' fix in p80211_indicate_shutdown(). - Added ctedrow's 'alloc not checked' fix in prism2sta_int_rx(). - Added pkundrat's auth mib changes. - fgrau's conf.modules/modules.conf fix. - Added ygalayda's submission for the Global Sun GL24110P PLX based adapter. Also included a Makefile fix. - Fixed some script bugs relating to 128-bit WEP based on smmclusky's observations. These changes have not yet been tested by me. - Added rlazarev's additions to the pcmcia startup scripts - Added pkundrat's wlandev-name fix for 2.3.99+ kernels - Fixed some type/(to|from)text mismatches per note from pkundrat - Fixed some missing MKITEMNAMEs per note from pkundrat - Added D-LINK and SMC to the linux-wlan-ng.conf file - Added Zoom, Linksys and Addtron to the linux-wlan-ng.conf file - Added pkundrat's meta-item minlen stuff. - Added conditionals for PLX vs. PCMCIA build - Changed _pci driver filename to _plx - Fixed undconditional MOD_INC in prismt2sta_open() - Removed identification of old PCF firmware. - Fixed version.h generation bug from pre5 - Added dhsu's (Eumitcom) code for supporting the PLX based PCI cards. - pkundrat's (whoops, sorry peter) PDA display program in ./scripts. I haven't used it because my perl setup is messed up and I'm perl challenged. - bcarr's patches for alpha boxes. - wwoods's patches for 2.2.18 and adding bytes received to the statistics. - proskin's patch adding 'network stop' - Most of proskin's patch containing Configure fixes, adding file existence checks, and making sure directories are present. - tgriffin's patch for mrproper/memleak/nullcheck/freeonsuccess. conf.modules change is already there. - Added most of jhicks ARM related patches. I had to leave out the HOST vs. TARGET compile variables in the Makefiles though. Some folks are using that stuff. - Added script changes and new mib items to support 128-bit WEP per hong's suggestion. - Added conf.modules alias instead of symlink - Added a compat macro for kfree_s to wlan_compat.h per the suggestion from rbraun. - Added pkundrat's 'chinfo' patch - Added pkundrat's 'small fixes' patch - Added some contributed patches supporting a fix to our 'reassoc under load' problem - Added wlannoenable pcmcia scheme support to prevent card initialization. - Removed a PDR patch requirement. 0.1.7 - Fixed the "converting eth in unknown mode" bug - Added APM/ACPI suspend/resume handling - Added PPC support - Added Prism test command support - Integrated patch to fix some structure alignment problems for ARM - Added multi-transmit buffer support - And much, much more..... 0.1.6 - Fixed usage of pcmcia scheme file so we're not stomping on the user's scheme setting. - Updated the wlan-ng script for the new config variable names and added configurable download utility and a set of user MIB settings. - Added support for the Samsung and Z-Com cards. - Changed the name of the module (from pcmcia's point of view). - Fixed the "echo \c" problem in Configure - Added new and rearranged existing wlan-ng.opts configuration variables. - Created a scheme for "addon software" in the ./src/Makefile - Made some changes to the target detection conditionals in wlan_compat.h to better support LinuxPPC (port isn't finished yet). - Finally fixed the byteorder stuff to use (duh) byteorder.h - Fixed a bad free of the TX skb when we signal an error to higher layers. - Moved some code around and added rules to the prism2/driver (new directory too) Makefile. This is so we build two separate drivers; one for STA, one for AP. Both drivers are built from the same source files with the code conditional on the WLAN_AP and WLAN_STA defines. - Fixed the plugging in prism2dl so it reports ALL missing PDRs. - Added an anonymously contributed patch that adds support for the -m and -s cmdline options for prism2dl. Thanks! You know who you are.@-) - Added some fixes to the dependency file generation. - Fixed a flash programming timeout miscalculation...and fixed it again when I introduced an integer promotion problem. - Added the STA vs. AP conditionals to prism2mgmt. Note that this causes a few compile time warnings. They're harmless and will go away in the next release. - Created the file prism2mib.c to hold all the MIB get/set stuff which is getting a little out of hand. - Added pcmcia config support for the Z-Com (supposedly) dual voltage card. Unfortunately the engineering sample I have doesn't seem to work at 5v, or it might be the code.....not sure yet. We're still a little bleeding edge with that card. - Cleaned up the version, compatibility range, and serial number log messages. - Added a loop limit to the interrupt handler. (duh) - Changed the names of the driver modules for STA and AP. make install then creates a softlink depending on the make config selection. One note, both drivers report the same dev_info string to pcmcia-cs. Trying to load both of them simultaneously would be bad (I have no idea what would happen, I just thought of it). - Changed a bunch of types and constants for hfa384x. - Added functions for a couple of new commands in the hfa384x. - Began adding support for the Prism2 unique MIB items. linux-wlan-ng-0.2.9+dfsg/etc/0000755000175000017500000000000011026545443015312 5ustar tormodtormodlinux-wlan-ng-0.2.9+dfsg/etc/wlan/0000755000175000017500000000000011026545443016253 5ustar tormodtormodlinux-wlan-ng-0.2.9+dfsg/etc/wlan/wlan-udev.sh0000644000175000017500000000166311024763205020513 0ustar tormodtormod#! /bin/bash # script to start prism2 wlan for fedora FC5 udev #udev rule #ACTION=="add",BUS=="usb",DRIVER=="prism2_usb",RUN+="/etc/wlan/wlan-udev.sh %k" # 01-01-2007 (rsk) add check for wlan_wext_write # 31-01-2007 (rsk) get the check right this time :) WEXT_PARAM=/sys/module/p80211/parameters/wlan_wext_write DEVICE=$1 WLAN_UDEV=1 . /etc/wlan/shared if [ -f $WEXT_PARAM ]; then WLAN_WEXT=`cat $WEXT_PARAM` fi if [ $WLAN_WEXT = 1 ]; then wlan_bring_it_up $DEVICE TRUE # set encrypt on card not host result=`$WLANCTL $DEVICE lnxreq_hostwep decrypt="false" encrypt="false"` if [ $? != 0 ]; then echo "Cannot enable wep $result" exit 1 fi else echo calling wlan_bring_it_up wlan_bring_it_up $DEVICE if [ $? = 0 ] ; then echo $DEVICE start OK #allow time during boot to let other things start #sleep 5 /sbin/ifup $DEVICE else echo $DEVICE failed to come up! >&2 exit 1 fi fi exit 0 linux-wlan-ng-0.2.9+dfsg/etc/wlan/wlancfg-DEFAULT0000644000175000017500000000344211024763205020700 0ustar tormodtormod#=======USER MIB SETTINGS============================= # You can add the assignments for various MIB items # of your choosing to this variable, separated by # whitespace. The wlan-ng script will then set each one. # Just uncomment the variable and set the assignments # the way you want them. #USER_MIBS="p2CnfRoamingMode=1 p2CnfShortPreamble=mixed" #=======WEP=========================================== # [Dis/En]able WEP. Settings only matter if PrivacyInvoked is true lnxreq_hostWEPEncrypt=false # true|false lnxreq_hostWEPDecrypt=false # true|false dot11PrivacyInvoked=false # true|false dot11WEPDefaultKeyID=0 # 0|1|2|3 dot11ExcludeUnencrypted=true # true|false, in AP this means WEP is required. # If PRIV_GENSTR is not empty, use PRIV_GENTSTR to generate # keys (just a convenience) # add-ons/ in the tarball contains other key generators. PRIV_GENERATOR=/sbin/nwepgen # nwepgen, Neesus compatible PRIV_KEY128=false # keylength to generate PRIV_GENSTR="" # or set them explicitly. Set genstr or keys, not both. dot11WEPDefaultKey0= # format: xx:xx:xx:xx:xx or dot11WEPDefaultKey1= # xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx dot11WEPDefaultKey2= # e.g. 01:20:03:40:05 or dot11WEPDefaultKey3= # 01:02:03:04:05:06:07:08:09:0a:0b:0c:0d #=======SELECT STATION MODE=================== IS_ADHOC=n # y|n, y - adhoc, n - infrastructure #======= INFRASTRUCTURE STATION =================== # What kind of authentication? AuthType="opensystem" # opensystem | sharedkey (requires WEP) #======= ADHOC STATION ============================ BCNINT=100 # Beacon interval (in Kus) CHANNEL=6 # DS channel for BSS (1-14, depends # on regulatory domain) BASICRATES="2 4" # Rates for mgmt&ctl frames (in 500Kb/s) OPRATES="2 4 11 22" # Supported rates in BSS (in 500Kb/s) linux-wlan-ng-0.2.9+dfsg/etc/wlan/Makefile0000644000175000017500000000457611024763205017723 0ustar tormodtormod# etc/wlan/Makefile # # Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. # -------------------------------------------------------------------- # # linux-wlan # # 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. # # 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. # # -------------------------------------------------------------------- # # Inquiries regarding the linux-wlan Open Source project can be # made directly to: # # AbsoluteValue Systems Inc. # info@linux-wlan.com # http://www.linux-wlan.com # # -------------------------------------------------------------------- # # Portions of the development of this software were funded by # Intersil Corporation as part of PRISM(R) chipset product development. # # -------------------------------------------------------------------- -include ../../config.mk all: echo "Nothing to do" clean: echo "Nothing to do" install: mkdir -p $(TARGET_ROOT_ON_HOST)/etc/wlan if [ ! -f $(TARGET_ROOT_ON_HOST)/etc/wlan/wlan.conf ] ; then \ cp wlan.conf $(TARGET_ROOT_ON_HOST)/etc/wlan/wlan.conf ; \ fi cp shared wlancfg-DEFAULT wlan-udev.sh \ $(TARGET_ROOT_ON_HOST)/etc/wlan chmod 600 $(TARGET_ROOT_ON_HOST)/etc/wlan/wlancfg-* chmod 600 $(TARGET_ROOT_ON_HOST)/etc/wlan/wlan.conf chmod 755 $(TARGET_ROOT_ON_HOST)/etc/wlan/wlan-udev.sh echo FIRMWARE_DIR=$(FIRMWARE_DIR) >> $(TARGET_ROOT_ON_HOST)/etc/wlan/shared linux-wlan-ng-0.2.9+dfsg/etc/wlan/shared0000644000175000017500000004171311024763205017446 0ustar tormodtormod#!/bin/bash # etc/wlan/shared # # Copyright (C) 2002 AbsoluteValue Systems, Inc. All Rights Reserved. # -------------------------------------------------------------------- # # linux-wlan # # 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. # # 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. # # -------------------------------------------------------------------- # # Inquiries regarding the linux-wlan Open Source project can be # made directly to: # # AbsoluteValue Systems Inc. # info@linux-wlan.com # http://www.linux-wlan.com # # -------------------------------------------------------------------- # # Portions of the development of this software were funded by # Intersil Corporation as part of PRISM(R) chipset product development. # # -------------------------------------------------------------------- TMPDIR=/tmp if [ ! -n "$ECHO" ]; then ECHO=echo fi if [ ! -n "$WLAN_UDEV" ] ; then if [ -x /sbin/modprobe ] ; then MODPROBE=/sbin/modprobe else ${ECHO} "/sbin/modprobe not found." exit 1 fi fi if [ -x /sbin/wlanctl-ng ] ; then WLANCTL=/sbin/wlanctl-ng else ${ECHO} "/sbin/wlanctl-ng not found." exit 1 fi # linux-wlan-ng > 0.2.4 there is no wland #if [ -x /sbin/wland ] ; then # WLAND=/sbin/wland #else # ${ECHO} "/sbin/wland not found." # exit 1 #fi if [ -z "$WLAN_UDEV" ] ; then HAS_HOTPLUG=n if [ -f /proc/sys/kernel/hotplug -a \ -f /etc/hotplug/wlan.agent ] ; then HOTPLUGGER=$(/dev/null`" ]; then for i in `find /etc/wlan -name 'shared.*' -and -not -name '*.dpkg*'` ; do . $i done else ${ECHO} "/etc/wlan/shared.* not found." exit 0 fi is_true () { # $1 == string containing a t/f indicator. [ "$1" = "y" -o "$1" = "Y" -o "$1" = "yes" -o "$1" = "YES" \ -o "$1" = "t" -o "$1" = "T" -o "$1" = "true" -o "$1" = "TRUE" ] } wlan_nsdname () { # $1 == wlandev # Writes the given device's name to stdout grep 'nsd name' /proc/net/p80211/$1/wlandev | sed -e 's/.*: \(.*\)_.*/\1/' } wlan_enable () { # $1 == wlandev #=======ENABLE IFSTATE============================= # Bring the device into its operable state # if running under udev module must be loaded to get here so skip checks if [ ! -n "$WLAN_UDEV" ] ; then $MODPROBE $1 # First, make sure the driver is loaded.... if ! ifconfig $1 > /dev/null 2>&1 ; then ${ECHO} "Error: Device $1 does not seem to be present." ${ECHO} "Make sure you've inserted the appropriate" ${ECHO} "modules or that your modules.conf file contains" ${ECHO} "the appropriate aliase(s)." return 1 fi fi # Call the nsd script's fwload function, in case the card needs # a firmware load, or could use an optional one. nsdname=`wlan_nsdname $1` if ! ${nsdname}_fwload $1 ; then ${ECHO} "Firmware failed to load for device $1" return 1 fi # Enable the interface result=`$WLANCTL $1 lnxreq_ifstate ifstate=enable` if [ $? = 0 ] ; then eval $result if [ $resultcode != "success" ]; then ${ECHO} "Failed to enable the device, resultcode=" \ $resultcode "." return 1 fi else ${ECHO} "Failed to enable the device, exitcode=" $? "." return 1 fi # Set any NSD specific MIBs ${nsdname}_mibset $1 } wlan_user_mibs () { # $1 == wlandev #=======USER MIB SETTINGS============================= # Set the user specified MIB items. for i in $USER_MIBS ; do result=`$WLANCTL $1 dot11req_mibset "mibattribute=$i"` if [ $? = 0 ] ; then eval $result if [ $resultcode != "success" ] ; then ${ECHO} "Failed to set user MIB $i." return 1 fi else ${ECHO} "Failed to set user MIB $i." return 1 fi done } wlan_source_config () { # $1 == wlandev # XXX what about stray singlequotes. eval 'GOSSID="$SSID_'$1'"' wlan_source_config_for_ssid "$GOSSID" } wlan_source_config_for_ssid () { # $1 == ssid[:bssid] # $2 == bssid (optional) DesiredSSID="$1" DesiredBSSID="$2" if [ -n "$2" ] ; then token_ssid=`echo $1 | sed -ne 's/\(.*\)\(:..:..:..:..:..:..\).*/\1/p'` token_bssid=`echo $1 | sed -ne 's/\(.*\):\(..:..:..:..:..:..\).*/\2/p'` if [ -n "$token_ssid" ] ; then DesiredSSID="$token_ssid" DesiredBSSID="$token_bssid" fi fi if [ -f "/etc/wlan/wlancfg-$DesiredSSID:$DesiredBSSID" ] ; then . "/etc/wlan/wlancfg-$DesiredSSID:$DesiredBSSID" elif [ -f "/etc/wlan/wlancfg-$DesiredSSID" ] ; then . "/etc/wlan/wlancfg-$DesiredSSID" else if [ -n "$1" ] ; then ${ECHO} "Failed to open network config file /etc/wlan/wlancfg-$1, using default." fi . "/etc/wlan/wlancfg-DEFAULT" fi } wlan_disable () { # $1 == wlandev $WLANCTL $1 lnxreq_ifstate ifstate=disable } wlan_ssid_in_list () { # $1 == wlandev, $2 == ssid, $3 == bssid eval 'GOSSID="$SSID_'$1'"' # This "eval" hackery is to allow escapes in GOSSID... cmd="for token in $GOSSID ; do ssid_token=\`echo \"\$token\" | sed -ne 's/\(.*\)\(:..:..:..:..:..:..\).*/\1/p'\` bssid_token=\`echo \"\$token\" | sed -ne 's/\(.*\):\(..:..:..:..:..:..\).*/\2/p'\` if [ -z \"\$ssid_token\" ] ; then ssid_token="\$token" fi if [ -n \"\$bssid_token\" ] ; then if [ \"\$bssid_token\" = \"\$3\" ] ; then return 0 fi elif [ \"\$2\" = \"\$ssid_token\" ] ; then return 0 fi done" eval "$cmd" return 1 } wlan_supports_scan () { # $1 == wlandev if is_true "$WLAN_SCAN" ; then cat /proc/net/p80211/$1/wlandev | grep 'scan' > /dev/null if [ $? = 0 ] ; then return 0 fi fi return 1 } wlan_scan () { # $1 == wlandev # find our allowed SSID list. # XXX what about stray singlequotes. eval 'GOSSID="$SSID_'$1'"' # kick off a quick scan with the broadcast SSID. wlan_scan_one $1 '' '' n if [ $? = 0 -a \ "$GOSSID" = "" ] ; then # if successful and our ssid list is null, return. sleep 1 return 0 fi # otherwise we walk through the list, and scan for eacn in turn. # this "eval" hackery is to allow escapes in GOSSID cmd="for token in $GOSSID ; do ssid_token=\`echo \"\$token\" | sed -ne 's/\(.*\)\(:..:..:..:..:..:..\).*/\1/p'\` bssid_token=\`echo \"\$token\" | sed -ne 's/\(.*\):\(..:..:..:..:..:..\).*/\2/p'\` if [ -z \"\$ssid_token\" ] ; then ssid_token=\"\$token\" fi wlan_scan_one \$1 \"\$ssid_token\" \"\$bssid_token\" if [ \$? = 0 ] ; then sleep 1 return 0 fi done" eval "$cmd" # We got to the end of the list. Maybe try "any" if is_true "$WLAN_ANY" ; then wlan_scan_one $1 sleep 1 return $? fi sleep 1 return 1 } wlan_scan_one () { # $1 == wlandev, [ $2 == ssid, $3 == bssid, $4 == append ] if [ -z "$4" ] ; then append=true else append=false fi numbss=0 result=`$WLANCTL $1 dot11req_scan bsstype=any bssid=ff:ff:ff:ff:ff:ff \ scantype=active probedelay=0 channellist=$ChannelList ssid="$2" \ minchanneltime=$ChannelMinTime maxchanneltime=$ChannelMaxTime append=$append` eval $result if [ $resultcode != 'success' ] ; then ${ECHO} "Scan failed ($resultcode) " return 1 fi ## XXX if numbss == 0, repeat with $2 $3 $4? i=0 bssfound="" # walk through the results and do first-cut matching. while [ $i -lt $numbss ] ; do result=`$WLANCTL $1 dot11req_scan_results bssindex=$i` eval $result if [ -n "$3" ] ; then if [ "$3" = "$bssid" ] ; then bssfound="$bssfound $i" fi elif [ -z "$2" ] ; then # if our ssid is "", then we pick the first entry. bssfound="$bssfound $i" elif [ "$2" = "$ssid" ] ; then bssfound="$bssfound $i" fi i=`expr $i + 1` done if [ -z "$bssfound" ]; then # No BSSs found, bail. return 1 else # Now find the closest bigsignal=0 for i in $bssfound ; do result=`$WLANCTL $1 dot11req_scan_results bssindex=$i` eval $result if [ $bigsignal -lt $signal ]; then bigsignal=$signal bigbssindex=$i fi done result=`$WLANCTL $1 dot11req_scan_results bssindex=$bigbssindex` eval $result return 0 fi } wlan_wep () { # $1 == wlandev #=======WEP=========================================== # Setup privacy if [ ${dot11PrivacyInvoked:-"false"} = "false" ] ; then return 0; fi result=`$WLANCTL $1 dot11req_mibget mibattribute=dot11PrivacyOptionImplemented` if [ $? = 0 ] ; then eval $result eval $mibattribute else ${ECHO} "dot11PrivacyOptionImplemented mibget failed." return 1 fi if [ $dot11PrivacyOptionImplemented = "false" ] ; then ${ECHO} "Cannot enable privacy, dot11PrivacyOptionImplemented=false." return 1 fi # Do we want host-based WEP? result=`$WLANCTL $1 lnxreq_hostwep \ decrypt="${lnxreq_hostWEPDecrypt:-false}" \ encrypt="${lnxreq_hostWEPEncrypt:-false}"` # set up the rest of the parametsrs. if [ $dot11PrivacyOptionImplemented = "true" -a \ $dot11PrivacyInvoked = "true" ] ; then result=`$WLANCTL $1 dot11req_mibset \ mibattribute=dot11WEPDefaultKeyID=$dot11WEPDefaultKeyID ` result=`$WLANCTL $1 dot11req_mibset \ mibattribute=dot11ExcludeUnencrypted=$dot11ExcludeUnencrypted ` result=`$WLANCTL $1 dot11req_mibset \ mibattribute=dot11PrivacyInvoked=$dot11PrivacyInvoked` if [ "${PRIV_GENSTR:-empty}" != "empty" ] ; then if [ ${PRIV_KEY128:-"false"} = "false" ]; then keys=`$PRIV_GENERATOR "$PRIV_GENSTR" 5` else keys=`$PRIV_GENERATOR "$PRIV_GENSTR" 13` fi knum=0 for i in $keys ; do result=`$WLANCTL $1 dot11req_mibset \ mibattribute=dot11WEPDefaultKey$knum=$i` knum=`expr $knum + 1` done else result=`$WLANCTL $1 dot11req_mibset \ mibattribute=dot11WEPDefaultKey0=$dot11WEPDefaultKey0 ` result=`$WLANCTL $1 dot11req_mibset \ mibattribute=dot11WEPDefaultKey1=$dot11WEPDefaultKey1 ` result=`$WLANCTL $1 dot11req_mibset \ mibattribute=dot11WEPDefaultKey2=$dot11WEPDefaultKey2 ` result=`$WLANCTL $1 dot11req_mibset \ mibattribute=dot11WEPDefaultKey3=$dot11WEPDefaultKey3 ` fi else # disable wep explicitly. result=`$WLANCTL $1 dot11req_mibset \ mibattribute=dot11PrivacyInvoked=$dot11PrivacyInvoked ` result=`$WLANCTL $1 dot11req_mibset \ mibattribute=dot11ExcludeUnencrypted=false ` fi } wlan_adhoc () { # $1 == wlandev #=======IBSS STARTUP================================== startcmd="$WLANCTL $1 dot11req_start " startcmd="$startcmd ssid=$DesiredSSID" startcmd="$startcmd bsstype=independent" startcmd="$startcmd beaconperiod=$BCNINT" startcmd="$startcmd dtimperiod=3" startcmd="$startcmd cfpollable=false" startcmd="$startcmd cfpollreq=false" startcmd="$startcmd cfpperiod=3" startcmd="$startcmd cfpmaxduration=100" startcmd="$startcmd probedelay=100" startcmd="$startcmd dschannel=$CHANNEL" j=1 for i in $BASICRATES ; do startcmd="$startcmd basicrate$j=$i" j=`expr $j + 1` done j=1 for i in $OPRATES ; do startcmd="$startcmd operationalrate$j=$i" j=`expr $j + 1` done results=`$startcmd` # Here's where it runs if [ $? = 0 ]; then eval $results if [ $resultcode != "success" ] ; then ${ECHO} "IBSS not started, resultcode=$resultcode" exit 1 else ${ECHO} "IBSS mode started." fi else ${ECHO} FAILED: $startcmd return 1 fi WLAN_SCHEMESSID="$DesiredSSID" } wlan_infra () { # $1 == wlandev #==== INFRASTRUCURE STARTUP=========================== # XXX TODO: Grok DesiredBSSID sleep 5 results=`$WLANCTL $1 lnxreq_autojoin \ "ssid=$DesiredSSID" \ authtype=${AuthType:="opensystem"} | sed 's/\([^=]*\)=\(.*\)/\1="\2"/'` eval $results if [ ${resultcode:-"failure"} != "success" ] ; then ${ECHO} 'error: Autojoin indicated failure!' return 1; fi WLAN_SCHEMESSID="$DesiredSSID" } wlan_dot11_join () { # $1 == wlandev joincmd="$WLANCTL $1 dot11req_join bssid=$DesiredBSSID" joincmd="$joincmd joinfailuretimeout=1" j=1 for i in $OPRATES ; do joincmd="$joincmd operationalrate$j=$i" j=`expr $j + 1` done results=`$joincmd` eval $results if [ ${resultcode:-"failure"} != "success" ] ; then ${ECHO} "$1: JOIN Failure" ${ECHO} "joincmd=$joincmd" ${ECHO} "results=$results" return 1; fi } wlan_dot11_auth_assoc () { # $1 == wlandev if [ $bsstype = "infrastructure" ] ; then results=`$WLANCTL $1 dot11req_authenticate \ peerstaaddress=$DesiredBSSID \ authenticationtype=$AuthType \ authenticationfailuretimeout=2000` eval $results if [ ${resultcode:-"failure"} != "success" ] ; then ${ECHO} "error: dot11req_authenticate failed, "\ "resultcode=$resultcode" return 1; fi results=`$WLANCTL $1 dot11req_associate \ listeninterval=1000 \ associatefailuretimeout=2000 ` if [ ${resultcode:-"failure"} != "success" ] ; then ${ECHO} 'error: dot11req_associate failed!' return 1; fi fi } wlan_set_ssid_schemefile () { # $1 == SSID # Find the scheme file if [ -r /var/lib/misc/pcmcia-scheme ] ; then # Debian WLAN_SCHEMEFILE="/var/lib/misc/pcmcia-scheme" elif [ -d /var/state/pcmcia ] ; then WLAN_SCHEMEFILE="/var/state/pcmcia/scheme" elif [ -d /var/lib/pcmcia ] ; then WLAN_SCHEMEFILE="/var/lib/pcmcia/scheme" else WLAN_SCHEMEFILE="/var/run/pcmcia-scheme" fi # Collect the current scheme name and save the file if [ -r $WLAN_SCHEMEFILE ] ; then WLAN_SCHEME=`cat $WLAN_SCHEMEFILE` cp $WLAN_SCHEMEFILE /var/run/wlan_scheme_`date +"%T"`.tmp else touch /var/run/wlan_scheme_`date +"%T"`.tmp fi # Set up the string if [ ! "$WLAN_SCHEME" ] ; then WLAN_SCHEME="default" fi WLAN_SCHEME="$WLAN_SCHEME:$1" # Write to schemefile echo $WLAN_SCHEME > $WLAN_SCHEMEFILE } wlan_restore_schemefile () { # Find the scheme file if [ -r /var/lib/misc/pcmcia-scheme ] ; then # Debian WLAN_SCHEMEFILE="/var/lib/misc/pcmcia-scheme" elif [ -d /var/state/pcmcia ] ; then WLAN_SCHEMEFILE="/var/state/pcmcia/scheme" elif [ -d /var/lib/pcmcia ] ; then WLAN_SCHEMEFILE="/var/lib/pcmcia/scheme" else WLAN_SCHEMEFILE="/var/run/pcmcia-scheme" fi TMPFILE=`ls /var/run/wlan_scheme*.tmp | tail -n 1` if [ -r $TMPFILE ] ; then cat $TMPFILE > $WLAN_SCHEMEFILE rm -f $TMPFILE else ${ECHO} "wlan_restore_schemefile: No wlan_scheme\*.tmp file found." fi } wlan_bring_it_up () { # $1 == wlandev # $2 == non-null if wext enabled. #=======ENABLE======================================== # Do we want to init the card at all? eval 'WLAN_ENABLE=$ENABLE_'$1 if ! is_true $WLAN_ENABLE ; then return 1 fi if wlan_enable $1 ; then if [ -z "$2" ] ; then wlan_scan_and_join $1 return $? else ${ECHO} "Bypassing configuration due to wireless extensions" fi else return 1; fi return 1 } wlan_scan_and_join () { #=======MAC STARTUP========================================= wlan_supports_scan $1 if [ $? = 0 ] ; then wlan_scan $1 if [ $? = 0 ] ; then wlan_source_config_for_ssid "$ssid" "$bssid" wlan_user_mibs $1 wlan_wep $1 wlan_join $1 else if is_true $IS_ADHOC ; then # start an IBSS; we didn't find one. wlan_adhoc $1 else return 1 fi fi else wlan_source_config $1 wlan_user_mibs $1 wlan_wep $1 if is_true $IS_ADHOC ; then wlan_adhoc $1 else wlan_infra $1 fi fi return $? } wlan_join () { # $1 == wlandev grep 'autojoin' /proc/net/p80211/$1/wlandev > /dev/null if [ $? = 0 ]; then wlan_infra $1 else wlan_dot11_join $1 wlan_dot11_auth_assoc $1 fi } tmpname () { # $1 == prefix local i=0 local tname=$TMPDIR/${1}_$$ if [ -f ${tname}.tmp ] ; then for i in 0 1 2 3 4 5 6 7 8 9 ; do if [ ! -f ${tname}_${i}.tmp ] ; then echo ${tname}_${i}.tmp return 0 fi done else echo ${tname}.tmp fi return 0 } source_procfile () { # $1 == procfile to source local fname=`tmpname wlan_procfile` cat "$1" > $fname . $fname rm -f $fname } # This is set by the Configure script as part of 'make install' #FIRMWARE_DIR="/usr/share/linux-wlan" linux-wlan-ng-0.2.9+dfsg/etc/wlan/wlan.conf0000644000175000017500000000603511024763205020063 0ustar tormodtormod#! /bin/sh # Wireless LAN adapter configuration # # etc/wlan/wlan.conf # # Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. # -------------------------------------------------------------------- # # linux-wlan # # 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. # # 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. # # -------------------------------------------------------------------- # # Inquiries regarding the linux-wlan Open Source project can be # made directly to: # # AbsoluteValue Systems Inc. # info@linux-wlan.com # http://www.linux-wlan.com # # -------------------------------------------------------------------- # # Portions of the development of this software were funded by # Intersil Corporation as part of PRISM(R) chipset product development. # # -------------------------------------------------------------------- # This file is sourced by all configuration scripts. # # The WLAN_DEVICES variable identifies the device names of each WLAN device. # If you have more than one, make sure each one is identified in a whitespace # separated list that's assigned to WLAN_DEVICES. WLAN_DEVICES="wlan0" # Below is the list of channels to scan, when we scan. ChannelList="01:02:03:04:05:06:07:08:09:0a:0b:00:00:00" # Below is the min and max time we linger on a channel during a scan. ChannelMinTime=200 ChannelMaxTime=250 # And here we have the master scan toggle. WLAN_SCAN=n # if you want temporary files to go elsewhere, change this. TMPDIR=/tmp ########## # Note: To bind to a specific network, change the SSID to something different # and create the file /etc/wlan/wlancfg- with your network- # specific settings. If this file is not present, the settings in # /etc/wlancfg/wlancfg-DEFAULT are used. # # for example: # SSID_wlan0="linux-wlan" # This expects a file called "/etc/wlan/wlancfg-linux-wlan" to be present. # # Use a SSID of "" to associate with any network in range. ######### SSID_wlan0="" ENABLE_wlan0=y #SSID_wlan1="" #ENABLE_wlan1=n #SSID_wlan2="" #ENABLE_wlan2=n linux-wlan-ng-0.2.9+dfsg/etc/rc.wlan0000755000175000017500000000336011024763205016602 0ustar tormodtormod#!/bin/sh # rc.wlan # # chkconfig: 2345 9 91 # description: Activates/Configures/Disables the devices if [ ! -f /etc/wlan/shared ] ; then echo "/etc/wlan/shared not present" exit 0 fi . /etc/wlan/shared if [ -f /etc/init.d/functions ] ; then . /etc/init.d/functions fi usage() { echo "Usage: $0 {start|stop|status|restart|reload|force-reload}" } if [ $# -lt 1 ] ; then usage ; exit 1 ; fi action=$1 case "$action" in start) # This will implicitly fire off wland via hotplug. echo -n "Starting WLAN Devices: " if ! $MODPROBE p80211; then echo "Failed to load p80211.o." exit 1 fi # NOTE: We don't explicitly insmod the card driver here. The # best thing to do is to specify an alias in /etc/modules.conf. for DEVICE in $WLAN_DEVICES; do $MODPROBE $DEVICE # if we don't have hotplug.. do things the old-fashioned way. if [ $HAS_HOTPLUG = 'n' ] ; then wlan_bring_it_up $DEVICE fi done # And hotplug will take care of the rest, namely device # initialization and whatnot. if [ -f /etc/init.d/functions ] ; then echo_success else echo fi ;; stop) echo -n "Shutting Down WLAN Devices: " echo -n "Shutting Down WLAN Devices: " # Do a reset on each device to make sure none of them are still # trying to generate interrupts. for DEVICE in $WLAN_DEVICES; do wlan_disable $DEVICE ifconfig $DEVICE down $MODPROBE -r $DEVICE done # remove p80211, which will implictly kill wland. $MODPROBE -r p80211 if [ -f /etc/init.d/functions ] ; then echo_success else echo fi ;; status) status wland ;; restart|reload|force-reload) $0 stop $0 start EXITCODE=$? ;; *) usage ;; esac linux-wlan-ng-0.2.9+dfsg/etc/Makefile0000644000175000017500000000512011024763205016744 0ustar tormodtormod# etc/Makefile # # Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. # -------------------------------------------------------------------- # # linux-wlan # # 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. # # 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. # # -------------------------------------------------------------------- # # Inquiries regarding the linux-wlan Open Source project can be # made directly to: # # AbsoluteValue Systems Inc. # info@linux-wlan.com # http://www.linux-wlan.com # # -------------------------------------------------------------------- # # Portions of the development of this software were funded by # Intersil Corporation as part of PRISM(R) chipset product development. # # -------------------------------------------------------------------- -include ../config.mk DIRS= pcmcia wlan all: set -e; for d in $(DIRS); do $(MAKE) -C $$d all; done clean: set -e; for d in $(DIRS); do $(MAKE) -C $$d clean; done install: set -e; for d in $(DIRS); do $(MAKE) -C $$d install; done if [ ! -d $(TARGET_ROOT_ON_HOST)$(RC_DIR)/init.d ]; then \ mkdir -p $(TARGET_ROOT_ON_HOST)$(RC_DIR)/init.d; \ fi; \ cp rc.wlan $(TARGET_ROOT_ON_HOST)$(RC_DIR)/init.d/wlan; \ chmod 755 $(TARGET_ROOT_ON_HOST)$(RC_DIR)/init.d/wlan ;\ if [ -d $(TARGET_ROOT_ON_HOST)/etc/hotplug ]; then \ cp wlan.agent $(TARGET_ROOT_ON_HOST)/etc/hotplug; \ rm -f $(TARGET_ROOT_ON_HOST)/etc/hotplug/usb/prism2_usb; \ rm -f $(TARGET_ROOT_ON_HOST)/etc/hotplug/pci/prism2_pci; \ rm -f $(TARGET_ROOT_ON_HOST)/etc/hotplug/pci/prism2_plx; \ fi linux-wlan-ng-0.2.9+dfsg/etc/wlan.agent0000755000175000017500000000315311024763205017274 0ustar tormodtormod#!/bin/bash # # p80211/wlan hotplug policy agent. # # wlan hotplug params include: # # ACTION=%s [register|remove|shutdown|startup|suspend|resume] # INTERFACE=%s # NSDNAME=%s # cd /etc/hotplug . hotplug.functions #DEBUG=yes export DEBUG if [ "$INTERFACE" = "" ]; then mesg Bad WLAN invocation: \$INTERFACE is not set exit 1 fi if [ "$NSDNAME" = "" ]; then mesg Bad WLAN invocation: \$NSDNAME is not set exit 1 fi debug_mesg WLAN $ACTION on $INTERFACE \($NSDNAME\) if [ "$NSDNAME" = "prism2_cs" ] ; then mesg "WLAN Hotplug bypassed for pcmcia" exit 0 fi # load up the shared scripts if [ ! -f /etc/wlan/shared ] ; then mesg "/etc/wlan/shared not present, aborting" exit 1 fi ECHO=mesg . /etc/wlan/shared case $ACTION in 'register'|'resume') debug_mesg WLAN $INTERFACE registered. wlan_bring_it_up $INTERFACE $WLAN_WEXT if [ $? = 0 ] ; then mesg WLAN $INTERFACE brought up successfully. if [ -x /etc/wlan/pre-ifup ] ; then # pre-ifup is presumed to call ifup if it # wants to...it may choose to skip it. mesg "WLAN bringing up layer 3+ with /etc/wlan/pre-ifup" /etc/wlan/pre-ifup $INTERFACE else mesg "WLAN bringing up layer 3+ with /sbin/ifup" /sbin/ifdown $INTERFACE /sbin/ifup $INTERFACE fi else mesg WLAN Could not bring up $INTERFACE fi # eventually invoke net.agent on $INTERFACE w/ REGISTER ;; 'remove'|'suspend') debug_mesg WLAN $INTERFACE removed. ;; 'startup') # kick off wland. debug_mesg WLAN p80211 starting! ;; 'shutdown') debug_mesg WLAN p80211 shutting down! ;; *) debug_mesg WLAN $ACTION event not supported exit 1 ;; esac linux-wlan-ng-0.2.9+dfsg/etc/pcmcia/0000755000175000017500000000000011026545443016546 5ustar tormodtormodlinux-wlan-ng-0.2.9+dfsg/etc/pcmcia/wlan-ng0000755000175000017500000001262611024763205020042 0ustar tormodtormod#! /bin/sh # # etc/pcmcia/wlan-ng # # Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. # -------------------------------------------------------------------- # # linux-wlan # # 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. # # 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. # # -------------------------------------------------------------------- # # Inquiries regarding the linux-wlan Open Source project can be # made directly to: # # AbsoluteValue Systems Inc. # info@linux-wlan.com # http://www.linux-wlan.com # # -------------------------------------------------------------------- # # Portions of the development of this software were funded by # Intersil Corporation as part of PRISM(R) chipset product development. # # -------------------------------------------------------------------- # [MSM]: Moved here because wlan/shared may is intended to be used by # other scripts wlan_usage () { echo "usage: wlan-ng [action] [device name] [debug]" echo " actions: start|resume, stop|suspend, check|cksum|restart" echo " debug : enables shell debug" exit 1 } if [ "$3" = "debug" ]; then set -x ; fi # Note: this 'shared' comes with the WLAN package if [ ! -f /etc/wlan/shared ] ; then echo "/etc/wlan/shared not present" exit 0 fi . /etc/wlan/shared # [MSM]: This test supplied by rlazarev, it's commented out due to pcmcia # stab file movement. This test needs to be 'functionized' and made a # little more robust. #if [ ! -f /var/run/stab ] ; then # echo "Error: Possibly PCMCIA CS is not started"; # wlan_usage; # exit 1; #fi # If number of args is less than 2 display usage if [ $# -lt 2 ]; then wlan_usage ; fi # Note: this 'shared' comes with the PCMCIA package # ACTION=$1 and DEVICE=$2 are assigned in pcmcia/shared if [ -f /etc/pcmcia/shared ] ; then . /etc/pcmcia/shared ; fi # XXXX we can do stuff with $SCHEME still..? case "$ACTION" in 'start'|'resume') #=======ENABLE======================================== # Do we want to init the card at all? eval 'WLAN_ENABLE=$ENABLE_'$DEVICE if ! is_true $WLAN_ENABLE ; then exit 0 fi if is_true $WLAN_DOWNLOAD; then wlan_download $DEVICE fi wlan_enable $DEVICE #=======MAC STARTUP========================================= wlan_supports_scan $DEVICE if [ $? = 0 ] ; then wlan_scan $DEVICE if [ $? = 0 ] ; then wlan_source_config_for_ssid "$ssid" "$bssid" wlan_user_mibs $DEVICE wlan_wep $DEVICE grep 'autojoin' /proc/net/p80211/$DEVICE/wlandev > /dev/null if [ $? = 0 ]; then wlan_infra $DEVICE else wlan_dot11_join $DEVICE fi else echo "network not found. maybe start IBSS?" fi else wlan_source_config $DEVICE wlan_user_mibs $DEVICE wlan_wep $DEVICE if is_true $IS_ADHOC ; then wlan_adhoc $DEVICE else wlan_infra $DEVICE fi fi # ==========PCMCIA NETDEVICE============================= # Append the SSID to the pcmcia scheme name wlan_set_ssid_schemefile "$WLAN_SCHEMESSID" # Call the normal network initialization ./network $1 $2 if [ $? = 1 ] ; then # echo "/etc/pcmcia/network $1 $2 failed." wlan_restore_schemefile exit 1 fi # Restore scheme file to it's prior contents wlan_restore_schemefile ;; 'stop'|'suspend') # ==========PCMCIA NETDEVICE============================= # Append the SSID to the pcmcia scheme name wlan_set_ssid_schemefile "$DesiredSSID" # Call the normal network initialization ./network $1 $2 if [ $? = 1 ] ; then # echo "/etc/pcmcia/network $1 $2 failed." wlan_restore_schemefile exit 1 fi #=======DISABLE IFSTATE============================= # Take the device down to a quiescent state. wlan_disable $DEVICE # Restore scheme file to it's prior contents wlan_restore_schemefile ;; 'check'|'cksum'|'restart') # ==========STA ==================================== # Just passes through for normal network device # behavior. if is_true $IS_ADHOC; then WLAN_SCHEMESSID="$SSID" else WLAN_SCHEMESSID="$DesiredSSID" fi # ==========PCMCIA NETDEVICE============================= # Append the SSID to the pcmcia scheme name wlan_set_ssid_schemefile "$WLAN_SCHEMESSID" # Call the normal network initialization ./network $1 $2 $3:$WLAN_SCHEMESSID if [ $? = 1 ] ; then # echo "/etc/pcmcia/network $1 $2 $3 failed." wlan_restore_schemefile exit 1 fi # Restore scheme file to it's prior contents wlan_restore_schemefile ;; *) usage ;; esac exit 0 linux-wlan-ng-0.2.9+dfsg/etc/pcmcia/wlan-ng.conf0000755000175000017500000001250311024763205020760 0ustar tormodtormod device "prism2_cs" class "wlan-ng" module "prism2_cs" card "Intersil PRISM2 Reference Design 11Mb/s 802.11b WLAN Card" version "INTERSIL", "HFA384x/IEEE" bind "prism2_cs" card "Compaq WL100/200 11Mb/s 802.11b WLAN Card" manfid 0x0138, 0x0002 bind "prism2_cs" card "Compaq iPaq HNW-100 11Mb/s 802.11b WLAN Card" manfid 0x028a, 0x0002 bind "prism2_cs" card "Samsung SWL2000-N 11Mb/s 802.11b WLAN Card" manfid 0x0250, 0x0002 bind "prism2_cs" card "Z-Com XI300 11Mb/s 802.11b WLAN Card" manfid 0xd601, 0x0002 bind "prism2_cs" card "ZoomAir 4100 11Mb/s 802.11b WLAN Card" version "ZoomAir 11Mbps High", "Rate wireless Networking" bind "prism2_cs" card "Linksys WPC11 11Mbps 802.11b WLAN Card" version "Instant Wireless ", " Network PC CARD", "Version 01.02" bind "prism2_cs" card "Addtron AWP-100 11Mbps 802.11b WLAN Card" version "Addtron", "AWP-100 Wireless PCMCIA", "Version 01.02" bind "prism2_cs" card "D-Link DWL-650 11Mbps 802.11b WLAN Card" version "D", "Link DWL-650 11Mbps WLAN Card", "Version 01.02" bind "prism2_cs" card "SMC 2632W 11Mbps 802.11b WLAN Card" version "SMC", "SMC2632W", "Version 01.02" bind "prism2_cs" card "BroMax Freeport 11Mbps 802.11b WLAN Card (Prism 2.5)" version "Intersil", "PRISM 2_5 PCMCIA ADAPTER", "ISL37300P", "Eval-RevA" bind "prism2_cs" card "U.S. Robotics IEEE 802.11b PC-CARD" version "U.S. Robotics", "IEEE 802.11b PC-CARD", "Version 01.02" bind "prism2_cs" card "Level-One WPC-0100" version "Digital Data Communications", "WPC-0100" bind "prism2_cs" card "Bromax OEM 11Mbps 802.11b WLAN Card (Prism 2.5)" manfid 0x0274, 0x1612 bind "prism2_cs" card "Bromax OEM 11Mbps 802.11b WLAN Card (Prism 3)" manfid 0x0274, 0x1613 bind "prism2_cs" card "corega K.K. Wireless LAN PCC-11" version "corega K.K.", "Wireless LAN PCC-11" bind "prism2_cs" card "corega K.K. Wireless LAN PCCA-11" version "corega K.K.", "Wireless LAN PCCA-11" bind "prism2_cs" card "CONTEC FLEXSCAN/FX-DDS110-PCC" manfid 0xc001, 0x0008 bind "prism2_cs" card "PLANEX GeoWave/GW-NS110" version "PLANEX", "GeoWave/GW-NS110" bind "prism2_cs" card "Ambicom WL1100 11Mbps 802.11b WLAN Card" version "OEM", "PRISM2 IEEE 802.11 PC-Card", "Version 01.02" bind "prism2_cs" card "LeArtery SYNCBYAIR 11Mbps 802.11b WLAN Card" version "LeArtery", "SYNCBYAIR 11Mbps Wireless LAN PC Card", "Version 01.02" bind "prism2_cs" card "Intermec MobileLAN 11Mbps 802.11b WLAN Card" manfid 0x01ff, 0x0008 bind "prism2_cs" card "NETGEAR MA401 11Mbps 802.11 WLAN Card" version "NETGEAR MA401 Wireless PC", "Card", "Version 01.00" bind "prism2_cs" card "Intersil PRISM Freedom 11mbps 802.11 WLAN Card" version "Intersil", "PRISM Freedom PCMCIA Adapter", "ISL37100P", "Eval-RevA" bind "prism2_cs" card "OTC Wireless AirEZY 2411-PCC 11Mbps 802.11 WLAN Card" version "OTC", "Wireless AirEZY 2411-PCC WLAN Card", "Version 01.02" bind "prism2_cs" card "Dynalink L11HDT 11Mbps 802.11 WLAN Card" version "802.11", "11Mbps Wireless LAN Card", "v08C1", "" manfid 0xc250, 0x0002 bind "prism2_cs" card "PROXIM RangeLAN-DS/LAN PC CARD" version "PROXIM", "RangeLAN-DS/LAN PC CARD" bind "prism2_cs" card "ACTIONTEC PRISM Wireless LAN PC Card" version "ACTIONTEC", "PRISM Wireless LAN PC Card", "0381", "RevA" manfid 0x1668, 0x0101 bind "prism2_cs" card "3Com AirConnect 3CRWE737A" version "3Com", "3CRWE737A AirConnect Wireless LAN PC Card" bind "prism2_cs" card "3Com AirConnect 3CRWE777A" version "3Com", "3CRWE777A AirConnect Wireless LAN PCI Card" bind "prism2_cs" card "ASUS WL-100 802.11b WLAN PC Card" version "ASUS", "802_11b_PC_CARD_25" bind "prism2_cs" card "ASUS WL-110 802.11b WLAN CF Card" version "ASUS", "802_11B_CF_CARD_25" bind "prism2_cs" card "BUFFALO WLI-CF-S11G 802.11b WLAN Card" version "BUFFALO", "WLI-CF-S11G" bind "prism2_cs" card "Linksys WCF11 11Mbps 802.11b WLAN Card (Prism 2.5)" version "The Linksys Group, Inc.", "Wireless Network CF Card", "ISL37300P", "RevA" bind "prism2_cs" card "Linksys WCF12 11Mbps 802.11b WLAN Card (Prism 3)" version "Linksys", "Wireless CompactFlash Card", "", "" manfid 0x028a, 0x0673 bind "prism2_cs" card "NETGEAR MA401RA 11Mbps 802.11 WLAN Card" version "NETGEAR MA401RA Wireless PC", "Card", "ISL37300P", "Eval-RevA" bind "prism2_cs" card "D-Link DCF-660W 11Mbps 802.11b WLAN Card" manfid 0xd601, 0x0005 bind "prism2_cs" card "Microsoft Wireless Notebook Adapter MN-520" manfid 0x02d2, 0x0001 bind "prism2_cs" card "AnyPoint(TM) Wireless II PC Card" manfid 0x0089, 0x0002 bind "prism2_cs" card "D-Link DRC-650 802.11b WLAN Card" version "D", "Link DRC-650 11Mbps WLAN Card", "Version 01.02", "" bind "prism2_cs" card "Adaptec AWN-8030" manfid 0x9005, 0x0021 bind "prism2_cs" card "D-Link DWL-650 rev P 802.11b WLAN card" manfid 0x000b, 0x7110 # version "D-Link", "DWL-650 Wireless PC Card RevP", "ISL37101P-10", "A3" bind "prism2_cs" card "I-Gate 11M PC Card" version "INTERSIL", "I-GATE 11M PC Card / PC Card plus", "Version 01.02" bind "prism2_cs" card "benQ AWL100 802.11b WLAN Card" version "BENQ", "AWL100 PCMCIA ADAPTER", "ISL37300P", "Eval-RevA" manfid 0x000b, 0x7300 bind "prism2_cs" card "Intersil Prism 2 card" version "INTERSIL" manfid 0x0156, 0x0002 bind "prism2_cs" linux-wlan-ng-0.2.9+dfsg/etc/pcmcia/Makefile0000644000175000017500000000544111024763205020206 0ustar tormodtormod# etc/pcmcia/Makefile # # Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. # -------------------------------------------------------------------- # # linux-wlan # # 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. # # 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. # # -------------------------------------------------------------------- # # Inquiries regarding the linux-wlan Open Source project can be # made directly to: # # AbsoluteValue Systems Inc. # info@linux-wlan.com # http://www.linux-wlan.com # # -------------------------------------------------------------------- # # Portions of the development of this software were funded by # Intersil Corporation as part of PRISM(R) chipset product development. # # -------------------------------------------------------------------- -include ../../config.mk all: @echo "Nothing to do" clean: @echo "Nothing to do" ifeq ($(PRISM2_PCMCIA), y) install: mkdir -p $(TARGET_PCMCIA_DIR) ; \ if [ -f $(TARGET_PCMCIA_DIR)/wlan-ng ]; then \ mv -f $(TARGET_PCMCIA_DIR)/wlan-ng $(TARGET_PCMCIA_DIR)/wlan-ng.O ; \ fi ; \ cp wlan-ng $(TARGET_PCMCIA_DIR) ; \ chmod +x $(TARGET_PCMCIA_DIR)/wlan-ng ; \ if [ -f $(TARGET_PCMCIA_DIR)/wlan-ng.conf ]; then \ mv -f $(TARGET_PCMCIA_DIR)/wlan-ng.conf $(TARGET_PCMCIA_DIR)/wlan-ng.conf.O ; \ fi ; \ cp wlan-ng.conf $(TARGET_PCMCIA_DIR) ; \ if [ -f $(TARGET_PCMCIA_DIR)/config ]; then \ if ! grep -sq 'source.*\.\/\*\.conf$$' $(TARGET_PCMCIA_DIR)/config ; then \ if ! grep -sq 'source \.\/wlan-ng.conf' $(TARGET_PCMCIA_DIR)/config ; then \ mv -f $(TARGET_PCMCIA_DIR)/config $(TARGET_PCMCIA_DIR)/config.O ; \ ( echo "source ./wlan-ng.conf"; cat $(TARGET_PCMCIA_DIR)/config.O) > $(TARGET_PCMCIA_DIR)/config ; \ fi ; \ fi ; \ fi else install: @echo "Nothing to do" endif linux-wlan-ng-0.2.9+dfsg/etc/udev/0000755000175000017500000000000011026545443016255 5ustar tormodtormodlinux-wlan-ng-0.2.9+dfsg/etc/udev/rules.d/0000755000175000017500000000000011026545443017631 5ustar tormodtormodlinux-wlan-ng-0.2.9+dfsg/etc/udev/rules.d/40-prism2.rules0000644000175000017500000000024611024763205022340 0ustar tormodtormod#ACTION=="add",BUS=="usb",DRIVER=="prism2_usb" ,RUN+="/etc/wlan/wlan-udev.sh %k" KERNEL="wlan*",ACTION=="add",DRIVERS=="prism2_usb" ,RUN+="/etc/wlan/wlan-udev.sh %k" linux-wlan-ng-0.2.9+dfsg/README0000644000175000017500000003335511024763205015424 0ustar tormodtormod* README * * Copyright (C) 2001 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- ======================================================================= Description: The linux-wlan package is a linux device driver and subsystem package that is intended to provide the full range of IEEE 802.11 MAC management capabilities for use in user-mode utilities and scripts. The package currently supports the Intersil 802.11b Prism2, Prism2.5, and Prism3 reference designs for PCMCIA, PCI, and USB. Additionally, the package includes support for PLX9052 based PCI to PCMCIA adapter with a few different PCMCIA cards. For a list of elements that are still undone, see the TODO file in this directory ======================================================================= License: See the COPYING and LICENSE files. ======================================================================= Top level directory for linux-wlan-ng: ./add-ons - additional programs that are not build from the top level make file ./doc - source distribution documentation ./etc - scripts used at run-time ./man - man pages ./scripts - contributed scripts that may do useful things ./src - source code for various components ======================================================================= Build Instructions: NOTE: You may not need to build at all. Binary packages are available for various distributions. See the FAQ for where to go. NOTE: This release supports building four different drivers: prism2_cs Driver for Prism2.x & Prism3 PCMCIA cards. prism2_pci Driver for Prism2.5 (ISL3874) based _native_ PCI cards. prism2_plx Driver for Prism2.x PCMCIA cards when used with a PLX9052 PCI/PCMCIA adapter. prism2_usb Driver for Prism2.x USB adapters. Prerequisites: To build linux-wlan-ng you will need: - Configured kernel source code for the kernel you are running. Ideally, this will be the resulting tree after building your own kernel. Configured means that you have at least run 'make config', 'make menuconfig', or 'make xconfig'. If you are trying to build linux-wlan-ng for a previously existing kernel binary (one you did not build yourself), look for help on the mailing lists because it can be tricky. I always run against kernels I've built myself, so I'm not much help in this area. - The good David Leffler identified that if you are having difficulty with *_netlink_* symbols, you may have a problem with 'make clean' in the kernel tree. Do a 'make mrproper' followed by 'make config' and the rest of the kernel build process. 'make mrproper' does a more thorough cleaning of the kernel tree. For more info, look for David's comments in the linux-wlan-user mailing list. - If you are building a driver for a PCMCIA card, you will also need the configured PCMCIA source code for the pcmcia_cs subsystem you are currently running. Building linux-wlan-ng: 1) untar the package using the command: tar zxvf linux-wlan-ng-X.Y.Z.tar.gz 2) Make sure you have configured kernel and (optionally) pcmcia sources on your system. Note that if you are _only_ building the prism2_pci, prism2_plx, or prism2_usb drivers you don't need the pcmcia-cs source tree. 3) To configure the linux-wlan-ng package, run 'make config'. The following set of questions will be asked. The default answer is in braces (e.g. []). Just press to select the default answer: - "Build Prism2.x PCMCIA Card Services (_cs) driver? (y/n) [y]: " Select "y" if you want to build the Prism PCMCIA driver. If you select "n", the PCMCIA related questions below will not be asked. - Build Prism2 PLX9052 based PCI (_plx) adapter driver? (y/n) [y]: Select "y" if you want to build the Prism driver for PLX PCI9052 PCI/PCMCIA adapter based solutions. - Build Prism2.5 native PCI (_pci) driver? (y/n) [y]: Select "y" if you want to build the Prism driver for Prism2.5 ISL3874 based native PCI cards. This includes PCI add-in cards and the mini-pci modules included in some notebook computers (but not all, some use internal USB modules). - Build Prism2.5 USB (_usb) driver? (y/n) [y]: Select "y" if you want to build the Prism driver for Prism2.5 ISL3873 based USB adapters. This includes USB add-on modules and the internal modules included in some notebook computers. - Linux source directory [/usr/src/linux]: The config script will attempt to automagically find your kernel source directory. If found, the kernel source source directory will be presented as the default selection. If the default selection is wrong, you may correct it here. - pcmcia-cs source dir [/usr/src/pcmcia-cs-3.1.29]: If the "_cs" driver is selected above, the configure script will attempt to present a reasonable default for the pcmcia source directory. If the presented directory is incorrect, you may change it here. If the "_cs" driver is not selected, this prompt will not appear. - PCMCIA script directory [/etc/pcmcia]: If the "_cs" driver is selected, this prompt allows you to change the location where the pcmcia scripts will be installed. Only do this if you have installed the rest of the pcmcia_cs scripts to a non-default location. - Alternate target install root directory on host []: This prompt allows you to specify an alternative root directory for the install process. - Module install directory [/lib/modules/2.2.20]: Select where you want the driver modules to be installed. The script constructs a default location using the output of uname. If you have not yet installed the kernel you will run linux-wlan with, and the new kernel has a different version string, you will need to change this value. - Prefix for build host compiler? (rarely needed) []: When cross-compiling or using different compilers for kernel and user-mode software, it is sometimes (but rarely) necessary to specify a different compiler prefix to use when compiling the _tools_ that are built to run on the build host during the linux-wlan-ng build process. - Build for debugging (see doc/config.debug) (y/n) [y]: This option enables the inclusion of debug output generating statements in the driver code. Note that enabling those statements requires the inclusion of insmod/modprobe command line arguments when loading the modules. See the document doc/config.debug for more information. 5) To build the package, run 'make all' 6) To install the package, run 'make install' (as root). ======================================================================= Configuring: NOTE: linux-wlan-ng does not fully implement the wireless extensions interface. This means that you can't use iwconfig and its kin to set things up. Instead, read on! As of linux-wlan-ng 0.1.16-pre5, the configuration and launch scripts have been largely re-written. pcmcia/rc/hotplug now all use a common library of routines and use the same set of configuration files. Now, everything relevant exists in /etc/wlan/* /etc/wlan/wlan.conf: This file maps between wlan devices and network IDs, and contains the names of all devices that should be initialized by the hotplug and rc scripts. /etc/wlan/wlancfg-* These files are per-network configurations. This makes it easy to switch between different SSIDs and the various settings they may require, like WEP keys and whatnot. The bare minimum you need to do to configure your system after a fresh driver install: 0) Nothing whatsoever. out-of-the-box, the driver will attempt to associate with any access point within range. However, we highly recommend setting up a configuration specifically for your network, using the following method: 0) This example assumes your network name/SSID is "MyHomeNetwork" 1) cp /etc/wlan/wlancfg-DEFAULT /etc/wlan/wlancfg-MyHomeNetwork 2) edit /etc/wlan/wlan.conf and change the SSID_wlan0 line to: SSID_wlan0="MyHomeNetwork" 3) edit /etc/wlan/wlancfg-MyHomeNetwork, and make any necessary changes necessary to support your network, such as WEP and whatnot. ------------------------------ FOR PCMCIA USERS: A) Edit /etc/pcmcia/network.opts file to set up your IP settings. Note: for a station, the SSID you're connecting to will be appended to the current pcmcia scheme name. You can use this to have different IP setups for different wireless LANs you connect to (e.g. home vs. work). Note2: This only applies if you are using a stock pcmcia-cs package. Most (if not all) distros use their own mechanisms for configuring pcmcia network interfaces, and thus /etc/pcmcia/network.opts may not even be present. B) Restart pcmcia-cs with the command: /etc/rc.d/init.d/pcmcia restart C) Insert the card. For most cards, a solid LED indicates that the SSID you specified was found, a bss was joined, and the firmware completed the authenticate and associate processes. D) Run ifconfig and route to determine if your IP and route settings are listed as you wanted them. It's also a good idea to look at the file /etc/resolv.conf to see if your nameserver address has been set up correctly. ------------------------------ FOR PCI, PLX, OR USB USERS: A) You must make sure that the drivers get loaded at boot time and that the necessary initialization takes place. The simplest way to do this is to add the following commands to your rc.local file: modprobe prism2_pci [or prism2_usb/prism2_plx] wlanctl-ng wlan0 lnxreq_ifstate ifstate=enable wlanctl-ng wlan0 lnxreq_autojoin ssid= authtype=opensystem ifconfig wlan0 netmask broadcast route add default gw Also, don't forget to set up your resolv.conf to point at your DNS server. B) Alternatively, you can use the rc.wlan script, which ties into the /etc/wlan/* configuration files mentioned above. We currently don't create the softlink from the runlevel directories to the wlan startup script due to differences in distributions, but the scripts are redhat-aware, and can be extended to hook into other tools easily. (patches welcome!) Just make sure it is brought up early in the process, namely, before the the network interfaces are brought up. C) Add an alias for wlan0 in /etc/modules.conf. For example, a usb interface on wlan0 would be set up as: alias wlan0 prism2_usb Substitute prism2_plx or prism2_pci as appropriate. ------------------------------ FOR USB USERS: A) Make sure your kernel usb support is running B) Plug in the Prism2.x USB device C) Run 'modprobe prism2_usb prism2_doreset=1' to load the driver into memory. D) Run 'wlanctl-ng wlan0 lnxreq_ifstate ifstate=enable' to initialize the driver+MAC functions. E) Run 'wlanctl-ng wlan0 lnxreq_autojoin ssid= authtype=opensystem' to enable the MAC in Infrastructure Station mode. F) Run 'ifconfig wlan0 ' Or, you can use the provided hotplug scripts, if your distribution has hotplug support. :) IMPORTANT: Due to an issue with some versions of the Prism USB firmware, the driver usually needs to perform a port reset. Some combinations of usb low-level drivers, kernel releases, and hardware don't like this, and usually end up generating a kernel OOPS. newer kernels are much better in this regard. In particular, Intel usb controllers are the most trouble-prone. The OOPS is due to bugs in the linux USB core, and newer kernels (2.4.19 and later) behave much better in this regard. However, the good news is that primary firmware 1.1.2 seems to resolve the need for the port reset to begin with. Contact your vendor to request this update. Also, using the 'Alt. UHCI' controller driver (uhci.o) is broken with kernels older than 2.4.22 due to a bug in the controller driver. linux-wlan-ng-0.2.9+dfsg/TODO0000644000175000017500000000555511024763205015235 0ustar tormodtormod* TODO * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- Linux WLAN NG TODO - Make the command-completion interrupt driven vs busywaiting. - Possibly hook up DMA on the Rx side for PCI devices - [USB] Remove driver's port-reset when new primary firmware becomes available. - Review changes necessary for static linking to kernel - Display the MAC and BBP partnum & revision at initialization time - Perform a more effective I/O access test and an irq test at initialization time - Detect dead card and perform reset and reinitialization - Finish the prism2 request responses for STA and AP Station: powermgmt join authenticate deauthenticate associate (currently only partially functional) disassociate reassociate start reset Access Point deauthenticate disassociate reset - Finish the mibget/mibset PHY MIBS Prism2 specific mibs (represent all RIDs) - Add event detection and notification of daemon Station: deauthenticate disassociate rxpwer_l2 rxpwer_l1 Access Point: associate authenticate reassociate - Add event handling scripts for the events above - Add AP support for power managing stations linux-wlan-ng-0.2.9+dfsg/COPYING0000644000175000017500000000467711024763205015604 0ustar tormodtormod* COPYING * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- Unless otherwise indicated, this code is distributed under version 1.1 of the Mozilla Public License ("MPL"), included in the LICENSE file. Where this software is combined with software released under the terms of the GNU Public License ("GPL") and the terms of the GPL would require the combined work to also be released under the terms of the GPL, the terms and conditions of the MPL will apply in addition to those of the GPL with the exception of any terms or conditions of the MPL that conflict with, or are expressly prohibited by, the GPL. -- AbsoluteValue Systems, Inc. Note: This file is derived from a copyrighted work of David Hinds. linux-wlan-ng-0.2.9+dfsg/config.in0000644000175000017500000000052711024763205016334 0ustar tormodtormodWLAN_VERSION=0 WLAN_PATCHLEVEL=2 WLAN_SUBLEVEL=9 WLAN_EXTRAVERSION= #LINUX_SRC=/usr/src/linux PCMCIA_SRC= PREFIX= INST_EXEDIR=/sbin TARGET_ROOT_ON_HOST= RC_DIR=/etc/rc.d PCMCIA_DIR=/etc/pcmcia SYSV_INIT=y INSTALL_DEPMOD=y WLAN_DEBUG=n CROSS_COMPILE_ENABLED=n CROSS_COMPILE= HOST_COMPILE= PRISM2_PLX=y PRISM2_PCMCIA=y PRISM2_PCI=y PRISM2_USB=y linux-wlan-ng-0.2.9+dfsg/Makefile0000644000175000017500000001101511024763205016171 0ustar tormodtormod# Makefile # # Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. # -------------------------------------------------------------------- # # linux-wlan # # 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. # # 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. # # -------------------------------------------------------------------- # # Inquiries regarding the linux-wlan Open Source project can be # made directly to: # # AbsoluteValue Systems Inc. # info@linux-wlan.com # http://www.linux-wlan.com # # -------------------------------------------------------------------- # # Portions of the development of this software were funded by # Intersil Corporation as part of PRISM(R) chipset product development. # # -------------------------------------------------------------------- DIRS = src doc man etc CTAGOPTS = --totals -I '__initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_NOVERS' ETAGS=etags ETAGSOPTS=-a default: all help: @echo "Pick one of the following targets:" @echo -e "\tmake config\t\t- interactive configure" @echo -e "\tmake auto_config\t- automated configure" @echo -e "\tmake default_config\t- automated configure using default config file" @echo -e "\tmake all\t\t- build modules and programs" @echo -e "\tmake install\t\t- install modules and programs" @echo -e "\tmake clean\t\t- remove old binaries and dependency files" @echo -e "\tmake mrproper\t\t- 'make clean' + remove config file" @echo -e "\tmake tags\t\t- generate ctag files for source code" @echo -e "\tmake TAGS\t\t- generate etag files for source code" @echo " " help_noconfig: @echo "You need to configure the source first" @echo "Pick one of the following targets:" @echo -e "\tmake config\t\t- interactive configure" @echo -e "\tmake auto_config\t- automated configure" @echo -e "\tmake default_config\t- automated configure using default config file" @echo -e "\tmake help\t\t- show information about other targets" all: config.mk set -e; for d in $(DIRS); do $(MAKE) -C $$d ; done distclean: mrproper mrproper: clean rm -f config.out rm -f tags.linux tags TAGS clean: set -e; for d in $(DIRS); do $(MAKE) -C $$d clean ; done rm -f core core.* *.o .*.o *.s *.a .depend tmp_make *~ tags for i in *_obj; do if [ -d $$i ]; then rm -fr $$i; fi; done rm -f config.mk config.new rm -f src/include/wlan/version.h install: find . -name .depend -exec rm {} \; set -e; for d in $(DIRS); do $(MAKE) -C $$d install ; done auto_config: @touch config.mk config.new @rm -f config.mk config.new @./Configure -d default_config: @touch config.mk config.new @rm -f config.mk config.new @./Configure -d ./default.config config: @touch config.mk @./Configure config.mk: config.out $(MAKE) auto_config config.out: @$(MAKE) help_noconfig @exit 1 tags: tags.linux dummy if [ -r tags.linux ]; then cp tags.linux tags; fi find . \ -name '*.[ch]' -o \ -name '*.mk' -o \ -iname 'Makefile' | \ xargs ctags -a $(CTAGOPTS) tags.linux: if [ -h linux ]; then \ find linux/include \ -type d \( -name 'asm-*' -o -name config \) \ -prune -o \ -name '*.h' -print | \ xargs ctags -a -f $@ $(CTAGOPTS) && \ find linux/kernel linux/drivers linux/mm linux/fs \ linux/net linux/ipc linux/lib linux/init \ -name '*.[ch]' | \ xargs ctags -a -f $@ $(CTAGOPTS); \ fi TAGS: dummy rm -f TAGS # if [ -h linux ]; then cp linux/TAGS TAGS; fi { find . -name '*.[ch]' -print ; \ find . -name '*.[ch]' -print ; \ find . -name '*.mk' -print ; \ find . -iname 'Makefile' -print ; } | $(ETAGS) - $(ETAGSOPTS) dummy: linux-wlan-ng-0.2.9+dfsg/LICENSE0000644000175000017500000007426511024763205015556 0ustar tormodtormod MOZILLA PUBLIC LICENSE Version 1.1 ---------------- 1. Definitions. 1.0.1. "Commercial Use" means distribution or otherwise making the Covered Code available to a third party. 1.1. ''Contributor'' means each entity that creates or contributes to the creation of Modifications. 1.2. ''Contributor Version'' means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor. 1.3. ''Covered Code'' means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof. 1.4. ''Electronic Distribution Mechanism'' means a mechanism generally accepted in the software development community for the electronic transfer of data. 1.5. ''Executable'' means Covered Code in any form other than Source Code. 1.6. ''Initial Developer'' means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A. 1.7. ''Larger Work'' means a work which combines Covered Code or portions thereof with code not governed by the terms of this License. 1.8. ''License'' means this document. 1.8.1. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein. 1.9. ''Modifications'' means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is: A. Any addition to or deletion from the contents of a file containing Original Code or previous Modifications. B. Any new file that contains any part of the Original Code or previous Modifications. 1.10. ''Original Code'' means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License. 1.10.1. "Patent Claims" means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor. 1.11. ''Source Code'' means the preferred form of the Covered Code for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an Executable, or source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor's choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge. 1.12. "You'' (or "Your") means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, "You'' includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control'' means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. Source Code License. 2.1. The Initial Developer Grant. The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims: (a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, and/or as part of a Larger Work; and (b) under Patents Claims infringed by the making, using or selling of Original Code, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Code (or portions thereof). (c) the licenses granted in this Section 2.1(a) and (b) are effective on the date Initial Developer first distributes Original Code under the terms of this License. (d) Notwithstanding Section 2.1(b) above, no patent license is granted: 1) for code that You delete from the Original Code; 2) separate from the Original Code; or 3) for infringements caused by: i) the modification of the Original Code or ii) the combination of the Original Code with other software or devices. 2.2. Contributor Grant. Subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license (a) under intellectual property rights (other than patent or trademark) Licensable by Contributor, to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code and/or as part of a Larger Work; and (b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications made by that Contributor (or portions thereof); and 2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination). (c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first makes Commercial Use of the Covered Code. (d) Notwithstanding Section 2.2(b) above, no patent license is granted: 1) for any code that Contributor has deleted from the Contributor Version; 2) separate from the Contributor Version; 3) for infringements caused by: i) third party modifications of Contributor Version or ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or 4) under Patent Claims infringed by Covered Code in the absence of Modifications made by that Contributor. 3. Distribution Obligations. 3.1. Application of License. The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients' rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5. 3.2. Availability of Source Code. Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License either on the same media as an Executable version or via an accepted Electronic Distribution Mechanism to anyone to whom you made an Executable version available; and if made available via Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are responsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party. 3.3. Description of Modifications. You must cause all Covered Code to which You contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code. 3.4. Intellectual Property Matters (a) Third Party Claims. If Contributor has knowledge that a license under a third party's intellectual property rights is required to exercise the rights granted by such Contributor under Sections 2.1 or 2.2, Contributor must include a text file with the Source Code distribution titled "LEGAL'' which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If Contributor obtains such knowledge after the Modification is made available as described in Section 3.2, Contributor shall promptly modify the LEGAL file in all copies Contributor makes available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained. (b) Contributor APIs. If Contributor's Modifications include an application programming interface and Contributor has knowledge of patent licenses which are reasonably necessary to implement that API, Contributor must also include this information in the LEGAL file. (c) Representations. Contributor represents that, except as disclosed pursuant to Section 3.4(a) above, Contributor believes that Contributor's Modifications are Contributor's original creation(s) and/or Contributor has sufficient rights to grant the rights conveyed by this License. 3.5. Required Notices. You must duplicate the notice in Exhibit A in each file of the Source Code. If it is not possible to put such notice in a particular Source Code file due to its structure, then You must include such notice in a location (such as a relevant directory) where a user would be likely to look for such a notice. If You created one or more Modification(s) You may add your name as a Contributor to the notice described in Exhibit A. You must also duplicate this License in any documentation for the Source Code where You describe recipients' rights or ownership rights relating to Covered Code. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code. However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear than any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer. 3.6. Distribution of Executable Versions. You may distribute Covered Code in Executable form only if the requirements of Section 3.1-3.5 have been met for that Covered Code, and if You include a notice stating that the Source Code version of the Covered Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable version, related documentation or collateral in which You describe recipients' rights relating to the Covered Code. You may distribute the Executable version of Covered Code or ownership rights under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient's rights in the Source Code version from the rights set forth in this License. If You distribute the Executable version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or any Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer. 3.7. Larger Works. You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code. 4. Inability to Comply Due to Statute or Regulation. If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. 5. Application of this License. This License applies to code to which the Initial Developer has attached the notice in Exhibit A and to related Covered Code. 6. Versions of the License. 6.1. New Versions. Netscape Communications Corporation (''Netscape'') may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number. 6.2. Effect of New Versions. Once Covered Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License published by Netscape. No one other than Netscape has the right to modify the terms applicable to Covered Code created under this License. 6.3. Derivative Works. If You create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), You must (a) rename Your license so that the phrases ''Mozilla'', ''MOZILLAPL'', ''MOZPL'', ''Netscape'', "MPL", ''NPL'' or any confusingly similar phrase do not appear in your license (except to note that your license differs from this License) and (b) otherwise make it clear that Your version of the license contains terms which differ from the Mozilla Public License and Netscape Public License. (Filling in the name of the Initial Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.) 7. DISCLAIMER OF WARRANTY. COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS'' BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. 8. TERMINATION. 8.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive. 8.2. If You initiate litigation by asserting a patent infringement claim (excluding declatory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You file such action is referred to as "Participant") alleging that: (a) such Participant's Contributor Version directly or indirectly infringes any patent, then any and all rights granted by such Participant to You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively, unless if within 60 days after receipt of notice You either: (i) agree in writing to pay Participant a mutually agreeable reasonable royalty for Your past and future use of Modifications made by such Participant, or (ii) withdraw Your litigation claim with respect to the Contributor Version against such Participant. If within 60 days of notice, a reasonable royalty and payment arrangement are not mutually agreed upon in writing by the parties or the litigation claim is not withdrawn, the rights granted by Participant to You under Sections 2.1 and/or 2.2 automatically terminate at the expiration of the 60 day notice period specified above. (b) any software, hardware, or device, other than such Participant's Contributor Version, directly or indirectly infringes any patent, then any rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are revoked effective as of the date You first made, used, sold, distributed, or had made, Modifications made by that Participant. 8.3. If You assert a patent infringement claim against Participant alleging that such Participant's Contributor Version directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license. 8.4. In the event of termination under Sections 8.1 or 8.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or any distributor hereunder prior to termination shall survive termination. 9. LIMITATION OF LIABILITY. UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. 10. U.S. GOVERNMENT END USERS. The Covered Code is a ''commercial item,'' as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of ''commercial computer software'' and ''commercial computer software documentation,'' as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Code with only those rights set forth herein. 11. MISCELLANEOUS. This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by California law provisions (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. With respect to disputes in which at least one party is a citizen of, or an entity chartered or registered to do business in the United States of America, any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California, with venue lying in Santa Clara County, California, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys' fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. 12. RESPONSIBILITY FOR CLAIMS. As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability. 13. MULTIPLE-LICENSED CODE. Initial Developer may designate portions of the Covered Code as "Multiple-Licensed". "Multiple-Licensed" means that the Initial Developer permits you to utilize portions of the Covered Code under Your choice of the NPL or the alternative licenses, if any, specified by the Initial Developer in the file described in Exhibit A. EXHIBIT A -Mozilla Public License. ``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 Original Code is ______________________________________. The Initial Developer of the Original Code is ________________________. Portions created by ______________________ are Copyright (C) ______ _______________________. All Rights Reserved. Contributor(s): ______________________________________. Alternatively, the contents of this file may be used under the terms of the _____ license (the "[___] License"), in which case the provisions of [______] License are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of the [____] License 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 [___] License. If you do not delete the provisions above, a recipient may use your version of this file under either the MPL or the [___] License." [NOTE: The text of this Exhibit A may differ slightly from the text of the notices in the Source Code files of the Original Code. You should use the text of this Exhibit A rather than the text found in the Original Code Source Code for Your Modifications.] ----------------------------------------------------------------------- AMENDMENTS The Netscape Public License Version 1.1 ("NPL") consists of the Mozilla Public License Version 1.1 with the following Amendments, including Exhibit A-Netscape Public License. Files identified with "Exhibit A-Netscape Public License" are governed by the Netscape Public License Version 1.1. Additional Terms applicable to the Netscape Public License. I. Effect. These additional terms described in this Netscape Public License -- Amendments shall apply to the Mozilla Communicator client code and to all Covered Code under this License. II. ''Netscape's Branded Code'' means Covered Code that Netscape distributes and/or permits others to distribute under one or more trademark(s) which are controlled by Netscape but which are not licensed for use under this License. III. Netscape and logo. This License does not grant any rights to use the trademarks "Netscape'', the "Netscape N and horizon'' logo or the "Netscape lighthouse" logo, "Netcenter", "Gecko", "Java" or "JavaScript", "Smart Browsing" even if such marks are included in the Original Code or Modifications. IV. Inability to Comply Due to Contractual Obligation. Prior to licensing the Original Code under this License, Netscape has licensed third party code for use in Netscape's Branded Code. To the extent that Netscape is limited contractually from making such third party code available under this License, Netscape may choose to reintegrate such code into Covered Code without being required to distribute such code in Source Code form, even if such code would otherwise be considered ''Modifications'' under this License. V. Use of Modifications and Covered Code by Initial Developer. V.1. In General. The obligations of Section 3 apply to Netscape, except to the extent specified in this Amendment, Section V.2 and V.3. V.2. Other Products. Netscape may include Covered Code in products other than the Netscape's Branded Code which are released by Netscape during the two (2) years following the release date of the Original Code, without such additional products becoming subject to the terms of this License, and may license such additional products on different terms from those contained in this License. V.3. Alternative Licensing. Netscape may license the Source Code of Netscape's Branded Code, including Modifications incorporated therein, without such Netscape Branded Code becoming subject to the terms of this License, and may license such Netscape Branded Code on different terms from those contained in this License. VI. Litigation. Notwithstanding the limitations of Section 11 above, the provisions regarding litigation in Section 11(a), (b) and (c) of the License shall apply to all disputes relating to this License. EXHIBIT A-Netscape Public License. ''The contents of this file are subject to the Netscape 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/NPL/ 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 Original Code is Mozilla Communicator client code, released March 31, 1998. The Initial Developer of the Original Code is Netscape Communications Corporation. Portions created by Netscape are Copyright (C) 1998-1999 Netscape Communications Corporation. All Rights Reserved. Contributor(s): ______________________________________. Alternatively, the contents of this file may be used under the terms of the _____ license (the "[___] License"), in which case the provisions of [______] License are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of the [____] License and not to allow others to use your version of this file under the NPL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the [___] License. If you do not delete the provisions above, a recipient may use your version of this file under either the NPL or the [___] License." linux-wlan-ng-0.2.9+dfsg/scripts/0000755000175000017500000000000011026545443016226 5ustar tormodtormodlinux-wlan-ng-0.2.9+dfsg/scripts/get_version.c0000644000175000017500000000022011024763201020700 0ustar tormodtormod#include #ifndef UTS_RELEASE #include #endif #include main() { printf("%s", UTS_RELEASE); } linux-wlan-ng-0.2.9+dfsg/scripts/Makefile.get_options0000644000175000017500000000102611024763201022206 0ustar tormodtormodKERNEL_VERSION := $(shell $(CURR_DIR)/get_version) KERNEL_RELEASE := $(shell echo $(KERNEL_VERSION) | cut -d\" -f2| cut -c-5) include Makefile get_version_target: echo "KERNEL_RELEASE=$(KERNEL_VERSION)" >> $(CURR_DIR)/make.opts echo "KERNEL_CFLAGS='$(CFLAGS)'" >> $(CURR_DIR)/make.opts echo "CROSS_COMPILE='$(CROSS_COMPILE)'" >> $(CURR_DIR)/make.opts echo "KERNEL_MODFLAGS='$(MODFLAGS)'" >> $(CURR_DIR)/make.opts echo "HOST_CC='$(HOSTCC)'" >> $(CURR_DIR)/make.opts echo "HOST_CFLAGS='$(HOSTCFLAGS)'" >> $(CURR_DIR)/make.opts linux-wlan-ng-0.2.9+dfsg/scripts/Makefile0000644000175000017500000000165311024763201017663 0ustar tormodtormodCURR_DIR :=$(shell pwd) export CURR_DIR .PHONY: get_version all: clean get_version get_options get_version: @if [ ! -d $(KERNEL_SOURCE)/ ]; then \ echo "";\ echo "$(KERNEL_SOURCE) directory does not exist. Please edit the file 'config'";\ echo "in this directory and set KERNEL_SOURCE to the correct location of your ";\ echo "kernel source.";\ echo "";\ echo "You are currently running kernel version `uname -r`, the source code should";\ echo "be for this version.";\ echo "";\ exit 1;\ fi @if [ ! -f $(KERNEL_SOURCE)/include/linux/version.h ]; then \ echo "$(KERNEL_SOURCE)/include/linux/version.h is missing. Please run make config";\ echo "in your kernel source tree";\ exit 1;\ fi $(CC) -I$(KERNEL_SOURCE)/include get_version.c -o get_version get_options: $(MAKE) -f $(CURR_DIR)/Makefile.get_options -C $(KERNEL_SOURCE) get_version_target clean: $(RM) get_version make.opts distclean: clean linux-wlan-ng-0.2.9+dfsg/scripts/pda.pl0000755000175000017500000001165411024763201017331 0ustar tormodtormod#!/usr/bin/perl use Getopt::Long; GetOptions(qw(pda! diff! repl! xdiff=s)); sub usage { print(q{ Usage: pda.pl pdafile or pda.pl --pda --diff --xdiff=0x0104,0x0007 pda1 pda2 > diff-pda1-pda2.pda --diff takes 2 filenams and prints a diff (2nd file will override the first on records that are present in both --pda saves output suitable for loading via prism2dl (mainly for --diff) --repl generates merged PDA, that could be used as a replacement (prism2dl -p) --xdiff exclude given PDR's from beeing overridden by dst PDA => those will be generated from src pdafile (comma separated hexlist) }); exit(0); } $pdr_codes = { 0x0001 => 'PCB_PARTNUM', 0x0002 => 'PCB_TRACENUM', 0x0003 => 'NIC_SERIAL', 0x0004 => 'MKK_MEASUREMENTS', 0x0005 => 'NIC_RAMSIZE', 0x0006 => 'MFISUPRANGE', 0x0007 => 'CFISUPRANGE', 0x0008 => 'NICID', 0x0010 => 'REFDAC_MEASUREMENTS', 0x0020 => 'VGDAC_MEASUREMENTS', 0x0030 => 'LEVEL_COMP_MEASUREMENTS', 0x0040 => 'MODEM_TRIMDAC_MEASUREMENTS', 0x0101 => 'MAC_ADDRESS', 0x0102 => 'MKK_CALLNAME', 0x0103 => 'REGDOMAIN', 0x0104 => 'ALLOWED_CHANNEL', 0x0105 => 'DEFAULT_CHANNEL', 0x0106 => 'PRIVACY_OPTION', 0x0107 => 'TEMPTYPE', 0x0110 => 'REFDAC_SETUP', 0x0120 => 'VGDAC_SETUP', 0x0130 => 'LEVEL_COMP_SETUP', 0x0140 => 'TRIMDAC_SETUP', 0x0200 => 'IFR_SETTING', 0x0201 => 'RFR_SETTING', 0x0202 => 'HFA3861_BASELINE', 0x0203 => 'HFA3861_SHADOW', 0x0204 => 'HFA3861_IFRF', 0x0300 => 'HFA3861_CHCALSP', 0x0301 => 'HFA3861_CHCALI', 0x0900 => 'HFA3861_MANF_TESTSP', 0x0901 => 'HFA3861_MANF_TESTI', 0x0000 => 'END_OF_PDA', }; $pdr_fmt = { 0x0001 => \&x2ascii_list, 0x0002 => \&x2ascii_list, 0x0003 => \&x2ascii_list, 0x0101 => \&x2hex_list, 0x0103 => \&x2dec_list, 0x0104 => \&x2bit_list, 0x0001 => \&x2ascii_list, }; $srcfile=$ARGV[0]; $dstfile=$ARGV[1]; if (defined $opt_xdiff) { @xdiff = map {hex} split /\s*,\s*/, $opt_xdiff; print "@@ xdiff: $opt_xdiff\n"; } if (!defined $srcfile) { usage(); } $src=read_pda($srcfile); if ($opt_diff) { if (!defined $dstfile) { usage(); } $dst=read_pda($dstfile); map { $join{$_->{code}} = 1; $src{$_->{code}} = $_; } @$src; map { $join{$_->{code}} = 1; $dst{$_->{code}} = $_; } @$dst; for $code (sort {($a || $a+0x1000) <=> ($b || $b+0x1000)} keys %join) { if (!defined $dst{$code}) { push @{$diff{src}}, $src{$code}; } elsif (!defined $src{$code}) { push @{$diff{dst}}, $dst{$code}; } elsif ($src{$code}{data} ne $dst{$code}{data}) { push @{$diff{diff}}, [$src{$code}, $dst{$code}]; } else { push @{$diff{same}}, [$src{$code}, $dst{$code}]; } } print "@@ Only in $srcfile:\n"; for my $pdr (@{$diff{src}}) { print_pdr($pdr, {prefix=>$opt_pda && !$opt_repl ? "#- " : ""}); } print "@@ Only in $dstfile:\n"; for my $pdr (@{$diff{dst}}) { print_pdr($pdr); } print "@@ Different:\n"; for my $pdr (@{$diff{diff}}) { if (grep {$_ == $pdr->[0]{code}} @xdiff) { print_pdr($pdr->[0]); } else { if ($opt_pda && !$opt_repl && $pdr->[0]{len} != $pdr->[1]{len}) { printf "0x%04x, 0x%04x,\n", 1, $pdr->[0]{code}; } print_pdr($pdr->[0], {prefix=>($opt_pda ? "#" : "").'- '}); print_pdr($pdr->[1], {prefix=>($opt_pda ? "" : "+ ")}); } } print "@@ Same:\n"; for my $pdr (@{$diff{same}}) { print_pdr($pdr->[0], {header=>!$opt_pda}); } } else { for $pdr (sort {($a->{code} || $a->{code}+0x1000) <=> ($b->{code} || $b->{code}+0x1000)} @$src) { print_pdr($pdr); } } sub x2ascii_list { my ($pdr) = @_; my ($data) = $pdr->{data}; $data =~ s/[\x0-\x1f\x80-\x9f]/sprintf "\\x%02x", $&/eg; return $data; } sub x2hex_list { my ($pdr) = @_; return join(':', map { sprintf "%02x", ord($_) } split //, $pdr->{data}); } sub x2dec_list { my ($pdr) = @_; return join(',', unpack('C*', $pdr->{data})); } sub x2bit_list { my ($pdr) = @_; my ($start) = 1; return join(',', map { $_ ? $start++ : scalar($start++, undef) } split //, unpack("b*", $pdr->{data})); } sub print_pdr { my ($pdr, $opts) = @_; my $data; if (exists($pdr_fmt->{$pdr->{code}})) { $data = &{$pdr_fmt->{$pdr->{code}}}($pdr); } printf "%s# %s (0x%04x/0x%04x) %s\n", $opts->{prefix}, $pdr_codes->{$pdr->{code}}, $pdr->{code}, $pdr->{len}, $data && "= $data"; print $opts->{prefix}.join('', map {sprintf "0x%04x, ", $_} $pdr->{len}, $pdr->{code}, @{$pdr->{nums}})."\n" unless $opts->{header}; } sub read_pda { my ($file) = @_; my (@pda, $pdrs); open PDA, "$file" or die "$file: $!\n"; while () { s/[^\s\da-fx,].*//; push @pda, grep { /^0x[\da-z]+$/i } split /[^x\da-z]+/i; } close PDA; my ($len, $op, @data); for (my $i=0; $i < @pda; $i+=$len+1) { $len = hex($pda[$i]); $code = hex($pda[$i+1]); next unless $code; $nums = [ map { hex } @pda[$i+2 .. $i+$len] ]; $data = pack("v*", @$nums); push @$pdrs, {len=>$len, code=>$code, data=>$data, nums=>$nums}; } return $pdrs; } linux-wlan-ng-0.2.9+dfsg/FAQ0000644000175000017500000004365211024763205015077 0ustar tormodtormod********************** Linux-wlan-ng FAQ ************************** For additions, corrections, and clarifications, send mail to solomon@linux-wlan.com with FAQ in the subject. ******************************************************************* Q: When will linux-wlan-ng be merged into the mainline kernel? Short answer: Never. First, the linux-netdev people will soundly reject this driver. I don't begrudge them for this; indeed in their position I'd do exactly the same. It's a sound engineering decision. linux-wlan-ng is obselete, and effort spent fixing it is better spent elsewhere. You can't even buy the hardware any longer. The original design for linux-wlan-ng was to separate the 802.11 stack from the actual hardware driver. This added a lot of complexity, but would greatly ease the pain of supporitng multiple hardware types. Unfortunately, the implementation was turned out to be somewhat flawed, and hardware manufaturers went away from the thick-mac model, leaving linux-wlan-ng overly complex for what it did. (Ironically, the linux kernel is adopting a similar separation model, but it is a long way off from being ready) So why not rewrite linux-wlan-ng to be more suitable, the enterprising reader may ask? The kernel already has two drivers for prism2 (cs/pci/plx) hardware -- hostap and orinoco. linux-wlan-ng basically has three features not present in kernel drivers: 1) USB support 2) nearly complete implemettion of the 802.11 MIB/MLME 3) Firmware-based AP support (3) requires an expensive license that isn't even available any longer, as the hostap mode works far better -- and is already supported by in-kernel drivers. (2) would need to be removed or completely rewritten in order to be merged, as it does not fit within existing kernel APIs, and it would be effectively merging new kernel APIs. (1) Is the only truly unique thing that linux-wlan-ng does that is generally needed any more. To merge it into the kernel, we'd need to strip out (2), which would necessitate a complete rewrite -- to the point where writing a new driver from scratch is easier. Basically, it would take far less effort to add USB support to the in-kernel drivers than it would to make linux-wlan-ng acceptable to be merged. In other words, the short answer is: Never. Q: It doesn't work/compile/sing/dance! First, make sure you're using the latest linux-wlan-ng release from http://www.linux-wlan-ng.org. New releases are infrequent, but tthey happen for a reason. If you are using the latest release, you may want to obtain the latest development sources via subversion: svn co svn://svn.shaftnet.org/linux-wlan-ng/trunk Questions and problems with the developement code should be sent to the development mailing list, at: linux-wlan-devel@lists.linux-wlan.com Q: What devices does the linux-wlan-ng driver support? Currently, the linux-wlan-ng driver supports the Intersil Prism2/2.5/3 chipsets. These chipsets are used in a wide variety of PCMCIA, PCI, and USB products. If it has a Prism chip in it, linux-wlan-ng should support it. Q: Will linux-wlan-ng support some feature or funkiness in the Linux distribution? Our development target always consists of stock kernels from kernel.org and stock pcmcia_cs. If a given distribution chooses to do something funky, we rely on users of that distribution to contribute patches to deal with their funkiness. The quickest way to get some action on this kind of item is to communicate with any users of the same distribution that you can find on the linux-wlan-[devel|user] lists about working up a patch. If it's reasonably sane and doesn't break things for our development environment or for other distributions, we'll be more than happy to roll that patch into the next release. Q: What does "resultcode=implementation_failure" mean? Complicated Answer: Each command that can be issued with wlanctl-ng returns a status called "resultcode". Resultcode is something that we picked up from the 802.11 MLME definition. In the standard, resultcode is an enumeration with a fixed set of values. To be able to report failures that a driver detects that are outside the context of the 802.11 standard set of resultcode values, we invented the "implementation_failure" value. Simple Answer: Go look in your kernel log for more detailed error information. Q: I'm trying to use the HostAP/orinoco/aironet/wvlan driver and it won't work! That has nothing to do with the linux-wlan-ng driver. Go ask those responsible for those drivers. Q: Can I get Debian packages of linux-wlan-ng? A: Packages of linux-wlan-ng are now available in the Debian stable tree. Q: Where do I find some RPMS for linux-wlan-ng? The ones on the ftp are dreadfully out of date! http://prism2.unixguru.raleigh.nc.us/ (Maintained by Tim Miller) Q: I installed the RPMs/compiled the driver and installed it and it won't work when I try to run 'ifup wlan0' or whatnot. First, ensure you're running the most up-to-date version of the driver. Many problems have been fixed in newer releases. 802.11 wireless networks are much more complex than wired ethernet networks. They require much more configuration than an ip address. If you are using pcmcia, edit the file /etc/pcmcia/wlan-ng.opts to set the network parameters. For PCI, PLX, or USB adapters, you need to edit /etc/wlan.conf. You also need to make sure you have the correct settings in /etc/modules.conf (alias wlan0 prism2_usb). Might we suggest you read the README file? Q: When I try to load the driver, I get a whole bunch of errors about unresolved symbols. The running kernel does not match the kernel the driver was compiled for. If you downloaded a RPM, make sure you downloaded the correct version for your kernel. This should not happen if you compiled the driver from source -- if it does, the kernel configuration you compiled against does not match the running kernel. Probably a screwed-up distro kernel. Q: I have a DWL-520 and it won't work! The DWL-520 claims to require a PCI 2.2 compliant motherboard. Only fairly new machines support this. Yes, the box lies. :) Check the documentation for your system and/or motherboard to see if it is PCI 2.2 compliant. NOTE: We have some reports of the DWL-520 working on PCI 2.1 motherboards; your mileage may vary. See the following URL: http://www.personaltelco.net/index.cgi/DlinkDwl520 NOTE: The Linksys WMP11 v2.7 is NOT prism-based, and thus not supported by this driver. The Actiontec PCI board is still known to be prism based; you may want to try that instead. Q: All I see is "Tx attempt prior to association, frame dropped" You are not associated with an access point. Double-check the settings in /etc/wlan.conf (USB, PCI, PLX) or /etc/pcmcia/wlan-ng.opts (for PCMCIA users). If all of these settings are correct (you did check with your admin, right?) make sure the access point doesn't have a MAC filter installed or has different WEP settings. If all of this is verified correct, and are using a PCMCIA card, try setting the "irq_mode=0" option. See the documentaiton in the pcmcia-cs sources. Q: I installed the modules, performed a 'wlanctl-ng wlan0 lnxreq_autojoin' command, and it still won't work! You did read the README, didn't you? You need to perform a "wlanctl-ng wlan0 lnxreq_ifstate ifstate=enable" in order to torn on the radio. The pcmcia scripts and the /etc/init.d/wlan script do this for you. Q: I have a XXX USB 802.11b device, will it work with this driver? Most 802.11b USB devices use the ATMEL AT76C503A chipset, which is not supported by the linux-wlan-ng project. However, there are some prism2.5-based USB adapters, most notably the Linksys WUSB v2.5. The other versions (1.0, 2.6, 3.0) are based on ATMEL chipsets. Another supported USB device is the Actiontec 802UI3. Q: My prism2.5-based USB adapter won't work! An excellent guide can be found at: http://www.fuw.edu.pl/~pliszka/hints/prism2.html Q: My prism2.5-based USB adapter won't come up if it's plugged in at boot! Thanks to buggy firmware, it is often necessary to perform a device reset on initialization. You can perform this by adding "options prism2_usb prism2_doreset=1" in your /etc/modules.conf Intersil has released Primary firmware 1.1.2, which seems to have resolved this problem, at least on our test machines. Q: My PC crashes when the USB device is plugged in! This is a result of the port reset necessitated by buggy firmware. You are probably using the 'usb-uhci' driver with an intel chipset. Unfortunately, the crashes happen deep within the USB core, so there's nothing the linux-wlan-ng driver can do. In the mean time, try using the 'uhci' host controller driver instead ("alias usb-controller uhci" in /etc/modules.conf), or plug the USB device into a hub. Linux kernel 2.4.19 is known to improve the situation somewhat, but the right way to fix it is to turn off the port reset (options prism2_usb prism2_doreset=0). The current firmware from Intersil alleviates the need to perform the reset. UPDATE: if you're using linux-wlan-ng 0.2.1-pre6 or newer and kernel < 2.4.22-pre, the 'uhci' driver will NOT work without a kernel patch! See: http://lists.linux-wlan.com/pipermail/linux-wlan-devel/2003-May/002369.html Q: How come I can't transmit when in monitor mode? You can't. It's a fundamental "feature" of the hardware. Q: How come the /proc/net/wireless info isn't updated when in monitor mode? The definition of "signal quality" refers to the quality of the link to the associated access point. When you're in monitor mode, you're not associated, so this information is by defintion irrelevant. And regardless, the hardware doesn't update the registers we poll to obtain this information while in monitor mode. Q: What do the various monitor mode options do? enable=[true/false] Turn it on and off. required. channel=[1-14] Sniff channel. required. prismheader=[true/false] Optionally preppend a special radio header on the packet. Defaults to off. keepwepflags=[true/false] If you had WEP configured correctly the card will perform WEP decoding. Defaults to off. stripfcs=[true/false] When true, the 802.11 FCS is not stripped from incoming packets. Defaults off. truncate=[number] Truncates the captured frame. Q: How come iwconfig/iwspy/[random other wireless tool] doesn't work? linux-wlan-ng only supports a subset of the wireless extensions; generally read-only things. However, you won't need any of those tools as wlan-ng comes with its own set of tools that closely mirror the 802.11 spec. Have a look through the documentation and supplied scripts. That said, if more complete (ie read/write) wireless extension support is really important to you, you're more than welcome to implement it and submit a patch. As of 0.1.16-pre1, the wireless extension plumbing has been re-written, and further support is much easier now. And many more bits are hooked up now than before. Q: How do I know exactly what prism variant is on my card? When you load the driver, you see a line which reads like: ident: nic h/w id=0x8008 1.0.0 1.0.0 is the hardware revision. Below is a (partial) list of IDs. 0x8003, 0x8008 : Prism2 PCMCIA 0x800b, 0x800c : Prism2.5 PCMCIA 0x8012, 0x8013 : Prism2.5 PCI 0x801a, 0x801b : Prism3 PCMCIA 0x8021, 0x8022 : Prism3 PCI 0x800f, 0x8010 : Prism2.5 USB (3863) 0x801e, 0x801f : Prism2.5 USB (3861B) 0x8025, 0x8026 : Prism3 USB Q: How do I know what firmware my card has? After the driver is loaded and brought into ifstate=enable, you will see the following lines in the kernel log: (eg dmesg |grep ident) ident: pri f/w: id=0x15 0.3.0 ident: sta f/w: id=0x1f 1.7.1 In this case, the card has primary firmware 0.3.0 and secondary firmware 1.7.1. Or, if you are using 0.2.1-pre17 or newer: 'cat /proc/net/p80211/wlan0/nsd' with the card running. Q: How can I update my firmware under Linux? Use the 'prism2dl' utility. While it does its utmost to ensure you don't fry your card, use it at your own risk. Even the Intersil-supplied tools fail occasionally. Q: Where can I download updated firmware for my Prism2/2.5/3-based card? As of linux-wlan-ng 0.2.1-pre21, the ram download firmware for all supported card types is bundled with the driver. These images cannot be flashed. A general FAQ on firmware updating is here: http://linux.junsun.net/intersil-prism It includes links to some sites with firmware images. We strongly recommend against flashing a new image, instead one should use the ram-download images that are loaded when the driver starts, much like the Windows drivers do. See the instructions below for getting this to work. Q: What's this about "ram downloading"? This means the driver loads up a firmware images directly into card RAM, instead of using the firmware stored in the card's flash ROM. This lets us ensure we are using the lastest available code without risking ruining the hardware due to a bad flashing. linux-wlan-ng will automatically perform a RAM download if you have the necessary firmware images. Q: Okay, I have new ram download firmware images, where do I put them? copy the *hex files into linux-wlan-ng-XXXX/src/prism2/ then build and install the driver per usual. Q: Can I use my 802.11b card as an AP under Linux? Yes, and in the true free software fashion, there are several ways: a) linux-wlan-ng supports AP operation by using special tertiary firmware on prism devices. This firmware is not generally available, however. Contact Intersil for licensing terms. b) The Prism2 HostAP driver uses the special HostAP mode of the prism chipsets. http://people.ssh.com/jkm/Prism2/ Q: I have a PCI adapter, and upon resuming from a suspend, the device is not responsive. Much like you need to run some commands to bring the card to life when the PC is first booted, you also need to perform similar steps when the card comes out of suspend. Run '/etc/init.d/wlan start' and all should be well. You'll need to be running 0.1.15-pre3 or newer for this to work properly. The prism2.5/3 chipsets do not support PCI power management, so this is the best we can realistically do. Q: I have a Linksys WMP11, and under moderate to heavy traffic, I get errors like "unknown port number" and "invalid frame type" Make sure you're using the latest firmware avaliable from Linksys's web site. According to the firmware release notes: "Changes were made to prevent erroneous data from being transferred over the PCI bus" Note that this problem has also beeen confirmed on the D-Link DWL-520. You will need firmware 1.3.5 or newer to resolve this. Q: I have a D-Link DWL-650/650+/520+ card, why doesn't it work with this driver? The DWL-650 comes in at least three flavors; older ones have grey antennae, with no revision number on the back. Second-generation has a black antenna and the back reads "H/W J3 F/W 1.x.x". Both of these will work. The third- generation, with a grey antenna, has "H/W A1, F/W x.x", and will NOT work; It has the same hardware as the "plus" series of cards. The "plus" series of cards from D-Link use the Texas Instruments ACX100/TNETW1100 chipset. TI has not been forthcoming with programming information. Politely ask TI and D-Link for Linux drivers and/or docs. We've been told that TI will be releasing binary-only Linux drivers sometime in December. In the mean time, return the card and buy one that works with Linux. Q: I have a Linksys WMP11 v2.7 card; why doesn't it work with this driver? Linksys, in their grand tradition, likes to introduce completely new cards but re-use the model number. The WMP11 v2.7 utilizes the Broadcomm chipset, and is not supported by linux-wlan-ng. Politely ask Linksys and/or Broadcomm for Linux drivers and/or docs. Q: What other resources are there for Wireless LANs under Linux? http://www.fuw.edu.pl/~pliszka/hints/wireless.html http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Linux.Wireless.drivers.html Q: I'm using RedHat 8.x+ (or Fedora Core), and I get this error when trying to ifup wlan0: Error for wireless request "Set Encode" (8B2A) : SET failed on device wlan0 ; Function not implemented. Error for wireless request "Set ESSID" (8B1A) : SET failed on device wlan0 ; Function not implemented. You can safely ignore this; it is there because linux-wlan-ng does not currently use the wireless extension commands for configuration. Q: When the prism2_cs module loads, I see the message "RequestIRQ: Resource in use" and the load fails! What's going on? Is your card a 16-bit PCMCIA card? If it is, you may need to recompile your kernel with ISA bus support enabled (CONFIG_ISA=y). The PCMCIA core uses ISA bus support to help determine what IRQs are available for the card. Without it, the PCMCIA core may not be able to select an IRQ. Q: After installing linux-wlan-ng on my RedHat 9 system, pcmcia no longer works! This is due to a bug in the RedHat 9 pcmcia startup scripts. On or about line 105 in /etc/init.d/pcmcia, remove all of the '.o' suffixes on the modprobe command lines. It should read something like this: if [ -d $PC ] ; then echo -n " modules" /sbin/modprobe pcmcia_core $CORE_OPTS /sbin/modprobe $PCIC $PCIC_OPTS /sbin/modprobe ds elif [ -d $KD ] ; then /sbin/modprobe pcmcia_core /sbin/modprobe $PCIC /sbin/modprobe ds else linux-wlan-ng-0.2.9+dfsg/add-ons/0000755000175000017500000000000011026545443016064 5ustar tormodtormodlinux-wlan-ng-0.2.9+dfsg/add-ons/lwepgen/0000755000175000017500000000000011026545443017525 5ustar tormodtormodlinux-wlan-ng-0.2.9+dfsg/add-ons/lwepgen/lwepgen.c0000644000175000017500000000634711024763155021344 0ustar tormodtormod/* * keygen.c * WEP Key Generators * * This program generates WEP keys using de facto standard key * generators for 40 and 128 bit keys. * * Link against OpenSSL's libcrypto.a * * I place this code in the public domain. * May 2001, Tim Newsham */ #include #include #include #include #include #include #define WEPKEYSIZE 5 #define WEPSTRONGKEYSIZE 13 #define WEPKEYS 4 #define WEPKEYSTORE (WEPKEYSIZE * WEPKEYS) /* * generate four subkeys from a seed using the defacto standard */ void wep_seedkeygen(int val, u_char *keys) { int i; for(i = 0; i < WEPKEYSTORE; i++) { val *= 0x343fd; val += 0x269ec3; keys[i] = val >> 16; } return; } /* * generate one key from a string using the de facto standard * * resultant key is stored in * one 128 bit key: keys[0-15] * * (NOTE: I'm not sure why, but it seems that only values 0-12 are used, * resulting in 104 bits of keying, not 128) */ void wep_keygen128(char *str, u_char *keys) { MD5_CTX ctx; u_char buf[64]; int i, j; /* repeat str until buf is full */ j = 0; for(i = 0; i < 64; i++) { if(str[j] == 0) j = 0; buf[i] = str[j++]; } MD5_Init(&ctx); MD5_Update(&ctx, buf, sizeof buf); MD5_Final(buf, &ctx); memcpy(keys, buf, WEPKEYSTORE); for(i = 0; i < WEPSTRONGKEYSIZE; i++) { keys[i] = buf[i]; } for(; i < WEPKEYSTORE; i++) { keys[i] = 0; } return; } /* * generate four subkeys from a string using the defacto standard * * resultant keys are stored in * four 40 bit keys: keys[0-4], keys[5-9], keys[10-14] and keys[15-20] */ void wep_keygen40(char *str, u_char *keys) { int val, i, shift; /* * seed is generated by xor'ing in the keystring bytes * into the four bytes of the seed, starting at the little end */ val = 0; for(i = 0; str[i]; i++) { shift = i & 0x3; val ^= (str[i] << (shift * 8)); } wep_seedkeygen(val, keys); return; } void wep_keyprint(u_char *keys, int strong) { int i, printlength, keylength; char sepchar; printlength = strong ? WEPSTRONGKEYSIZE : WEPKEYSTORE; keylength = strong ? WEPSTRONGKEYSIZE : WEPKEYSIZE; for(i = 0; i < printlength; i++) { sepchar = (i % keylength == keylength - 1) ? '\n' : ':'; printf("%02x%c", keys[i], sepchar); } return; } void usage(char *prog) { printf("%s: generates Lucent compatible WEP keys from a string\n", prog); printf("Usage: %s [-s] keystring\n", prog); exit(1); } int main(int argc, char **argv) { u_char keys[WEPKEYSTORE]; char *prog, *genstr; int strong, ch; prog = argv[0]; strong = 0; while((ch = getopt(argc, argv, "s")) != EOF) { switch(ch) { case 's': strong ++; break; default: usage(prog); } } argc -= optind; argv += optind; if(argc != 1) usage(prog); genstr = argv[0]; if(strong) wep_keygen128(genstr, keys); else wep_keygen40(genstr, keys); wep_keyprint(keys, strong); return 0; } linux-wlan-ng-0.2.9+dfsg/add-ons/lwepgen/Makefile0000644000175000017500000000024011024763155021161 0ustar tormodtormoddefault: lwepgen lwepgen: lwepgen.c gcc -Wl,/usr/lib/libcrypto.so -o lwepgen lwepgen.c lwepgen.c: echo lwepgen.c missing! false clean: rm -rf lwepgen linux-wlan-ng-0.2.9+dfsg/add-ons/keygen/0000755000175000017500000000000011026545443017346 5ustar tormodtormodlinux-wlan-ng-0.2.9+dfsg/add-ons/keygen/Makefile0000644000175000017500000000353411024763155021013 0ustar tormodtormod# Makefile # # Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. # -------------------------------------------------------------------- # # linux-wlan # # 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. # # 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. # # -------------------------------------------------------------------- # # Inquiries regarding the linux-wlan Open Source project can be # made directly to: # # AbsoluteValue Systems Inc. # info@linux-wlan.com # http://www.linux-wlan.com # # -------------------------------------------------------------------- # # Portions of the development of this software were funded by # Intersil Corporation as part of PRISM(R) chipset product development. # # -------------------------------------------------------------------- keygen: gcc -o keygen keygen.c -lcrypto linux-wlan-ng-0.2.9+dfsg/add-ons/keygen/keygen.c0000644000175000017500000000676311024763155021010 0ustar tormodtormod/* * keygen.c * WEP Key Generators * * This program generates WEP keys using de facto standard key * generators for 40 and 128 bit keys. * * Link against OpenSSL's libcrypto.a * * I place this code in the public domain. * May 2001, Tim Newsham */ #include #include #include #include #include #include #define WEPKEYSIZE 5 #define WEPSTRONGKEYSIZE 13 #define WEPKEYS 4 #define WEPKEYSTORE (WEPKEYSIZE * WEPKEYS) #define WEPSTRONGKEYSTORE (WEPSTRONGKEYSIZE * WEPKEYS) /* * generate four subkeys from a seed using the defacto standard */ void wep_seedkeygen(int val, u_char *keys) { int i; for(i = 0; i < WEPKEYSTORE; i++) { val *= 0x343fd; val += 0x269ec3; keys[i] = val >> 16; } return; } /* * generate one key from a string using the de facto standard * * resultant key is stored in * one 128 bit key: keys[0-15] * * (NOTE: I'm not sure why, but it seems that only values 0-12 are used, * resulting in 104 bits of keying, not 128) */ void wep_keygen128(char *str, u_char *keys) { MD5_CTX ctx; u_char buf[64]; int i, j; /* repeat str until buf is full */ j = 0; for(i = 0; i < 64; i++) { if(str[j] == 0) j = 0; buf[i] = str[j++]; } MD5_Init(&ctx); MD5_Update(&ctx, buf, sizeof buf); MD5_Final(buf, &ctx); memcpy(keys, buf, WEPSTRONGKEYSTORE); for(i = 0; i < WEPSTRONGKEYSIZE; i++) { keys[i] = buf[i]; } for(; i < WEPSTRONGKEYSTORE; i++) { keys[i] = 0; } return; } /* * generate four subkeys from a string using the defacto standard * * resultant keys are stored in * four 40 bit keys: keys[0-4], keys[5-9], keys[10-14] and keys[15-20] */ void wep_keygen40(char *str, u_char *keys) { int val, i, shift; /* * seed is generated by xor'ing in the keystring bytes * into the four bytes of the seed, starting at the little end */ val = 0; for(i = 0; str[i]; i++) { shift = i & 0x3; val ^= (str[i] << (shift * 8)); } wep_seedkeygen(val, keys); return; } void wep_keyprint40(u_char *keys) { int i; char sepchar; for(i = 0; i < WEPKEYSTORE; i++) { sepchar = (i % WEPKEYSIZE == WEPKEYSIZE - 1) ? '\n' : ':'; printf("%02x%c", keys[i], sepchar); } return; } void wep_keyprint128(u_char *keys) { int i; char sepchar; for(i = 0; i < WEPSTRONGKEYSTORE; i++) { sepchar = (i % WEPSTRONGKEYSIZE == WEPSTRONGKEYSIZE - 1) ? '\n' : ':'; printf("%02x%c", keys[i], sepchar); } return; } void usage(char *prog) { printf("Usage: %s keystring [-s || 5 || 13]\n", prog); exit(1); } int main(int argc, char **argv) { u_char keys[WEPKEYSTORE]; u_char strongkeys[WEPSTRONGKEYSTORE]; char *prog, *genstr; int strong, ch; prog = argv[0]; strong = 0; while((ch = getopt(argc, argv, "s")) != EOF) { switch(ch) { case 's': strong ++; break; default: usage(prog); } } argc -= optind; argv += optind; if(argc==2) if(!strcmp(argv[1],"13")) { strong++; argc--; } else argc--; if(argc != 1) usage(prog); genstr = argv[0]; if(strong) { wep_keygen128(genstr, strongkeys); wep_keyprint128(strongkeys); } else { wep_keygen40(genstr, keys); wep_keyprint40(keys); } return 0; } linux-wlan-ng-0.2.9+dfsg/man/0000755000175000017500000000000011026545443015312 5ustar tormodtormodlinux-wlan-ng-0.2.9+dfsg/man/nwepgen.10000644000175000017500000000064211024763204017034 0ustar tormodtormod.TH NWEPGEN 8 .SH NAME nwepgen \- generates Neesus Datacom compatible WEP keys .SH SYNOPSIS .B nwepgen genstr length .SH DESCRIPTION .B nwepgen generates Neesus Datacom compatible WEP keys from a string. You will typically not run it by hand, but it is called by the linux-wlan-ng initialization scripts if you specify a WEP key string in the config file. .P .SH AUTHOR This minimal man page was written by Joey Hess. linux-wlan-ng-0.2.9+dfsg/man/Makefile0000644000175000017500000000413711024763204016752 0ustar tormodtormod# man/Makefile # # Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. # -------------------------------------------------------------------- # # linux-wlan # # 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. # # 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. # # -------------------------------------------------------------------- # # Inquiries regarding the linux-wlan Open Source project can be # made directly to: # # AbsoluteValue Systems Inc. # info@linux-wlan.com # http://www.linux-wlan.com # # -------------------------------------------------------------------- # # Portions of the development of this software were funded by # Intersil Corporation as part of PRISM(R) chipset product development. # # -------------------------------------------------------------------- -include ../config.mk all: @echo "Nothing to do..." install: mkdir -p $(TARGET_ROOT_ON_HOST)/usr/local/man/man1 cp *.1 $(TARGET_ROOT_ON_HOST)/usr/local/man/man1 clean: rm -f core core.* *.o .*.o *.s *.a .depend tmp_make *~ tags for i in *_obj; do if [ -d $$i ]; then rm -fr $$i; fi; done linux-wlan-ng-0.2.9+dfsg/man/prism2dl.10000644000175000017500000000544011024763204017126 0ustar tormodtormod.TH PRISM2DL 8 .SH NAME prism2dl \- 802.11 frame dump utility .SH SYNOPSIS .B prism2dl [OPTIONS] devname .SH DESCRIPTION .B prism2dl User utility for downloading prism2 images .SH OPTIONS .TP .B -s (status) Show CIS, PDA from card and exit .TP .B -v (verbose) Show more status info during operation .TP .B -V (Version) Show version and exit .TP .B -n (nowrite) Do all processing, including card PDA read but do not write to card .TP .B -d (debug) Do all processing, excluding card PDA read but do not write to card. A valid interface name is _not_ required for this mode. .TP .B -g (generate) Show the PDA in a format readable by this program. Useful for saving the existing from a card. .SH IMAGEFILE OPTIONS .TP .B -r (ram) Load SREC file to card RAM. This option may be specified multiple times. If the value is "stdin", the file will be read from stdin and the option may only be specified once. .TP .B -f (flash) Load SREC file to card FLASH. This option may be specified multiple times. If the value is "stdin", the file will be read from stdin and the option may only be specified once. .SH PDA OPTIONS .TP .B -a (addpdr) Add the PDRs from file to the PDA from card. This option may be specified multiple times. .TP .B -p (pda) Replace the card PDA with the contents of file. .TP .B -m (macaddr) Overwrite the MAC address PDR with the given value. ::= xx:xx:xx:xx:xx:xx, where xx is a two digit hex number. .TP .B -S (Sernum) Overwrite the serial number PDR with the given string. String must be <= 12 characters, any extra will be truncated. .TP .B -l (padloc) PDA location in card memory. Commonly values: HFA3841 ==> 0x003f0000 HFA3842 ==> 0x007f0000 .TP .B devname Linux device name (e.g. eth0, wlan0) .SH EXAMPLES Review card status: prism2dl -s wlan0 Load a new PDA: prism2dl -p pdafile.txt wlan0 or prism2dl -p pdafile.txt -a pda1.txt -a pda2.txt wlan0 Note that the f/w images will most likely contain bogus plug info after rewriting the PDA by itself. It is generally recommended to reload the primage and secondary images at the same time as modifying the PDA. Load a FLASH image _and_ PDA: prism2dl -p pdafile.txt -f CIS.hex -f primary.hex -f secondary.hex wlan0 Load a RAM image: prism2dl -a pda1.txt -r tertiary.hex Note: PDA records are additive starting with the records from the card OR the records from the -p specified file. -a specified file(s) overwrite, append, or remove records one at a time. If multiple files are specified using the -a option, the files are processed from left to right. This implies that a record removed from the current working PDA may then be added again by a record that appears after the "remove" record in the file set. .P .SH AUTHOR This minimal man page was written by Victor Seva. linux-wlan-ng-0.2.9+dfsg/man/wlanctl-ng.10000644000175000017500000000141111024763204017432 0ustar tormodtormod.TH WLANCTL-NG 8 .SH NAME wlanctl-ng \- control utility for linux-wlan-ng 802.11 devices .SH SYNOPSIS .B wlanctl-ng interface|verson|commands|mibs cmd cmdarg [cmdarg..] .SH DESCRIPTION The wlanctl-ng utility program is used to set up linux-wlan-ng 802.11 devices. linux-wlan-ng devices are configured using a MIB. .P Only experts will want to use this program, as it is quite complicated. Everyone else edits a config file and uses a script that runs this program as necessary. .SH OPTIONS .TP .B commands Output a list of all available commands. .TP .B mibs Outputs a list of available mibs. .TP .B version Outputs the version of the program. .TP .B interface The name of a wireless network interface, such as wlan0. .SH AUTHOR This minimal man page was written by Joey Hess. linux-wlan-ng-0.2.9+dfsg/man/wlancfg.10000644000175000017500000000265311024763204017016 0ustar tormodtormod.TH WLANCFG 8 .SH NAME wlancfg \- manupulate linux-wlan-ng MIB values .SH SYNOPSIS .B wlancfg query dev .P .B wlancfg show dev [all] .P .B wlancfg set dev .P .B wlancfg list .P .B wlancfg version .SH DESCRIPTION The wlancfg utility program provides an alternative method to .B wlanctl-ng (1) , for manipulating MIB values. It was designed to provide an easier mechanism for saving and restoring the complete wireless configuration (i.e. when re-starting the device driver) and to provide a more efficient mechanism for GUI's to query multiple MIB's. .SH OPTIONS .TP .B dev The name of the device (e.g., wlan0). .TP .B query Read MIB names (separated by whitespace) from stdin and output their values (separated by carriage returns) to stdout. The MIB's may be either read/write or read-only. .TP .B show Query the values of all supported read/write MIB's and output their values (separated by carriage returns) to stdout. The syntax of the output will be: name=value .RS If the "all" parameter is specified, then all supported MIB's (i.e. read-only MIB's as well) are output. .RE .TP .B set Read MIB name/value pairs (separated by carriage returns) from stdin and set the values of the specified MIB's. The pairs must have the same syntax as above. The MIB's must be read/write. .TP .B list Display a list of all supported MIB's. .TP .B version Display the compiled version of wlancfg. .SH AUTHOR This minimal man page was written by Joey Hess. linux-wlan-ng-0.2.9+dfsg/man/wland.10000644000175000017500000000073311024763204016477 0ustar tormodtormod.TH WLAND 8 .SH NAME wland \- linux-wlan-ng daemon .SH SYNOPSIS .B wland [-V|-v] [-d wlandpath] [-u] .SH DESCRIPTION .B wland is a daemon for receiving and handling events from 802.11 services and MAC-specific linux-wlan-ng drivers. It is not currently used. .SH OPTIONS .TP .B -V .TP .B -v Display version number. .TP .B -d wlandpath Specify the directory to run in. .TP .B -u Do not daemonize; run in foreground. .SH AUTHOR This minimal man page was written by Joey Hess. linux-wlan-ng-0.2.9+dfsg/THANKS0000644000175000017500000001276211024763205015456 0ustar tormodtormodLinux WLAN package CONTRIBUTORS This project was initially developed for personal interest and use. It has since evolved into it's current state through the support and contributions of many individuals who have taken an interest in this project. We appreciate the source code contributions and bug fixes from those who didn't want to wait on us and fearlessly dived into the source code to either add a feature or fix a bug. Contributions to the project are not limited to source code and bug fixes. Addtitional contributions include (but not limited to) reporting bugs, documentation, test results, helpful and enlightening dicussions on the project's mailing lists, kind words and feedback from users as well as commercial support for the project. Additionally, we'd like to thank the vendors who have contributed wireless network cards for testing the driver. To see a listing of supported wireless cards, visit the Linux WLAN Project page at our web site. http://www.linux-wlan.com Below are some of the contributors to the project. Contributions are made often. Therefore, the list is never "current" even in the most recent release of the project. ;-) This list includes contributors to the original linux-wlan Prism1 driver as well as contributors to this package. deadparrot - an anonymous contributor who's been an enormous help. You know who you are. Robert Coie Geoff Hibble Yoshimura Haba Dries Buytaert Derrick Brashear Tony Awtrey Peter Teuben hong Greg Smith Peter Kundrat James Hicks Erik Kunze Larrick, Douglas Cagle, John Rob Braun Terry Griffin Ken Gordon Pavel Roskin Scott Franzyshen Will Woods Bill Carr David Hsu Alessandro Jouni Malinen Bob James Calvin Fang Jim Suhr Vragor Chris Rankin Michael Carmack Mark Taylor Ben Gertzfield Daniel Lyddy Bryan Smith Stuffed Crust (aka Solomon Peachy) Reyk Floeter Adam Richter Collin Mulliner Mike Kershaw David Leffler Godmar Back Jean Tourrilhes Erik McKee Jack Diedrich Caz Yokoyama Matthias Welwarsky David Brownell Henri Muurimaa Bryan Huang Tony Seward Matthias Welk Josh Wyatt Tim Fletcher Tim Miller Remy Cool Mike Klar Tony Likhite David Everly Nick Jafa James Goodwin Derek Atkins Michael Beattie Joey Hess Clay Jones Matthew Rush Tom Prado Olivier Bornet Ryan Veety Michael Hackett Pavel Kankovsky Brad Davidson Ralf Miunske Juan Conde Ichiro Doi Jeff Chua Chris Wilson Daniel Jiseok Song Albert Pauw Andrew Beresford Stephan Müller Henry Ip Andre McCurdy Allan Claghorn Steve Berry Dan Noe Natsakis Konstantinos Greg Weeks Francesco Bochicchio Federico Pellegrin Nemanja Jakovljevic Shiro Ninomiya Josef Kriegl Arnold Liu Alain Chehikian Ashish J.D. Cole Wolfram Gloger Colin Leroy Giacomo Lozito Armijn Hemel Dan Williams Andrzej Turowski Tim Huck Ekin Meroglu Eric Koenders Andreas Schultes Victor Seva Lopez Richard Kennedy Tormod Volden Karl Relton [Many, many more. If I've overlooked you and you want to be listed here, send me e-mail and I'll fix it. I _know_ a bunch of linux-wlan contributors are missing.] -- Our Sincerest Thanks to all contributors, users and vendors AbsoluteValue Systems, Inc. linux-wlan-ng-0.2.9+dfsg/Configure0000755000175000017500000003673311024763205016416 0ustar tormodtormod#!/bin/bash # # Configure # # linux-wlan Open Sourc Project # # Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. # ------------------------------------------------------------------------- # # Inquiries regarding the linux-wlan Open Source Project can be # made directly to: # # AbsoluteValue Systems Inc. # info@linux-wlan.com # http://www.linux-wlan.com # # ------------------------------------------------------------------------- # TODO: Since we're dependent on configured pcmcia source, we should change # this such that it will ask for the pcmcia source dir and then read # all our stuff from pcmcia/config.mk. Would simplify alot of things. # ------------------------------------------------------------------------- # # This script adapted from the pcmcia-cs/Configure file, license statement below: # # pcmcia-cs/Configure 1.110 1999/06/24 17:37:36 # # The contents of this file are subject to the Mozilla Public License # Version 1.0 (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 Configure code is David A. Hinds # . Portions created by David A. Hinds # are Copyright (C) 1998 David A. Hinds. All Rights Reserved. #------------------------------------------------------------------------- ECHO="/bin/echo -e " fail () { $ECHO "" $ECHO "Configuration failed" $ECHO "" exit 1 } usage () { $ECHO "usage: Configure [-h|help|-d [filename]|-f ]" $ECHO "" $ECHO " -h|help - display usage info" $ECHO " -d [filename] - automated configuration with option to specify input file" $ECHO " -f - read configuration data from file and prompt user" exit 1 } if [ ! -r config.in ]; then $ECHO "config.in does not exist!" fail fi . ./config.in if [ -r config.out ]; then . ./config.out 2>/dev/null fi PROMPT=y if [ $# -gt 0 ] ; then if [ "$1" = "-h" -o "$1" = "help" ] ; then usage fi if [ "$1" = "-d" -o "$1" = "-f" ] ; then if [ $# -gt 1 ] ; then if [ -r $2 ]; then . $2 else $ECHO "$2 does not exist" fail fi else if [ "$1" = "-f" ] ; then usage fi fi if [ "$1" = "-d" ] ; then PROMPT=n fi fi fi #======================================================================= CONFIG=config.new CONFIG_MK=config.mk rm -f $CONFIG $CONFIG_MK $MODVER cat << 'EOF' > $CONFIG # # Automatically generated by 'make config' -- don't edit! # EOF write_bool() { value=`eval $ECHO '$'$1` if [ "$value" = "y" ] ; then $ECHO "$1=y" >> $CONFIG $ECHO "$1=y" >> $CONFIG_MK else $ECHO "$1=n" >> $CONFIG $ECHO "# $1 is not defined" >> $CONFIG_MK fi } write_str () { value=`eval $ECHO '$'$1` $ECHO "$1"=\"$value\" >> $CONFIG $ECHO "$1=$value" >> $CONFIG_MK } dump_str () { $ECHO "$1" >> $CONFIG $ECHO "$1" >> $CONFIG_MK } prompt () { eval $3=\"$2\" if [ "$PROMPT" = "y" ] ; then $ECHO "$1 [$2]: \c" read tmp if [ -n "$tmp" ] ; then eval $3=\"$tmp\" ; fi else $ECHO "$1 [$2]" fi } ask_bool () { default=`eval $ECHO '$'$2` if [ ! "$default" ] ; then default=n ; fi answer="" while [ "$answer" != "n" -a "$answer" != "y" ] ; do prompt "$1 (y/n)" "$default" answer done eval "$2=$answer" write_bool $2 } ask_str () { default=`eval $ECHO '$'$2` prompt "$1" "`$ECHO $default`" answer eval $2=\"$answer\" write_str $2 } mkversionh () { versionh=src/include/wlan/version.h cp src/version.h.in $versionh DATE=`date` printf '#define WLAN_RELEASE\t"%d.%d.%d%s"\n' \ ${WLAN_VERSION} \ ${WLAN_PATCHLEVEL} \ ${WLAN_SUBLEVEL} \ ${WLAN_EXTRAVERSION} >> $versionh printf '#define WLAN_RELEASE_CODE 0x%02x%02x%02x\n' \ ${WLAN_VERSION} \ ${WLAN_PATCHLEVEL} \ ${WLAN_SUBLEVEL} >> $versionh echo "#define WLAN_BUILD_DATE \"$DATE\" " >> $versionh printf '\n' >> $versionh printf '#endif\n' >> $versionh } #======================================================================= # If the src/include/wlan/version.h file needs a touchup, fix or create it if [ -r src/include/wlan/version.h ]; then WLAN_RELEASE="${WLAN_VERSION}.${WLAN_PATCHLEVEL}.${WLAN_SUBLEVEL}${WLAN_EXTRAVERSION}" OLD_RELEASE=`sed --quiet -e '/#define.*WLAN_RELEASE[^_].*\"\(.*\)\"/s//\1/p' < src/include/wlan/version.h` if [ "${WLAN_RELEASE}" != "${OLD_RELEASE}" ]; then # Overwrite the file mkversionh fi else # File doesn't exist, create it mkversionh fi $ECHO "" $ECHO "-------------- Linux WLAN Configuration Script -------------" $ECHO "" $ECHO "The default responses are correct for most users." $ECHO "" #======================================================================= # Should we build for PCMCIA Card Services? ask_bool "Build Prism2.x PCMCIA Card Services (_cs) driver?" PRISM2_PCMCIA #======================================================================= # Should we build for PLX9052 based PCI adapters? ask_bool "Build Prism2 PLX9052 based PCI (_plx) adapter driver?" PRISM2_PLX #======================================================================= # Should we build for Prism2 native PCI? ask_bool "Build Prism2.5 native PCI (_pci) driver?" PRISM2_PCI #======================================================================= # Should we build for Prism2.5 USB? ask_bool "Build Prism2.5 USB (_usb) driver?" PRISM2_USB $ECHO "" #======================================================================= # Collect the kernel source tree and test for sanity CUR_RELEASE=`uname -r` if [ "$LINUX_SRC" = "" ] ; then LINUX_SRC=/lib/modules/$CUR_RELEASE/build fi ask_str "Linux source directory" LINUX_SRC if [ ! -f $LINUX_SRC/include/linux/version.h ] ; then $ECHO "Linux source tree $LINUX_SRC is incomplete or missing!" if [ -d $LINUX_SRC/include/linux ] ; then $ECHO " The kernel header files are present, but not " \ "the full source code." fi $ECHO " See the HOWTO for a list of FTP sites for current" \ "kernel sources." fail fi KERNEL_SOURCE=$LINUX_SRC make -Cscripts 2>&1 > /dev/null . scripts/make.opts # What kernel are we compiling for? version () { expr $1 \* 65536 + $2 \* 256 + $3 } $ECHO "" SRC_RELEASE="$KERNEL_RELEASE" VERSION_CODE=`grep LINUX_VERSION_CODE $LINUX_SRC/include/linux/version.h | \ sed -e 's/[^0-9]//g'` $ECHO "The kernel source tree is version $SRC_RELEASE." if [ $VERSION_CODE -lt `version 2 4 0` ] ; then $ECHO "This package requires at least a 2.4.x series kernel." fail fi if [ $VERSION_CODE -gt `version 2 5 0` ] ; then KERN_25=y write_bool KERN_25 fi if [ $VERSION_CODE -ge `version 2 6 5` ] ; then KERN_2_6_5=y fi write_bool KERN_2_6_5 if [ $VERSION_CODE -ge `version 2 6 17` ] ; then KERN_2_6_17=y fi write_bool KERN_2_6_17 if [ $VERSION_CODE -gt `version 2 6 24` ] ; then $ECHO "******* WARNING WARNING WARNING *******" $ECHO "Kernels newer than 2.6.24.x are not supported." $ECHO "******* WARNING WARNING WARNING *******" fi if [ "$SRC_RELEASE" != "$CUR_RELEASE" ] ; then $ECHO "WARNING: the current running kernel is actually version $CUR_RELEASE." fi if [ ! -f $LINUX_SRC/.config ] ; then $ECHO "WARNING: .config not present in kernel source tree. This will" $ECHO " screw up modversions detection and build optimizations." $ECHO " Is this a RedHat kernel? Workarounds enabled." if [ -f $LINUX_SRC/include/linux/modversions.h ] ; then KERNEL_MODFLAGS="-DMODULE -DMODVERSIONS -include $LINUX_SRC/include/linux/modversions.h" fi $ECHO " For an optimized build, copy over the relevent file from" $ECHO " $LINUX_SRC/configs/ to $LINUX_SRC/.config" fi # Check for consistent kernel build dates CUR_D=`uname -v | sed -e 's/^#[0-9]* //;s/SMP //;s/PREEMPT //;'` CUR_D=`$ECHO $CUR_D | sed -e 's/\(:[0-9][0-9]\) .* \([12][90]\)/\1 \2/'` $ECHO "The current kernel build date is $CUR_D." UTS_VERSION="unknown"; if [ -f $LINUX_SRC/include/linux/compile.h ] ; then UTS_VERSION=`grep UTS_VERSION $LINUX_SRC/include/linux/compile.h | sed -e 's/.*"\(.*\)"/\1/'` SRC_D=`$ECHO $UTS_VERSION | sed -e 's/^#[0-9]* //;s/SMP //;s/PREEMPT //;'` SRC_D=`$ECHO $SRC_D | sed -e 's/\(:[0-9][0-9]\) .* \([12][90]\)/\1 \2/'` if [ $SRC_RELEASE = $CUR_RELEASE -a "$SRC_D" != "$CUR_D" ] ; then $ECHO "WARNING: the source tree has a build date of $SRC_D." if [ `date -d "$SRC_D" +%s` -gt `date -d "$CUR_D" +%s` ] ; then $ECHO " Did you forget to install your new kernel?!?" fi fi fi $ECHO "" # Test for netlink availability in the kernel if grep -sq "#define.*CONFIG_NETLINK.*1" ${LINUX_SRC}/include/linux/autoconf.h; then CONFIG_NETLINK=y else CONFIG_NETLINK=n fi write_bool CONFIG_NETLINK # Test for pf_packet availability in the kernel if grep -sq "#define.*CONFIG_PACKET.*1" ${LINUX_SRC}/include/linux/autoconf.h; then CONFIG_PACKET=y else CONFIG_PACKET=n fi write_bool CONFIG_PACKET # Test for pf_packet availability in the kernel if grep -sq "#define.*CONFIG_HOTPLUG.*1" ${LINUX_SRC}/include/linux/autoconf.h; then CONFIG_HOTPLUG=y else CONFIG_HOTPLUG=n fi write_bool CONFIG_HOTPLUG # test to see if __KERNEL__ is defined in KERNEL_CFLAGS # if not, $KERNEL_CFLAGS += __KERNEL__ grep __KERNEL__ < scripts/make.opts > /dev/null if [ $? = 1 ] ; then KERNEL_CFLAGS="-D__KERNEL__ -I$LINUX_SRC/include $KERNEL_CFLAGS" fi dump_str "KERNEL_CFLAGS=$KERNEL_CFLAGS" dump_str "KERNEL_MODFLAGS=$KERNEL_MODFLAGS" #======================================================================= # If compiling for pcmcia-cs, find the PCMCIA source tree if [ $PRISM2_PCMCIA = "y" ] ; then # Should we build for Kernel based PCMCIA? WLAN_KERN_PCMCIA=y grep 'define CONFIG_PCMCIA' < $LINUX_SRC/include/linux/autoconf.h > /dev/null if [ $? = 1 ] ; then WLAN_KERN_PCMCIA=n fi write_bool WLAN_KERN_PCMCIA # We only need the pcmcia source directory if we're NOT building for # kernel PCMCIA. if [ $WLAN_KERN_PCMCIA != "y" ] ; then if [ ! "$PCMCIA_SRC" ] ; then if [ -f /sbin/cardctl ] ; then PCMCIA_SRC=`/sbin/cardctl -V 2>&1 | sed -e 's/cardctl version //'` PCMCIA_SRC=/usr/src/pcmcia-cs-$PCMCIA_SRC fi fi ask_str "pcmcia-cs source dir" PCMCIA_SRC if [ ! -f $PCMCIA_SRC/Makefile ] ; then $ECHO "pcmcia-cs source tree $PCMCIA_SRC is incomplete or missing!" $ECHO "The wlan driver for pcmcia cannot be built without " $ECHO "the pcmcia-cs source tree present and configured." fail fi if [ ! -f $PCMCIA_SRC/include/pcmcia/config.h ] ; then $ECHO "The pcmcia-cs source tree does not appear to be configured." $ECHO "The wlan driver for pcmcia cannot be built without "\ $ECHO "the pcmcia-cs source tree present and configured." fail fi $ECHO "" # Now we need to generate the module options flags. # It's only relevant if modversions is turned on. grep CONFIG_MODVERSIONS=y < $PCMCIA_SRC/config.mk > /dev/null if [ $? = 0 ] ; then PCMCIA_MODFLAGS="-DMODULE -DMODVERSIONS -include $PCMCIA_SRC/include/linux/modversions.h" else PCMCIA_MODFLAGS="-DMODULE" fi # new versions of pcmcia-cs don't generate their own modversion.h # if they don't have it, use the kernel module flags instead. if [ ! -f $PCMCIA_SRC/include/linux/modversions.h ] ; then PCMCIA_MODFLAGS="$KERNEL_MODFLAGS" fi dump_str "PCMCIA_MODFLAGS=$PCMCIA_MODFLAGS" fi fi #======================================================================= # Alternate target install root dir - the value of this variable # will prefix other variables, such as modules and pcmcia directories ask_str "Alternate target install root directory on host" TARGET_ROOT_ON_HOST if [ $PRISM2_PCMCIA = "y" ] ; then # PCMCIA script dir ask_str "PCMCIA script directory" PCMCIA_DIR TARGET_PCMCIA_DIR=$TARGET_ROOT_ON_HOST$PCMCIA_DIR write_str TARGET_PCMCIA_DIR fi MODDIR=/lib/modules/$SRC_RELEASE ask_str " Module install directory" MODDIR TARGET_MODDIR=$TARGET_ROOT_ON_HOST$MODDIR/linux-wlan-ng write_str TARGET_MODDIR $ECHO "" # Just write some out (we're not prompting right now) write_str INST_EXEDIR TARGET_INST_EXEDIR=$TARGET_ROOT_ON_HOST$INST_EXEDIR write_str TARGET_INST_EXEDIR #======================================================================= # How should the startup scripts be configured? SYSV_INIT=n if [ "$PREFIX" = "" ] ; then if [ -d /etc/rc.d/init.d -o -d /etc/init.d -o -d /sbin/init.d ] ; then $ECHO "It looks like you have a System V init file setup." SYSV_INIT=y if [ -d /etc/rc.d/init.d ] ; then $ECHO "RC_DIR=/etc/rc.d" >> $CONFIG $ECHO "RC_DIR=/etc/rc.d" >> $CONFIG_MK elif [ -d /sbin/init.d ] ; then $ECHO "RC_DIR=/sbin" >> $CONFIG $ECHO "RC_DIR=/sbin" >> $CONFIG_MK else $ECHO "RC_DIR=/etc" >> $CONFIG $ECHO "RC_DIR=/etc" >> $CONFIG_MK fi else $ECHO "It looks like you have a BSD-ish init file setup." if ! grep rc.wlan /etc/rc.d/rc.S >/dev/null ; then $ECHO " You'll need to edit /etc/rc.d/rc.S to invoke" \ "/etc/rc.d/rc.wlan (for ISA/PCMCIA cards)" $ECHO " so that wlan cards will be started at boot time." fi SYSV_INIT=n fi write_bool SYSV_INIT else ask_bool "System V init script layout" SYSV_INIT if [ "$SYSV_INIT" = "y" ] ; then ask_str "Top-level directory for RC scripts" RC_DIR fi fi if [ ! -x $TARGET_ROOT_ON_HOST/sbin/depmod ] ; then INSTALL_DEPMOD=n ; fi write_bool INSTALL_DEPMOD $ECHO "" #======================================================================= # Make sure our target architecture is correct $ECHO "" ask_str "Prefix for build host compiler? (rarely needed)" HOST_COMPILE dump_str "HOST_CFLAGS=$HOST_CFLAGS" $ECHO "" dump_str 'HOST_AS=$(HOST_COMPILE)as' dump_str 'HOST_LD=$(HOST_COMPILE)ld' dump_str 'HOST_CC=$(HOST_COMPILE)gcc' dump_str 'HOST_CPP=$(HOST_CC) -E' dump_str 'HOST_AR=$(HOST_COMPILE)ar' dump_str 'HOST_NM=$(HOST_COMPILE)nm' dump_str 'HOST_STRIP=$(HOST_COMPILE)strip' dump_str 'HOST_OBJCOPY=$(HOST_COMPILE)objcopy' dump_str 'HOST_OBJDUMP=$(HOST_COMPILE)objdump' dump_str 'HOST_RANLIB=$(HOST_COMPILE)ranlib' dump_str 'HOST_MAKE=make' CROSS_COMPILE_ENABLED=y if [ "_$CROSS_COMPILE" = "_" ] ; then CROSS_COMPILE_ENABLED=n fi write_str CROSS_COMPILE write_bool CROSS_COMPILE_ENABLED #dump_str 'CFLAGS=-O2 -Wall -Wstrict-prototypes -pipe' if [ "_$CROSS_COMPILE" = "_" ] ; then dump_str 'AS=$(HOST_COMPILE)as' dump_str 'LD=$(HOST_COMPILE)ld' dump_str 'CC=$(HOST_COMPILE)gcc' dump_str 'CPP=$(HOST_CC) -E' dump_str 'AR=$(HOST_COMPILE)ar' dump_str 'NM=$(HOST_COMPILE)nm' dump_str 'STRIP=$(HOST_COMPILE)strip' dump_str 'OBJCOPY=$(HOST_COMPILE)objcopy' dump_str 'OBJDUMP=$(HOST_COMPILE)objdump' dump_str 'RANLIB=$(HOST_COMPILE)ranlib' dump_str 'MAKE=make' else dump_str "AS=$CROSS_COMPILE"as dump_str "LD=$CROSS_COMPILE"ld dump_str "CC=$CROSS_COMPILE"gcc CC="$CROSS_COMPILE"gcc dump_str "CPP=$CC -E" dump_str "AR=$CROSS_COMPILE"ar dump_str "NM=$CROSS_COMPILE"nm dump_str "STRIP=$CROSS_COMPILE"strip dump_str "OBJCOPY=$CROSS_COMPILE"objcopy dump_str "OBJDUMP=$CROSS_COMPILE"objdump dump_str "RANLIB=$CROSS_COMPILE"ranlib dump_str "MAKE=make" fi #======================================================================= # Should we build for debugging? ask_bool "Build for debugging (see doc/config.debug)" WLAN_DEBUG $ECHO "" FIRMWARE_DIR="/etc/wlan/" write_str FIRMWARE_DIR WLAN_SRC=`pwd`/src/ write_str WLAN_SRC mv $CONFIG config.out $ECHO "" $ECHO "Configuration successful. Now type 'make' and pray." $ECHO "" linux-wlan-ng-0.2.9+dfsg/doc/0000755000175000017500000000000011026545443015304 5ustar tormodtormodlinux-wlan-ng-0.2.9+dfsg/doc/capturefrm.txt0000644000175000017500000001661311024763203020216 0ustar tormodtormodAVS Capture Frame Format Version 2.1.1 1. Introduction The original header format for "monitor mode" or capturing frames was a considerable hack. The document covers a redesign of that format. Any questions, corrections, or proposed changes go to info@linux-wlan.com 2. Frame Format All sniff frames follow the same format: Offset Name Size Description -------------------------------------------------------------------- 0 CaptureHeader AVS capture metadata header 64 802.11Header [10-30] 802.11 frame header ?? 802.11Payload [0-2312] 802.11 frame payload ?? 802.11FCS 4 802.11 frame check sequence Note that the header and payload are variable length and the payload may be empty. If the hardware does not supply the FCS to the driver, then the frame shall have a FCS of 0xFFFFFFFF. 3. Byte Order All multibyte fields of the capture header are in "network" byte order. The "host to network" and "network to host" functions should work just fine. All the remaining multibyte fields are ordered according to their respective standards. 4. Capture Header Format The following fields make up the AVS capture header: Offset Name Type ------------------------------ 0 version uint32 4 length uint32 8 mactime uint64 16 hosttime uint64 24 phytype uint32 28 frequency uint32 32 datarate uint32 36 antenna uint32 40 priority uint32 44 ssi_type uint32 48 ssi_signal int32 52 ssi_noise int32 56 preamble uint32 60 encoding uint32 64 sequence uint32 68 drops uint32 72 receiver_addr uint8[6] 78 padding uint8[2] ------------------------------ 80 The following subsections detail the fields of the capture header. 4.1 version The version field identifies this type of frame as a subtype of ETH_P_802111_CAPTURE as received by an ARPHRD_IEEE80211_PRISM or an ARPHRD_IEEE80211_CAPTURE device. The value of this field shall be 0x80211002. As new revisions of this header are necessary, we can increment the version appropriately. 4.2 length The length field contains the length of the entire AVS capture header, in bytes. 4.3 mactime Many WLAN devices supply a relatively high resolution frame reception time value. This field contains the value supplied by the device. If the device does not supply a receive time value, this field shall be set to zero. The units for this field are microseconds. If possible, this time value should be absolute, representing the number of microseconds elapsed since the UNIX epoch. 4.4 hosttime The hosttime field is set to the current value of the host maintained clock variable when the frame is received by the host. If possible, this time value should be absolute, representing the number of microseconds elapsed since the UNIX epoch. 4.5 phytype The phytype field identifies what type of PHY is employed by the WLAN device used to capture this frame. The valid values are: PhyType Value ------------------------------------- phytype_fhss_dot11_97 1 phytype_dsss_dot11_97 2 phytype_irbaseband 3 phytype_dsss_dot11_b 4 phytype_pbcc_dot11_b 5 phytype_ofdm_dot11_g 6 phytype_pbcc_dot11_g 7 phytype_ofdm_dot11_a 8 phytype_dss_ofdm_dot11_g 9 4.6 frequency This represents the frequency or channel number of the receiver at the time the frame was received. It is interpreted as follows: For frequency hopping radios, this field is broken in to the following subfields: Byte Subfield ------------------------ Byte0 Hop Set Byte1 Hop Pattern Byte2 Hop Index Byte3 reserved For non-hopping radios, the frequency is interpreted as follows: Value Meaning ----------------------------------------- < 256 Channel number (using externally-defined channelization) < 10000 Center frequency, in MHz >= 10000 Center frequency, in KHz 4.7 datarate The data rate field contains the rate at which the frame was received in units of 100kbps. 4.8 antenna For WLAN devices that indicate the receive antenna for each frame, the antenna field shall contain an index value into the dot11AntennaList. If the device does not indicate a receive antenna value, this field shall be set to zero. 4.9 priority The priority field indicates the receive priority of the frame. The value is in the range [0-15] with the value 0 reserved to indicate contention period and the value 6 reserved to indicate contention free period. 4.10 ssi_type The ssi_type field is used to indicate what type of signal strength information is present: "None", "Normalized RSSI" or "dBm". "None" indicates that the underlying WLAN device does not supply any signal strength at all and the ssi_* values are unset. "Normalized RSSI" values are integers in the range [0-1000] where higher numbers indicate stronger signal. "dBm" values indicate an actual signal strength measurement quantity and are usually in the range [-108 - 10]. The following values indicate the three types: Value Description --------------------------------------------- 0 None 1 Normalized RSSI 2 dBm 3 Raw RSSI 4.11 ssi_signal The ssi_signal field contains the signal strength value reported by the WLAN device for this frame. Note that this is a signed quantity and if the ssi_type value is "dBm" that the value may be negative. 4.12 ssi_noise The ssi_noise field contains the noise or "silence" value reported by the WLAN device. This value is commonly defined to be the "signal strength reported immediately prior to the baseband processor lock on the frame preamble". If the hardware does not provide noise data, this shall equal 0xffffffff. 4.12 preamble For PHYs that support variable preamble lengths, the preamble field indicates the preamble type used for this frame. The values are: Value Description --------------------------------------------- 0 Undefined 1 Short Preamble 2 Long Preamble 4.13 encoding This specifies the encoding of the received packet. For PHYs that support multiple encoding types, this will tell us which one was used. Value Description --------------------------------------------- 0 Unknown 1 CCK 2 PBCC 3 OFDM 4 DSSS-OFDM 5 BPSK 6 QPSK 7 16QAM 8 64QAM 4.14 sequence This is a receive frame sequence counter. The sniff host shall increment this by one for every valid frame received off the medium. By watching for gaps in the sequence numbers we can determine when packets are lost due to unreliable transport, rather than a frame never being received to begin with. 4.15 drops This is a counter of the number of known frame drops that occured. This is particularly useful when the system or hardware cannot keep up with the sniffer load. 4.16 receiver_addr This specifies the MAC address of the receiver of this frame. It is six octets in length. This field is followed by two octets of padding to keep the structure 32-bit word aligned. ================================ Changes: v2->v2.1 * Added contact e-mail address to introduction * Added sniffer_addr, drop count, and sequence fields, bringing total length to 80 bytes * Bumped version to 0x80211002 * Mactime is specified in microseconds, not nanoseconds * Added 64QAM, 16QAM, BPSK, QPSK encodings ================================ Changes: v2.1->v2.1.1 * Renamed 'channel' to 'frequency' * Clarified the interpretation of the frequency/channel field. * Renamed 'sniffer address' to 'receiver address' * Clarified timestamp fields. linux-wlan-ng-0.2.9+dfsg/doc/config.debug0000644000175000017500000000675011024763203017563 0ustar tormodtormod* doc/config.debug * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- The kernel components of linux-wlan currently have debugging code that can be enabled via a "make config" option. If debug output has been compiled into a driver, enable it by setting the value of the module parameter xxx_debug where xxx is the name of the component. There are five levels of debugging (1-5). Here's a summary of the levels and their usage: 1 - Enables most error messages for exception (but rare) conditions 2 - Enables more exceptions 3 - Enables MAC status output 4 - More status 5 - Function entry and exit The levels are additive. For example, level 3 includes level 3 messages plus levels 1 and 2. To configure p80211.o for debug output, put the following line (with your own level number) in your modutils configuration file (usually /etc/conf.modules or /etc/modules.conf): options p80211 wlan_debug=2 To configure the prism2_cs driver for debug output, put the following line (with your own level number) in your /etc/pcmcia/config.opts file: module "prism2_cs" opts "prism2_debug=2" To configure the PCI, PLX, or USB driver for debug output, put the following line (with your own level number) in your modutils configuration file (usually /etc/conf.modules or /etc/modules.conf): options prism2_pci prism2_debug=3 options prism2_plx prism2_debug=3 options prism2_usb prism2_debug=3 Then configure the collection and display of your kernel output. This is usually done using syslog. Here are the relevant entries from the /etc/syslog.conf file on one of our test machines: kern.* /var/log/kernel kern.* /dev/tty9 *.info;mail.none;news.none;authpriv.none /var/log/messages *.info;mail.none;news.none;authpriv.none /dev/tty10 linux-wlan-ng-0.2.9+dfsg/doc/releasepolicy.txt0000644000175000017500000000304311024763203020677 0ustar tormodtormodlinux-wlan Release Policy/Checklist -------------------------------------------------- [MSM Note: Here's a _quick_ attempt at a release policy for linux-wlan. It's very brief and relatively simple. I'm open to suggestions for improvement. ] The following steps should be taken each time a new release of linux-wlan is ready for distribution: 0) Make sure the current code builds, loads, associates, and ftps cleanly on all 3 AVS lab build boxes. 1) Assign an W.X.Y-preZ version number. 2) Update the version number in config.in. 3) Tag the files. 4) Build the tarball. (Bonehead! double check next time that the tarball and config.in version number match, eh?) 5) Release to ftp. 6) Announce on linux-wlan-annouce as a feature frozen 'pre' release. 7) Announce on freshmeat (Pavel? ;-) 8) Allow at least 24 hours for bug reports and (hopefully) bugfix patches. 9a) After 24 hour period, if bugfix patches and/or local fixes to bug reports are present, apply patches and GOTO step 0. 9b) If no show-stopper bug-reports and/or patches are received during the 'pre' release period GOTO step 10. 10) Make sure the current code builds, loads, associates, and ftps cleanly on all 3 AVS lab build boxes. 11) Assign an W.X.Y version number. 12) Update the version number in config.in. 13) Tag the files. 14) Build the tarball. (Bonehead! double check next time that the tarball and config.in version number match, eh?) 15) Release to ftp. 16) Announce on linux-wlan-annouce as a final W.X.Y release. 17) Announce on freshmeat. linux-wlan-ng-0.2.9+dfsg/doc/prism2/0000755000175000017500000000000011026545443016520 5ustar tormodtormodlinux-wlan-ng-0.2.9+dfsg/doc/prism2/ridlist-rid.html0000644000175000017500000016031711024763202021635 0ustar tormodtormod 802.11 to PRISM2 RID Mapping List

doc/prism2/ridlist-rid.html
Copyright (C) 2000 AbsoluteValue Systems, Inc. All Rights Reserved.


API - The document source for this RID is the API Enhancements Document


PRO - The document source for this RID is the CW10 Programmer's Manual


[1] - read mode is implemented internally within the driver


[2] - This RID is implemented internally in the driver during implementation of the Group Addresses RID (0xFC80)


[3] - This RID is implemented internally in the driver


PRISM2
RID
VALUE
PRISM2
RID
NAME
STA AP 802.11 MibItem Name Doc
Src
Implemented?
   
   
   
   
dot11ACKFailureCount PRO
   
   
   
   
   
dot11AntennaListIndex PRO
   
   
   
   
   
dot11AuthenticateFailStation PRO R [3]
   
   
   
   
dot11AuthenticateFailStatus PRO R [3]
   
   
   
   
dot11AuthenticationAlgorithm2 PRO
   
   
   
   
   
dot11AuthenticationAlgorithm3 PRO
   
   
   
   
   
dot11AuthenticationAlgorithm4 PRO
   
   
   
   
   
dot11AuthenticationAlgorithm5 PRO
   
   
   
   
   
dot11AuthenticationAlgorithm6 PRO
   
   
   
   
   
dot11AuthenticationAlgorithmsEnable2 PRO
   
   
   
   
   
dot11AuthenticationAlgorithmsEnable3 PRO
   
   
   
   
   
dot11AuthenticationAlgorithmsEnable4 PRO
   
   
   
   
   
dot11AuthenticationAlgorithmsEnable5 PRO
   
   
   
   
   
dot11AuthenticationAlgorithmsEnable6 PRO
   
   
   
   
   
dot11CCAModeSupported PRO
   
   
   
   
   
dot11CCAWatchdogCountMax PRO
   
   
   
   
   
dot11CCAWatchdogCountMin PRO
   
   
   
   
   
dot11CCAWatchdogTimerMax PRO
   
   
   
   
   
dot11CCAWatchdogTimerMin PRO
   
   
   
   
   
dot11ChannelAgilityEnabled PRO
   
   
   
   
   
dot11ChannelAgilityPresent PRO
   
   
   
   
   
dot11CurrentChannelNumber PRO
   
   
   
   
   
dot11CurrentDwellTime PRO
   
   
   
   
   
dot11CurrentIndex PRO
   
   
   
   
   
dot11CurrentPattern PRO
   
   
   
   
   
dot11CurrentRegDomain PRO
   
   
   
   
   
dot11CurrentRxAntenna PRO
   
   
   
   
   
dot11CurrentSet PRO
   
   
   
   
   
dot11CurrentTxAntenna PRO
   
   
   
   
   
dot11CurrentTxPowerLevel PRO
   
   
   
   
   
dot11DeauthenticateReason PRO R [3]
   
   
   
   
dot11DeauthenticateStation PRO R [3]
   
   
   
   
dot11DesiredBSSType PRO R/W [3]
   
   
   
   
dot11DisassociateReason PRO R [3]
   
   
   
   
dot11DisassociateStation PRO R [3]
   
   
   
   
dot11DiversitySelectionRx PRO
   
   
   
   
   
dot11DiversitySupport PRO
   
   
   
   
   
dot11EDThreshold PRO
   
   
   
   
   
dot11FCSErrorCount PRO
   
   
   
   
   
dot11FailedCount PRO
   
   
   
   
   
dot11FrameDuplicateCount PRO
   
   
   
   
   
dot11HopTime PRO
   
   
   
   
   
dot11ManufacturerID PRO
   
   
   
   
   
dot11MaxDwellTime PRO
   
   
   
   
   
dot11MulticastReceivedFrameCount PRO
   
   
   
   
   
dot11MulticastTransmittedFrameCount PRO
   
   
   
   
   
dot11MultipleRetryCount PRO
   
   
   
   
   
dot11NumberSupportedPowerLevels PRO
   
   
   
   
   
dot11PBCCOptionImplemented PRO
   
   
   
   
   
dot11ProductID PRO
   
   
   
   
   
dot11RTSFailureCount PRO
   
   
   
   
   
dot11RTSSuccessCount PRO
   
   
   
   
   
dot11ReceivedFragmentCount PRO
   
   
   
   
   
dot11RegDomainsSupportIndex PRO
   
   
   
   
   
dot11RegDomainsSupportValue PRO
   
   
   
   
   
dot11RetryCount PRO
   
   
   
   
   
dot11ShortPreambleOptionImplemented PRO
   
   
   
   
   
dot11SupportedDataRatesRxIndex PRO
   
   
   
   
   
dot11SupportedDataRatesRxValue PRO
   
   
   
   
   
dot11SupportedDataRatesTxIndex PRO
   
   
   
   
   
dot11SupportedDataRatesTxValue PRO
   
   
   
   
   
dot11SupportedRxAntenna PRO
   
   
   
   
   
dot11SupportedTxAntenna PRO
   
   
   
   
   
dot11TransmittedFragmentCount PRO
   
   
   
   
   
dot11TransmittedFrameCount PRO
   
   
   
   
   
dot11TxPowerLevel1 PRO
   
   
   
   
   
dot11TxPowerLevel2 PRO
   
   
   
   
   
dot11TxPowerLevel3 PRO
   
   
   
   
   
dot11TxPowerLevel4 PRO
   
   
   
   
   
dot11TxPowerLevel5 PRO
   
   
   
   
   
dot11TxPowerLevel6 PRO
   
   
   
   
   
dot11TxPowerLevel7 PRO
   
   
   
   
   
dot11TxPowerLevel8 PRO
   
   
   
   
   
dot11WEPExcludedCount PRO
   
   
   
   
   
dot11WEPICVErrorCount PRO
   
   
   
   
   
dot11WEPKeyMappingAddress PRO
   
   
   
   
   
dot11WEPKeyMappingIndex PRO
   
   
   
   
   
dot11WEPKeyMappingLength PRO
   
   
   
   
   
dot11WEPKeyMappingValue PRO
   
   
   
   
   
dot11WEPKeyMappingWEPOn PRO
   
   
   
   
   
dot11WEPUndecryptableCount PRO
   
F101 ScanResults
   
   
   
PRO
   
F102 ChannelInfoResults
   
   
   
PRO
   
F200 LinkStatus
   
   
   
API
   
F201 AssociationStatus
   
   
   
API
   
F202 AuthenticationRequest
   
   
   
API
   
F203 PowerSaveUserCount
   
   
   
API
   
FC00 cnfPortType
   
   
   
PRO
   
FC01 cnfOwnMACAddress X
   
dot11StationID PRO R/W
FC02 cnfDesiredSSID X
   
dot11DesiredSSID PRO R/W
FC03 cnfOwnChannel
   
   
   
PRO
   
FC04 cnfOwnSSID IBSS
   
   
   
PRO
   
FC05 cnfOwnATIMWindow
   
   
   
PRO
   
FC06 cnfSystemScale
   
   
   
PRO
   
FC07 cnfMaxDataLength
   
   
   
PRO
   
FC08 cnfWDSAddress
   
   
   
PRO
   
FC09 cnfPMEnabled X
   
dot11PowerManagementMode PRO R/W
FC0A cnfPMEPS
   
   
   
PRO
   
FC0B cnfMulticastReceive
   
   
   
PRO
   
FC0C cnfMaxSleepDuration
   
   
   
PRO
   
FC0D cnfPMHoldoverDuration
   
   
   
PRO
   
FC0E cnfOwnName
   
   
   
PRO
   
FC10 cnfOwnDTIMPeriod
   
X dot11DTIMPeriod API R/W
FC11 cnfWDSAddress1
   
   
   
PRO
   
FC12 cnfWDSAddress2
   
   
   
PRO
   
FC13 cnfWDSAddress3
   
   
   
PRO
   
FC14 cnfWDSAddress4
   
   
   
PRO
   
FC15 cnfWDSAddress5
   
   
   
PRO
   
FC16 cnfWDSAddress6
   
   
   
PRO
   
FC17 cnfMulticastPMBuffering
   
   
   
PRO
   
FC23 cnfWEPDefaultKeyID X X dot11WEPDefaultKeyID API R/W
FC24 cnfDefaultKey0 X X dot11WEPDefaultKey0 API R/W
FC25 cnfDefaultKey1 X X dot11WEPDefaultKey1 API R/W
FC26 cnfDefaultKey2 X X dot11WEPDefaultKey2 API R/W
FC27 cnfDefaultKey3 X X dot11WEPDefaultKey3 API R/W
FC28 cnfWEPFlags X X dot11ExcludeUnencrypted API R/W
FC28 cnfWEPFlags X X dot11PrivacyInvoked API R/W
FC29 cnfWEPKeyMappingTable
   
   
   
API
   
FC2A cnfAuthentication
   
   
   
API
   
FC2B cnfMaxAssociatedStations
   
   
   
API
   
FC2C cnfTxControl
   
   
   
API
   
FC2D cnfRoamingMode
   
   
   
API
   
FC2E cnfHostAuthentication
   
   
   
API
   
FC30 cnfRcvCrcError
   
   
   
API
   
FC31 cnfMMLife
   
   
   
API
   
FC32 cnfAltRetryCnt
   
   
   
API
   
FC33 cnfBeaconInterval
   
   
   
API
   
FC34 cnfAPPCFInfo
   
   
   
API
   
FC35 cnfSTAPCFInfo
   
   
   
API
   
FC80 GroupAddresses X
   
dot11Address10 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address11 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address12 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address13 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address14 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address15 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address16 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address17 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address18 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address19 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address1 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address20 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address21 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address22 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address23 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address24 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address25 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address26 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address27 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address28 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address29 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address2 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address30 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address31 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address32 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address3 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address4 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address5 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address6 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address7 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address8 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address9 PRO R/W [1]
FC81 CreateIBSS
   
   
   
PRO
   
FC82 FragmentationThreshold X
   
dot11FragmentationThreshold PRO R/W
FC83 RTSThreshold X
   
dot11RTSThreshold PRO R/W
FC84 TxRateControl X
   
dot11OperationalRateSet API R/W
FC85 PromiscuousMode X
   
dot11Address1-32 PRO R/W [2]
FC90 FragmentationThreshold0
   
   
   
PRO
   
FC91 FragmentationThreshold1
   
   
   
PRO
   
FC92 FragmentationThreshold2
   
   
   
PRO
   
FC93 FragmentationThreshold3
   
   
   
PRO
   
FC94 FragmentationThreshold4
   
   
   
PRO
   
FC95 FragmentationThreshold5
   
   
   
PRO
   
FC96 FragmentationThreshold6
   
   
   
PRO
   
FC97 RTSThreshold0
   
   
   
PRO
   
FC98 RTSThreshold1
   
   
   
PRO
   
FC99 RTSThreshold2
   
   
   
PRO
   
FC9A RTSThreshold3
   
   
   
PRO
   
FC9B RTSThreshold4
   
   
   
PRO
   
FC9C RTSThreshold5
   
   
   
PRO
   
FC9D RTSThreshold6
   
   
   
PRO
   
FC9E TxRateControl0
   
   
   
API
   
FC9F TxRateControl1
   
   
   
API
   
FCA0 TxRateControl2
   
   
   
API
   
FCA1 TxRateControl3
   
   
   
API
   
FCA2 TxRateControl4
   
   
   
API
   
FCA3 TxRateControl5
   
   
   
API
   
FCA4 TxRateControl6
   
   
   
API
   
FCB0 cnfShortPreamble
   
   
   
API
   
FCB1 cnfExcludeLongPreamble
   
   
   
API
   
FCB2 cnfAuthenticationRspTO X
   
dot11AuthenticationResponseTimeOut API R
FCB3 cnfBasicRates
   
   
   
API
   
FCB4 cnfSupportedRates
   
   
   
PRO
   
FCE0 TickTime
   
   
   
PRO
   
FCE1 ScanRequest
   
   
   
API
   
FCE2 JoinRequest
   
   
   
API
   
FCE3 authenticateStation
   
   
   
API
   
FCE4 ChannelInfoRequest
   
   
   
API
   
FD00 MaxLoadTime
   
   
   
PRO
   
FD01 DownloadBuffer
   
   
   
PRO
   
FD02 PRIIdentity
   
   
   
PRO
   
FD03 PRISupRange
   
   
   
PRO
   
FD04 CFIActRanges
   
   
   
PRO
   
FD0A NICSerialNumber
   
   
   
PRO
   
FD0B NICIdentity
   
   
   
PRO
   
FD0C MFISupRange
   
   
   
PRO
   
FD0D CFISupRange
   
   
   
PRO
   
FD10 ChannelList
   
   
   
PRO
   
FD11 RegulatoryDomains
   
   
   
PRO
   
FD12 TempType X X dot11TempType PRO R
FD13 CIS
   
   
   
PRO
   
FD20 STAIdentity
   
   
   
PRO
   
FD21 STASupRange
   
   
   
PRO
   
FD22 MFIActRanges
   
   
   
PRO
   
FD23 CFIActRanges
   
   
   
PRO
   
FD40 PortStatus
   
   
   
PRO
   
FD41 CurrentSSID
   
   
   
PRO
   
FD42 CurrentBSSID
   
   
   
PRO
   
FD43 CommsQuality
   
   
   
PRO
   
FD44 CurrentTxRate
   
   
   
PRO
   
FD45 CurrentBeaconInterval X X dot11BeaconPeriod PRO R/W
FD46 CurrentScaleThresholds
   
   
   
PRO
   
FD47 ProtocolRspTime X X dot11AssociationResponseTimeOut PRO R
FD48 ShortRetryLimit X X dot11ShortRetryLimit PRO R
FD49 LongRetryLimit X X dot11LongRetryLimit PRO R
FD4A MaxTransmitLifetime
   
   
dot11MaxTransmitMSDULifetime PRO R
FD4B MaxReceiveLifetime
   
   
dot11MaxReceiveLifetime PRO R
FD4C CFPollable X
   
dot11CFPollable PRO R
FD4D AuthenticationAlgorithms X X dot11AuthenticationAlgorithm1 PRO R/W
FD4D AuthenticationAlgorithms X X dot11AuthenticationAlgorithmsEnable1 PRO R/W
FD4F PrivacyOptionImplemented
   
   
dot11PrivacyOptionImplemented PRO R
FD80 CurrentTxRate1
   
   
   
PRO
   
FD81 CurrentTxRate2
   
   
   
PRO
   
FD82 CurrentTxRate3
   
   
   
PRO
   
FD83 CurrentTxRate4
   
   
   
PRO
   
FD84 CurrentTxRate5
   
   
   
PRO
   
FD85 CurrentTxRate6
   
   
   
PRO
   
FD86 OwnMACAddress
   
X dot11MACAddress PRO R/W
FD87 PCFInfo
   
X dot11CFPMaxDuration PRO R
FD87 PCFInfo
   
X dot11CFPPeriod PRO R
FD87 PCFInfo
   
X dot11MediumOccupancyLimit PRO R
FDC0 PHYType X X dot11PHYType PRO R
FDC1 CurrentChannel X X dot11CurrentChannel PRO R
FDC2 CurrentPowerState
   
   
   
PRO
   
FDC3 CCAMode X X dot11CurrentCCAMode PRO R
FDC6 SupportedDataRates
   
   
   
PRO
   
linux-wlan-ng-0.2.9+dfsg/doc/prism2/ridlist-mib.txt0000644000175000017500000013767211024763202021511 0ustar tormodtormoddoc/prism2/ridlist-mib.txt Copyright (C) 2000 AbsoluteValue Systems, Inc. All Rights Reserved. API - The document source for this RID is the API Enhancements Document PRO - The document source for this RID is the CW10 Programmer's Manual [1] - read mode is implemented internally within the driver [2] - This RID is implemented internally in the driver during implementation of the Group Addresses RID (0xFC80) [3] - This RID is implemented internally in the driver ======================================================================================================= PRISM2 | PRISM2 | | | | | RID | RID | | | | Doc | VALUE | NAME | STA | AP | MibItem NAME | Src | Implemented? ======================================================================================================= F200 | LinkStatus | | | | API | ------------------------------------------------------------------------------------------------------- F201 | AssociationStatus | | | | API | ------------------------------------------------------------------------------------------------------- F202 | AuthenticationReques | | | | API | ------------------------------------------------------------------------------------------------------- F203 | PowerSaveUserCount | | | | API | ------------------------------------------------------------------------------------------------------- FC29 | cnfWEPKeyMappingTabl | | | | API | ------------------------------------------------------------------------------------------------------- FC2A | cnfAuthentication | | | | API | ------------------------------------------------------------------------------------------------------- FC2B | cnfMaxAssociatedStat | | | | API | ------------------------------------------------------------------------------------------------------- FC2C | cnfTxControl | | | | API | ------------------------------------------------------------------------------------------------------- FC2D | cnfRoamingMode | | | | API | ------------------------------------------------------------------------------------------------------- FC2E | cnfHostAuthenticatio | | | | API | ------------------------------------------------------------------------------------------------------- FC30 | cnfRcvCrcError | | | | API | ------------------------------------------------------------------------------------------------------- FC31 | cnfMMLife | | | | API | ------------------------------------------------------------------------------------------------------- FC32 | cnfAltRetryCnt | | | | API | ------------------------------------------------------------------------------------------------------- FC33 | cnfBeaconInterval | | | | API | ------------------------------------------------------------------------------------------------------- FC34 | cnfAPPCFInfo | | | | API | ------------------------------------------------------------------------------------------------------- FC35 | cnfSTAPCFInfo | | | | API | ------------------------------------------------------------------------------------------------------- FC9E | TxRateControl0 | | | | API | ------------------------------------------------------------------------------------------------------- FC9F | TxRateControl1 | | | | API | ------------------------------------------------------------------------------------------------------- FCA0 | TxRateControl2 | | | | API | ------------------------------------------------------------------------------------------------------- FCA1 | TxRateControl3 | | | | API | ------------------------------------------------------------------------------------------------------- FCA2 | TxRateControl4 | | | | API | ------------------------------------------------------------------------------------------------------- FCA3 | TxRateControl5 | | | | API | ------------------------------------------------------------------------------------------------------- FCA4 | TxRateControl6 | | | | API | ------------------------------------------------------------------------------------------------------- FCB0 | cnfShortPreamble | | | | API | ------------------------------------------------------------------------------------------------------- FCB1 | cnfExcludeLongPreamb | | | | API | ------------------------------------------------------------------------------------------------------- FCB3 | cnfBasicRates | | | | API | ------------------------------------------------------------------------------------------------------- FCE1 | ScanRequest | | | | API | ------------------------------------------------------------------------------------------------------- FCE2 | JoinRequest | | | | API | ------------------------------------------------------------------------------------------------------- FCE3 | authenticateStation | | | | API | ------------------------------------------------------------------------------------------------------- FCE4 | ChannelInfoRequest | | | | API | ------------------------------------------------------------------------------------------------------- F101 | ScanResults | | | | PRO | ------------------------------------------------------------------------------------------------------- F102 | ChannelInfoResults | | | | PRO | ------------------------------------------------------------------------------------------------------- FC00 | cnfPortType | | | | PRO | ------------------------------------------------------------------------------------------------------- FC03 | cnfOwnChannel | | | | PRO | ------------------------------------------------------------------------------------------------------- FC04 | cnfOwnSSID IBSS | | | | PRO | ------------------------------------------------------------------------------------------------------- FC05 | cnfOwnATIMWindow | | | | PRO | ------------------------------------------------------------------------------------------------------- FC06 | cnfSystemScale | | | | PRO | ------------------------------------------------------------------------------------------------------- FC07 | cnfMaxDataLength | | | | PRO | ------------------------------------------------------------------------------------------------------- FC08 | cnfWDSAddress | | | | PRO | ------------------------------------------------------------------------------------------------------- FC0A | cnfPMEPS | | | | PRO | ------------------------------------------------------------------------------------------------------- FC0B | cnfMulticastReceive | | | | PRO | ------------------------------------------------------------------------------------------------------- FC0C | cnfMaxSleepDuration | | | | PRO | ------------------------------------------------------------------------------------------------------- FC0D | cnfPMHoldoverDuratio | | | | PRO | ------------------------------------------------------------------------------------------------------- FC0E | cnfOwnName | | | | PRO | ------------------------------------------------------------------------------------------------------- FC11 | cnfWDSAddress1 | | | | PRO | ------------------------------------------------------------------------------------------------------- FC12 | cnfWDSAddress2 | | | | PRO | ------------------------------------------------------------------------------------------------------- FC13 | cnfWDSAddress3 | | | | PRO | ------------------------------------------------------------------------------------------------------- FC14 | cnfWDSAddress4 | | | | PRO | ------------------------------------------------------------------------------------------------------- FC15 | cnfWDSAddress5 | | | | PRO | ------------------------------------------------------------------------------------------------------- FC16 | cnfWDSAddress6 | | | | PRO | ------------------------------------------------------------------------------------------------------- FC17 | cnfMulticastPMBuffer | | | | PRO | ------------------------------------------------------------------------------------------------------- FC81 | CreateIBSS | | | | PRO | ------------------------------------------------------------------------------------------------------- FC90 | FragmentationThresho | | | | PRO | ------------------------------------------------------------------------------------------------------- FC91 | FragmentationThresho | | | | PRO | ------------------------------------------------------------------------------------------------------- FC92 | FragmentationThresho | | | | PRO | ------------------------------------------------------------------------------------------------------- FC93 | FragmentationThresho | | | | PRO | ------------------------------------------------------------------------------------------------------- FC94 | FragmentationThresho | | | | PRO | ------------------------------------------------------------------------------------------------------- FC95 | FragmentationThresho | | | | PRO | ------------------------------------------------------------------------------------------------------- FC96 | FragmentationThresho | | | | PRO | ------------------------------------------------------------------------------------------------------- FC97 | RTSThreshold0 | | | | PRO | ------------------------------------------------------------------------------------------------------- FC98 | RTSThreshold1 | | | | PRO | ------------------------------------------------------------------------------------------------------- FC99 | RTSThreshold2 | | | | PRO | ------------------------------------------------------------------------------------------------------- FC9A | RTSThreshold3 | | | | PRO | ------------------------------------------------------------------------------------------------------- FC9B | RTSThreshold4 | | | | PRO | ------------------------------------------------------------------------------------------------------- FC9C | RTSThreshold5 | | | | PRO | ------------------------------------------------------------------------------------------------------- FC9D | RTSThreshold6 | | | | PRO | ------------------------------------------------------------------------------------------------------- FCB4 | cnfSupportedRates | | | | PRO | ------------------------------------------------------------------------------------------------------- FCE0 | TickTime | | | | PRO | ------------------------------------------------------------------------------------------------------- FD00 | MaxLoadTime | | | | PRO | ------------------------------------------------------------------------------------------------------- FD01 | DownloadBuffer | | | | PRO | ------------------------------------------------------------------------------------------------------- FD02 | PRIIdentity | | | | PRO | ------------------------------------------------------------------------------------------------------- FD03 | PRISupRange | | | | PRO | ------------------------------------------------------------------------------------------------------- FD04 | CFIActRanges | | | | PRO | ------------------------------------------------------------------------------------------------------- FD0A | NICSerialNumber | | | | PRO | ------------------------------------------------------------------------------------------------------- FD0B | NICIdentity | | | | PRO | ------------------------------------------------------------------------------------------------------- FD0C | MFISupRange | | | | PRO | ------------------------------------------------------------------------------------------------------- FD0D | CFISupRange | | | | PRO | ------------------------------------------------------------------------------------------------------- FD10 | ChannelList | | | | PRO | ------------------------------------------------------------------------------------------------------- FD11 | RegulatoryDomains | | | | PRO | ------------------------------------------------------------------------------------------------------- FD13 | CIS | | | | PRO | ------------------------------------------------------------------------------------------------------- FD20 | STAIdentity | | | | PRO | ------------------------------------------------------------------------------------------------------- FD21 | STASupRange | | | | PRO | ------------------------------------------------------------------------------------------------------- FD22 | MFIActRanges | | | | PRO | ------------------------------------------------------------------------------------------------------- FD23 | CFIActRanges | | | | PRO | ------------------------------------------------------------------------------------------------------- FD40 | PortStatus | | | | PRO | ------------------------------------------------------------------------------------------------------- FD41 | CurrentSSID | | | | PRO | ------------------------------------------------------------------------------------------------------- FD42 | CurrentBSSID | | | | PRO | ------------------------------------------------------------------------------------------------------- FD43 | CommsQuality | | | | PRO | ------------------------------------------------------------------------------------------------------- FD44 | CurrentTxRate | | | | PRO | ------------------------------------------------------------------------------------------------------- FD46 | CurrentScaleThreshol | | | | PRO | ------------------------------------------------------------------------------------------------------- FD80 | CurrentTxRate1 | | | | PRO | ------------------------------------------------------------------------------------------------------- FD81 | CurrentTxRate2 | | | | PRO | ------------------------------------------------------------------------------------------------------- FD82 | CurrentTxRate3 | | | | PRO | ------------------------------------------------------------------------------------------------------- FD83 | CurrentTxRate4 | | | | PRO | ------------------------------------------------------------------------------------------------------- FD84 | CurrentTxRate5 | | | | PRO | ------------------------------------------------------------------------------------------------------- FD85 | CurrentTxRate6 | | | | PRO | ------------------------------------------------------------------------------------------------------- FDC2 | CurrentPowerState | | | | PRO | ------------------------------------------------------------------------------------------------------- FDC6 | SupportedDataRates | | | | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11ACKFailureCount | PRO | ------------------------------------------------------------------------------------------------------- FC85 | PromiscuousMode | X | | dot11Address1-32 | PRO | R/W [2] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address10 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address11 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address12 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address13 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address14 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address15 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address16 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address17 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address18 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address19 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address1 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address20 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address21 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address22 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address23 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address24 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address25 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address26 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address27 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address28 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address29 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address2 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address30 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address31 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address32 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address3 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address4 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address5 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address6 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address7 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address8 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address9 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- | | | | dot11AntennaListIndex | PRO | ------------------------------------------------------------------------------------------------------- FD47 | ProtocolRspTime | X | X | dot11AssociationResponseTimeOut | PRO | R ------------------------------------------------------------------------------------------------------- | | | | dot11AuthenticateFailStation | PRO | R [3] ------------------------------------------------------------------------------------------------------- | | | | dot11AuthenticateFailStatus | PRO | R [3] ------------------------------------------------------------------------------------------------------- FD4D | AuthenticationAlgori | X | X | dot11AuthenticationAlgorithm1 | PRO | R/W ------------------------------------------------------------------------------------------------------- | | | | dot11AuthenticationAlgorithm2 | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11AuthenticationAlgorithm3 | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11AuthenticationAlgorithm4 | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11AuthenticationAlgorithm5 | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11AuthenticationAlgorithm6 | PRO | ------------------------------------------------------------------------------------------------------- FD4D | AuthenticationAlgori | X | X | dot11AuthenticationAlgorithmsEnable1 | PRO | R/W ------------------------------------------------------------------------------------------------------- | | | | dot11AuthenticationAlgorithmsEnable2 | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11AuthenticationAlgorithmsEnable3 | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11AuthenticationAlgorithmsEnable4 | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11AuthenticationAlgorithmsEnable5 | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11AuthenticationAlgorithmsEnable6 | PRO | ------------------------------------------------------------------------------------------------------- FCB2 | cnfAuthenticationRsp | X | | dot11AuthenticationResponseTimeOut | API | R ------------------------------------------------------------------------------------------------------- FD45 | CurrentBeaconInterva | X | X | dot11BeaconPeriod | PRO | R/W ------------------------------------------------------------------------------------------------------- | | | | dot11CCAModeSupported | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11CCAWatchdogCountMax | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11CCAWatchdogCountMin | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11CCAWatchdogTimerMax | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11CCAWatchdogTimerMin | PRO | ------------------------------------------------------------------------------------------------------- FD87 | PCFInfo | | X | dot11CFPMaxDuration | PRO | R ------------------------------------------------------------------------------------------------------- FD87 | PCFInfo | | X | dot11CFPPeriod | PRO | R ------------------------------------------------------------------------------------------------------- FD4C | CFPollable | X | | dot11CFPollable | PRO | R ------------------------------------------------------------------------------------------------------- | | | | dot11ChannelAgilityEnabled | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11ChannelAgilityPresent | PRO | ------------------------------------------------------------------------------------------------------- FDC3 | CCAMode | X | X | dot11CurrentCCAMode | PRO | R ------------------------------------------------------------------------------------------------------- FDC1 | CurrentChannel | X | X | dot11CurrentChannel | PRO | R ------------------------------------------------------------------------------------------------------- | | | | dot11CurrentChannelNumber | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11CurrentDwellTime | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11CurrentIndex | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11CurrentPattern | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11CurrentRegDomain | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11CurrentRxAntenna | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11CurrentSet | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11CurrentTxAntenna | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11CurrentTxPowerLevel | PRO | ------------------------------------------------------------------------------------------------------- FC10 | cnfOwnDTIMPeriod | | X | dot11DTIMPeriod | API | R/W ------------------------------------------------------------------------------------------------------- | | | | dot11DeauthenticateReason | PRO | R [3] ------------------------------------------------------------------------------------------------------- | | | | dot11DeauthenticateStation | PRO | R [3] ------------------------------------------------------------------------------------------------------- | | | | dot11DesiredBSSType | PRO | R/W [3] ------------------------------------------------------------------------------------------------------- FC02 | cnfDesiredSSID | X | | dot11DesiredSSID | PRO | R/W ------------------------------------------------------------------------------------------------------- | | | | dot11DisassociateReason | PRO | R [3] ------------------------------------------------------------------------------------------------------- | | | | dot11DisassociateStation | PRO | R [3] ------------------------------------------------------------------------------------------------------- | | | | dot11DiversitySelectionRx | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11DiversitySupport | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11EDThreshold | PRO | ------------------------------------------------------------------------------------------------------- FC28 | cnfWEPFlags | X | X | dot11ExcludeUnencrypted | API | R/W ------------------------------------------------------------------------------------------------------- | | | | dot11FCSErrorCount | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11FailedCount | PRO | ------------------------------------------------------------------------------------------------------- FC82 | FragmentationThresho | X | | dot11FragmentationThreshold | PRO | R/W ------------------------------------------------------------------------------------------------------- | | | | dot11FrameDuplicateCount | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11HopTime | PRO | ------------------------------------------------------------------------------------------------------- FD49 | LongRetryLimit | X | X | dot11LongRetryLimit | PRO | R ------------------------------------------------------------------------------------------------------- FD86 | OwnMACAddress | | X | dot11MACAddress | PRO | R/W ------------------------------------------------------------------------------------------------------- | | | | dot11ManufacturerID | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11MaxDwellTime | PRO | ------------------------------------------------------------------------------------------------------- FD4B | MaxReceiveLifetime | | | dot11MaxReceiveLifetime | PRO | R ------------------------------------------------------------------------------------------------------- FD4A | MaxTransmitLifetime | | | dot11MaxTransmitMSDULifetime | PRO | R ------------------------------------------------------------------------------------------------------- FD87 | PCFInfo | | X | dot11MediumOccupancyLimit | PRO | R ------------------------------------------------------------------------------------------------------- | | | | dot11MulticastReceivedFrameCount | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11MulticastTransmittedFrameCount | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11MultipleRetryCount | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11NumberSupportedPowerLevels | PRO | ------------------------------------------------------------------------------------------------------- FC84 | TxRateControl | X | | dot11OperationalRateSet | API | R/W ------------------------------------------------------------------------------------------------------- | | | | dot11PBCCOptionImplemented | PRO | ------------------------------------------------------------------------------------------------------- FDC0 | PHYType | X | X | dot11PHYType | PRO | R ------------------------------------------------------------------------------------------------------- FC09 | cnfPMEnabled | X | | dot11PowerManagementMode | PRO | R/W ------------------------------------------------------------------------------------------------------- FC28 | cnfWEPFlags | X | X | dot11PrivacyInvoked | API | R/W ------------------------------------------------------------------------------------------------------- FD4F | PrivacyOptionImpleme | | | dot11PrivacyOptionImplemented | PRO | R ------------------------------------------------------------------------------------------------------- | | | | dot11ProductID | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11RTSFailureCount | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11RTSSuccessCount | PRO | ------------------------------------------------------------------------------------------------------- FC83 | RTSThreshold | X | | dot11RTSThreshold | PRO | R/W ------------------------------------------------------------------------------------------------------- | | | | dot11ReceivedFragmentCount | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11RegDomainsSupportIndex | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11RegDomainsSupportValue | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11RetryCount | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11ShortPreambleOptionImplemented | PRO | ------------------------------------------------------------------------------------------------------- FD48 | ShortRetryLimit | X | X | dot11ShortRetryLimit | PRO | R ------------------------------------------------------------------------------------------------------- FC01 | cnfOwnMACAddress | X | | dot11StationID | PRO | R/W ------------------------------------------------------------------------------------------------------- | | | | dot11SupportedDataRatesRxIndex | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11SupportedDataRatesRxValue | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11SupportedDataRatesTxIndex | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11SupportedDataRatesTxValue | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11SupportedRxAntenna | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11SupportedTxAntenna | PRO | ------------------------------------------------------------------------------------------------------- FD12 | TempType | X | X | dot11TempType | PRO | R ------------------------------------------------------------------------------------------------------- | | | | dot11TransmittedFragmentCount | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11TransmittedFrameCount | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11TxPowerLevel1 | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11TxPowerLevel2 | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11TxPowerLevel3 | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11TxPowerLevel4 | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11TxPowerLevel5 | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11TxPowerLevel6 | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11TxPowerLevel7 | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11TxPowerLevel8 | PRO | ------------------------------------------------------------------------------------------------------- FC24 | cnfDefaultKey0 | X | X | dot11WEPDefaultKey0 | API | R/W ------------------------------------------------------------------------------------------------------- FC25 | cnfDefaultKey1 | X | X | dot11WEPDefaultKey1 | API | R/W ------------------------------------------------------------------------------------------------------- FC26 | cnfDefaultKey2 | X | X | dot11WEPDefaultKey2 | API | R/W ------------------------------------------------------------------------------------------------------- FC27 | cnfDefaultKey3 | X | X | dot11WEPDefaultKey3 | API | R/W ------------------------------------------------------------------------------------------------------- FC23 | cnfWEPDefaultKeyID | X | X | dot11WEPDefaultKeyID | API | R/W ------------------------------------------------------------------------------------------------------- | | | | dot11WEPExcludedCount | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11WEPICVErrorCount | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11WEPKeyMappingAddress | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11WEPKeyMappingIndex | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11WEPKeyMappingLength | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11WEPKeyMappingValue | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11WEPKeyMappingWEPOn | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11WEPUndecryptableCount | PRO | ------------------------------------------------------------------------------------------------------- linux-wlan-ng-0.2.9+dfsg/doc/prism2/ridlist-rid.txt0000644000175000017500000013767211024763202021520 0ustar tormodtormoddoc/prism2/ridlist-rid.txt Copyright (C) 2000 AbsoluteValue Systems, Inc. All Rights Reserved. API - The document source for this RID is the API Enhancements Document PRO - The document source for this RID is the CW10 Programmer's Manual [1] - read mode is implemented internally within the driver [2] - This RID is implemented internally in the driver during implementation of the Group Addresses RID (0xFC80) [3] - This RID is implemented internally in the driver ======================================================================================================= PRISM2 | PRISM2 | | | | | RID | RID | | | | Doc | VALUE | NAME | STA | AP | MibItem NAME | Src | Implemented? ======================================================================================================= | | | | dot11ACKFailureCount | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11AntennaListIndex | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11AuthenticateFailStation | PRO | R [3] ------------------------------------------------------------------------------------------------------- | | | | dot11AuthenticateFailStatus | PRO | R [3] ------------------------------------------------------------------------------------------------------- | | | | dot11AuthenticationAlgorithm2 | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11AuthenticationAlgorithm3 | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11AuthenticationAlgorithm4 | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11AuthenticationAlgorithm5 | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11AuthenticationAlgorithm6 | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11AuthenticationAlgorithmsEnable2 | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11AuthenticationAlgorithmsEnable3 | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11AuthenticationAlgorithmsEnable4 | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11AuthenticationAlgorithmsEnable5 | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11AuthenticationAlgorithmsEnable6 | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11CCAModeSupported | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11CCAWatchdogCountMax | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11CCAWatchdogCountMin | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11CCAWatchdogTimerMax | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11CCAWatchdogTimerMin | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11ChannelAgilityEnabled | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11ChannelAgilityPresent | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11CurrentChannelNumber | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11CurrentDwellTime | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11CurrentIndex | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11CurrentPattern | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11CurrentRegDomain | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11CurrentRxAntenna | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11CurrentSet | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11CurrentTxAntenna | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11CurrentTxPowerLevel | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11DeauthenticateReason | PRO | R [3] ------------------------------------------------------------------------------------------------------- | | | | dot11DeauthenticateStation | PRO | R [3] ------------------------------------------------------------------------------------------------------- | | | | dot11DesiredBSSType | PRO | R/W [3] ------------------------------------------------------------------------------------------------------- | | | | dot11DisassociateReason | PRO | R [3] ------------------------------------------------------------------------------------------------------- | | | | dot11DisassociateStation | PRO | R [3] ------------------------------------------------------------------------------------------------------- | | | | dot11DiversitySelectionRx | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11DiversitySupport | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11EDThreshold | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11FCSErrorCount | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11FailedCount | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11FrameDuplicateCount | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11HopTime | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11ManufacturerID | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11MaxDwellTime | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11MulticastReceivedFrameCount | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11MulticastTransmittedFrameCount | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11MultipleRetryCount | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11NumberSupportedPowerLevels | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11PBCCOptionImplemented | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11ProductID | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11RTSFailureCount | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11RTSSuccessCount | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11ReceivedFragmentCount | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11RegDomainsSupportIndex | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11RegDomainsSupportValue | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11RetryCount | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11ShortPreambleOptionImplemented | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11SupportedDataRatesRxIndex | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11SupportedDataRatesRxValue | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11SupportedDataRatesTxIndex | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11SupportedDataRatesTxValue | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11SupportedRxAntenna | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11SupportedTxAntenna | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11TransmittedFragmentCount | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11TransmittedFrameCount | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11TxPowerLevel1 | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11TxPowerLevel2 | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11TxPowerLevel3 | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11TxPowerLevel4 | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11TxPowerLevel5 | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11TxPowerLevel6 | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11TxPowerLevel7 | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11TxPowerLevel8 | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11WEPExcludedCount | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11WEPICVErrorCount | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11WEPKeyMappingAddress | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11WEPKeyMappingIndex | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11WEPKeyMappingLength | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11WEPKeyMappingValue | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11WEPKeyMappingWEPOn | PRO | ------------------------------------------------------------------------------------------------------- | | | | dot11WEPUndecryptableCount | PRO | ------------------------------------------------------------------------------------------------------- F101 | ScanResults | | | | PRO | ------------------------------------------------------------------------------------------------------- F102 | ChannelInfoResults | | | | PRO | ------------------------------------------------------------------------------------------------------- F200 | LinkStatus | | | | API | ------------------------------------------------------------------------------------------------------- F201 | AssociationStatus | | | | API | ------------------------------------------------------------------------------------------------------- F202 | AuthenticationReques | | | | API | ------------------------------------------------------------------------------------------------------- F203 | PowerSaveUserCount | | | | API | ------------------------------------------------------------------------------------------------------- FC00 | cnfPortType | | | | PRO | ------------------------------------------------------------------------------------------------------- FC01 | cnfOwnMACAddress | X | | dot11StationID | PRO | R/W ------------------------------------------------------------------------------------------------------- FC02 | cnfDesiredSSID | X | | dot11DesiredSSID | PRO | R/W ------------------------------------------------------------------------------------------------------- FC03 | cnfOwnChannel | | | | PRO | ------------------------------------------------------------------------------------------------------- FC04 | cnfOwnSSID IBSS | | | | PRO | ------------------------------------------------------------------------------------------------------- FC05 | cnfOwnATIMWindow | | | | PRO | ------------------------------------------------------------------------------------------------------- FC06 | cnfSystemScale | | | | PRO | ------------------------------------------------------------------------------------------------------- FC07 | cnfMaxDataLength | | | | PRO | ------------------------------------------------------------------------------------------------------- FC08 | cnfWDSAddress | | | | PRO | ------------------------------------------------------------------------------------------------------- FC09 | cnfPMEnabled | X | | dot11PowerManagementMode | PRO | R/W ------------------------------------------------------------------------------------------------------- FC0A | cnfPMEPS | | | | PRO | ------------------------------------------------------------------------------------------------------- FC0B | cnfMulticastReceive | | | | PRO | ------------------------------------------------------------------------------------------------------- FC0C | cnfMaxSleepDuration | | | | PRO | ------------------------------------------------------------------------------------------------------- FC0D | cnfPMHoldoverDuratio | | | | PRO | ------------------------------------------------------------------------------------------------------- FC0E | cnfOwnName | | | | PRO | ------------------------------------------------------------------------------------------------------- FC10 | cnfOwnDTIMPeriod | | X | dot11DTIMPeriod | API | R/W ------------------------------------------------------------------------------------------------------- FC11 | cnfWDSAddress1 | | | | PRO | ------------------------------------------------------------------------------------------------------- FC12 | cnfWDSAddress2 | | | | PRO | ------------------------------------------------------------------------------------------------------- FC13 | cnfWDSAddress3 | | | | PRO | ------------------------------------------------------------------------------------------------------- FC14 | cnfWDSAddress4 | | | | PRO | ------------------------------------------------------------------------------------------------------- FC15 | cnfWDSAddress5 | | | | PRO | ------------------------------------------------------------------------------------------------------- FC16 | cnfWDSAddress6 | | | | PRO | ------------------------------------------------------------------------------------------------------- FC17 | cnfMulticastPMBuffer | | | | PRO | ------------------------------------------------------------------------------------------------------- FC23 | cnfWEPDefaultKeyID | X | X | dot11WEPDefaultKeyID | API | R/W ------------------------------------------------------------------------------------------------------- FC24 | cnfDefaultKey0 | X | X | dot11WEPDefaultKey0 | API | R/W ------------------------------------------------------------------------------------------------------- FC25 | cnfDefaultKey1 | X | X | dot11WEPDefaultKey1 | API | R/W ------------------------------------------------------------------------------------------------------- FC26 | cnfDefaultKey2 | X | X | dot11WEPDefaultKey2 | API | R/W ------------------------------------------------------------------------------------------------------- FC27 | cnfDefaultKey3 | X | X | dot11WEPDefaultKey3 | API | R/W ------------------------------------------------------------------------------------------------------- FC28 | cnfWEPFlags | X | X | dot11ExcludeUnencrypted | API | R/W ------------------------------------------------------------------------------------------------------- FC28 | cnfWEPFlags | X | X | dot11PrivacyInvoked | API | R/W ------------------------------------------------------------------------------------------------------- FC29 | cnfWEPKeyMappingTabl | | | | API | ------------------------------------------------------------------------------------------------------- FC2A | cnfAuthentication | | | | API | ------------------------------------------------------------------------------------------------------- FC2B | cnfMaxAssociatedStat | | | | API | ------------------------------------------------------------------------------------------------------- FC2C | cnfTxControl | | | | API | ------------------------------------------------------------------------------------------------------- FC2D | cnfRoamingMode | | | | API | ------------------------------------------------------------------------------------------------------- FC2E | cnfHostAuthenticatio | | | | API | ------------------------------------------------------------------------------------------------------- FC30 | cnfRcvCrcError | | | | API | ------------------------------------------------------------------------------------------------------- FC31 | cnfMMLife | | | | API | ------------------------------------------------------------------------------------------------------- FC32 | cnfAltRetryCnt | | | | API | ------------------------------------------------------------------------------------------------------- FC33 | cnfBeaconInterval | | | | API | ------------------------------------------------------------------------------------------------------- FC34 | cnfAPPCFInfo | | | | API | ------------------------------------------------------------------------------------------------------- FC35 | cnfSTAPCFInfo | | | | API | ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address10 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address11 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address12 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address13 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address14 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address15 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address16 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address17 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address18 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address19 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address1 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address20 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address21 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address22 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address23 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address24 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address25 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address26 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address27 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address28 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address29 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address2 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address30 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address31 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address32 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address3 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address4 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address5 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address6 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address7 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address8 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC80 | GroupAddresses | X | | dot11Address9 | PRO | R/W [1] ------------------------------------------------------------------------------------------------------- FC81 | CreateIBSS | | | | PRO | ------------------------------------------------------------------------------------------------------- FC82 | FragmentationThresho | X | | dot11FragmentationThreshold | PRO | R/W ------------------------------------------------------------------------------------------------------- FC83 | RTSThreshold | X | | dot11RTSThreshold | PRO | R/W ------------------------------------------------------------------------------------------------------- FC84 | TxRateControl | X | | dot11OperationalRateSet | API | R/W ------------------------------------------------------------------------------------------------------- FC85 | PromiscuousMode | X | | dot11Address1-32 | PRO | R/W [2] ------------------------------------------------------------------------------------------------------- FC90 | FragmentationThresho | | | | PRO | ------------------------------------------------------------------------------------------------------- FC91 | FragmentationThresho | | | | PRO | ------------------------------------------------------------------------------------------------------- FC92 | FragmentationThresho | | | | PRO | ------------------------------------------------------------------------------------------------------- FC93 | FragmentationThresho | | | | PRO | ------------------------------------------------------------------------------------------------------- FC94 | FragmentationThresho | | | | PRO | ------------------------------------------------------------------------------------------------------- FC95 | FragmentationThresho | | | | PRO | ------------------------------------------------------------------------------------------------------- FC96 | FragmentationThresho | | | | PRO | ------------------------------------------------------------------------------------------------------- FC97 | RTSThreshold0 | | | | PRO | ------------------------------------------------------------------------------------------------------- FC98 | RTSThreshold1 | | | | PRO | ------------------------------------------------------------------------------------------------------- FC99 | RTSThreshold2 | | | | PRO | ------------------------------------------------------------------------------------------------------- FC9A | RTSThreshold3 | | | | PRO | ------------------------------------------------------------------------------------------------------- FC9B | RTSThreshold4 | | | | PRO | ------------------------------------------------------------------------------------------------------- FC9C | RTSThreshold5 | | | | PRO | ------------------------------------------------------------------------------------------------------- FC9D | RTSThreshold6 | | | | PRO | ------------------------------------------------------------------------------------------------------- FC9E | TxRateControl0 | | | | API | ------------------------------------------------------------------------------------------------------- FC9F | TxRateControl1 | | | | API | ------------------------------------------------------------------------------------------------------- FCA0 | TxRateControl2 | | | | API | ------------------------------------------------------------------------------------------------------- FCA1 | TxRateControl3 | | | | API | ------------------------------------------------------------------------------------------------------- FCA2 | TxRateControl4 | | | | API | ------------------------------------------------------------------------------------------------------- FCA3 | TxRateControl5 | | | | API | ------------------------------------------------------------------------------------------------------- FCA4 | TxRateControl6 | | | | API | ------------------------------------------------------------------------------------------------------- FCB0 | cnfShortPreamble | | | | API | ------------------------------------------------------------------------------------------------------- FCB1 | cnfExcludeLongPreamb | | | | API | ------------------------------------------------------------------------------------------------------- FCB2 | cnfAuthenticationRsp | X | | dot11AuthenticationResponseTimeOut | API | R ------------------------------------------------------------------------------------------------------- FCB3 | cnfBasicRates | | | | API | ------------------------------------------------------------------------------------------------------- FCB4 | cnfSupportedRates | | | | PRO | ------------------------------------------------------------------------------------------------------- FCE0 | TickTime | | | | PRO | ------------------------------------------------------------------------------------------------------- FCE1 | ScanRequest | | | | API | ------------------------------------------------------------------------------------------------------- FCE2 | JoinRequest | | | | API | ------------------------------------------------------------------------------------------------------- FCE3 | authenticateStation | | | | API | ------------------------------------------------------------------------------------------------------- FCE4 | ChannelInfoRequest | | | | API | ------------------------------------------------------------------------------------------------------- FD00 | MaxLoadTime | | | | PRO | ------------------------------------------------------------------------------------------------------- FD01 | DownloadBuffer | | | | PRO | ------------------------------------------------------------------------------------------------------- FD02 | PRIIdentity | | | | PRO | ------------------------------------------------------------------------------------------------------- FD03 | PRISupRange | | | | PRO | ------------------------------------------------------------------------------------------------------- FD04 | CFIActRanges | | | | PRO | ------------------------------------------------------------------------------------------------------- FD0A | NICSerialNumber | | | | PRO | ------------------------------------------------------------------------------------------------------- FD0B | NICIdentity | | | | PRO | ------------------------------------------------------------------------------------------------------- FD0C | MFISupRange | | | | PRO | ------------------------------------------------------------------------------------------------------- FD0D | CFISupRange | | | | PRO | ------------------------------------------------------------------------------------------------------- FD10 | ChannelList | | | | PRO | ------------------------------------------------------------------------------------------------------- FD11 | RegulatoryDomains | | | | PRO | ------------------------------------------------------------------------------------------------------- FD12 | TempType | X | X | dot11TempType | PRO | R ------------------------------------------------------------------------------------------------------- FD13 | CIS | | | | PRO | ------------------------------------------------------------------------------------------------------- FD20 | STAIdentity | | | | PRO | ------------------------------------------------------------------------------------------------------- FD21 | STASupRange | | | | PRO | ------------------------------------------------------------------------------------------------------- FD22 | MFIActRanges | | | | PRO | ------------------------------------------------------------------------------------------------------- FD23 | CFIActRanges | | | | PRO | ------------------------------------------------------------------------------------------------------- FD40 | PortStatus | | | | PRO | ------------------------------------------------------------------------------------------------------- FD41 | CurrentSSID | | | | PRO | ------------------------------------------------------------------------------------------------------- FD42 | CurrentBSSID | | | | PRO | ------------------------------------------------------------------------------------------------------- FD43 | CommsQuality | | | | PRO | ------------------------------------------------------------------------------------------------------- FD44 | CurrentTxRate | | | | PRO | ------------------------------------------------------------------------------------------------------- FD45 | CurrentBeaconInterva | X | X | dot11BeaconPeriod | PRO | R/W ------------------------------------------------------------------------------------------------------- FD46 | CurrentScaleThreshol | | | | PRO | ------------------------------------------------------------------------------------------------------- FD47 | ProtocolRspTime | X | X | dot11AssociationResponseTimeOut | PRO | R ------------------------------------------------------------------------------------------------------- FD48 | ShortRetryLimit | X | X | dot11ShortRetryLimit | PRO | R ------------------------------------------------------------------------------------------------------- FD49 | LongRetryLimit | X | X | dot11LongRetryLimit | PRO | R ------------------------------------------------------------------------------------------------------- FD4A | MaxTransmitLifetime | | | dot11MaxTransmitMSDULifetime | PRO | R ------------------------------------------------------------------------------------------------------- FD4B | MaxReceiveLifetime | | | dot11MaxReceiveLifetime | PRO | R ------------------------------------------------------------------------------------------------------- FD4C | CFPollable | X | | dot11CFPollable | PRO | R ------------------------------------------------------------------------------------------------------- FD4D | AuthenticationAlgori | X | X | dot11AuthenticationAlgorithm1 | PRO | R/W ------------------------------------------------------------------------------------------------------- FD4D | AuthenticationAlgori | X | X | dot11AuthenticationAlgorithmsEnable1 | PRO | R/W ------------------------------------------------------------------------------------------------------- FD4F | PrivacyOptionImpleme | | | dot11PrivacyOptionImplemented | PRO | R ------------------------------------------------------------------------------------------------------- FD80 | CurrentTxRate1 | | | | PRO | ------------------------------------------------------------------------------------------------------- FD81 | CurrentTxRate2 | | | | PRO | ------------------------------------------------------------------------------------------------------- FD82 | CurrentTxRate3 | | | | PRO | ------------------------------------------------------------------------------------------------------- FD83 | CurrentTxRate4 | | | | PRO | ------------------------------------------------------------------------------------------------------- FD84 | CurrentTxRate5 | | | | PRO | ------------------------------------------------------------------------------------------------------- FD85 | CurrentTxRate6 | | | | PRO | ------------------------------------------------------------------------------------------------------- FD86 | OwnMACAddress | | X | dot11MACAddress | PRO | R/W ------------------------------------------------------------------------------------------------------- FD87 | PCFInfo | | X | dot11CFPMaxDuration | PRO | R ------------------------------------------------------------------------------------------------------- FD87 | PCFInfo | | X | dot11CFPPeriod | PRO | R ------------------------------------------------------------------------------------------------------- FD87 | PCFInfo | | X | dot11MediumOccupancyLimit | PRO | R ------------------------------------------------------------------------------------------------------- FDC0 | PHYType | X | X | dot11PHYType | PRO | R ------------------------------------------------------------------------------------------------------- FDC1 | CurrentChannel | X | X | dot11CurrentChannel | PRO | R ------------------------------------------------------------------------------------------------------- FDC2 | CurrentPowerState | | | | PRO | ------------------------------------------------------------------------------------------------------- FDC3 | CCAMode | X | X | dot11CurrentCCAMode | PRO | R ------------------------------------------------------------------------------------------------------- FDC6 | SupportedDataRates | | | | PRO | ------------------------------------------------------------------------------------------------------- linux-wlan-ng-0.2.9+dfsg/doc/prism2/ridlist-mib.html0000644000175000017500000016031711024763202021626 0ustar tormodtormod 802.11 to PRISM2 RID Mapping List

doc/prism2/ridlist-mib.html
Copyright (C) 2000 AbsoluteValue Systems, Inc. All Rights Reserved.


API - The document source for this RID is the API Enhancements Document


PRO - The document source for this RID is the CW10 Programmer's Manual


[1] - read mode is implemented internally within the driver


[2] - This RID is implemented internally in the driver during implementation of the Group Addresses RID (0xFC80)


[3] - This RID is implemented internally in the driver


PRISM2
RID
VALUE
PRISM2
RID
NAME
STA AP 802.11 MibItem Name Doc
Src
Implemented?
F200 LinkStatus
   
   
   
API
   
F201 AssociationStatus
   
   
   
API
   
F202 AuthenticationRequest
   
   
   
API
   
F203 PowerSaveUserCount
   
   
   
API
   
FC29 cnfWEPKeyMappingTable
   
   
   
API
   
FC2A cnfAuthentication
   
   
   
API
   
FC2B cnfMaxAssociatedStations
   
   
   
API
   
FC2C cnfTxControl
   
   
   
API
   
FC2D cnfRoamingMode
   
   
   
API
   
FC2E cnfHostAuthentication
   
   
   
API
   
FC30 cnfRcvCrcError
   
   
   
API
   
FC31 cnfMMLife
   
   
   
API
   
FC32 cnfAltRetryCnt
   
   
   
API
   
FC33 cnfBeaconInterval
   
   
   
API
   
FC34 cnfAPPCFInfo
   
   
   
API
   
FC35 cnfSTAPCFInfo
   
   
   
API
   
FC9E TxRateControl0
   
   
   
API
   
FC9F TxRateControl1
   
   
   
API
   
FCA0 TxRateControl2
   
   
   
API
   
FCA1 TxRateControl3
   
   
   
API
   
FCA2 TxRateControl4
   
   
   
API
   
FCA3 TxRateControl5
   
   
   
API
   
FCA4 TxRateControl6
   
   
   
API
   
FCB0 cnfShortPreamble
   
   
   
API
   
FCB1 cnfExcludeLongPreamble
   
   
   
API
   
FCB3 cnfBasicRates
   
   
   
API
   
FCE1 ScanRequest
   
   
   
API
   
FCE2 JoinRequest
   
   
   
API
   
FCE3 authenticateStation
   
   
   
API
   
FCE4 ChannelInfoRequest
   
   
   
API
   
F101 ScanResults
   
   
   
PRO
   
F102 ChannelInfoResults
   
   
   
PRO
   
FC00 cnfPortType
   
   
   
PRO
   
FC03 cnfOwnChannel
   
   
   
PRO
   
FC04 cnfOwnSSID IBSS
   
   
   
PRO
   
FC05 cnfOwnATIMWindow
   
   
   
PRO
   
FC06 cnfSystemScale
   
   
   
PRO
   
FC07 cnfMaxDataLength
   
   
   
PRO
   
FC08 cnfWDSAddress
   
   
   
PRO
   
FC0A cnfPMEPS
   
   
   
PRO
   
FC0B cnfMulticastReceive
   
   
   
PRO
   
FC0C cnfMaxSleepDuration
   
   
   
PRO
   
FC0D cnfPMHoldoverDuration
   
   
   
PRO
   
FC0E cnfOwnName
   
   
   
PRO
   
FC11 cnfWDSAddress1
   
   
   
PRO
   
FC12 cnfWDSAddress2
   
   
   
PRO
   
FC13 cnfWDSAddress3
   
   
   
PRO
   
FC14 cnfWDSAddress4
   
   
   
PRO
   
FC15 cnfWDSAddress5
   
   
   
PRO
   
FC16 cnfWDSAddress6
   
   
   
PRO
   
FC17 cnfMulticastPMBuffering
   
   
   
PRO
   
FC81 CreateIBSS
   
   
   
PRO
   
FC90 FragmentationThreshold0
   
   
   
PRO
   
FC91 FragmentationThreshold1
   
   
   
PRO
   
FC92 FragmentationThreshold2
   
   
   
PRO
   
FC93 FragmentationThreshold3
   
   
   
PRO
   
FC94 FragmentationThreshold4
   
   
   
PRO
   
FC95 FragmentationThreshold5
   
   
   
PRO
   
FC96 FragmentationThreshold6
   
   
   
PRO
   
FC97 RTSThreshold0
   
   
   
PRO
   
FC98 RTSThreshold1
   
   
   
PRO
   
FC99 RTSThreshold2
   
   
   
PRO
   
FC9A RTSThreshold3
   
   
   
PRO
   
FC9B RTSThreshold4
   
   
   
PRO
   
FC9C RTSThreshold5
   
   
   
PRO
   
FC9D RTSThreshold6
   
   
   
PRO
   
FCB4 cnfSupportedRates
   
   
   
PRO
   
FCE0 TickTime
   
   
   
PRO
   
FD00 MaxLoadTime
   
   
   
PRO
   
FD01 DownloadBuffer
   
   
   
PRO
   
FD02 PRIIdentity
   
   
   
PRO
   
FD03 PRISupRange
   
   
   
PRO
   
FD04 CFIActRanges
   
   
   
PRO
   
FD0A NICSerialNumber
   
   
   
PRO
   
FD0B NICIdentity
   
   
   
PRO
   
FD0C MFISupRange
   
   
   
PRO
   
FD0D CFISupRange
   
   
   
PRO
   
FD10 ChannelList
   
   
   
PRO
   
FD11 RegulatoryDomains
   
   
   
PRO
   
FD13 CIS
   
   
   
PRO
   
FD20 STAIdentity
   
   
   
PRO
   
FD21 STASupRange
   
   
   
PRO
   
FD22 MFIActRanges
   
   
   
PRO
   
FD23 CFIActRanges
   
   
   
PRO
   
FD40 PortStatus
   
   
   
PRO
   
FD41 CurrentSSID
   
   
   
PRO
   
FD42 CurrentBSSID
   
   
   
PRO
   
FD43 CommsQuality
   
   
   
PRO
   
FD44 CurrentTxRate
   
   
   
PRO
   
FD46 CurrentScaleThresholds
   
   
   
PRO
   
FD80 CurrentTxRate1
   
   
   
PRO
   
FD81 CurrentTxRate2
   
   
   
PRO
   
FD82 CurrentTxRate3
   
   
   
PRO
   
FD83 CurrentTxRate4
   
   
   
PRO
   
FD84 CurrentTxRate5
   
   
   
PRO
   
FD85 CurrentTxRate6
   
   
   
PRO
   
FDC2 CurrentPowerState
   
   
   
PRO
   
FDC6 SupportedDataRates
   
   
   
PRO
   
   
   
   
   
dot11ACKFailureCount PRO
   
FC85 PromiscuousMode X
   
dot11Address1-32 PRO R/W [2]
FC80 GroupAddresses X
   
dot11Address10 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address11 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address12 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address13 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address14 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address15 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address16 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address17 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address18 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address19 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address1 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address20 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address21 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address22 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address23 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address24 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address25 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address26 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address27 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address28 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address29 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address2 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address30 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address31 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address32 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address3 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address4 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address5 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address6 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address7 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address8 PRO R/W [1]
FC80 GroupAddresses X
   
dot11Address9 PRO R/W [1]
   
   
   
   
dot11AntennaListIndex PRO
   
FD47 ProtocolRspTime X X dot11AssociationResponseTimeOut PRO R
   
   
   
   
dot11AuthenticateFailStation PRO R [3]
   
   
   
   
dot11AuthenticateFailStatus PRO R [3]
FD4D AuthenticationAlgorithms X X dot11AuthenticationAlgorithm1 PRO R/W
   
   
   
   
dot11AuthenticationAlgorithm2 PRO
   
   
   
   
   
dot11AuthenticationAlgorithm3 PRO
   
   
   
   
   
dot11AuthenticationAlgorithm4 PRO
   
   
   
   
   
dot11AuthenticationAlgorithm5 PRO
   
   
   
   
   
dot11AuthenticationAlgorithm6 PRO
   
FD4D AuthenticationAlgorithms X X dot11AuthenticationAlgorithmsEnable1 PRO R/W
   
   
   
   
dot11AuthenticationAlgorithmsEnable2 PRO
   
   
   
   
   
dot11AuthenticationAlgorithmsEnable3 PRO
   
   
   
   
   
dot11AuthenticationAlgorithmsEnable4 PRO
   
   
   
   
   
dot11AuthenticationAlgorithmsEnable5 PRO
   
   
   
   
   
dot11AuthenticationAlgorithmsEnable6 PRO
   
FCB2 cnfAuthenticationRspTO X
   
dot11AuthenticationResponseTimeOut API R
FD45 CurrentBeaconInterval X X dot11BeaconPeriod PRO R/W
   
   
   
   
dot11CCAModeSupported PRO
   
   
   
   
   
dot11CCAWatchdogCountMax PRO
   
   
   
   
   
dot11CCAWatchdogCountMin PRO
   
   
   
   
   
dot11CCAWatchdogTimerMax PRO
   
   
   
   
   
dot11CCAWatchdogTimerMin PRO
   
FD87 PCFInfo
   
X dot11CFPMaxDuration PRO R
FD87 PCFInfo
   
X dot11CFPPeriod PRO R
FD4C CFPollable X
   
dot11CFPollable PRO R
   
   
   
   
dot11ChannelAgilityEnabled PRO
   
   
   
   
   
dot11ChannelAgilityPresent PRO
   
FDC3 CCAMode X X dot11CurrentCCAMode PRO R
FDC1 CurrentChannel X X dot11CurrentChannel PRO R
   
   
   
   
dot11CurrentChannelNumber PRO
   
   
   
   
   
dot11CurrentDwellTime PRO
   
   
   
   
   
dot11CurrentIndex PRO
   
   
   
   
   
dot11CurrentPattern PRO
   
   
   
   
   
dot11CurrentRegDomain PRO
   
   
   
   
   
dot11CurrentRxAntenna PRO
   
   
   
   
   
dot11CurrentSet PRO
   
   
   
   
   
dot11CurrentTxAntenna PRO
   
   
   
   
   
dot11CurrentTxPowerLevel PRO
   
FC10 cnfOwnDTIMPeriod
   
X dot11DTIMPeriod API R/W
   
   
   
   
dot11DeauthenticateReason PRO R [3]
   
   
   
   
dot11DeauthenticateStation PRO R [3]
   
   
   
   
dot11DesiredBSSType PRO R/W [3]
FC02 cnfDesiredSSID X
   
dot11DesiredSSID PRO R/W
   
   
   
   
dot11DisassociateReason PRO R [3]
   
   
   
   
dot11DisassociateStation PRO R [3]
   
   
   
   
dot11DiversitySelectionRx PRO
   
   
   
   
   
dot11DiversitySupport PRO
   
   
   
   
   
dot11EDThreshold PRO
   
FC28 cnfWEPFlags X X dot11ExcludeUnencrypted API R/W
   
   
   
   
dot11FCSErrorCount PRO
   
   
   
   
   
dot11FailedCount PRO
   
FC82 FragmentationThreshold X
   
dot11FragmentationThreshold PRO R/W
   
   
   
   
dot11FrameDuplicateCount PRO
   
   
   
   
   
dot11HopTime PRO
   
FD49 LongRetryLimit X X dot11LongRetryLimit PRO R
FD86 OwnMACAddress
   
X dot11MACAddress PRO R/W
   
   
   
   
dot11ManufacturerID PRO
   
   
   
   
   
dot11MaxDwellTime PRO
   
FD4B MaxReceiveLifetime
   
   
dot11MaxReceiveLifetime PRO R
FD4A MaxTransmitLifetime
   
   
dot11MaxTransmitMSDULifetime PRO R
FD87 PCFInfo
   
X dot11MediumOccupancyLimit PRO R
   
   
   
   
dot11MulticastReceivedFrameCount PRO
   
   
   
   
   
dot11MulticastTransmittedFrameCount PRO
   
   
   
   
   
dot11MultipleRetryCount PRO
   
   
   
   
   
dot11NumberSupportedPowerLevels PRO
   
FC84 TxRateControl X
   
dot11OperationalRateSet API R/W
   
   
   
   
dot11PBCCOptionImplemented PRO
   
FDC0 PHYType X X dot11PHYType PRO R
FC09 cnfPMEnabled X
   
dot11PowerManagementMode PRO R/W
FC28 cnfWEPFlags X X dot11PrivacyInvoked API R/W
FD4F PrivacyOptionImplemented
   
   
dot11PrivacyOptionImplemented PRO R
   
   
   
   
dot11ProductID PRO
   
   
   
   
   
dot11RTSFailureCount PRO
   
   
   
   
   
dot11RTSSuccessCount PRO
   
FC83 RTSThreshold X
   
dot11RTSThreshold PRO R/W
   
   
   
   
dot11ReceivedFragmentCount PRO
   
   
   
   
   
dot11RegDomainsSupportIndex PRO
   
   
   
   
   
dot11RegDomainsSupportValue PRO
   
   
   
   
   
dot11RetryCount PRO
   
   
   
   
   
dot11ShortPreambleOptionImplemented PRO
   
FD48 ShortRetryLimit X X dot11ShortRetryLimit PRO R
FC01 cnfOwnMACAddress X
   
dot11StationID PRO R/W
   
   
   
   
dot11SupportedDataRatesRxIndex PRO
   
   
   
   
   
dot11SupportedDataRatesRxValue PRO
   
   
   
   
   
dot11SupportedDataRatesTxIndex PRO
   
   
   
   
   
dot11SupportedDataRatesTxValue PRO
   
   
   
   
   
dot11SupportedRxAntenna PRO
   
   
   
   
   
dot11SupportedTxAntenna PRO
   
FD12 TempType X X dot11TempType PRO R
   
   
   
   
dot11TransmittedFragmentCount PRO
   
   
   
   
   
dot11TransmittedFrameCount PRO
   
   
   
   
   
dot11TxPowerLevel1 PRO
   
   
   
   
   
dot11TxPowerLevel2 PRO
   
   
   
   
   
dot11TxPowerLevel3 PRO
   
   
   
   
   
dot11TxPowerLevel4 PRO
   
   
   
   
   
dot11TxPowerLevel5 PRO
   
   
   
   
   
dot11TxPowerLevel6 PRO
   
   
   
   
   
dot11TxPowerLevel7 PRO
   
   
   
   
   
dot11TxPowerLevel8 PRO
   
FC24 cnfDefaultKey0 X X dot11WEPDefaultKey0 API R/W
FC25 cnfDefaultKey1 X X dot11WEPDefaultKey1 API R/W
FC26 cnfDefaultKey2 X X dot11WEPDefaultKey2 API R/W
FC27 cnfDefaultKey3 X X dot11WEPDefaultKey3 API R/W
FC23 cnfWEPDefaultKeyID X X dot11WEPDefaultKeyID API R/W
   
   
   
   
dot11WEPExcludedCount PRO
   
   
   
   
   
dot11WEPICVErrorCount PRO
   
   
   
   
   
dot11WEPKeyMappingAddress PRO
   
   
   
   
   
dot11WEPKeyMappingIndex PRO
   
   
   
   
   
dot11WEPKeyMappingLength PRO
   
   
   
   
   
dot11WEPKeyMappingValue PRO
   
   
   
   
   
dot11WEPKeyMappingWEPOn PRO
   
   
   
   
   
dot11WEPUndecryptableCount PRO
   
linux-wlan-ng-0.2.9+dfsg/doc/config.linux-wlan-ng0000644000175000017500000002406611024763203021175 0ustar tormodtormod* doc/config.linux-wlan-ng * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- 1. Summary This document describes a little more of the detail behind configuring the linux-wlan system. 2. Installed Componenents The linux-wlan-ng package consists of the following components: p80211.o Kernel module for 802.11 services prism2sta_cs.o Kernel module for the Prism2 PCMCIA device driver. wlanctl-ng User-mode utility for sending commands to 802.11 services and MAC-specific drivers. wland User-mode daemon for receiving and handling events from 802.11 services and MAC-specific drivers (not used in this version). /etc/pcmcia/wlan-ng* PCMCIA event and configuration scripts *prism2dl This utility is used for loading firmware images into prism2 cards. DO NOT USE IT! UNLESS YOU KNOW EXACTLY WHAT YOU ARE DOING. This utility has the capability to damage a card in a way that can only be repaired by the manufacturer. When a 'make install' is performed, the modules are copied to the /usr/lib/modules//net and /usr/lib/modules/pcmcia directory, the user-mode utilities are copied to /sbin, and the contents of linux-wlan-ng/etc/pcmcia are copied to the /etc/pcmcia directory. If necessary, the pcmcia config files are altered to include a reference to the wlan-ng.conf file containing the information cardmgr uses to match card CIS information to specific device drivers at card insertion time. NOTE: It is very important that you restart your pcmcia services after installing linux-wlan-ng. cardmgr will not recognize the information in the wlan-ng.conf file until after it has been restarted. 3. Configuration Variables To configure your installation for use, it will probably be necessary to edit the /etc/pcmcia/wlan-ng.opts file. This file contains a collection of variable assignments that are used by the wlan-ng script to intialize your card at insertion time. The variables are broken into groups: ENABLE, DOWNLOAD, USER MIB, WEP, STA, and AP START. Many of the choices involved in choosing configuration variable settings are dependent on whether you are setting up your system as a Station (STA) or an Access Point (AP). STA configuration is most common. If you are using a mobile station that will connect to one or more APs, STA configuration is all you will need. 3.1 ENABLE Group The only variable is this group is: WLAN_ENABLE=y This variable determines whether the card will be intialized, configured for operation, and your protocol stack configured. Generally, you always want this set to 'y'. For some cards, you will set this variable to 'n' when performing card maintenance like firmware upgrades. 3.2 DOWNLOAD Group The DOWNLOAD group contains variables that indicate if code or data needs to be downloaded to the card prior to initialization and normal operation. Currently, this is only required for the Prism2 card when running in AP mode. WLAN_DOWNLOAD=n Set this variable to 'y' if code or data must be downloaded into the card prior to operation. WLAN_DOWNLOADER=/sbin/prism2dl This variable contains the name of the program used to download the code into the card. WLAN_DLIMAGE=/etc/wlan/apfw.hex This variable contains the name of the file you wish to download. 3.3 USER MIB Group There is only one variable in this group, USER_MIBS. You may add your own local MIB item assignments assignments to this variable. The wlan-ng script will loop through the assignments found in this variable and configure the card with each one prior to final configuration and enable. 3.4 WEP Group The variables in the WEP group are used to configure the 802.11 "Wired Equivalent Privacy" element of the MAC if it is supported. The driver is queried for WEP support prior to attempting WEP configuration. If the driver states that WEP is NOT supported, these variables are ignored. Note that you may need to set some of these variables even if you are not using the privacy service. If shared-key authentication is used, the WEP keys must be present. dot11PrivacyInvoked=false Set this variable to "true" to enable the WEP support. lnxreq_hostWEPEncrypt=false lnxreq_hostWEPDecrypt=false Set these to true if you want WEP to be handled by the driver instead of the hardware. The only downside of this is that it takes a bit of CPU time and you lose the ability to handle fragmentation. However, with prism2 cards, you should see a performance boost, and with prism2.5 cards, this may avoid lockups. dot11WEPDefaultKeyID=1 This variable identifies which of the WEP keys is the default key used for all transmits from this station. In some implementations, this can be changed (or rotated) later. dot11ExcludeUnencrypted=true Setting this variable to "true" and dot11PrivacyInvoked to true, has the effect of making WEP completely required for this station (or AP). If set to "true", this STA will discard any received frames that are not encrypted. PRIV_GENERATOR=/sbin/nwepgen Some vendors include "WEP Key Generator" programs as part of their windows or AP implementations. This is purely a convenience to prevent you from having to type in 40 hexadecimal digits. It does not contribute to the secrity of your system at all. In some cases, we've included small programs that generate keys in a manner compatible with the vendor's method. If you wish to use this capability, include the name of the generator program here. PRIV_GENSTR="12345" Every generator implementation we've seen so far uses some kind of 'passphrase' to generate the keys. This variable contains the passphrase. To disable the use of a generator, leave this variable empty. dot11WEPDefaultKey0 dot11WEPDefaultKey1 dot11WEPDefaultKey2 dot11WEPDefaultKey3 If you are configuring your keys by hand, you need to assign these four variables. The format is "xx:xx:xx:xx:xx" and the order of the keys in these variables IS IMPORTANT. Note: If the PRIV_GENSTR variable is not empty, these variables are ignored. 3.5 STA Group Currently, there is only one variable in the STA group. This will change over time. dot11DesiredSSID="WLAN_PRISM2" This variable contains the SSID or "network name" of the wireless network you wish to associate with. 3.6 AP START Group If you have access to the necessary hardware and firmware, this driver can be used to set up a Access Point. To configure for an access point, set the IS_AP variable to 'y'. The following is a quick summary of the other AP configuration variables: APBRIDGEDEVICE=eth0 Defines the ethernet device that will be the 'other' port for bridging 802.11 frames. APSSID="WLAN_PRISM2" Defines the SSID that the AP will use when creating the network. APBCNINT=100 Defines the beacon interval (in Kus) that the AP will use. APDTIMINT=3 Defines the DTIM interval (in beacon intervals). APCFPOLLABLE|APCFPOLLREQ | Description --------------------------- false | false | No point coordination by this AP false | true | AP will point coordinate for delivery only true | false | AP will point coordinate for deliver and polling true | true | Reserved APCFPPERIOD=3 Defines how often the contention free period occurrs (in beacons). APCFPMAXDURATION=100 Defines the maximum length of the contention free period (in Kus). APPROBEDELAY=100 Not used for infrastructure networks, any value is valid. APCHANNEL=6 Channel that the AP will create the network on. Range of valid values depends on you regulatory domain. In the USA and Canada the range is 1-11. In Japan the range is 1-14. APBASICRATES="2 4" A whitespace separated list of data rates in units of 500Kb/s. The basic rate set is the set of rates that stations MUST support to be allowed to join the network. APOPRATES="2 4 11 22" A whitespace separated list of data rates in units of 500Kb/s. The operational rate set is the set of rates that are allowed in the network. It must be a superset of the basic rates above. To complete the configuration of an Access Point, you will need to make sure you have kernel bridging enable in your currently running kernel and have the brcfg utility installed. One version of the brcfg utility can be found at ftp://ftp.absoval.com To start the access point running, make sure the ethernet card is in the system first. Then insert the WLAN card and everything should be configured automatically by the /etc/pcmcia/wlan-ng script. linux-wlan-ng-0.2.9+dfsg/doc/Makefile0000644000175000017500000000402211024763203016734 0ustar tormodtormod# doc/Makefile # # Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. # -------------------------------------------------------------------- # # linux-wlan # # 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. # # 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. # # -------------------------------------------------------------------- # # Inquiries regarding the linux-wlan Open Source project can be # made directly to: # # AbsoluteValue Systems Inc. # info@linux-wlan.com # http://www.linux-wlan.com # # -------------------------------------------------------------------- # # Portions of the development of this software were funded by # Intersil Corporation as part of PRISM(R) chipset product development. # # -------------------------------------------------------------------- -include ../config.mk all: @echo "Nothing to do..." install: @echo "Nothing to do..." clean: rm -f core core.* *.o .*.o *.s *.a .depend tmp_make *~ tags for i in *_obj; do if [ -d $$i ]; then rm -fr $$i; fi; done linux-wlan-ng-0.2.9+dfsg/doc/codingstd/0000755000175000017500000000000011026545443017262 5ustar tormodtormodlinux-wlan-ng-0.2.9+dfsg/doc/codingstd/format.srcfile.c0000644000175000017500000000616711024763203022350 0ustar tormodtormod/* [filename]: [one line description of the file] * * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * -------------------------------------------------------------------- * * linux-wlan * * 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. * * 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. * * -------------------------------------------------------------------- * * Inquiries regarding the linux-wlan Open Source project can be * made directly to: * * AbsoluteValue Systems Inc. * info@linux-wlan.com * http://www.linux-wlan.com * * -------------------------------------------------------------------- * * Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- * * [File Description] * * [Implementation and Usage Notes] * * -------------------------------------------------------------------- */ /*================================================================*/ /* System Includes */ /*================================================================*/ /* Project Includes */ /*================================================================*/ /* Local Constants */ /*================================================================*/ /* Local Macros */ /*================================================================*/ /* Local Types */ /*================================================================*/ /* Local Static Definitions */ /*----------------------------------------------------------------*/ /* --A subsection */ /*================================================================*/ /* Local Function Declarations */ /*---------------------------------------------------------------- * [function name] * * [Description] * * Arguments: * [arglist] * * Returns: * [retlist] * * Side effects: * [desc] * * Call context: * [desc] ----------------------------------------------------------------*/ int afunction(void) { DBFENTER; if ( a ) { prinf("xxx"); } DBFEXIT; return 0; } linux-wlan-ng-0.2.9+dfsg/doc/codingstd/format.srcfile0000644000175000017500000001075711024763203022127 0ustar tormodtormod
/* asource.c: [one line description of file]
*    --------------------------------------------------------------------
*
*   [Project Name]
*
*   [License Statement, eg.
*   The contents of this file are subject to the Mozilla Public
*   License Version 1.0 (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/ ]
*
*   [Warranty Statement, eg.
*   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. ]
*
*   [Author contact, eg.
*   Copyright (C) 1998 AbsoluteValue Software, Inc.  All Rights Reserved.
*
*   Inquiries regarding the linux-wlan Open Source project can be
*   made directly to:
*
*   AbsoluteValue Systems Inc.
*   info@linux-wlan.com
*   http://www.linux-wlan.com ]
*
*   [Change History]
*
*   [Verbose Description]
*
*   [Implementation and usage notes]
*
*   [References]
*
*    --------------------------------------------------------------------
*/

/* Portability/Compatibility header */
#include <wlan/wlan_compat.h>

/* The following prevents "kernel_version" from being set in this file. */
#define __NO_VERSION__

/* Non-project specific includes */
/* PCMCIA headers generated during PCMCIA package installation */
#include <pcmcia/config.h>
#include <pcmcia/k_compat.h>

/* Module related headers, non-module drivers should not include */
#include <linux/version.h>

#include <assert.h>
#include <linux/delay.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/fcntl.h>
#include <linux/interrupt.h>
#include <linux/ptrace.h>
#include <linux/ioport.h>
#include <linux/in.h>
#include <linux/malloc.h>
#include <linux/string.h>
#include <linux/timer.h>
#include <asm/system.h>
#include <asm/bitops.h>
#include <asm/io.h>
#include <linux/errno.h>

/* Project Includes */
#include <wlan/version.h>
#include <wlan/am930mib.h>
#include <wlan/p80211hdr.h>
#include <wlan/p80211mgmt.h>
#include <wlan/wlan_ioctl.h>
#include <wlan/wlan_stable.h>
#include "am930di.h"
#include "am930llc.h"
#include "am930mac.h"
#include "am930hw.h"
#include "am930mgr.h"

/*====================================================================*/
/* Local Constants                                                    */
/*====================================================================*/

#define ACONSTANT    22


/*====================================================================*/
/* Local Types                                                        */
/*====================================================================*/

typdef struct atype
{
    struct atype *next;
    struct atype *prev;
} atype_t;


/*====================================================================*/
/* Static data defined in this file                                   */
/*====================================================================*/

UINT8    wepkey[WLAN_WEP_NKEYS][WLAN_WEP_KEYLEN] =
{
    { 0xf1, 0x10, 0xec, 0xe0, 0xdc },
    { 0x0f, 0xf2, 0x04, 0x09, 0xfb },
    { 0x13, 0x37, 0xf2, 0xf9, 0x2d },
    { 0xe9, 0x17, 0x19, 0x63, 0xc7 }
};


/*====================================================================*/
/* Local Function Declarations                                        */
/*====================================================================*/

static void am930mgr_authen1_rx( am930mgr_t *mgr, wlan_fr_authen_t *f );
static void am930mgr_authen2_rx( am930mgr_t *mgr, wlan_fr_authen_t *f );
static void am930mgr_authen3_rx( am930mgr_t *mgr, wlan_fr_authen_t *f );
static void am930mgr_authen4_rx( am930mgr_t *mgr, wlan_fr_authen_t *f );

/*====================================================================*/
/* Function Definitions                                               */
/*====================================================================*/


/*----------------------------------------------------------------
*    am930mgr_assoc_begin_sta
*
*    Start the station association procedure.  Namely, send an
*    association request frame to the AP.
*
*    returns: nothing for now
----------------------------------------------------------------*/
void am930mgr_assoc_begin_sta(am930mgr_t *mgr)
linux-wlan-ng-0.2.9+dfsg/doc/codingstd/linux.CodingStyle0000644000175000017500000002047411024763203022570 0ustar  tormodtormod
		Linux kernel coding style 

This is a short document describing the preferred coding style for the
linux kernel.  Coding style is very personal, and I won't _force_ my
views on anybody, but this is what goes for anything that I have to be
able to maintain, and I'd prefer it for most other things too.  Please
at least consider the points made here. 

First off, I'd suggest printing out a copy of the GNU coding standards,
and NOT read it.  Burn them, it's a great symbolic gesture. 

Anyway, here goes:


	 	Chapter 1: Indentation

Tabs are 8 characters, and thus indentations are also 8 characters. 
There are heretic movements that try to make indentations 4 (or even 2!)
characters deep, and that is akin to trying to define the value of PI to
be 3. 

Rationale: The whole idea behind indentation is to clearly define where
a block of control starts and ends.  Especially when you've been looking
at your screen for 20 straight hours, you'll find it a lot easier to see
how the indentation works if you have large indentations. 

Now, some people will claim that having 8-character indentations makes
the code move too far to the right, and makes it hard to read on a
80-character terminal screen.  The answer to that is that if you need
more than 3 levels of indentation, you're screwed anyway, and should fix
your program. 

In short, 8-char indents make things easier to read, and have the added
benefit of warning you when you're nesting your functions too deep. 
Heed that warning. 


		Chapter 2: Placing Braces

The other issue that always comes up in C styling is the placement of
braces.  Unlike the indent size, there are few technical reasons to
choose one placement strategy over the other, but the preferred way, as
shown to us by the prophets Kernighan and Ritchie, is to put the opening
brace last on the line, and put the closing brace first, thusly:

	if (x is true) {
		we do y
	}

However, there is one special case, namely functions: they have the
opening brace at the beginning of the next line, thus:

	int function(int x)
	{
		body of function
	}

Heretic people all over the world have claimed that this inconsistency
is ...  well ...  inconsistent, but all right-thinking people know that
(a) K&R are _right_ and (b) K&R are right.  Besides, functions are
special anyway (you can't nest them in C). 

Note that the closing brace is empty on a line of its own, _except_ in
the cases where it is followed by a continuation of the same statement,
ie a "while" in a do-statement or an "else" in an if-statement, like
this:

	do {
		body of do-loop
	} while (condition);

and

	if (x == y) {
		..
	} else if (x > y) {
		...
	} else {
		....
	}
			
Rationale: K&R. 

Also, note that this brace-placement also minimizes the number of empty
(or almost empty) lines, without any loss of readability.  Thus, as the
supply of new-lines on your screen is not a renewable resource (think
25-line terminal screens here), you have more empty lines to put
comments on. 


		Chapter 3: Naming

C is a Spartan language, and so should your naming be.  Unlike Modula-2
and Pascal programmers, C programmers do not use cute names like
ThisVariableIsATemporaryCounter.  A C programmer would call that
variable "tmp", which is much easier to write, and not the least more
difficult to understand. 

HOWEVER, while mixed-case names are frowned upon, descriptive names for
global variables are a must.  To call a global function "foo" is a
shooting offense. 

GLOBAL variables (to be used only if you _really_ need them) need to
have descriptive names, as do global functions.  If you have a function
that counts the number of active users, you should call that
"count_active_users()" or similar, you should _not_ call it "cntusr()". 

Encoding the type of a function into the name (so-called Hungarian
notation) is brain damaged - the compiler knows the types anyway and can
check those, and it only confuses the programmer.  No wonder MicroSoft
makes buggy programs. 

LOCAL variable names should be short, and to the point.  If you have
some random integer loop counter, it should probably be called "i". 
Calling it "loop_counter" is non-productive, if there is no chance of it
being mis-understood.  Similarly, "tmp" can be just about any type of
variable that is used to hold a temporary value. 

If you are afraid to mix up your local variable names, you have another
problem, which is called the function-growth-hormone-imbalance syndrome. 
See next chapter. 

		
		Chapter 4: Functions

Functions should be short and sweet, and do just one thing.  They should
fit on one or two screenfuls of text (the ISO/ANSI screen size is 80x24,
as we all know), and do one thing and do that well. 

The maximum length of a function is inversely proportional to the
complexity and indentation level of that function.  So, if you have a
conceptually simple function that is just one long (but simple)
case-statement, where you have to do lots of small things for a lot of
different cases, it's OK to have a longer function. 

However, if you have a complex function, and you suspect that a
less-than-gifted first-year high-school student might not even
understand what the function is all about, you should adhere to the
maximum limits all the more closely.  Use helper functions with
descriptive names (you can ask the compiler to in-line them if you think
it's performance-critical, and it will probably do a better job of it
that you would have done). 

Another measure of the function is the number of local variables.  They
shouldn't exceed 5-10, or you're doing something wrong.  Re-think the
function, and split it into smaller pieces.  A human brain can
generally easily keep track of about 7 different things, anything more
and it gets confused.  You know you're brilliant, but maybe you'd like
to understand what you did 2 weeks from now. 


		Chapter 5: Commenting

Comments are good, but there is also a danger of over-commenting.  NEVER
try to explain HOW your code works in a comment: it's much better to
write the code so that the _working_ is obvious, and it's a waste of
time to explain badly written code. 

Generally, you want your comments to tell WHAT your code does, not HOW. 
Also, try to avoid putting comments inside a function body: if the
function is so complex that you need to separately comment parts of it,
you should probably go back to chapter 4 for a while.  You can make
small comments to note or warn about something particularly clever (or
ugly), but try to avoid excess.  Instead, put the comments at the head
of the function, telling people what it does, and possibly WHY it does
it. 


		Chapter 6: You've made a mess of it

That's OK, we all do.  You've probably been told by your long-time Unix
user helper that "GNU emacs" automatically formats the C sources for
you, and you've noticed that yes, it does do that, but the defaults it
uses are less than desirable (in fact, they are worse than random
typing - a infinite number of monkeys typing into GNU emacs would never
make a good program). 

So, you can either get rid of GNU emacs, or change it to use saner
values.  To do the latter, you can stick the following in your .emacs file:

(defun linux-c-mode ()
  "C mode with adjusted defaults for use with the Linux kernel."
  (interactive)
  (c-mode)
  (c-set-style "K&R")
  (setq c-basic-offset 8))

This will define the M-x linux-c-mode command.  When hacking on a
module, if you put the string -*- linux-c -*- somewhere on the first
two lines, this mode will be automatically invoked. Also, you may want
to add

(setq auto-mode-alist (cons '("/usr/src/linux.*/.*\\.[ch]$" . linux-c-mode)
                       auto-mode-alist))

to your .emacs file if you want to have linux-c-mode switched on
automagically when you edit source files under /usr/src/linux.

But even if you fail in getting emacs to do sane formatting, not
everything is lost: use "indent".

Now, again, GNU indent has the same brain dead settings that GNU emacs
has, which is why you need to give it a few command line options. 
However, that's not too bad, because even the makers of GNU indent
recognize the authority of K&R (the GNU people aren't evil, they are
just severely misguided in this matter), so you just give indent the
options "-kr -i8" (stands for "K&R, 8 character indents"). 

"indent" has a lot of options, and especially when it comes to comment
re-formatting you may want to take a look at the manual page.  But
remember: "indent" is not a fix for bad programming. 
linux-wlan-ng-0.2.9+dfsg/doc/codingstd/format.hfile0000644000175000017500000001050011024763203021551 0ustar  tormodtormod/* aheader.h: [one line description of the file]
*    --------------------------------------------------------------------
*
*   [Project Name]
*
*   [License Statement, eg.
*   The contents of this file are subject to the Mozilla Public
*   License Version 1.0 (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/ ]
*
*   [Warranty Statement, eg.
*   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. ]
*
*   [Author contact, eg.
*   Copyright (C) 1998 AbsoluteValue Software, Inc.  All Rights Reserved.
*
*   Inquiries regarding the linux-wlan Open Source project can be
*   made directly to:
*
*   AbsoluteValue Systems Inc.
*   info@linux-wlan.com
*   http://www.linux-wlan.com ]
*
*   [Change History]
*
*   [Verbose Description]
*
*   [Implementation and usage notes]
*
*   [References]
*
*    --------------------------------------------------------------------
*/

#ifndef _AHEADER_H
#define _AHEADER_H

/*=============================================================*/
/*------ Constants --------------------------------------------*/

/*--- Fixed memory offsets --------------------------*/
#define SU_OFF_LAST_TXDESC        0x3ec
#define SU_OFF_RSVD1              0x400
#define SU_OFF_BANNER             0x480
#define SU_OFF_CMD_BLK            0x4a0
#define SU_OFF_CNTL_STATUS_BLK    0x4f0
#define SU_OFF_VBM                0x500
#define SU_OFF_BUFFER             0x600

/*--- Global Sizes ----------------------------------*/
#define SU_LEN_BANNER             32



/*=============================================================*/
/*------ Macros -----------------------------------------------*/

/*--- next testing macro (applies to Rx and Tx) -------*/
#define SUTXD_ISLAST(x)            ((x) & BIT31)
#define SURXD_ISLAST(x)            ((x) & BIT31)


/*=============================================================*/
/*------ Types and their related constants --------------------*/

/*--- Last Completed Tx Descriptor Block ---------------*/
__WLAN_PRAGMA_PACK1__
typedef struct am930txcmplt_blk
{
    volatile UINT32    last_bcast    __WLAN_ATTRIB_PACK__;
    volatile UINT32    last_mgmt     __WLAN_ATTRIB_PACK__;
    volatile UINT32    last_data     __WLAN_ATTRIB_PACK__;
    volatile UINT32    last_pspoll   __WLAN_ATTRIB_PACK__;
    volatile UINT32    last_cfpoll   __WLAN_ATTRIB_PACK__;
} am930txcmplt_blk_t;
__WLAN_PRAGMA_PACKDFLT__

#define TXCMPLT_OFF_BCAST     0
#define TXCMPLT_OFF_MGMT      4
#define TXCMPLT_OFF_DATA      8
#define TXCMPLT_OFF_PSPOLL    12
#define TXCMPLT_OFF_CFPOLL    16      

typedef void (*am930hw_scan_callback_t)(void *);

/*=============================================================*/
/*--- Function Declarations -----------------------------------*/
/*=============================================================*/
/* public: */
am930hw_t*    
am930hw_construct(UINT32 irq, UINT32 iobase,
                  UINT32 membase, am930mac_t *mac);

void        
am930hw_destruct(am930hw_t *hw);

int
am930hw_init_rx_tx( am930hw_t *hw );

void
am930hw_ISR( am930hw_t *hw );

UINT32
am930hw_joinbss( am930hw_t *hw, UINT32 ch, UINT32 newBSS, 
                 UINT8 *bssid, wlan_ie_ssid_t *ssid, UINT32 bcn_int,
                 wlan_bss_ts_t ts, UINT32 sutro_ref_time );

UINT32
am930hw_scan( am930hw_t *hw, UINT32 cntl, UINT8 *bssid, 
              UINT32 ch, UINT32 duration,
              am930hw_scan_callback_t cb, void *callback_arg );

UINT32
am930hw_reset( am930hw_t *hw );

/*=============================================================*/
/*--- Inline Function Definitions (if supported) --------------*/
/*=============================================================*/

/*----------------------------------------------------------------
*	am930hw_reset
*
*   Perform reset of am930 part and test for valid operation
*   operation following reset.
*
*	returns: zero on success, non-zero if part fails to come up
*            after reset.
----------------------------------------------------------------*/
__INLINE__ UINT32 am930hw_reset( am930hw_t* hw)
{
	UINT32   result = 0;

	/* perform reset */
	/* test part */
	return result;
}

#endif /* _AHEADER_H */
linux-wlan-ng-0.2.9+dfsg/doc/codingstd/format.srcfile.html0000644000175000017500000002027211024763203023063 0ustar  tormodtormod

    AVS C Source file format


1. C Source file format

The following defines the common C source file format for linux-wlan. Most of the C-code formatting rules come from the linux kernel document CodingStyle.

2. Characters and Code layout

2.1. Character Set

For all source files, we'll stick to the US character set and avoid all trigraphs.

2.2. Indentation

All indentation will be done using tab characters which are mapped to a spacing of eight characters.

2.3. Braces

Braces will be placed according to the format originally established in Kernighan and Ritchie's book "The C Programming Language". Here are some example statements:


for ( i= 0; i < N; i++) {
   .
   .
   .
}

if ( a < b ) {
   .
   .
   .
} else {
   .
   .
   .
}

do {
   .
   .
   .
} while ( i >> 0 );

3. Naming and Definition Conventions

3.1. Preprocessor Elements

All elements defined via the C preprocessor (constants and macros) are named using all capital letters. An exception is for macros that are either wrapping function calls for portability or for macros that are inline replacements for code that would normally be in a function.

3.2. Types

All programmer defined types must have single word type names defined using the

typedef
statement. All type names should be identified with an
_t
suffix. This is particularly important for function pointers that are members of structures or arguments to functions.

Anonymous types are not allowed. All struct, union, and enum types shall be named and typedef'd.

3.3. Variables

The following conventions should be followed for variable declaration and naming:
  • Variables should be named using meaningful names.
  • Avoid variables with static lifetimes.
  • If static lifetime variables must be used, use file scoped static variables and avoid static lifetime variables with visibility beyond file scope.
  • All static lifetime variables should be declared in the "Local Statics" section near the top of a given source file.

3.4. Functions

The following conventions should be followed for function declaration and definition:
  • All functions must be declared above the point where they are called.
  • Any functions that are only intended to be called within a given source file should be declared static within that file.
  • Functions defined within a common source file that are visible across source file boundaries should be named using a prefix that is unique to that source file.

4. File Layout

Each file should be layed out using a common format. The following shows a complete file with all its major sections.

Each major section within the file is begun with a comment of the form:

/*================================================================*/
/* [Section Name] */

Subsections within a major section are denoted using:

/*----------------------------------------------------------------*/
/*  [Subsection Name]  */

/* [filename]: [one line description of the file]
* --------------------------------------------------------------------
*
* [Project Name]
*
* [License Statement]
*
* [Warranty Statement]
*
* [Initial Author Statement]
*   
* --------------------------------------------------------------------
*
* [Initial Author Contact]
*
* --------------------------------------------------------------------
*
* [File Description]
*
* [Implementation and Usage Notes]
*
* --------------------------------------------------------------------
*/

/*================================================================*/
/* System Includes */


/*================================================================*/
/* Project Includes */


/*================================================================*/
/* Local Constants */


/*================================================================*/
/* Local Macros */

/*----------------------------------------------------------------*/
/*  [A subsection]  */

/*================================================================*/
/* Local Types */


/*================================================================*/
/* Local Static Definitions */


/*================================================================*/
/* Local Function Declarations */


/*================================================================*/
/* Function Definitions */

4.1. System Includes Section

Preprocessor #include statements that are including system includes shall be placed in this section. System includes are those include files that are not part of the managed source for this project.

4.2. Project Includes Section

Preprocessor #include statements that are including project includes shall be placed in this section. Project includes are those include files that are a part of the managed source for this project.

4.3. Local Constants Section

Preprocessor "manifest" constants that are local to this file shall be placed in this section. "Manifest" constants are preprocessor macros that take no arguments.

4.4. Local Macros Section

Proprocessor macros that accept arguments shall be placed in this section.

4.5. Local Types Section

Programmer defined types that are only used within the scope of this file shall be defined in this section. Programmer defined types that are used in more than one source file should be defined in a header file.

4.6. Local Static Definitions Section

Variables with static extent that are defined within this file shall be placed in this section. Whether a variable has scope beyond this file will be apparent based on the presence or absence of the static keyword in the declaration. If a variable is declared without the static keyword, there should be an extern declaration for that variable in a header file.

4.6. Local Function Declarations Section

Functions that are only used within this file should be declared (prototyped) in this section. Additionally, these functions should be declared using the static keyword. This avoids polluting the global namespace with function names that need not be extern.

Any functions defined in this file that are called from outside this file should be declared (prototyped) in a header file.

4.6. Function Definitions Section

This section contains the definitions of the functions in this file. Each function (or group of strongly related functions) will be preceded by a function header comment (see below).

5. Comments

5.1. File Header

Each source file will have a header comment containing information about the file as a whole. That comment shall be formatted:

/* [filename]: [one line description of the file]
* --------------------------------------------------------------------
*
* [Project Name]
*
* [License Statement]
*
* [Warranty Statement]
*
* [Initial Author Statement]
*   
* --------------------------------------------------------------------
*
* [Initial Author Contact]
*
* --------------------------------------------------------------------
*
* [File Description]
*
* [Implementation and Usage Notes]
*
* --------------------------------------------------------------------
*/

5.2. Function Header

Each function (or group of closely related functions) will be preceded by a function comment header. The Side effects and Call context sections are optional.

/*----------------------------------------------------------------
* [function name]
*
* [description]
*
* Arguments:
*	[argument list]
*
* Returns: 
*	[return value list]
*
* Side effects:
*	[description of function side effects]
*
* Call context:
*	[description of calling context]
----------------------------------------------------------------*/
linux-wlan-ng-0.2.9+dfsg/doc/rh71notes0000644000175000017500000000334111024763203017054 0ustar tormodtormod[MSM]: Here's an old e-mail. I'm not sure if it's in the list archives so I figured I'd save it here. It may be useful for those using RH71. Date: Wed, 25 Apr 2001 16:03:20 +0800 From: Leonard Ye Reply-To: linux-wlan-user@absoval.com To: linux-wlan-user@absoval.com Subject: [lwlan-user]: REDHAT 7.1 + wlan-ng 0.1.18 HOWTO Hi all, Just get the wlan-ng 0.1.18pre11 working on my redhat 7.1 and I would like to share the experiences with you. Assumption: a default installation of redhat 7.1 with kernel-pcmcia-cs-3.1.24-2.rpm installed Four steps as followings: 1) Get kernel source ready install kernel-source-2.4.2-2 if you don't have the kernel source ready on the machine copy a suitable configuration file from the configs directory to .config make dep 2) Get pcmcia-cs header files ready download the pcmcia-cs-3.1.24.tar.gz package unzip it at appropriate place make config when you were asked what kind of kernel configuration you want to use, select "1" make all DON'T "make install" 3) compile the wlan-ng-0.1.18pre11 code download the linux-wlan-ng-0.1.18pre11.tar.gz unzip it at appropriate place make config select build-in kernel support make all make install 4) some minor configuration edit /etc/pcmcia/config.opts to comment out the card definition for "Intersil PRISM2 11 .." edit /etc/wlan-ng.opts change string p2RoamingMode to p2CnfRoamingMode set appropriate SSID for variable DesiredSSID create an ifcfg-wlan0 file in /etc/sysconfig/network-scripts Ok, your machine should be able to work as a STA using wlan-ng-0.1.18pre11. If you have experience with enabling AP mode, it shouldn't be a problem for you enable it in redhat 7.1 Regards, Leonard Ye linux-wlan-ng-0.2.9+dfsg/doc/impnotes/0000755000175000017500000000000011026545443017142 5ustar tormodtormodlinux-wlan-ng-0.2.9+dfsg/doc/impnotes/l8s_uses.obj0000644000175000017500000002103711024763203021400 0ustar tormodtormod%TGIF 4.1.16 state(0,37,100.000,0,0,0,4,1,9,1,1,0,0,1,0,1,0,'Courier',0,69120,0,0,0,10,0,0,1,1,0,16,0,0,1,1,1,1,1088,1408,1,0,2880,0). % % @(#)$Header$ % %W% % unit("1 pixel/pixel"). color_info(11,65535,0,[ "magenta", 65535, 0, 65535, 65535, 0, 65535, 1, "red", 65535, 0, 0, 65535, 0, 0, 1, "green", 0, 65535, 0, 0, 65535, 0, 1, "blue", 0, 0, 65535, 0, 0, 65535, 1, "yellow", 65535, 65535, 0, 65535, 65535, 0, 1, "pink", 65535, 49344, 52171, 65535, 49344, 52171, 1, "cyan", 0, 65535, 65535, 0, 65535, 65535, 1, "CadetBlue", 24415, 40606, 41120, 24415, 40606, 41120, 1, "white", 65535, 65535, 65535, 65535, 65535, 65535, 1, "black", 0, 0, 0, 0, 0, 0, 1, "DarkSlateGray", 12079, 20303, 20303, 12079, 20303, 20303, 1 ]). script_frac("0.6"). fg_bg_colors('black','white'). page(1,"",1,''). box('black','',88,172,632,532,0,2,1,0,0,0,0,0,0,'2',0,[ ]). text('black',580,149,1,0,1,21,14,1,11,3,0,0,0,0,2,21,14,0,0,"",0,0,0,0,160,'',[ minilines(21,14,0,0,0,0,0,[ mini_line(21,11,3,0,0,0,[ str_block(0,21,11,3,0,-1,0,0,0,[ str_seg('black','Courier',0,69120,21,11,3,0,-1,0,0,0,0,0, "L8S")]) ]) ])]). box('black','',108,188,292,312,0,1,1,3,0,0,0,0,0,'1',0,[ ]). box('black','',108,384,292,520,0,1,1,4,0,0,0,0,0,'1',0,[ ]). box('black','',308,316,472,380,0,1,1,5,0,0,0,0,0,'1',0,[ ]). box('black','',340,432,448,512,0,1,1,6,0,0,0,0,0,'1',0,[ ]). box('black','',500,432,620,516,0,1,1,7,0,0,0,0,0,'1',0,[ ]). box('black','',332,188,464,252,0,1,1,8,0,0,0,0,0,'1',0,[ ]). box('black','',508,196,620,272,0,1,1,9,0,0,0,0,0,'1',0,[ ]). poly('black','',2,[ 144,312,144,384],1,1,1,10,0,0,0,0,0,0,0,'1',0,0, "0","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]). poly('black','',2,[ 244,384,244,312],1,1,1,11,0,0,0,0,0,0,0,'1',0,0, "0","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]). poly('black','',3,[ 292,400,320,400,320,380],1,1,1,12,0,0,0,0,0,0,0,'1',0,0, "0","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]). poly('black','',3,[ 292,408,424,408,424,380],1,1,1,13,0,0,0,0,0,0,0,'1',0,0, "0","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]). poly('black','',3,[ 292,300,320,300,320,316],1,1,1,25,0,0,0,0,0,0,0,'1',0,0, "0","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]). poly('black','',3,[ 292,292,424,292,424,316],1,1,1,26,0,0,0,0,0,0,0,'1',0,0, "0","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]). poly('black','',2,[ 388,316,388,380],0,1,1,27,0,0,5,0,0,0,0,'1',0,0, "0","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]). poly('black','',2,[ 608,432,608,272],1,1,1,30,0,0,0,0,0,0,0,'1',0,0, "0","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]). poly('black','',6,[ 456,252,456,268,488,268,488,300,560,300,560,432],1,1,1,32,0,0,0,0,0,0,0,'1',0,0, "00","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]). poly('black','',6,[ 536,432,536,312,476,312,476,280,440,280,440,252],1,1,1,33,0,0,0,0,0,0,0,'1',0,0, "00","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]). poly('black','',2,[ 508,220,464,220],1,1,1,34,0,0,0,0,0,0,0,'1',0,0, "0","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]). poly('black','',2,[ 372,380,372,432],1,1,1,35,0,0,0,0,0,0,0,'1',0,0, "0","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]). poly('black','',2,[ 148,132,148,188],1,1,1,36,0,0,0,0,0,0,0,'1',0,0, "0","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]). poly('black','',2,[ 244,188,244,128],1,1,1,37,0,0,0,0,0,0,0,'1',0,0, "0","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]). poly('black','',2,[ 140,520,140,580],1,1,1,38,0,0,0,0,0,0,0,'1',0,0, "0","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]). poly('black','',2,[ 244,580,244,520],1,1,1,39,0,0,0,0,0,0,0,'1',0,0, "0","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]). poly('black','',2,[ 388,572,388,512],1,1,1,40,0,0,0,0,0,0,0,'1',0,0, "0","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]). poly('black','',4,[ 468,568,468,408,448,408,448,380],1,1,1,41,0,0,0,0,0,0,0,'1',0,0, "0","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]). text('black',148,209,2,0,1,112,28,46,11,3,0,0,0,0,2,112,28,0,0,"",0,0,0,0,220,'',[ minilines(112,28,0,0,0,0,0,[ mini_line(98,11,3,0,0,0,[ str_block(0,98,11,3,0,0,0,0,0,[ str_seg('black','Courier',0,69120,98,11,3,0,0,0,0,0,0,0, "Kernel Network")]) ]), mini_line(112,11,3,0,0,0,[ str_block(0,112,11,3,0,-1,0,0,0,[ str_seg('black','Courier',0,69120,112,11,3,0,-1,0,0,0,0,0, "Device Interface")]) ]) ])]). text('black',144,429,2,0,1,112,28,48,11,3,0,0,0,0,2,112,28,0,0,"",0,0,0,0,440,'',[ minilines(112,28,0,0,0,0,0,[ mini_line(98,11,3,0,0,0,[ str_block(0,98,11,3,0,0,0,0,0,[ str_seg('black','Courier',0,69120,98,11,3,0,0,0,0,0,0,0, "p80211 Network")]) ]), mini_line(112,11,3,0,0,0,[ str_block(0,112,11,3,0,-1,0,0,0,[ str_seg('black','Courier',0,69120,112,11,3,0,-1,0,0,0,0,0, "Device Interface")]) ]) ])]). text('black',320,325,2,0,1,49,28,50,11,3,0,0,0,0,2,49,28,0,0,"",0,0,0,0,336,'',[ minilines(49,28,0,0,0,0,0,[ mini_line(35,11,3,0,0,0,[ str_block(0,35,11,3,0,-1,0,0,0,[ str_seg('black','Courier',0,69120,35,11,3,0,-1,0,0,0,0,0, "Frame")]) ]), mini_line(49,11,3,0,0,0,[ str_block(0,49,11,3,0,0,0,0,0,[ str_seg('black','Courier',0,69120,49,11,3,0,0,0,0,0,0,0, "Convert")]) ]) ])]). text('black',404,329,2,0,1,42,28,54,11,3,0,0,0,0,2,42,28,0,0,"",0,0,0,0,340,'',[ minilines(42,28,0,0,0,0,0,[ mini_line(42,11,3,0,0,0,[ str_block(0,42,11,3,0,0,0,0,0,[ str_seg('black','Courier',0,69120,42,11,3,0,0,0,0,0,0,0, "Packet")]) ]), mini_line(42,11,3,0,0,0,[ str_block(0,42,11,3,0,-1,0,0,0,[ str_seg('black','Courier',0,69120,42,11,3,0,-1,0,0,0,0,0, "Buffer")]) ]) ])]). text('black',364,197,2,0,1,63,28,56,11,3,0,0,0,0,2,63,28,0,0,"",0,0,0,0,208,'',[ minilines(63,28,0,0,0,0,0,[ mini_line(49,11,3,0,0,0,[ str_block(0,49,11,3,0,0,0,0,0,[ str_seg('black','Courier',0,69120,49,11,3,0,0,0,0,0,0,0, "Request")]) ]), mini_line(63,11,3,0,0,0,[ str_block(0,63,11,3,0,-1,0,0,0,[ str_seg('black','Courier',0,69120,63,11,3,0,-1,0,0,0,0,0, "Interface")]) ]) ])]). text('black',532,209,2,0,1,70,28,58,11,3,0,0,0,0,2,70,28,0,0,"",0,0,0,0,220,'',[ minilines(70,28,0,0,0,0,0,[ mini_line(70,11,3,0,0,0,[ str_block(0,70,11,3,0,0,0,0,0,[ str_seg('black','Courier',0,69120,70,11,3,0,0,0,0,0,0,0, "Indication")]) ]), mini_line(63,11,3,0,0,0,[ str_block(0,63,11,3,0,-1,0,0,0,[ str_seg('black','Courier',0,69120,63,11,3,0,-1,0,0,0,0,0, "Interface")]) ]) ])]). text('black',524,449,3,0,1,70,42,60,11,3,0,0,0,0,2,70,42,0,0,"",0,0,0,0,460,'',[ minilines(70,42,0,0,0,0,0,[ mini_line(21,11,3,0,0,0,[ str_block(0,21,11,3,0,-1,0,0,0,[ str_seg('black','Courier',0,69120,21,11,3,0,-1,0,0,0,0,0, "MAC")]) ]), mini_line(70,11,3,0,0,0,[ str_block(0,70,11,3,0,0,0,0,0,[ str_seg('black','Courier',0,69120,70,11,3,0,0,0,0,0,0,0, "Management")]) ]), mini_line(63,11,3,0,0,0,[ str_block(0,63,11,3,0,-1,0,0,0,[ str_seg('black','Courier',0,69120,63,11,3,0,-1,0,0,0,0,0, "Interface")]) ]) ])]). text('black',360,449,3,0,1,77,42,62,11,3,0,0,0,0,2,77,42,0,0,"",0,0,0,0,460,'',[ minilines(77,42,0,0,0,0,0,[ mini_line(35,11,3,0,0,0,[ str_block(0,35,11,3,0,-1,0,0,0,[ str_seg('black','Courier',0,69120,35,11,3,0,-1,0,0,0,0,0, "Frame")]) ]), mini_line(77,11,3,0,0,0,[ str_block(0,77,11,3,0,0,0,0,0,[ str_seg('black','Courier',0,69120,77,11,3,0,0,0,0,0,0,0, "Construct &")]) ]), mini_line(35,11,3,0,0,0,[ str_block(0,35,11,3,0,-1,0,0,0,[ str_seg('black','Courier',0,69120,35,11,3,0,-1,0,0,0,0,0, "Parse")]) ]) ])]). poly('black','',2,[ 544,516,544,576],1,1,1,66,0,0,0,0,0,0,0,'1',0,0, "0","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]). poly('black','',2,[ 596,576,596,516],1,1,1,67,0,0,0,0,0,0,0,'1',0,0, "0","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]). text('black',68,41,4,0,1,259,56,68,11,3,0,0,0,0,2,259,56,0,0,"",0,0,0,0,52,'',[ minilines(259,56,0,0,0,0,0,[ mini_line(175,11,3,0,0,0,[ str_block(0,175,11,3,0,-2,0,0,0,[ str_seg('black','Courier',0,69120,175,11,3,0,-2,0,0,0,0,0, "doc/impnotes/l8s_uses.obj")]) ]), mini_line(259,11,3,0,0,0,[ str_block(0,259,11,3,0,-1,0,0,0,[ str_seg('black','Courier',0,69120,259,11,3,0,-1,0,0,0,0,0, "L8S Internal/External Using Relations")]) ]), mini_line(56,11,3,0,0,0,[ str_block(0,56,11,3,0,-1,0,0,0,[ str_seg('black','Courier',0,69120,56,11,3,0,-1,0,0,0,0,0, "11/14/99")]) ]), mini_line(154,11,3,0,0,0,[ str_block(0,154,11,3,0,-3,0,0,0,[ str_seg('black','Courier',0,69120,154,11,3,0,-3,0,0,0,0,0, "Arrows indicate 'uses'")]) ]) ])]). poly('black','',2,[ 536,196,536,128],1,1,1,70,0,0,0,0,0,0,0,'1',0,0, "0","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]). poly('black','',2,[ 292,200,332,200],1,1,1,71,0,0,0,0,0,0,0,'1',0,0, "0","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]). linux-wlan-ng-0.2.9+dfsg/doc/impnotes/structptr.obj0000644000175000017500000002003211024763203021677 0ustar tormodtormod%TGIF 4.1.16 state(0,37,100.000,0,0,0,4,1,9,1,1,1,0,1,0,1,0,'Courier',0,69120,0,0,0,10,0,0,1,1,0,16,0,0,1,1,1,1,1088,1408,1,0,2880,0). % % @(#)$Header$ % %W% % unit("1 pixel/pixel"). color_info(11,65535,0,[ "magenta", 65535, 0, 65535, 65535, 0, 65535, 1, "red", 65535, 0, 0, 65535, 0, 0, 1, "green", 0, 65535, 0, 0, 65535, 0, 1, "blue", 0, 0, 65535, 0, 0, 65535, 1, "yellow", 65535, 65535, 0, 65535, 65535, 0, 1, "pink", 65535, 49344, 52171, 65535, 49344, 52171, 1, "cyan", 0, 65535, 65535, 0, 65535, 65535, 1, "CadetBlue", 24415, 40606, 41120, 24415, 40606, 41120, 1, "white", 65535, 65535, 65535, 65535, 65535, 65535, 1, "black", 0, 0, 0, 0, 0, 0, 1, "DarkSlateGray", 12079, 20303, 20303, 12079, 20303, 20303, 1 ]). script_frac("0.6"). fg_bg_colors('black','white'). page(1,"",1,''). text('black',32,3,2,0,1,153,32,0,13,3,0,0,0,0,2,153,32,0,0,"",0,0,0,0,16,'',[ minilines(153,32,0,0,0,0,0,[ mini_line(153,13,3,0,0,0,[ str_block(0,153,13,3,0,-3,0,0,0,[ str_seg('black','Courier',0,80640,153,13,3,0,-3,0,0,0,0,0, "doc/structptr.obj")]) ]), mini_line(72,13,3,0,0,0,[ str_block(0,72,13,3,0,-2,0,0,0,[ str_seg('black','Courier',0,80640,72,13,3,0,-2,0,0,0,0,0, "11/14/99")]) ]) ])]). text('black',76,81,1,0,1,175,14,4,11,3,0,0,0,0,2,175,14,0,0,"",0,0,0,0,92,'',[ minilines(175,14,0,0,0,0,0,[ mini_line(175,11,3,0,0,0,[ str_block(0,175,11,3,0,-3,0,0,0,[ str_seg('black','Courier',0,69120,175,11,3,0,-3,0,0,0,0,0, "dev_link_t (from pcmcia)")]) ]) ])]). box('black','',76,100,236,180,0,2,1,6,0,0,0,0,0,'2',0,[ ]). text('black',84,105,1,0,1,119,14,10,11,3,0,0,0,0,2,119,14,0,0,"",0,0,0,0,116,'',[ minilines(119,14,0,0,0,0,0,[ mini_line(119,11,3,0,0,0,[ str_block(0,119,11,3,0,0,0,0,0,[ str_seg('black','Courier',0,69120,119,11,3,0,0,0,0,0,0,0, "dev_node_t *dev")]) ]) ])]). text('black',84,161,1,0,1,126,14,13,11,3,0,0,0,0,2,126,14,0,0,"",0,0,0,0,172,'',[ minilines(126,14,0,0,0,0,0,[ mini_line(126,11,3,0,0,0,[ str_block(0,126,11,3,0,0,0,0,0,[ str_seg('black','Courier',0,69120,126,11,3,0,0,0,0,0,0,0, "void *priv")]) ]) ])]). poly('black','',2,[ 100,124,100,156],0,1,1,16,0,0,5,0,0,0,0,'1',0,0, "0","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]). text('black',216,5,3,0,1,294,42,31,11,3,0,0,0,0,2,294,42,0,0,"",0,0,0,0,16,'',[ minilines(294,42,0,0,0,0,0,[ mini_line(273,11,3,0,0,0,[ str_block(0,273,11,3,0,-1,0,0,0,[ str_seg('black','Courier',0,69120,273,11,3,0,-1,0,0,0,0,0, "Shows the links established between the")]) ]), mini_line(294,11,3,0,0,0,[ str_block(0,294,11,3,0,-1,0,0,0,[ str_seg('black','Courier',0,69120,294,11,3,0,-1,0,0,0,0,0, "netdevice, wlandevice, pcmcia, and private")]) ]), mini_line(238,11,3,0,0,0,[ str_block(0,238,11,3,0,-4,0,0,0,[ str_seg('black','Courier',0,69120,238,11,3,0,-4,0,0,0,0,0, "structures at initialization time.")]) ]) ])]). box('black','',76,268,236,372,0,2,1,33,0,0,0,0,0,'2',0,[ ]). text('black',84,273,1,0,1,126,14,40,11,3,0,0,0,0,2,126,14,0,0,"",0,0,0,0,284,'',[ minilines(126,14,0,0,0,0,0,[ mini_line(126,11,3,0,0,0,[ str_block(0,126,11,3,0,-1,0,0,0,[ str_seg('black','Courier',0,69120,126,11,3,0,-1,0,0,0,0,0, "char *name")]) ]) ])]). text('black',76,249,1,0,1,161,14,42,11,3,0,0,0,0,2,161,14,0,0,"",0,0,0,0,260,'',[ minilines(161,14,0,0,0,0,0,[ mini_line(161,11,3,0,0,0,[ str_block(0,161,11,3,0,-3,0,0,0,[ str_seg('black','Courier',0,69120,161,11,3,0,-3,0,0,0,0,0, "wlandevice_t (from L8S)")]) ]) ])]). text('black',84,337,1,0,1,126,14,45,11,3,0,0,0,0,2,126,14,0,0,"",0,0,0,0,348,'',[ minilines(126,14,0,0,0,0,0,[ mini_line(126,11,3,0,0,0,[ str_block(0,126,11,3,0,0,0,0,0,[ str_seg('black','Courier',0,69120,126,11,3,0,0,0,0,0,0,0, "void *priv")]) ]) ])]). text('black',84,353,1,0,1,140,14,46,11,3,0,0,0,0,2,140,14,0,0,"",0,0,0,0,364,'',[ minilines(140,14,0,0,0,0,0,[ mini_line(140,11,3,0,0,0,[ str_block(0,140,11,3,0,0,0,0,0,[ str_seg('black','Courier',0,69120,140,11,3,0,0,0,0,0,0,0, "netdevice_t *netdev")]) ]) ])]). poly('black','',2,[ 100,292,100,332],0,1,1,53,0,0,5,0,0,0,0,'1',0,0, "0","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]). box('black','',80,460,240,564,0,2,1,61,0,0,0,0,0,'2',0,[ ]). text('black',88,465,1,0,1,126,14,62,11,3,0,0,0,0,2,126,14,0,0,"",0,0,0,0,476,'',[ minilines(126,14,0,0,0,0,0,[ mini_line(126,11,3,0,0,0,[ str_block(0,126,11,3,0,-1,0,0,0,[ str_seg('black','Courier',0,69120,126,11,3,0,-1,0,0,0,0,0, "char *name")]) ]) ])]). text('black',80,417,3,0,1,133,42,63,11,3,0,0,0,0,2,133,42,0,0,"",0,0,0,0,428,'',[ minilines(133,42,0,0,0,0,0,[ mini_line(98,11,3,0,0,0,[ str_block(0,98,11,3,0,-6,0,0,0,[ str_seg('black','Courier',0,69120,98,11,3,0,-6,0,0,0,0,0, "struct device ")]) ]), mini_line(119,11,3,0,0,0,[ str_block(0,119,11,3,0,-3,0,0,0,[ str_seg('black','Courier',0,69120,119,11,3,0,-3,0,0,0,0,0, "(aka netdevice_t)")]) ]), mini_line(133,11,3,0,0,0,[ str_block(0,133,11,3,0,-3,0,0,0,[ str_seg('black','Courier',0,69120,133,11,3,0,-3,0,0,0,0,0, "(from linux kernel)")]) ]) ])]). text('black',88,545,1,0,1,126,14,64,11,3,0,0,0,0,2,126,14,0,0,"",0,0,0,0,556,'',[ minilines(126,14,0,0,0,0,0,[ mini_line(126,11,3,0,0,0,[ str_block(0,126,11,3,0,0,0,0,0,[ str_seg('black','Courier',0,69120,126,11,3,0,0,0,0,0,0,0, "void *priv")]) ]) ])]). poly('black','',2,[ 104,484,104,540],0,1,1,66,0,0,5,0,0,0,0,'1',0,0, "0","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]). box('black','',352,172,516,340,0,2,1,75,0,0,0,0,0,'2',0,[ ]). text('black',356,153,1,0,1,140,14,77,11,3,0,0,0,0,2,140,14,0,0,"",0,0,0,0,164,'',[ minilines(140,14,0,0,0,0,0,[ mini_line(140,11,3,0,0,0,[ str_block(0,140,11,3,0,-3,0,0,0,[ str_seg('black','Courier',0,69120,140,11,3,0,-3,0,0,0,0,0, "devpriv_t (from MSD)")]) ]) ])]). text('black',364,321,1,0,1,140,14,78,11,3,0,0,0,0,2,140,14,0,0,"",0,0,0,0,332,'',[ minilines(140,14,0,0,0,0,0,[ mini_line(140,11,3,0,0,0,[ str_block(0,140,11,3,0,0,0,0,0,[ str_seg('black','Courier',0,69120,140,11,3,0,0,0,0,0,0,0, "dev_link_t *link")]) ]) ])]). poly('black','',2,[ 388,276,388,316],0,1,1,79,0,0,5,0,0,0,0,'1',0,0, "0","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]). text('black',364,177,2,0,1,133,28,88,11,3,0,0,0,0,2,133,28,0,0,"",0,0,0,0,188,'',[ minilines(133,28,0,0,0,0,0,[ mini_line(133,11,3,0,0,0,[ str_block(0,133,11,3,0,-1,0,0,0,[ str_seg('black','Courier',0,69120,133,11,3,0,-1,0,0,0,0,0, "dev_node_t node")]) ]), mini_line(91,11,3,0,0,0,[ str_block(0,91,11,3,0,-3,0,0,0,[ str_seg('black','Courier',0,69120,91,11,3,0,-3,0,0,0,0,0, "(from pcmcia)")]) ]) ])]). box('black','',364,204,492,268,0,2,1,89,5,0,0,0,0,'2',0,[ ]). text('black',380,209,1,0,1,98,14,90,11,3,0,0,0,0,2,98,14,0,0,"",0,0,0,0,220,'',[ minilines(98,14,0,0,0,0,0,[ mini_line(98,11,3,0,0,0,[ str_block(0,98,11,3,0,-3,0,0,0,[ str_seg('black','Courier',0,69120,98,11,3,0,-3,0,0,0,0,0, "char name[32]")]) ]) ])]). poly('black','',2,[ 388,228,388,260],0,1,1,92,0,0,5,0,0,0,0,'1',0,0, "0","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]). poly('black','',6,[ 216,168,256,168,256,220,60,220,60,268,76,268],1,1,1,116,0,0,0,0,0,0,0,'1',0,0, "00","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]). poly('black','',6,[ 228,360,256,360,256,396,60,396,60,460,80,460],1,1,1,119,0,0,0,0,0,0,0,'1',0,0, "00","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]). poly('black','',4,[ 212,112,332,112,332,204,364,204],1,1,1,121,0,0,0,0,0,0,0,'1',0,0, "0","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]). poly('black','',4,[ 216,280,320,280,320,216,340,216],1,1,1,127,0,0,0,0,0,0,0,'1',0,0, "0","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]). poly('black','',4,[ 216,344,304,344,304,172,352,172],1,1,1,135,0,0,0,0,0,0,0,'1',0,0, "0","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]). poly('black','',6,[ 224,552,260,552,260,592,32,592,32,268,60,268],1,1,1,136,0,0,0,0,0,0,0,'1',0,0, "00","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]). poly('black','',4,[ 220,472,340,472,340,216,376,216],1,1,1,141,0,0,0,0,0,0,0,'1',0,0, "0","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]). poly('black','',6,[ 508,328,536,328,536,64,56,64,56,100,76,100],1,1,1,156,0,0,0,0,0,0,0,'1',0,0, "00","",[ 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ ]).