w35und: add softmac interface
Subsystems (2)
Hi!
This adds softmac interface to w35und driver... so it becomes monster driver with _two_ interfaces.
If you initialize hardmac interface, then softmac starts to works... it associates to AP, and can even ping.
(Or at least I hope so... it was somewhat too easy.)
Pavel
drivers/net/wireless/winbond/winbondport/adapter.h +1 -1
@@ -19,7 +19,7 @@ typedef struct WB32_ADAPTERTESTSTA sTestSta;// For test station WBLINUX WbLinux; -WB_STA_WPA_DESCRIPTION Global_STA_Wpa;//For WB_WPA +WB_STA_WPA_DESCRIPTION Global_STA_Wpa;struct iw_statistics iw_stats;u8 LinkName[MAX_ANSI_STRING ];
drivers/net/wireless/winbond/winbondport/gl_80211.h +8 -23
@@ -5,8 +5,7 @@ #define __GL_80211_H__/****************** CONSTANT AND MACRO SECTION ******************************/ /* BSS Type */ -enum -{ +enum {WLAN_BSSTYPE_INFRASTRUCTURE =0 ,WLAN_BSSTYPE_INDEPENDENT ,WLAN_BSSTYPE_ANY_BSS ,
@@ -15,29 +14,25 @@ enum/* Preamble_Type, see <SFS-802.11G-MIB-203> */ -typedef enum preamble_type -{ +typedef enum preamble_type {WLAN_PREAMBLE_TYPE_SHORT ,WLAN_PREAMBLE_TYPE_LONG , }preamble_type_e ;/* Slot_Time_Type, see <SFS-802.11G-MIB-208> */ -typedef enum slot_time_type -{ -WLAN_SLOT_TIME_TYPE_LONG ,// TODO: 0627 kevin +typedef enum slot_time_type { +WLAN_SLOT_TIME_TYPE_LONG ,WLAN_SLOT_TIME_TYPE_SHORT , }slot_time_type_e ;/*--------------------------------------------------------------------------*/ /* Encryption Mode */ -typedef enum -{ +typedef enum { WEP_DISABLE = 0, WEP_64, WEP_128, - // TODO: for _WPA_SUPPORTED_ (0627 kevin) ENCRYPT_DISABLE, ENCRYPT_WEP, ENCRYPT_WEP_NOKEY,
@@ -45,24 +40,17 @@ typedef enumENCRYPT_TKIP_NOKEY ,ENCRYPT_CCMP ,ENCRYPT_CCMP_NOKEY , - -//#ifdef _WPA_SUPPORTED_ -// RSN_TKIP, -// RSN_CCMP, -//#endif // _WPA_SUPPORTED_ } encryption_mode_e; -typedef enum _WLAN_RADIO -{ +typedef enum _WLAN_RADIO {WLAN_RADIO_ON ,WLAN_RADIO_OFF ,WLAN_RADIO_MAX ,// not a real type, defined as an upper bound }WLAN_RADIO ; -typedef struct _WLAN_RADIO_STATUS -{ +typedef struct _WLAN_RADIO_STATUS {WLAN_RADIO HWStatus; -WLAN_RADIO SWStatus; +WLAN_RADIO SWStatus; }WLAN_RADIO_STATUS ;//----------------------------------------------------------------------------
@@ -93,11 +81,9 @@ typedef enum _WLAN_REGION_CODEWLAN_REGION_FRANCE ,WLAN_REGION_SPAIN ,WLAN_REGION_ISRAEL , -//WLAN_REGION_CANADA, WLAN_REGION_MAX ,// not a real type, defined as an upper bound } WLAN_REGION_CODE; -//#define REGION_NAME_MAX_LENGTH 32 #define REGION_NAME_MAX_LENGTH 256 typedef struct _WLAN_REGION_CHANNELS
@@ -115,7 +101,6 @@ typedef struct _WLAN_REGION_CAPABILITIESWLAN_REGION_CHANNELS Region[1 ]; }WLAN_REGION_CAPABILITIES ; -// 20041103 1.1.91.1000 ybjiang typedef struct _region_name_map { WLAN_REGION_CODE region; u8 *name;
drivers/net/wireless/winbond/winbondport/gui_structures.h +0 -315
315 lines not on this page · raw message
drivers/net/wireless/winbond/winbondport/linux/wb35reg.c +1 -15
@@ -614,7 +614,7 @@ Wb35Reg_destroy(phw_data_t pHwData)//==================================================================================== // The function can be run in passive-level only. //==================================================================================== -unsigned char Wb35Reg_initial (phw_data_t pHwData ) +unsigned char Wb35Reg_initial (phw_data_t pHwData) {PWB35REG pWb35Reg=&pHwData->Wb35Reg;u32 ltmp;
@@ -672,20 +672,6 @@ unsigned char Wb35Reg_initial( phw_data// Update Ethernet address memcpy ( pHwData->CurrentMacAddress, pHwData->PermanentMacAddress,ETH_LENGTH_OF_ADDRESS ); -#ifdef _PE_REG_DUMP_ - { -int i; -WBDEBUG (("EthAddr = " ));//Debug information -for ( i=0 ; i<ETH_LENGTH_OF_ADDRESS ; i++ ) - { -WBDEBUG (("%02x " ,pHwData->PermanentMacAddress[i] )); -if ( i==5 )break ; -WBDEBUG (("-" )); - } -WBDEBUG (("\n" )); - } -#endif -// Update software variable pHwData->SoftwareSet = (u16)(SoftwareSet &0xffff ); TxVga &=0x000000ff ;
drivers/net/wireless/winbond/winbondport/linux/wb35rx.c +19 -18
@@ -106,20 +106,20 @@ void Wb35Rx_Complete(PURB pUrb) pRxBufferAddress = pWb35Rx->pDRx; BulkLength = (u16 )pUrb->actual_length; -//The IRP is completed +// The IRP is completed pWb35Rx->EP3vm_state =VM_COMPLETED ;if (pHwData->SurpriseRemove || pHwData->HwStop)// Must be here, or RxBufferId is invalid break ; -if ( pWb35Rx->rx_halt ) +if (pWb35Rx->rx_halt)break ;// Start to process the data only in successful condition pWb35Rx->RxOwner[ RxBufferId ] =0 ;// Set the owner to driver R00 .value =le32_to_cpu (*(PULONG )pRxBufferAddress); -//The URB is completed, check the result +// The URB is completed, check the result if (pWb35Rx->EP3VM_status !=0 ) {#ifdef _PE_USB_STATE_DUMP_WBDEBUG (("EP3 IoCompleteRoutine return error\n" ));
@@ -136,22 +136,21 @@ void Wb35Rx_Complete(PURB pUrb) SizeCheck -=4 ; SizeCheck = (SizeCheck +3 ) & ~0x03 ; SizeCheck +=12 ;// 8 + 4 badbeef -if ( (BulkLength >1600 ) || +if ((BulkLength >1600 ) || (SizeCheck >1600 ) || (BulkLength != SizeCheck) || - (BulkLength ==0 ) )// Add for fail Urb - { + (BulkLength ==0 )) {// Add for fail Urb pWb35Rx->EP3vm_state =VM_STOP ; pWb35Rx->Ep3ErrorCount2++; } } -//Indicating the receiving data +// Indicating the receiving data pWb35Rx->ByteReceived += BulkLength; pWb35Rx->RxBufferSize[ RxBufferId ] = BulkLength;if (!pWb35Rx->RxOwner[ RxBufferId ]) -Wb35Rx_indicate ( pHwData ); +Wb35Rx_indicate (pHwData);kfree (pWb35Rx->pDRx);// Do the next receive
@@ -259,7 +258,9 @@ void Wb35Rx_adjust(PDESCRIPTOR pRxDes) pRxDes->buffer_size[0 ] = BufferSize; } -//931130.4.b +extern void packet_came (char *pRxBufferAddress,int PacketSize); + +u16 Wb35Rx_indicate (phw_data_t pHwData) {DESCRIPTOR RxDes;
@@ -269,29 +270,27 @@ u16 Wb35Rx_indicate(phw_data_t pHwData)u16 stmp, BufferSize, stmp2 =0 ;u32 RxBufferId; -// Only one thread be allowed to run into the follow +// Only one thread be allowed to run into the following do { RxBufferId = pWb35Rx->RxProcessIndex; - if( pWb35Rx->RxOwner[ RxBufferId ] )//Owner by VM + if (pWb35Rx->RxOwner[ RxBufferId ]) //Owner by VM break; pWb35Rx->RxProcessIndex++; pWb35Rx->RxProcessIndex %= MAX_USB_RX_BUFFER_NUMBER; - //pRxBufferAddress = pWb35Rx->RxBuffer[ RxBufferId ]; pRxBufferAddress = pWb35Rx->pDRx; BufferSize = pWb35Rx->RxBufferSize[ RxBufferId ]; // Parse the bulkin buffer - while( BufferSize >= 4 ) - { + while (BufferSize >= 4) { if ((cpu_to_le32(*(PULONG)pRxBufferAddress) & 0x0fffffff) == RX_END_TAG) //Is ending? 921002.9.a break; // Get the R00 R01 first - RxDes.R00.value = le32_to_cpu(*(PULONG)pRxBufferAddress); //20060926 add by anson's endian + RxDes.R00.value = le32_to_cpu(*(PULONG)pRxBufferAddress); PacketSize = (u16)RxDes.R00.R00_receive_byte_count; - RxDes.R01.value = le32_to_cpu(*((PULONG)(pRxBufferAddress+4))); //20060926 anson's ednian + RxDes.R01.value = le32_to_cpu(*((PULONG)(pRxBufferAddress+4))); // For new DMA 4k if ((PacketSize & 0x03) > 0) PacketSize -= 4;
@@ -309,7 +308,7 @@ u16 Wb35Rx_indicate(phw_data_t pHwData)// Start to process Rx buffer // RxDes.Descriptor_ID = RxBufferId; // Due to synchronous indicate, the field doesn't necessary to use. - BufferSize -=8 ;//subtract 8 byte for 35's USB header length + BufferSize -=8 ;//subtract 8 byte for 35's USB header length pRxBufferAddress +=8 ; RxDes.buffer_address[0 ] = pRxBufferAddress;
@@ -317,7 +316,9 @@ u16 Wb35Rx_indicate(phw_data_t pHwData) RxDes.buffer_number =1 ; RxDes.buffer_start_index =0 ; RxDes.buffer_total_size = RxDes.buffer_size[0 ]; -Wb35Rx_adjust ( &RxDes ); +Wb35Rx_adjust (&RxDes); + +packet_came (pRxBufferAddress, PacketSize);// Indicating to upper module hal_descriptor_indicate ( pHwData, &RxDes );
drivers/net/wireless/winbond/winbondport/linux/wb35tx.c +14 -22
@@ -39,8 +39,8 @@ void Wb35Tx(phw_data_t pHwData)PADAPTER Adapter = pHwData->Adapter;PUCHAR pTxBufferAddress;PMDS pMds = &Adapter->Mds; -struct urb * pUrb = (struct urb *)pWb35Tx->Tx4Urb; -int retv; +struct urb * pUrb = (struct urb *)pWb35Tx->Tx4Urb; +int retv;u32 SendIndex;
@@ -110,8 +110,7 @@ void Wb35Tx_complete(struct urb * pUrb)break ;// The URB is completed, check the result -if ( pWb35Tx->EP4VM_status !=0 ) - { +if (pWb35Tx->EP4VM_status !=0 ) {#ifdef _PE_USB_STATE_DUMP_WBDEBUG (("EP4 IoCompleteRoutine return error\n" ));DebugUsbdStatusInformation ( pWb35Tx->EP4VM_status );
@@ -121,8 +120,8 @@ void Wb35Tx_complete(struct urb * pUrb) }// Do the next send -Mds_Tx ( Adapter ); -Wb35Tx ( pHwData ); +Mds_Tx (Adapter); +Wb35Tx (pHwData);return ; }while (FALSE);
@@ -157,7 +156,7 @@ unsigned char Wb35Tx_initial(phw_data_t }//====================================================== -void Wb35Tx_stop (phw_data_t pHwData ) +void Wb35Tx_stop (phw_data_t pHwData) {PWB35TX pWb35Tx = &pHwData->Wb35Tx;
@@ -198,7 +197,7 @@ void Wb35Tx_destroy(phw_data_t pHwData)#endif } -void Wb35Tx_CurrentTime (phw_data_t pHwData,u32 TimeCount ) +void Wb35Tx_CurrentTime (phw_data_t pHwData,u32 TimeCount) {PWB35TX pWb35Tx = &pHwData->Wb35Tx;unsigned char Trigger = FALSE;
@@ -214,13 +213,12 @@ void Wb35Tx_CurrentTime( phw_data_t pHw } } -void Wb35Tx_EP2VM_start (phw_data_t pHwData ) +void Wb35Tx_EP2VM_start (phw_data_t pHwData) {PWB35TX pWb35Tx = &pHwData->Wb35Tx;// Allow only one thread to run into function -if (OS_ATOMIC_INC ( pHwData->Adapter, &pWb35Tx->TxResultCount ) ==1 ) - { +if (OS_ATOMIC_INC ( pHwData->Adapter, &pWb35Tx->TxResultCount ) ==1 ) { pWb35Tx->EP2vm_state =VM_RUNNING ;Wb35Tx_EP2VM ( pHwData ); }
@@ -237,28 +235,22 @@ void Wb35Tx_EP2VM(phw_data_t pHwData)int retv; do { - if( pHwData->SurpriseRemove || pHwData->HwStop ) + if (pHwData->SurpriseRemove || pHwData->HwStop) break; - if( pWb35Tx->tx_halt ) + if (pWb35Tx->tx_halt) break; // // Issuing URB // - usb_fill_int_urb( pUrb, - pHwData->WbUsb.udev, - usb_rcvintpipe(pHwData->WbUsb.udev,2), - pltmp, - MAX_INTERRUPT_LENGTH, - Wb35Tx_EP2VM_complete, - pHwData,32); + usb_fill_int_urb( pUrb, pHwData->WbUsb.udev, usb_rcvintpipe(pHwData->WbUsb.udev,2), + pltmp, MAX_INTERRUPT_LENGTH, Wb35Tx_EP2VM_complete, pHwData, 32); pWb35Tx->EP2vm_state = VM_RUNNING; retv = wb_usb_submit_urb( pUrb ); - if(retv < 0) - { + if(retv < 0) { #ifdef _PE_TX_DUMP_ WBDEBUG(("EP2 Tx Irp sending error\n")); #endif
drivers/net/wireless/winbond/winbondport/linux/wbusb.c +199 -8
258 lines not on this page · raw message
drivers/net/wireless/winbond/winbondport/mds.c +36 -70
271 lines not on this page · raw message
drivers/net/wireless/winbond/winbondport/mlme_assoc.c +5 -11
@@ -30,14 +30,14 @@ #include "os_common.h"//============================================================================ s8 SendAssociationRequest (PWB32_ADAPTER Adapter,u16 iMSindex, -unsigned char Reasso) +unsigned char Reasso) {u16 iFildOffset =0 ;u8 *msg;struct Management_Frame * msgHeader; -struct Association_Request_Frame_Body * msgBody; +struct Association_Request_Frame_Body * msgBody; -// Get the free data buffer +// Get the free data buffer if ((msg =MLMEGetMMPDUBuffer (Adapter)) ==NULL ) {// No available data buffer now. Stop sending the MMPDU. Adapter->sMlmeFrame.wNumTxMMPDUDiscarded++;
@@ -60,20 +60,14 @@ s8 SendAssociationRequest(PWB32_ADAPTER msgHeader->frame_control.WEP =0 ; msgHeader->duration =0 ;// Set by the MDS -#ifdef _PE_TX_DUMP_ -//WBDEBUG(("addr of DA =%p\n", msgHeader->DA)); -//WBDEBUG(("addr of SA =%p\n", msgHeader->SA)); -//WBDEBUG(("addr of BSSID =%p\n", msgHeader->BSSID)); -#endif memcpy ( msgHeader->DA,psBSS (iMSindex)->abPeerAddress,MAC_ADDR_LENGTH );memcpy ( msgHeader->SA, psLOCAL->ThisMacAddress,MAC_ADDR_LENGTH );memcpy ( msgHeader->BSSID,psBSS (iMSindex)->abBssID,MAC_ADDR_LENGTH ); -// HW-MAC automatically generates the frame sequence number -// MDS automatically generates the fragment number. +// HW-MAC automatically generates the frame sequence number +// MDS automatically generates the fragment number. // now set the associtaion request information -//20060926 add by anson's endian msgBody->capability_information =cpu_to_le16 ( psSME->wCapabilityInfo ); msgBody->listenInterval =cpu_to_le16 ( psLOCAL->ListenInterval );if (Reasso)
drivers/net/wireless/winbond/winbondport/mlmetxrx.c +22 -25
78 lines not on this page · raw message
drivers/net/wireless/winbond/winbondport/rxisr.c +35 -102
220 lines not on this page · raw message
drivers/net/wireless/winbond/winbondport/scan_probe.c +32 -44
122 lines not on this page · raw message
drivers/net/wireless/winbond/winbondport/scantask.c +19 -58
165 lines not on this page · raw message
drivers/net/wireless/winbond/winbondport/wbhal.c +54 -62
270 lines not on this page · raw message
drivers/net/wireless/winbond/winbondport/wbhal_s.h +12 -39
95 lines not on this page · raw message
drivers/net/wireless/winbond/winbondport/wblinux.c +130 -140
344 lines not on this page · raw message
net/mac80211/rx.c +14 -1
@@ -1496,6 +1496,7 @@ static inline ieee80211_txrx_result __iefor (handler = handlers; *handler !=NULL ; handler++) { res = (*handler)(rx); +printk ("handler %x result %d\n" , handler, res);switch (res) {case TXRX_CONTINUE :
@@ -1730,6 +1731,11 @@ static void __ieee80211_rx_handle_packet rx.fc =le16_to_cpu (hdr->frame_control); type = rx.fc &IEEE80211_FCTL_FTYPE ; +if (type ==IEEE80211_FTYPE_MGMT ) +printk ("management frame\n" ); +if (type ==IEEE80211_FTYPE_DATA ) +printk ("data frame\n" ); +if (type ==IEEE80211_FTYPE_DATA || type ==IEEE80211_FTYPE_MGMT ) local->dot11ReceivedFragmentCount++;
@@ -1740,6 +1746,7 @@ static void __ieee80211_rx_handle_packet }if ((status->flag &RX_FLAG_MMIC_ERROR )) { +printk ("mic error\n" );ieee80211_rx_michael_mic_report (local->mdev, hdr, sta, &rx); goto end; }
@@ -1752,6 +1759,7 @@ static void __ieee80211_rx_handle_packet goto end; skb = rx.skb; +printk ("handlers did not like it\n" );if (sta && !(sta->flags & (WLAN_STA_WDS |WLAN_STA_ASSOC_AP )) && !atomic_read (&local->iff_promiscs) && !is_multicast_ether_addr (hdr->addr1)) {
@@ -1762,6 +1770,7 @@ static void __ieee80211_rx_handle_packetreturn ; } +printk ("searching monitors\n" );list_for_each_entry_rcu (sdata, &local->interfaces, list) {if (!netif_running (sdata->dev))continue ;
@@ -2020,6 +2029,7 @@ void __ieee80211_rx(struct ieee80211_hwstruct ieee80211_local *local =hw_to_local (hw);u32 pkt_load; +printk ("_rx\n" );/* * key references and virtual interfaces are protected using RCU * and this requires that we are in a read-side RCU section during
@@ -2038,12 +2048,15 @@ void __ieee80211_rx(struct ieee80211_hwrcu_read_unlock ();return ; } +printk ("_rx_monitor passed\n" ); pkt_load =ieee80211_rx_load_stats (local, skb, status); local->channel_use_raw += pkt_load; -if (!ieee80211_rx_reorder_ampdu (local, skb)) +if (!ieee80211_rx_reorder_ampdu (local, skb)) { +printk ("_rx_reorder_ampdu passed\n" );__ieee80211_rx_handle_packet (hw, skb, status, pkt_load); + }rcu_read_unlock (); }
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 11 lines · Pavel Machek
Hi!
This adds softmac interface to w35und driver... so it becomes monster driver with _two_ interfaces.
If you initialize hardmac interface, then softmac starts to works... it associates to AP, and can even ping.
(Or at least I hope so... it was somewhat too easy.)
Pavel
OK, I'm late to the party...what is this stuff going into drivers/net/wireless?
John
Signature · 2 lines
John W. Linville [email protected]
Hi!
Quoted 10 lines
Quoted 7 lines
This adds softmac interface to w35und driver... so it becomes monster driver with _two_ interfaces.
If you initialize hardmac interface, then softmac starts to works... it associates to AP, and can even ping.
(Or at least I hope so... it was somewhat too easy.)
OK, I'm late to the party...what is this stuff going into
drivers/net/wireless?
Actually you are about month early to the party ;-). We are trying to clean up winbond usb wireless driver, so that it can think about inclusion in kernel.
http://code.google.com/p/winbondport/
Unfortunately, original driver carries its own 802.11 stack with it; that needs to be stripped down. (And then code needs to be rewritten due to horrible coding style).
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 18 lines · Pavel Machek
Hi!
Quoted 11 lines
Quoted 7 lines
This adds softmac interface to w35und driver... so it becomes monster driver with _two_ interfaces.
If you initialize hardmac interface, then softmac starts to works... it associates to AP, and can even ping.
(Or at least I hope so... it was somewhat too easy.)
OK, I'm late to the party...what is this stuff going into
drivers/net/wireless?Actually you are about month early to the party ;-). We are trying to clean up winbond usb wireless driver, so that it can think about inclusion in kernel.
Quoted 7 lines
http://code.google.com/p/winbondport/
Unfortunately, original driver carries its own 802.11 stack with it; that needs to be stripped down. (And then code needs to be rewritten due to horrible coding style).
Pavel
Hi!
Last weekend we have started to rewrite the whole code based on rtl8187's softmac driver.
The wlan0 device init with it's own mac is ok, but thats all so far. I think it would be more sane to just drop the
old driver now (it would take more work the correct the old one), and create a new svn branch for the softmac
only brand new one.
KK
Hi!
Quoted 18 lines
Quoted 18 lines
Quoted 11 lines
Quoted 7 lines
This adds softmac interface to w35und driver... so it becomes monster driver with _two_ interfaces.
If you initialize hardmac interface, then softmac starts to works... it associates to AP, and can even ping.
(Or at least I hope so... it was somewhat too easy.)
OK, I'm late to the party...what is this stuff going into
drivers/net/wireless?Actually you are about month early to the party ;-). We are trying to clean up winbond usb wireless driver, so that it can think about inclusion in kernel.
Quoted 7 lines
Quoted 3 lines
Unfortunately, original driver carries its own 802.11 stack with it; that needs to be stripped down. (And then code needs to be rewritten due to horrible coding style).
Last weekend we have started to rewrite the whole code based on rtl8187's softmac driver.
Hmm, I used adm* code as a template.
Quoted 5 lines
The wlan0 device init with it's own mac is ok, but thats all so far. I think it would be more sane to just drop the
old driver now (it would take more work the correct the old one), and create a new svn branch for the softmac
only brand new one.
Really take a look at those patches. I believe I'm pretty close to dropping those upper layer code... Then, we'll be able to proceed incrementally.
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Hi!
Quoted 5 lines
Quoted 2 lines
Last weekend we have started to rewrite the whole code based on rtl8187's softmac driver.
Hmm, I used adm* code as a template.
:)
Quoted 5 lines
Really take a look at those patches. I believe I'm pretty close to dropping those upper layer code... Then, we'll be able to proceed incrementally.
I commited them after some changes, please send patches next time against the last revision :)
However I still think we should focus on rewriting the whole thing instead of hacking this elder chaos.
I created /branches/softmac for the new code, You should extend that maybe?
KK
Hi!
Quoted 6 lines
Quoted 4 lines
Really take a look at those patches. I believe I'm pretty close to dropping those upper layer code... Then, we'll be able to proceed incrementally.
I commited them after some changes, please send patches next time against the last revision :)
Sorry, will violate that once again (this is preview, not for commiting, so perhaps you can forgive me :-).
Which this, I'm able to connect to my access point and ping, without ifconfig-ing the original interface up. Only softmac interface is active.
Quoted 4 lines
However I still think we should focus on rewriting the whole thing instead of hacking this elder chaos.
I created /branches/softmac for the new code, You should extend that maybe?
I don't believe rewrite like that is a good idea.
My plan is:
1) remove duplicate 802.11 stack, making sure it still works as I progress.
(at this point I have pretty small driver -- like 2000 lines -- but it will be ugly)
2) either clean that one up, or rewrite it; making sure it still works in the process.
(at this point we have mergeable driver)
Pavel
drivers/net/wireless/winbond/winbondport/linux/wbusb.c +26 -0
@@ -126,6 +126,31 @@ static int wbsoft_start(struct ieee80211static int wbsoft_config (struct ieee80211_hw *dev,struct ieee80211_conf *conf) {printk ("wbsoft_config called\n" ); + +ChanInfo ch; + + ch.band =1 ; + ch.ChanNo =1 ;/* Should use channel_num, or something, as that is already pre-translated */ + + +hal_set_current_channel (&my_adapter->sHwData, ch); +hal_set_beacon_period (&my_adapter->sHwData, conf->beacon_int); +// hal_set_cap_info(&my_adapter->sHwData, ?? ); +// hal_set_ssid(phw_data_t pHwData, PUCHAR pssid, u8 ssid_len); ?? +hal_set_accept_broadcast (&my_adapter->sHwData,1 ); +hal_set_accept_promiscuous (&my_adapter->sHwData,1 ); +hal_set_accept_multicast (&my_adapter->sHwData,1 ); +hal_set_accept_beacon (&my_adapter->sHwData,1 ); +hal_set_radio_mode (&my_adapter->sHwData,0 ); +//hal_set_antenna_number( phw_data_t pHwData, u8 number ) +//hal_set_rf_power(phw_data_t pHwData, u8 PowerIndex) + + +// hal_start_bss(&my_adapter->sHwData, WLAN_BSSTYPE_INFRASTRUCTURE); ?? + +//void hal_set_rates(phw_data_t pHwData, PUCHAR pbss_rates, +// u8 length, unsigned char basic_rate_set) +return 0 ; }
@@ -155,6 +180,7 @@ static const struct ieee80211_ops wbsoft .get_stats = wbsoft_nop, .get_tx_stats = wbsoft_nop, .get_tsf = wbsoft_get_tsf, +// conf_tx: hal_set_cwmin()/hal_set_cwmax; };struct wbsoft_priv {
drivers/net/wireless/winbond/winbondport/wbhal.c +4 -2
@@ -418,7 +418,7 @@ u8 hal_init_hardware(phw_data_t pHwData, } -void hal_halt (phw_data_t pHwData,void *ppa_data) +void hal_halt (phw_data_t pHwData,void *ppa_data) {switch ( pHwData->InitialResource ) {
@@ -500,7 +500,7 @@ void hal_set_slot_time( phw_data_t pHwDa }//--------------------------------------------------------------------------------------------------- void hal_set_rates (phw_data_t pHwData,PUCHAR pbss_rates, -u8 length,unsigned char basic_rate_set ) +u8 length,unsigned char basic_rate_set) {PWB35REG pWb35Reg = &pHwData->Wb35Reg;u32 tmp, tmp1;
@@ -765,6 +765,8 @@ void hal_set_current_channel_ex( phw_daif ( pHwData->SurpriseRemove )return ; +printk ("Going to channel: %d/%d\n" , channel.band, channel.ChanNo); +RFSynthesizer_SwitchingChannel ( pHwData, channel );// Switch channel pHwData->Channel = channel.ChanNo; pHwData->band = channel.band;
drivers/net/wireless/winbond/winbondport/wblinux.c +2 -2
@@ -416,7 +416,7 @@ #endif Adapter->sLocalPara.ShutDowned = FALSE;//added by ws for wep key error detection - Adapter->sLocalPara.bWepKeyError= FALSE;//added by ws 02/02/04 + Adapter->sLocalPara.bWepKeyError= FALSE; Adapter->sLocalPara.bToSelfPacketReceived = FALSE; Adapter->sLocalPara.WepKeyDetectTimerCount=2 *100 ;/// 2 seconds
@@ -534,7 +534,7 @@ #endif }// 20060802 -void WBLINUX_ConnectStatus (PADAPTER Adapter,u32 flag ) +void WBLINUX_ConnectStatus (PADAPTER Adapter,u32 flag) {PWBLINUX pWbLinux = &Adapter->WbLinux;
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 17 lines · Pavel Machek
Hi!
Quoted 10 lines
Quoted 7 lines
This adds softmac interface to w35und driver... so it becomes monster driver with _two_ interfaces.
If you initialize hardmac interface, then softmac starts to works... it associates to AP, and can even ping.
(Or at least I hope so... it was somewhat too easy.)
OK, I'm late to the party...what is this stuff going into
drivers/net/wireless?Actually you are about month early to the party ;-). We are trying to clean up winbond usb wireless driver, so that it can think about inclusion in kernel.
Quoted 5 lines
http://code.google.com/p/winbondport/
Unfortunately, original driver carries its own 802.11 stack with it; that needs to be stripped down. (And then code needs to be rewritten due to horrible coding style).
I see...OK.
Did you get any legal advice regarding whether or not MODULE_LICENSE("GPL") was sufficient to proclaim the driver as covered by the GPL?
John
Signature · 2 lines
John W. Linville [email protected]
Hi!
Quoted 10 lines
Quoted 9 lines
Actually you are about month early to the party ;-). We are trying to clean up winbond usb wireless driver, so that it can think about inclusion in kernel.
http://code.google.com/p/winbondport/
Unfortunately, original driver carries its own 802.11 stack with it; that needs to be stripped down. (And then code needs to be rewritten due to horrible coding style).
Quoted 5 lines
I see...OK.
Did you get any legal advice regarding whether or not
MODULE_LICENSE("GPL")was sufficient to proclaim the driver as covered by the GPL?
I dislike talking to lawyers, do not have any easily physically reachable, and believe the case is pretty clear...
...plus, we plan to rewrite the driver, anyway...
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Re: w35und: good news about licensing
Hi!
Quoted 12 lines
Quoted 12 lines
Quoted 9 lines
Actually you are about month early to the party ;-). We are trying to clean up winbond usb wireless driver, so that it can think about inclusion in kernel.
http://code.google.com/p/winbondport/
Unfortunately, original driver carries its own 802.11 stack with it; that needs to be stripped down. (And then code needs to be rewritten due to horrible coding style).
I see...OK.
Quoted 8 lines
Quoted 3 lines
Did you get any legal advice regarding whether or not
MODULE_LICENSE("GPL")was sufficient to proclaim the driver as covered by the GPL?I dislike talking to lawyers, do not have any easily physically reachable, and believe the case is pretty clear...
...plus, we plan to rewrite the driver, anyway...
Ok, so I did actually talk to a lawyer that happened to be nearby. We did short analysis, and we believe that yes, w35und is under GPL. The only problem is in wpa/ subdirectory where md5 (IIRC) is under RSA license.
wpa/ subdirectory is already empty in my version, so we should be ok.
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html