66 #include <linux/if_arp.h>
68 #include <linux/slab.h>
70 #include <asm/uaccess.h>
101 extern dbg_info_t *DbgInfo;
140 DBG_TRACE(DbgInfo,
"IOCTL: WVLAN2_IOCTL_UIL -- WVLAN2_UIL_CONNECT\n");
144 DBG_TRACE(DbgInfo,
"IOCTL: WVLAN2_IOCTL_UIL -- WVLAN2_UIL_DISCONNECT\n");
148 DBG_TRACE(DbgInfo,
"IOCTL: WVLAN2_IOCTL_UIL -- WVLAN2_UIL_ACTION\n" );
152 DBG_TRACE(DbgInfo,
"IOCTL: WVLAN2_IOCTL_UIL -- WVLAN2_UIL_SEND_DIAG_MSG\n");
156 DBG_TRACE(DbgInfo,
"IOCTL: WVLAN2_IOCTL_UIL -- WVLAN2_UIL_GET_INFO\n");
160 DBG_TRACE(DbgInfo,
"IOCTL: WVLAN2_IOCTL_UIL -- WVLAN2_UIL_PUT_INFO\n");
164 DBG_TRACE(DbgInfo,
"IOCTL: WVLAN2_IOCTL_UIL -- UNSUPPORTED UIL CODE: 0x%X", urq->
command );
208 urq->
result = UIL_SUCCESS;
211 urq->
result = UIL_ERR_IN_USE;
263 urq->
result = UIL_SUCCESS;
265 DBG_ERROR( DbgInfo,
"UIL_ERR_WRONG_IFB\n" );
266 urq->
result = UIL_ERR_WRONG_IFB;
319 DBG_TRACE( DbgInfo,
"UIL_ACT_UNBLOCK\n" );
339 DBG_ERROR( DbgInfo,
"Bad LTV for this action\n" );
340 urq->
result = UIL_ERR_LEN;
343 DBG_ERROR( DbgInfo,
"UIL_ERR_WRONG_IFB\n" );
344 urq->
result = UIL_ERR_WRONG_IFB;
388 netif_stop_queue(lp->
dev);
390 urq->
result = UIL_SUCCESS;
397 DBG_ERROR( DbgInfo,
"UIL_ERR_WRONG_IFB\n" );
398 urq->
result = UIL_ERR_WRONG_IFB;
441 netif_wake_queue(lp->
dev);
450 DBG_ERROR( DbgInfo,
"UIL_ERR_WRONG_IFB\n" );
451 urq->
result = UIL_ERR_WRONG_IFB;
488 DBG_FUNC(
"wvlan_uil_send_diag_msg" );
500 DBG_ERROR( DbgInfo,
"verify_area failed, result: %d\n", result );
512 Descp[0].BUF_CNT = urq->
len;
526 urq->
result = UIL_ERR_BUSY;
538 DBG_ERROR( DbgInfo,
"UIL_ERR_WRONG_IFB\n" );
539 urq->
result = UIL_ERR_WRONG_IFB;
586 if( urq->
len < (
sizeof(
hcf_16 ) * 2 )) {
588 urq->
result = UIL_ERR_LEN;
589 DBG_ERROR( DbgInfo,
"No Length/Type in LTV!!!\n" );
599 DBG_ERROR( DbgInfo,
"verify_area(), VERIFY_READ FAILED\n" );
611 urq->
result = UIL_ERR_LEN;
627 urq->
result = UIL_ERR_LEN;
644 switch( pLtv->
typ ) {
647 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
654 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
661 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
665 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
673 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
677 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
681 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
685 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
690 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
694 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
698 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
701 case CFG_CNF_TX_POW_LVL:
703 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
710 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
711 pLtv->
u.
u16[1] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[1] );
716 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
717 pLtv->
u.
u16[1] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[1] );
719 case CFG_CNF_CONNECTION_CNTL:
721 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
726 #if 1 //;? (HCF_TYPE) & HCF_TYPE_AP
731 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
734 case CFG_CNF_OWN_BEACON_INTERVAL:
736 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
741 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
772 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
776 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
782 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
786 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
788 #if 1 //;? (HCF_TYPE) & HCF_TYPE_AP
800 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
824 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
828 (
strcmp( &pLtv->
u.
u8[2],
"ANY" ) == 0 ) ||
829 (
strcmp( &pLtv->
u.
u8[2],
"any" ) == 0 )) {
841 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
845 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
850 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
851 pLtv->
u.
u16[1] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[1] );
859 #if 1 //;? #if (HCF_TYPE) & HCF_TYPE_AP
863 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
867 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
871 lp->wds_port[0].rtsThreshold = pLtv->
u.
u16[0];
872 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
876 lp->wds_port[1].rtsThreshold = pLtv->
u.
u16[0];
877 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
881 lp->wds_port[2].rtsThreshold = pLtv->
u.
u16[0];
882 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
886 lp->wds_port[3].rtsThreshold = pLtv->
u.
u16[0];
887 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
891 lp->wds_port[4].rtsThreshold = pLtv->
u.
u16[0];
892 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
896 lp->wds_port[5].rtsThreshold = pLtv->
u.
u16[0];
897 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
901 lp->wds_port[0].txRateCntl = pLtv->
u.
u16[0];
902 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
906 lp->wds_port[1].txRateCntl = pLtv->
u.
u16[0];
907 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
911 lp->wds_port[2].txRateCntl = pLtv->
u.
u16[0];
912 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
916 lp->wds_port[3].txRateCntl = pLtv->
u.
u16[0];
917 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
921 lp->wds_port[4].txRateCntl = pLtv->
u.
u16[0];
922 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
926 lp->wds_port[5].txRateCntl = pLtv->
u.
u16[0];
927 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
935 CFG_DEFAULT_KEYS_STRCT *pKeys = (CFG_DEFAULT_KEYS_STRCT *)pLtv;
937 pKeys->key[0].
len = CNV_INT_TO_LITTLE( pKeys->key[0].len );
938 pKeys->key[1].len = CNV_INT_TO_LITTLE( pKeys->key[1].len );
939 pKeys->key[2].len = CNV_INT_TO_LITTLE( pKeys->key[2].len );
940 pKeys->key[3].len = CNV_INT_TO_LITTLE( pKeys->key[3].len );
943 sizeof( CFG_DEFAULT_KEYS_STRCT ));
948 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
1005 DBG_ERROR( DbgInfo,
"set CFG_AP_MODE no longer supported\n" );
1026 sizeof( CFG_DEFAULT_KEYS_STRCT ));
1036 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
1040 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
1044 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
1052 pLtv->
u.
u16[0] = CNV_INT_TO_LITTLE( pLtv->
u.
u16[0] );
1069 switch( pLtv->
typ ) {
1085 case CFG_CNF_TX_POW_LVL:
1086 case CFG_CNF_CONNECTION_CNTL:
1089 #if 1 //;? (HCF_TYPE) & HCF_TYPE_AP
1093 case CFG_CNF_OWN_BEACON_INTERVAL:
1109 #if 1 //;? (HCF_TYPE) & HCF_TYPE_AP
1161 if( ltvAllocated ) {
1173 DBG_ERROR( DbgInfo,
"UIL_ERR_WRONG_IFB\n" );
1174 urq->
result = UIL_ERR_WRONG_IFB;
1217 if( urq->
len < (
sizeof(
hcf_16 ) * 2 )) {
1219 DBG_ERROR( DbgInfo,
"No Length/Type in LTV!!!\n" );
1221 urq->
result = UIL_ERR_LEN;
1229 DBG_ERROR( DbgInfo,
"verify_area(), VERIFY_READ FAILED\n" );
1241 DBG_ERROR( DbgInfo,
"Incoming LTV too big\n" );
1243 urq->
result = UIL_ERR_LEN;
1257 DBG_ERROR( DbgInfo,
"set CFG_AP_MODE no longer supported, so is get useful ????\n" );
1270 DBG_TRACE( DbgInfo,
"Intercept CFG_DRV_INFO\n" );
1273 case CFG_DRV_IDENTITY:
1274 DBG_TRACE( DbgInfo,
"Intercept CFG_DRV_IDENTITY\n" );
1292 DBG_ERROR( DbgInfo,
"verify_area(), VERIFY_WRITE FAILED\n" );
1303 ltvAllocated =
TRUE;
1309 urq->
result = UIL_ERR_LEN;
1310 DBG_ERROR( DbgInfo,
"kmalloc FAILED\n" );
1358 case CFG_CNF_TX_POW_LVL:
1359 case CFG_CNF_CONNECTION_CNTL:
1360 case CFG_CNF_OWN_BEACON_INTERVAL:
1449 CFG_DEFAULT_KEYS_STRCT *pKeys = (CFG_DEFAULT_KEYS_STRCT *)&lp->
ltvRecord.
u.
u8[0];
1451 pKeys[0].len = CNV_INT_TO_LITTLE( pKeys[0].len );
1452 pKeys[1].len = CNV_INT_TO_LITTLE( pKeys[1].len );
1453 pKeys[2].len = CNV_INT_TO_LITTLE( pKeys[2].len );
1454 pKeys[3].len = CNV_INT_TO_LITTLE( pKeys[3].len );
1518 if( ltvAllocated ) {
1522 urq->
result = UIL_SUCCESS;
1527 DBG_ERROR( DbgInfo,
"UIL_ERR_WRONG_IFB\n" );
1528 urq->
result = UIL_ERR_WRONG_IFB;
1572 urq->
result = UIL_ERR_LEN;
1588 urq->
result = UIL_SUCCESS;
1624 DBG_FUNC(
"wvlan_driver_identity" );
1631 urq->
result = UIL_ERR_LEN;
1645 urq->
result = UIL_SUCCESS;
1688 unsigned long flags;
1696 wl_lock(lp, &flags);
1703 wl_unlock(lp, &flags);
1738 unsigned long flags;
1748 wl_lock(lp, &flags);
1756 if( status == HCF_SUCCESS ) {
1767 wl_unlock(lp, &flags);
1796 int wvlan_set_station_nickname(
struct net_device *dev,
1802 unsigned long flags;
1807 DBG_FUNC(
"wvlan_set_station_nickname" );
1810 wl_lock(lp, &flags);
1818 wl_unlock(lp, &flags);
1847 int wvlan_get_station_nickname(
struct net_device *dev,
1853 unsigned long flags;
1860 DBG_FUNC(
"wvlan_get_station_nickname" );
1863 wl_lock( lp, &flags );
1871 if( status == HCF_SUCCESS ) {
1881 wl_unlock(lp, &flags);
1911 int wvlan_set_porttype(
struct net_device *dev,
1917 unsigned long flags;
1926 wl_lock(lp, &flags);
1929 portType = *((
__u32 *)extra);
1931 if( !(( portType == 1 ) || ( portType == 3 ))) {
1942 wl_unlock(lp, &flags);
1971 int wvlan_get_porttype(
struct net_device *dev,
1977 unsigned long flags;
1988 wl_lock( lp, &flags );
1996 if( status == HCF_SUCCESS ) {
1999 *pData = CNV_LITTLE_TO_INT( *pPortType );
2004 wl_unlock(lp, &flags);
2012 #endif // WIRELESS_EXT
2047 DBG_PRINT(
"io_base: 0x%08x\n", io_base );
2049 switch( rrq->
typ ) {
2051 DBG_TRACE(DbgInfo,
"IOCTL: WVLAN2_IOCTL_RTS -- WL_IOCTL_RTS_READ\n");
2056 DBG_TRACE(DbgInfo,
"IOCTL: WVLAN2_IOCTL_RTS -- WL_IOCTL_RTS_WRITE\n");
2061 DBG_TRACE(DbgInfo,
"IOCTL: WVLAN2_IOCTL_RTS -- WL_IOCTL_RTS_BATCH_READ\n");
2062 IN_PORT_STRING_16( io_base + rrq->
reg, rrq->
data, rrq->
len );
2066 DBG_TRACE(DbgInfo,
"IOCTL: WVLAN2_IOCTL_RTS -- WL_IOCTL_RTS_BATCH_WRITE\n");
2067 OUT_PORT_STRING_16( io_base + rrq->
reg, rrq->
data, rrq->
len );
2072 DBG_TRACE(DbgInfo,
"IOCTL: WVLAN2_IOCTL_RTS -- UNSUPPORTED RTS CODE: 0x%X", rrq->
typ );