67 #define __KERNEL_SYSCALLS__
74 #include <linux/module.h>
76 #include <linux/types.h>
77 #include <linux/kernel.h>
91 #include <asm/uaccess.h>
93 #include <linux/netdevice.h>
120 #include <wl_profile.h>
133 #define VALID_PARAM(C) \
137 printk(KERN_INFO "Wireless, parameter error: \"%s\"\n", #C); \
146 #if 0 //SCULL_USE_PROC
157 static p_u16 irq_mask = 0xdeb8;
158 static p_s8 irq_list[4] = { -1 };
161 MODULE_PARM(irq_mask,
"h");
163 MODULE_PARM(irq_list,
"1-4b");
288 #if 1 //;? (HCF_TYPE) & HCF_TYPE_STA
319 #if 1 //;? (HCF_TYPE) & HCF_TYPE_AP
386 p_u32 DebugFlag = ~0;
390 dbg_info_t *DbgInfo = &wl_info;
395 static p_char *useRTS =
"N";
396 MODULE_PARM( useRTS,
"s" );
403 extern struct CFG_RANGE2_STRCT
BASED
406 #if 0 //;? (HCF_TYPE) & HCF_TYPE_AP
410 #if 1 //;? (HCF_TYPE) & HCF_TYPE_STA
421 unsigned long flags = 0;
440 DBG_PARAM( DbgInfo,
"irq_mask",
"0x%04x", irq_mask & 0x0FFFF );
441 DBG_PARAM( DbgInfo,
"irq_list",
"0x%02x 0x%02x 0x%02x 0x%02x",
442 irq_list[0] & 0x0FF, irq_list[1] & 0x0FF,
443 irq_list[2] & 0x0FF, irq_list[3] & 0x0FF );
477 #if 1 //;? (HCF_TYPE) & HCF_TYPE_AP
649 #if 1 //;? (HCF_TYPE) & HCF_TYPE_STA
679 #if 1 //;? (HCF_TYPE) & HCF_TYPE_AP
753 wl_lock( lp, &flags );
771 INIT_LIST_HEAD( &( lp->
txFree ));
783 INIT_LIST_HEAD( &( lp->
txQ[i] ));
793 DBG_TRACE( DbgInfo,
"HERMES 2.5 BUSMASTER DMA MODE\n" );
796 DBG_TRACE( DbgInfo,
"HERMES 2.5 PORT I/O MODE\n" );
806 DBG_TRACE( DbgInfo,
"Calling hcf_connect()...\n" );
811 DBG_ERROR( DbgInfo,
"hcf_connect() failed, status: 0x%x\n", hcf_status );
812 wl_unlock( lp, &flags );
817 lp->driverInfo.IO_address = dev->
base_addr;
819 lp->driverInfo.IRQ_number = dev->
irq;
820 lp->driverInfo.card_stat = lp->hcfCtx.IFB_CardStat;
824 lp->driverIdentity.len = (
sizeof( lp->driverIdentity ) /
sizeof(
hcf_16 )) - 1;
825 lp->driverIdentity.typ = CFG_DRV_IDENTITY;
834 DBG_TRACE( DbgInfo,
"Calling wvlan_go() to perform a card reset...\n" );
835 hcf_status =
wl_go( lp );
838 DBG_ERROR( DbgInfo,
"wl_go() failed\n" );
839 wl_unlock( lp, &flags );
846 #if 0 //;?why was this already commented out in wl_lkm_720
850 DBG_TRACE( DbgInfo,
"Enabling Port 0\n" );
854 DBG_TRACE( DbgInfo,
"Enable port 0 failed: 0x%x\n", hcf_status );
857 #if (HCF_TYPE) & HCF_TYPE_AP
858 DBG_TRACE( DbgInfo,
"Enabling WDS Ports\n" );
866 memcpy( lp->dev->dev_addr, lp->MACAddress, ETH_ALEN );
869 lp->is_registered =
TRUE;
890 if ( lp->useRTS == 1 ) {
891 DBG_TRACE( DbgInfo,
"ENTERING RTS MODE...\n" );
901 wl_unlock( lp, &flags );
903 DBG_TRACE( DbgInfo,
"%s: Wireless, io_addr %#03lx, irq %d, ""mac_address ",
907 printk(
"%02X%c", dev->
dev_addr[i], (( i < ( ETH_ALEN-1 )) ?
':' :
'\n' ));
910 #if 0 //SCULL_USE_PROC
911 create_proc_read_entry(
"wlags", 0,
NULL, scull_read_procmem, dev );
913 proc_write(
"driver/wlags49/wlags49_type",
write_int, &lp->wlags49_type);
924 DBG_ERROR( DbgInfo,
"wl_insert() FAILED\n" );
926 if ( lp->is_registered ==
TRUE ) {
927 lp->is_registered =
FALSE;
985 DBG_ERROR( DbgInfo,
"hcf_connect() failed, status: 0x%x\n", hcf_status );
998 hcf_status =
wl_go( lp );
1000 DBG_ERROR( DbgInfo,
"wl_go() failed, status: 0x%x\n", hcf_status );
1007 DBG_ERROR( DbgInfo,
"Device Base Address INVALID!!!\n" );
1045 DBG_TRACE( DbgInfo,
"Disable port 0 failed: 0x%x\n", hcf_status );
1047 while (( hcf_status !=
HCF_SUCCESS ) && (retries < 10)) {
1052 DBG_TRACE( DbgInfo,
"Disable port 0 succes : %d retries\n", retries );
1054 DBG_TRACE( DbgInfo,
"Disable port 0 failed after: %d retries\n", retries );
1058 #if 1 //;? (HCF_TYPE) & HCF_TYPE_AP
1080 if ( file_desc == -1 ) {
1081 DBG_ERROR( DbgInfo,
"No image file found\n" );
1083 DBG_TRACE( DbgInfo,
"F/W image file found\n" );
1084 #define DHF_ALLOC_SIZE 96000 //just below 96K, let's hope it suffices for now and for the future
1085 cp = (
char*)
vmalloc( DHF_ALLOC_SIZE );
1087 DBG_ERROR( DbgInfo,
"error in vmalloc\n" );
1089 rc =
read( file_desc, cp, DHF_ALLOC_SIZE );
1090 if ( rc == DHF_ALLOC_SIZE ) {
1091 DBG_ERROR( DbgInfo,
"buffer too small, %d\n", DHF_ALLOC_SIZE );
1092 }
else if ( rc > 0 ) {
1093 DBG_TRACE( DbgInfo,
"read O.K.: %d bytes %.12s\n", rc, cp );
1094 rc =
read( file_desc, &cp[rc], 1 );
1096 DBG_TRACE( DbgInfo,
"no more to read\n" );
1100 DBG_ERROR( DbgInfo,
"file not read in one swoop or other error"\
1101 ", give up, too complicated, rc = %0X\n", rc );
1102 DBG_ERROR( DbgInfo,
"still have to change code to get a real download now !!!!!!!!\n" );
1104 DBG_TRACE( DbgInfo,
"before dhf_download_binary\n" );
1106 DBG_TRACE( DbgInfo,
"after dhf_download_binary, before dhf_download_fw\n" );
1109 DBG_TRACE( DbgInfo,
"after dhf_download_fw\n" );
1132 DBG_TRACE( DbgInfo,
"Downloading STA firmware...\n" );
1137 DBG_ERROR( DbgInfo,
"Firmware Download failed\n" );
1145 DBG_TRACE( DbgInfo,
"downloaded station F/W\n" );
1147 DBG_TRACE( DbgInfo,
"downloaded AP F/W\n" );
1149 DBG_ERROR( DbgInfo,
"unknown F/W type\n" );
1160 DBG_TRACE( DbgInfo,
"ComponentID:%04x variant:%04x major:%04x minor:%04x\n",
1176 DBG_ERROR( DbgInfo,
"Could not retrieve MAC address\n" );
1227 DBG_PARAM( DbgInfo,
"lp",
"%s (0x%p)", lp->
dev->name, lp );
1249 for( count = 0; count <
MAX_KEYS; count++ ) {
1257 for( count = 0; count <
MAX_KEYS; count++ ) {
1295 DBG_PARAM( DbgInfo,
"lp",
"%s (0x%p)", lp->
dev->name, lp );
1308 DBG_ERROR( DbgInfo,
"Disconnect failed\n" );
1314 DBG_ERROR( DbgInfo,
"Disable failed\n" );
1364 CFG_RID_LOG_STRCT *RidLog;
1369 DBG_ERROR( DbgInfo,
"lp pointer is NULL\n" );
1391 DBG_TRACE( DbgInfo,
"CFG_CNTL_OPT : 0x%04x\n",
1393 DBG_TRACE( DbgInfo,
"CFG_CNTL_OPT result : 0x%04x\n",
1427 RidLog = (CFG_RID_LOG_STRCT *)&lp->
ltvRecord;
1429 RidLog->typ = CFG_REG_INFO_LOG;
1433 DBG_TRACE( DbgInfo,
"CFG_REG_INFO_LOG\n" );
1434 DBG_TRACE( DbgInfo,
"CFG_REG_INFO_LOG result : 0x%04x\n",
1468 DBG_ERROR( DbgInfo,
"lp pointer is NULL\n" );
1489 lp->
ltvRecord.
u.
u16[0] = CNV_INT_TO_LITTLE( HCF_MAX_PACKET_SIZE );
1632 DBG_TRACE( DbgInfo,
"CFG_TX_RATE_CNTL 2.4GHz : 0x%04x\n",
1634 DBG_TRACE( DbgInfo,
"CFG_TX_RATE_CNTL 5.0GHz : 0x%04x\n",
1636 DBG_TRACE( DbgInfo,
"CFG_TX_RATE_CNTL result : 0x%04x\n",
1736 #if 0 //;? (HCF_TYPE) & HCF_TYPE_AP
1809 lp->
ltvRecord.
u.
u16[0] = CNV_INT_TO_LITTLE( lp->wds_port[0].rtsThreshold );
1815 lp->
ltvRecord.
u.
u16[0] = CNV_INT_TO_LITTLE( lp->wds_port[1].rtsThreshold );
1822 lp->
ltvRecord.
u.
u16[0] = CNV_INT_TO_LITTLE( lp->wds_port[2].rtsThreshold );
1829 lp->
ltvRecord.
u.
u16[0] = CNV_INT_TO_LITTLE( lp->wds_port[3].rtsThreshold );
1836 lp->
ltvRecord.
u.
u16[0] = CNV_INT_TO_LITTLE( lp->wds_port[4].rtsThreshold );
1842 lp->
ltvRecord.
u.
u16[0] = CNV_INT_TO_LITTLE( lp->wds_port[5].rtsThreshold );
1848 lp->
ltvRecord.
u.
u16[0] = CNV_INT_TO_LITTLE( lp->wds_port[0].txRateCntl );
1854 lp->
ltvRecord.
u.
u16[0] = CNV_INT_TO_LITTLE( lp->wds_port[1].txRateCntl );
1860 lp->
ltvRecord.
u.
u16[0] = CNV_INT_TO_LITTLE( lp->wds_port[2].txRateCntl );
1866 lp->
ltvRecord.
u.
u16[0] = CNV_INT_TO_LITTLE( lp->wds_port[3].txRateCntl );
1872 lp->
ltvRecord.
u.
u16[0] = CNV_INT_TO_LITTLE( lp->wds_port[4].txRateCntl );
1878 lp->
ltvRecord.
u.
u16[0] = CNV_INT_TO_LITTLE( lp->wds_port[5].txRateCntl );
2027 static int __init wl_module_init(
void )
2037 DbgInfo->DebugFlag = 0;
2038 DbgInfo->DebugFlag = DBG_TRACE_ON;
2041 DbgInfo->DebugFlag |= DBG_DS_ON;
2043 DbgInfo->DebugFlag |= DBG_RX_ON | DBG_TX_ON;
2045 DbgInfo->DebugFlag |= DBG_PARAM_ON;
2047 DbgInfo->DebugFlag |= DBG_TRACE_ON;
2049 DbgInfo->DebugFlag |= DBG_VERBOSE_ON;
2093 static void __exit wl_module_exit(
void )
2099 #if 0 //SCULL_USE_PROC
2136 if (( dev ==
NULL ) || ( !netif_device_present( dev ))) {
2144 if ( lp->useRTS == 1 ) {
2145 DBG_PRINT(
"EXITING ISR, IN RTS MODE...\n" );
2157 tasklet_schedule(&lp->
task);
2186 #define WVLAN_MAX_INT_SERVICES 50
2191 unsigned long flags;
2199 DBG_PRINT(
"wl_isr_handler lp adapter pointer is NULL!!!\n" );
2201 wl_lock( lp, &flags );
2204 if ( dev !=
NULL && netif_device_present( dev ) ) stop =
FALSE;
2216 #ifndef USE_MBOX_SYNC
2257 if ( lp->
hcfCtx.IFB_DmaPackets & HREG_EV_RDMAD ) {
2262 if ( lp->
hcfCtx.IFB_DmaPackets & HREG_EV_TDMAD ) {
2263 wl_pci_dma_hcf_reclaim_tx( lp );
2268 #endif // ENABLE_DMA
2283 wl_unlock( lp, &flags );
2311 unsigned long flags;
2318 wl_lock( lp, &flags );
2332 #if 0 //;? (HCF_TYPE) & HCF_TYPE_AP
2344 if ( lp->useRTS == 1 ) {
2345 wl_unlock( lp, &flags );
2355 wl_unlock( lp, &flags );
2383 unsigned long flags;
2394 wl_lock( lp, &flags );
2411 wl_unlock( lp, &flags );
2439 unsigned long flags;
2446 wl_lock( lp, &flags );
2463 wl_unlock( lp, &flags );
2502 DBG_TRACE( DbgInfo,
"Calling unregister_netdev(), as it wasn't called yet\n" );
2588 DBG_TRACE( DbgInfo,
"No action: Card already enabled\n" );
2591 DBG_TRACE( DbgInfo,
"No action: Card already connected\n" );
2599 wl_pci_dma_hcf_supply( lp );
2605 DBG_TRACE( DbgInfo,
"failed: 0x%x\n", hcf_status );
2637 DBG_ERROR( DbgInfo,
"!!!!;? someone misunderstood something !!!!!\n" );
2672 DBG_TRACE( DbgInfo,
"No action: Not in enabled state\n" );
2712 DBG_TRACE( DbgInfo,
"No action: Not in connected state\n" );
2752 DBG_TRACE( DbgInfo,
"No action: Port state is disabled\n" );
2761 wl_pci_dma_hcf_reclaim( lp );
2767 DBG_TRACE( DbgInfo,
"failed: 0x%x\n", hcf_status );
2796 DBG_FUNC(
"wl_disable_wds_ports" );
2800 DBG_ERROR( DbgInfo,
"!!!!;? someone misunderstood something !!!!!\n" );
2817 #ifndef USE_MBOX_SYNC
2841 DBG_TRACE( DbgInfo,
"Mailbox Info: IFB_MBInfoLen: %d\n",
2851 DBG_ERROR( DbgInfo,
"hcf_get_info returned 0x%x\n", hcf_status );
2891 DBG_FUNC(
"wl_endian_translate_mailbox" );
2893 switch( ltv->
typ ) {
2905 while( num_aps >= 1 ) {
2909 CNV_LITTLE_TO_INT( aps[num_aps].channel_id );
2912 CNV_LITTLE_TO_INT( aps[num_aps].noise_level );
2915 CNV_LITTLE_TO_INT( aps[num_aps].signal_level );
2918 CNV_LITTLE_TO_INT( aps[num_aps].beacon_interval_time );
2921 CNV_LITTLE_TO_INT( aps[num_aps].
capability );
2924 CNV_LITTLE_TO_INT( aps[num_aps].ssid_len );
2936 probe_resp->
durID = CNV_LITTLE_TO_INT( probe_resp->
durID );
2944 probe_resp->
flags = CNV_LITTLE_TO_INT( probe_resp->
flags );
2949 #define ls ((LINK_STATUS_STRCT *)ltv)
2950 ls->linkStatus = CNV_LITTLE_TO_INT(
ls->linkStatus );
3012 switch( ltv->
typ ) {
3029 DBG_TRACE( DbgInfo,
"Number of APs: %d\n", num_aps );
3031 while( num_aps >= 1 ) {
3034 DBG_TRACE( DbgInfo,
"AP : %d\n", num_aps );
3035 DBG_TRACE( DbgInfo,
"=========================\n" );
3036 DBG_TRACE( DbgInfo,
"Channel ID : 0x%04x\n",
3037 aps[num_aps].channel_id );
3038 DBG_TRACE( DbgInfo,
"Noise Level : 0x%04x\n",
3039 aps[num_aps].noise_level );
3040 DBG_TRACE( DbgInfo,
"Signal Level : 0x%04x\n",
3041 aps[num_aps].signal_level );
3042 DBG_TRACE( DbgInfo,
"Beacon Interval : 0x%04x\n",
3043 aps[num_aps].beacon_interval_time );
3044 DBG_TRACE( DbgInfo,
"Capability : 0x%04x\n",
3046 DBG_TRACE( DbgInfo,
"SSID Length : 0x%04x\n",
3047 aps[num_aps].ssid_len );
3049 aps[num_aps].
bssid);
3051 if ( aps[num_aps].ssid_len != 0 ) {
3053 aps[num_aps].ssid_val );
3055 DBG_TRACE( DbgInfo,
"SSID : %s.\n",
"ANY" );
3080 DBG_TRACE( DbgInfo,
"(%s) =========================\n",
3083 DBG_TRACE( DbgInfo,
"(%s) length : 0x%04x.\n",
3086 if ( probe_rsp->
length > 1 ) {
3087 DBG_TRACE( DbgInfo,
"(%s) infoType : 0x%04x.\n",
3090 DBG_TRACE( DbgInfo,
"(%s) signal : 0x%02x.\n",
3093 DBG_TRACE( DbgInfo,
"(%s) silence : 0x%02x.\n",
3096 DBG_TRACE( DbgInfo,
"(%s) rxFlow : 0x%02x.\n",
3099 DBG_TRACE( DbgInfo,
"(%s) rate : 0x%02x.\n",
3100 lp->
dev->name, probe_rsp->
rate );
3102 DBG_TRACE( DbgInfo,
"(%s) frame cntl : 0x%04x.\n",
3105 DBG_TRACE( DbgInfo,
"(%s) durID : 0x%04x.\n",
3108 DBG_TRACE(DbgInfo,
"(%s) address1 : %pM\n",
3111 DBG_TRACE(DbgInfo,
"(%s) address2 : %pM\n",
3114 DBG_TRACE(DbgInfo,
"(%s) BSSID : %pM\n",
3117 DBG_TRACE( DbgInfo,
"(%s) sequence : 0x%04x.\n",
3120 DBG_TRACE(DbgInfo,
"(%s) address4 : %pM\n",
3123 DBG_TRACE( DbgInfo,
"(%s) datalength : 0x%04x.\n",
3127 lp->
dev->name, probe_rsp->
DA);
3130 lp->
dev->name, probe_rsp->
SA);
3136 "%d.%d.%d.%d.%d.%d.%d.%d\n",
3147 DBG_TRACE( DbgInfo,
"(%s) beaconInt : 0x%04x.\n",
3150 DBG_TRACE( DbgInfo,
"(%s) capability : 0x%04x.\n",
3153 DBG_TRACE( DbgInfo,
"(%s) SSID len : 0x%04x.\n",
3156 if ( probe_rsp->
rawData[1] > 0 ) {
3159 memset( ssid, 0,
sizeof( ssid ));
3164 lp->
dev->name, ssid );
3169 if ( wpa_ie !=
NULL ) {
3170 DBG_TRACE( DbgInfo,
"(%s) WPA-IE : %s\n",
3174 DBG_TRACE( DbgInfo,
"(%s) flags : 0x%04x.\n",
3180 if ( probe_rsp->
length == 1 ) {
3181 DBG_TRACE( DbgInfo,
"SCAN COMPLETE\n" );
3224 DBG_WARNING( DbgInfo,
"Num of scan results exceeds storage, truncating\n" );
3239 #define ls ((LINK_STATUS_STRCT *)ltv)
3240 DBG_TRACE( DbgInfo,
"CFG_LINK_STAT\n" );
3242 switch(
ls->linkStatus ) {
3244 DBG_TRACE( DbgInfo,
"Link Status : Connected\n" );
3249 DBG_TRACE( DbgInfo,
"Link Status : Disconnected\n" );
3253 DBG_TRACE( DbgInfo,
"Link Status : Access Point Change\n" );
3257 DBG_TRACE( DbgInfo,
"Link Status : Access Point Out of Range\n" );
3261 DBG_TRACE( DbgInfo,
"Link Status : Access Point In Range\n" );
3265 DBG_TRACE( DbgInfo,
"Link Status : UNKNOWN (0x%04x)\n",
3274 DBG_TRACE( DbgInfo,
"CFG_ASSOC_STAT\n" );
3281 DBG_TRACE( DbgInfo,
"Association Status : STA Associated\n" );
3285 DBG_TRACE( DbgInfo,
"Association Status : STA Reassociated\n" );
3289 DBG_TRACE( DbgInfo,
"Association Status : STA Disassociated\n" );
3293 DBG_TRACE( DbgInfo,
"Association Status : UNKNOWN (0x%04x)\n",
3298 DBG_TRACE(DbgInfo,
"STA Address : %pM\n",
3302 DBG_TRACE(DbgInfo,
"Old AP Address : %pM\n",
3310 DBG_TRACE( DbgInfo,
"CFG_SECURITY_STAT\n" );
3317 DBG_TRACE( DbgInfo,
"Security Status : Dissassociate [AP]\n" );
3321 DBG_TRACE( DbgInfo,
"Security Status : Deauthenticate [AP]\n" );
3325 DBG_TRACE( DbgInfo,
"Security Status : Authenticate Fail [STA] or [AP]\n" );
3329 DBG_TRACE( DbgInfo,
"Security Status : MIC Fail\n" );
3333 DBG_TRACE( DbgInfo,
"Security Status : Associate Fail\n" );
3337 DBG_TRACE( DbgInfo,
"Security Status : UNKNOWN %d\n",
3342 DBG_TRACE(DbgInfo,
"STA Address : %pM\n",
3352 DBG_TRACE( DbgInfo,
"CFG_WMP, size is %d bytes\n", ltv->
len );
3356 DBG_TRACE( DbgInfo,
"CFG_WMP, pdu type is 0x%x\n",
3365 DBG_TRACE( DbgInfo,
"LINK TEST RESULT\n" );
3366 DBG_TRACE( DbgInfo,
"================\n" );
3378 DBG_TRACE( DbgInfo,
"Power Mgmt : 0x%02x 0x%02x 0x%02x 0x%02x.\n",
3384 DBG_TRACE( DbgInfo,
"Robustness : 0x%02x 0x%02x 0x%02x 0x%02x.\n",
3407 DBG_TRACE( DbgInfo,
"UPDATED INFORMATION RECORD\n" );
3409 ltv_val = CNV_INT_TO_LITTLE( ltv->
u.
u16[0] );
3414 DBG_TRACE( DbgInfo,
"Updated country info\n" );
3427 DBG_WARNING( DbgInfo,
"Unknown RID: 0x%04x\n", ltv_val );
3433 DBG_TRACE( DbgInfo,
"UNKNOWN MESSAGE: 0x%04x\n", ltv->
typ );
3462 void wl_wds_netdev_register(
struct wl_private *lp )
3466 DBG_FUNC(
"wl_wds_netdev_register" );
3473 DBG_WARNING( DbgInfo,
"net device for WDS port %d could not be registered\n",
3509 void wl_wds_netdev_deregister(
struct wl_private *lp )
3513 DBG_FUNC(
"wl_wds_netdev_deregister" );
3530 #if 0 //SCULL_USE_PROC
3534 int printf_hcf_16(
char *
s,
char *
buf,
hcf_16*
p,
int n );
3535 int printf_hcf_16(
char *
s,
char *
buf,
hcf_16*
p,
int n ) {
3540 while ( len < 20 ) len +=
sprintf(buf+len,
" " );
3541 len +=
sprintf(buf+len,
": " );
3542 for ( i = 0; i <
n; i++ ) {
3543 if ( len % 80 > 75 ) {
3544 len +=
sprintf(buf+len,
"\n" );
3546 len +=
sprintf(buf+len,
"%04X ", p[i] );
3548 len +=
sprintf(buf+len,
"\n" );
3552 int printf_hcf_8(
char *s,
char *buf,
hcf_8* p,
int n );
3553 int printf_hcf_8(
char *s,
char *buf,
hcf_8* p,
int n ) {
3558 while ( len < 20 ) len +=
sprintf(buf+len,
" " );
3559 len +=
sprintf(buf+len,
": " );
3560 for ( i = 0; i <=
n; i++ ) {
3561 if ( len % 80 > 77 ) {
3562 len +=
sprintf(buf+len,
"\n" );
3564 len +=
sprintf(buf+len,
"%02X ", p[i] );
3566 len +=
sprintf(buf+len,
"\n" );
3570 int printf_strct(
char *s,
char *buf,
hcf_16* p );
3571 int printf_strct(
char *s,
char *buf,
hcf_16* p ) {
3576 while ( len < 20 ) len +=
sprintf(buf+len,
" " );
3577 len +=
sprintf(buf+len,
": " );
3578 for ( i = 0; i <= *
p; i++ ) {
3579 if ( len % 80 > 75 ) {
3580 len +=
sprintf(buf+len,
"\n" );
3582 len +=
sprintf(buf+len,
"%04X ", p[i] );
3584 len +=
sprintf(buf+len,
"\n" );
3594 #define LIMIT (PAGE_SIZE-80)
3600 len +=
sprintf(buf+len,
"No wl_private in scull_read_procmem\n" );
3608 len +=
sprintf(buf+len,
"TickCnt: 0x%04X\n", ifbp->IFB_TickCnt );
3610 len += printf_hcf_16(
"IFB_FWIdentity", &buf[len],
3622 #endif // WIRELESS_EXT
3627 len +=
sprintf(buf+len,
"DebugFlag (DbgInfo): 0x%08lX\n", DbgInfo->DebugFlag );
3637 len += printf_strct(
"PrimaryIdentity", &buf[len], (
hcf_16*)&lp->
hcfCtx.IFB_PRIIdentity );
3638 len += printf_strct(
"PrimarySupplier", &buf[len], (
hcf_16*)&lp->
hcfCtx.IFB_PRISup );
3654 len +=
sprintf(buf+len,
"TxRateControl[2]: 0x%04X 0x%04X\n",
3713 len +=
sprintf(buf+len,
"useRTS: 0x%04X\n", lp->useRTS );
3715 #if 1 //;? (HCF_TYPE) & HCF_TYPE_AP
3729 len +=
sprintf(buf+len,
"tallies to be added\n" );
3755 #if (HCF_EXT) & HCF_EXT_TALLIES_FW
3757 #endif // HCF_EXT_TALLIES_FW
3765 len +=
sprintf(buf+len,
"0x0000 - IFB\n" );
3766 len +=
sprintf(buf+len,
"0x0001 - wl_private\n" );
3767 len +=
sprintf(buf+len,
"0x0002 - Tallies\n" );
3768 len +=
sprintf(buf+len,
"0x8xxx - Change debufflag\n" );
3769 len +=
sprintf(buf+len,
"ERROR 0001\nWARNING 0002\nNOTICE 0004\nTRACE 0008\n" );
3770 len +=
sprintf(buf+len,
"VERBOSE 0010\nPARAM 0020\nBREAK 0040\nRX 0100\n" );
3771 len +=
sprintf(buf+len,
"TX 0200\nDS 0400\n" );
3787 static char proc_number[11];
3788 unsigned int nr = 0;
3799 proc_number[
count] = 0;
3801 *(
unsigned int *)data = nr;
3802 if ( nr & 0x8000 ) {
3804 DbgInfo->DebugFlag = nr & 0x7FFF;
3816 #define RUN_AT(x) (jiffies+(x)) //"borrowed" from include/pcmcia/k_compat.h
3817 #define DS_OOR 0x8000 //Deepsleep OutOfRange Status
3819 lp->timer_oor_cnt = DS_OOR;
3821 lp->timer_oor.function = timer_oor;
3822 lp->timer_oor.data = (
unsigned long)lp;
3823 lp->timer_oor.expires =
RUN_AT( 3 *
HZ );
3853 DBG_PARAM( DbgInfo,
"arg",
"0x%08lx", arg );
3856 lp->timer_oor_cnt += 10;
3857 if ( (lp->timer_oor_cnt & ~DS_OOR) > 300 ) {
3858 lp->timer_oor_cnt = 300;
3860 lp->timer_oor_cnt |= DS_OOR;
3862 lp->timer_oor.function = timer_oor;
3863 lp->timer_oor.data = (
unsigned long)lp;
3864 lp->timer_oor.expires =
RUN_AT( (lp->timer_oor_cnt & ~DS_OOR) *
HZ );