Difference between revisions of "Davinci USB Wlan"

From eLinux.org
Jump to: navigation, search
Line 1: Line 1:
 
 
== '''Guide to Compile and use USB WLan Adapter.''' ==
 
== '''Guide to Compile and use USB WLan Adapter.''' ==
  
Line 46: Line 45:
  
 
In some cases you might get a compile error in rtusb_data.c:1950 when this happens you need to
 
In some cases you might get a compile error in rtusb_data.c:1950 when this happens you need to
fix the code skb->mac_header = skb->data; //PSRK
+
fix the code skb->mac_header = skb->data;  
  
{
+
          rfmontx_80211_receive:
rfmontx_80211_receive:
+
          skb->dev = pAd->net_dev;
skb->dev = pAd->net_dev;
+
          memcpy(skb_put(skb, pRxD->DataByteCnt), pHeader, pRxD->DataByteCnt);
memcpy(skb_put(skb, pRxD->DataByteCnt), pHeader, pRxD->DataByteCnt);
+
          //skb_reset_mac_header(skb); //ORIGINAL
//skb_reset_mac_header(skb); //ORIGINAL
+
          skb->mac_header = skb->data; //FIX
skb->mac_header = skb->data; //PSRK
+
          skb->pkt_type = PACKET_OTHERHOST;
skb->pkt_type = PACKET_OTHERHOST;
+
          skb->pkt_type = PACKET_OTHERHOST;
skb->pkt_type = PACKET_OTHERHOST;
+
          skb->protocol = htons(ETH_P_802_2);
skb->protocol = htons(ETH_P_802_2);
+
          skb->ip_summed = CHECKSUM_NONE;
skb->ip_summed = CHECKSUM_NONE;
+
          netif_rx(skb);
netif_rx(skb);
 
}
 
  
 
Step 6: Copy the ko to the target
 
Step 6: Copy the ko to the target
Line 73: Line 70:
  
  
insmod rt73
+
  insmod rt73
  
 
Insert the USB Wlan adapter, this should be detected and the driver loaded. If this does not
 
Insert the USB Wlan adapter, this should be detected and the driver loaded. If this does not
Line 83: Line 80:
 
if everything was ok then run the following command.
 
if everything was ok then run the following command.
  
ifconfig wlan0 up
+
  ifconfig wlan0 up
iwlist wlan0 scan
+
  iwlist wlan0 scan
  
 
This should list the Accesspoints
 
This should list the Accesspoints
Line 93: Line 90:
  
  
#DHCP
+
  Using DHCP  
dhcpcd -n wlan0
+
  dhcpcd -n wlan0
  
#STATIC IP
+
  Using STATIC IP
ifconfig wlan0 192.168.9.50 netmask 255.255.255.0 broadcast 192.168.9.1 up
+
  ifconfig wlan0 192.168.9.50 netmask 255.255.255.0 broadcast 192.168.9.1 up
  
 
Best of Luck.
 
Best of Luck.
Ravi Kiran.
 

Revision as of 10:10, 2 September 2007

Guide to Compile and use USB WLan Adapter.

We are using DLink DWL G 122 Rev C (Available in India).

If you are using 2.6.10 Kernel then you need ZHENG path. Search the Mail Archive for ZHENG patch Downlaod the Diff from this message and apply it. http://www.mail-archive.com/davinci-linux-open-source@linux.davincidsp.com/msg01652.html

If you are using 2.6.21 Kernel , it works as it is, No patch is required but you need to enable wlan. Ive tested thru a Powered Hub, Tested with USB Flash Drive and WLan connected at the same time.


Build Instructions for Kernel.

make menuconfig

Device Drivers -> Generic Device Options -> Enable Hot plug Firmware loading. Make sure that usb is enabled in the host mode and jumper on the board is set to host. Networking -> Enable Generic 802.11 and Enable WEP/Other Schemes you might need.

Rebuild the kernel


Building the RTL Driver

Step 1: Goto http://rt2x00.serialmonkey.com/wiki/index.php?title=Main_Page Download and extract the latest rt73 Driver Source.

Step 2:

  1. Export the KERNDIR Path

export KERNDIR=/workdir/lsp/ti-davinci/

Step 3:

  1. Export the build Path

export PATH=/opt/mv_pro_4.0/montavista/pro/devkit/arm/v5t_le/bin:/opt/mv_pro_4.0/montavista/pro/bin:$PATH

Step 4: cd /home/ralink/rt73-cvs-2007070309/Module

Step 5: make ARCH=arm CROSS_COMPILE=arm_v5t_le- arm

In some cases you might get a compile error in rtusb_data.c:1950 when this happens you need to fix the code skb->mac_header = skb->data;

          rfmontx_80211_receive:
          skb->dev = pAd->net_dev;
          memcpy(skb_put(skb, pRxD->DataByteCnt), pHeader, pRxD->DataByteCnt);
          //skb_reset_mac_header(skb); //ORIGINAL
          skb->mac_header = skb->data; //FIX
          skb->pkt_type = PACKET_OTHERHOST;
          skb->pkt_type = PACKET_OTHERHOST;
          skb->protocol = htons(ETH_P_802_2);
          skb->ip_summed = CHECKSUM_NONE;
          netif_rx(skb);

Step 6: Copy the ko to the target cp ./rt73.ko /dvevm/nfs/home/

Step 7: Important!!! Copy the rt73.bin from the build directory to /lib/firmware on the target DVEVM.

Once this is done you are all set to use the driver.


On the target

 insmod rt73

Insert the USB Wlan adapter, this should be detected and the driver loaded. If this does not just reboot the EVM and insert the Adapter again.

If you get some Ep0 errors this means that the You did not apply the Zheng Patch. If you get some firmware error make sure you enabled the hotplug during kernel menuconfig.

if everything was ok then run the following command.

 ifconfig wlan0 up
 iwlist wlan0 scan

This should list the Accesspoints

Then you can attach to the AP using

iwconfig wlan0 essid [APNAME] key [KEY]


 Using DHCP 
 dhcpcd -n wlan0
 Using STATIC IP
 ifconfig wlan0 192.168.9.50 netmask 255.255.255.0 broadcast 192.168.9.1 up

Best of Luck.