This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

WiFi module SPI driver

Other Parts Discussed in Thread: WL1271

Hi There:

Customer isconsidering to use the WL1273 module on their system. the Host is DM6446.

But They have the interface issue as the DM6446 only has 1 SDIO which already used for SD card. The SDIO switch between SD card and WiFi module may cause some issue when the data communication for the WiFi and SD card at the same time.

So, They are checking if any possibility to use the SPI interface. I think the answer is no, right?

 If not, do you have any solution for this? is there something hardcore/adaptor to convert the signal?

BR. Albin

  • I don't think it will be possible to share the SDIO bus because:

    1. Throughputs
    2. Suspend issues (Disabling/enabling clocks)
    3. Virtual card detection implementation
    SPI exists in HW level but not supported.
    - Elad.
  • What do you mean by 'SPI exists in HW level but not supported.'? Is the SPI driver not supported or the SPI as the WiFi interface is not supported? Any possibility for the SPI interface for WiFi module?    And do you have any idea about the possible solution for Davinci DM6446 with SD card and WiFi module supported?

  • The physical lines exists, the synthesis from 1251 exists, the SW code in the FW also exists, but no one has tested it, and it's not sure if somewhere along the bus there isn't any IOP.

  • Hi Elad:

          Thanks. So, based on your experience, it's not reasonable to develop the WL1273 with SPI interface?  

         And how about change the Davinci SPI interface to SDIO by CPLD and CPLD SDIO connected to WiFi module? Is there any driver related issue for such kind of idea?

     

  • Hi Elad and Albin:

        Another question, does TI has solution for WiFi module (802.11 a/b/g/n, 2.4G/5G) with USB interface?

     

    Thanks.

  • Hi Simon,

    so far, we don't have USB wifi.

    BR. Albin

  • Hi Albin,

    CPLD is not good enough for the translation of address from SDIO to SPI.

    However, you can use commercial SDIO 2 USB or SDIO 2 UART that sending messages are translated to SDIO transaction.

    This require a change to the "SdioDrv" module in the driver to operate over the commercial SDIO module, but it's not so much hard work to done.

    Thanks,

    - Elad.

  • Good day!

    I try to use TiWi_R2 in our project. Unfortunately, we can't use PXA320 SDIO interface (allready used for memory card) and I try to connect TiWi_R2 via SPI interface. I make hardware connections:

    Connect VBAT (pin1) to 3.3V
    Connect VIO (pin11) to 1.8V
    Connect GND (all pins)
    Connect SCLK (pin19) to 32,768KHz 1.8V

    all other signals connected via converter 3.3<->1.8

    Connect DAT3 (pin13) to SPI_CS
    Connect DAT0 (pin16) to SPI_MISO
    Connect CMD (pin17) to SPI_MOSI
    Connect SCLK (pin18) to SPI_CLK
    Connect WIRQ (pin4) to GPIO SPI_IRQ
    Connect WLEN (pin10) to GPIO POWER_EN

    Put next code in my platform specific init (I use latest vanilla kernel - 3.2.1):

    static struct pxa2xx_spi_chip xilinx_spi_tuning = {
        .gpio_cs   = 1,
    };
     
    static struct pxa2xx_spi_chip tiwi_spi_tuning = {
        .dma_burst_size = 32,
        .gpio_cs   = 84,
    };
     
    void tiwi_set_power(bool enable)
    {
        if (enable) {
            printk(KERN_INFO "[TiWi_R2] Power enable\n");
            gpio_request(mfp_to_gpio(GPIO95_GPIO), "TiWi_Reset");
            gpio_direction_output(mfp_to_gpio(GPIO95_GPIO), 0);
            msleep(50);
            gpio_direction_output(mfp_to_gpio(GPIO95_GPIO), 1);
           msleep(100);
        } else {
            printk(KERN_INFO "[TiWi_R2] Power disable\n");
            gpio_direction_output(mfp_to_gpio(GPIO95_GPIO), 0);
            msleep(50);
            gpio_free(mfp_to_gpio(GPIO95_GPIO));
        }
    }
     
     
    static struct wl12xx_platform_data tiwi_platform_data = {
            .board_ref_clock        = WL12XX_REFCLOCK_38,
            .set_power              = tiwi_set_power,
            .platform_quirks        = WL12XX_PLATFORM_QUIRK_EDGE_IRQ,
    };
     
    static struct spi_board_info colibri_pxa320_spi_chips[] = {
        { // Xilinx FPGA
           .modalias        = "xilinx-fpga",
           .max_speed_hz    = 13000000,
           .mode            = SPI_MODE_0,
           .bus_num         = 1,
           .chip_select     = 0,
           .controller_data = &xilinx_spi_tuning,
        },
        { // LS Research WiFi module TiWi_R2
            .modalias       = "wl1271_spi",
            .max_speed_hz   = 13000000,
            .mode           = SPI_MODE_0,
            .bus_num        = 1,
            .chip_select    = 1,
            .irq            = gpio_to_irq( mfp_to_gpio(GPIO94_GPIO) ),
            .platform_data  = &tiwi_platform_data,
            .controller_data = &tiwi_spi_tuning,
        },
    };
     
    static struct pxa2xx_spi_master colibri_pxa320_spi_master = {
        .clock_enable = CKEN_SSP1,
        .num_chipselect = ARRAY_SIZE(colibri_pxa320_spi_chips),
        .enable_dma = 1,
    };
     
    static inline void colibri_spi_init(void)
    {
        // Configure MFP subsystem
        pxa3xx_mfp_config( ARRAY_AND_SIZE( colibri_pxa320_ssp_pin_config ) );
        // Add SPI master interface
        pxa2xx_set_spi_info(1,&colibri_pxa320_spi_master);
        // Add devices on SPI bus
        spi_register_board_info( ARRAY_AND_SIZE( colibri_pxa320_spi_chips ) );
    }
    Marvel PXA320 not support leve IRQ (only edge) - I use WL12XX_PLATFORM_QUIRK_EDGE_IRQ in platform code.
    got firmware from git://git.kernel.org/pub/scm/linux/kernel/git/dwmw2/linux-firmware.git

    Card detected, configured, and can be calibrated with Ti calibrator and INI file from LSR (if rename wl127x-fw-plt-3.bin to wl127x-fw-3.bin). 
    Kernel build with WL12XX_SPI support an module (named wl12xx_spi.ko)

    I read Ti messages about officialy not supported SPI interface, but our platform not have free SDIO.
    I try make open network with minimal configurations value (no key, no rate, no power control) with script:
    #!/bin/sh
     
    iwconfig wlan0 mode ad-hoc
    iwconfig wlan0 essid schtech
    iwconfig wlan0 channel 7
    #iwconfig wlan0 rate 1M fixed
    #iwconfig wlan0 key 1029384756
    #iwconfig wlan0 txpower 20
    on both sides. Next upping interface on target

    ifconfig wlan0 192.168.77.1/24 up

    and on host

    ifconfig wlan0 192.168.77.2/24 up

    In result - network worked fine (ICMP echo req and ack go between host and taget). In dmesg
    cfg80211: Updating information on frequency 2412 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
    cfg80211: Updating information on frequency 2417 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
    cfg80211: Updating information on frequency 2422 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
    cfg80211: Updating information on frequency 2427 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
    cfg80211: Updating information on frequency 2432 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
    cfg80211: Updating information on frequency 2437 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
    cfg80211: Updating information on frequency 2442 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
    cfg80211: Updating information on frequency 2447 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
    cfg80211: Updating information on frequency 2452 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
    cfg80211: Updating information on frequency 2457 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
    cfg80211: Updating information on frequency 2462 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
    cfg80211: Updating information on frequency 2467 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 2457000 KHz - 2482000 KHz @ 20000 KHz), (600 mBi, 2000 mBm)
    cfg80211: Updating information on frequency 2472 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 2457000 KHz - 2482000 KHz @ 20000 KHz), (600 mBi, 2000 mBm)
    cfg80211: Updating information on frequency 2484 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 2474000 KHz - 2494000 KHz @ 20000 KHz), (600 mBi, 2000 mBm)
    cfg80211: Disabling freq 5035 MHz
    cfg80211: Disabling freq 5040 MHz
    cfg80211: Disabling freq 5045 MHz
    cfg80211: Disabling freq 5055 MHz
    cfg80211: Disabling freq 5060 MHz
    cfg80211: Disabling freq 5080 MHz
    cfg80211: Disabling freq 5170 MHz
    cfg80211: Updating information on frequency 5180 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 5170000 KHz - 5250000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
    cfg80211: Updating information on frequency 5190 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 5170000 KHz - 5250000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
    cfg80211: Updating information on frequency 5200 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 5170000 KHz - 5250000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
    cfg80211: Updating information on frequency 5210 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 5170000 KHz - 5250000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
    cfg80211: Updating information on frequency 5220 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 5170000 KHz - 5250000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
    cfg80211: Updating information on frequency 5230 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 5170000 KHz - 5250000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
    cfg80211: Updating information on frequency 5240 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 5170000 KHz - 5250000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
    cfg80211: Disabling freq 5260 MHz
    cfg80211: Disabling freq 5280 MHz
    cfg80211: Disabling freq 5300 MHz
    cfg80211: Disabling freq 5320 MHz
    cfg80211: Disabling freq 5500 MHz
    cfg80211: Disabling freq 5520 MHz
    cfg80211: Disabling freq 5540 MHz
    cfg80211: Disabling freq 5560 MHz
    cfg80211: Disabling freq 5580 MHz
    cfg80211: Disabling freq 5600 MHz
    cfg80211: Disabling freq 5620 MHz
    cfg80211: Disabling freq 5640 MHz
    cfg80211: Disabling freq 5660 MHz
    cfg80211: Disabling freq 5680 MHz
    cfg80211: Disabling freq 5700 MHz
    cfg80211: Updating information on frequency 5180 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 5170000 KHz - 5250000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
    cfg80211: Updating information on frequency 5190 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 5170000 KHz - 5250000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
    cfg80211: Updating information on frequency 5200 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 5170000 KHz - 5250000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
    cfg80211: Updating information on frequency 5210 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 5170000 KHz - 5250000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
    cfg80211: Updating information on frequency 5220 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 5170000 KHz - 5250000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
    cfg80211: Updating information on frequency 5230 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 5170000 KHz - 5250000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
    cfg80211: Updating information on frequency 5240 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 5170000 KHz - 5250000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
    cfg80211: Disabling freq 5260 MHz
    cfg80211: Disabling freq 5280 MHz
    cfg80211: Disabling freq 5300 MHz
    cfg80211: Disabling freq 5320 MHz
    cfg80211: Disabling freq 5500 MHz
    cfg80211: Disabling freq 5520 MHz
    cfg80211: Disabling freq 5540 MHz
    cfg80211: Disabling freq 5560 MHz
    cfg80211: Disabling freq 5580 MHz
    cfg80211: Disabling freq 5600 MHz
    cfg80211: Disabling freq 5620 MHz
    cfg80211: Disabling freq 5640 MHz
    cfg80211: Disabling freq 5660 MHz
    cfg80211: Disabling freq 5680 MHz
    cfg80211: Disabling freq 5700 MHz
    cfg80211: Updating information on frequency 5745 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
    cfg80211: Updating information on frequency 5765 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
    cfg80211: Updating information on frequency 5785 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
    cfg80211: Updating information on frequency 5805 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
    cfg80211: Updating information on frequency 5825 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
    wl1271: loaded
    [TiWi_R2] Power enable
    wl1271: firmware booted (Rev 6.3.0.0.77)
     
    But, if I uncomment string "iwconfig wlan0 key 1029384756" wireless network not working. Debug fs show established cross connection.  Logs in dmesg not show any errors, but /sys/kernel/debug/ieee80211/phy0/statistics/failed_count increasing with any transmitted packet.
    Can you help me?

    Alex A. Mihaylov
    AKA MinimumLaw
  • Hi Alex,

    Can you please open the "DEBUG_CMD" as well?

    I would like to know which commands were download.

    - Elad.

  • Good day!

    Sorry, what is "DEBUG_CMD"?

    I have workspace with host desktop computer (named "utra") with Gento AMD64 and target module based on Toradex Colibri PXA320 (named "localhost"). On host I have wireless card ZD1211RW (or Atheros AR9170 - result is same), on target TiWi_r2 connected via SPI bus as described later.

    On HOST:

    ultra alex # lsmod | grep zd
    zd1211rw 37200 0
    mac80211 193600 1 zd1211rw
    cfg80211 124496 2 zd1211rw,mac80211
    usbcore 103336 9 zd1211rw,hid_sony,sl811_hcd,usbhid,ohci_hcd,uhci_hcd,usb_storage,ehci_hcd
    firmware_class 4360 9 zd1211rw,tg3,aic94xx,libsas,lpfc,qla2xxx,qla1280,advansys,pcmcia
    ultra alex # uname -a
    Linux ultra 3.1.6-gentoo #1 SMP Tue Jan 10 12:21:00 MSK 2012 x86_64 Dual-Core AMD Opteron(tm) Processor 1218 AuthenticAMD GNU/Linux
    ultra alex #

    On TARGET:

    localhost ~ # uname -a
    Linux localhost 3.2.1-g3023df3-dirty #7 Fri Jan 20 17:06:31 MSK 2012 armv5tel XScale-V3 based processor rev 7 (v5l) Toradex Colibri PXA320 GNU/Linux
    localhost ~ # zcat /proc/config.gz | grep WL12XX
    CONFIG_WL12XX_MENU=m
    CONFIG_WL12XX=m
    CONFIG_WL12XX_SPI=m
    # CONFIG_WL12XX_SDIO is not set
    localhost ~ #

    For target I use latest vanilla kernel with Texas wl12xx as module. Next, I clone git repo, as described here. From big kernel-firmware blobs, I use only wl127x-fw-3.bin as working firmware, wl127x-fw-plt-3.bin as firmware for Texas calibrator and wl1271-nvs.bin (symlink to wl127x-nvs.bin) as reference chip data. All this files placed in ti-connectivity folder.

    For target kernel used platform patch described later. Next, I boot target and load wl12xx drivers:

    localhost ~ # modprobe wl12xx
    localhost ~ # dmesg -c
    localhost ~ # modprobe wl12xx_spi
    localhost ~ # dmesg -c
    cfg80211: Updating information on frequency 2412 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2000 mBm) [skiped output] cfg80211: Updating information on frequency 5825 MHz for a 20 MHz width channel with regulatory rule:
    cfg80211: 5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
    wl1271: loaded
    localhost ~ #

    At this moment both HOST and TARGET have loaded (but uncofigured) WiFi driver. On HOST:

    ultra root # iwconfig
    lo no wireless extensions.

    wlan0 IEEE 802.11bg ESSID:off/any
    Mode:Managed Access Point: Not-Associated Tx-Power=0 dBm
    Retry long limit:7 RTS thr:off Fragment thr:off
    Encryption key:off
    Power Management:on

    eth0 no wireless extensions.

    eth1 no wireless extensions.

    ultra root #

    And on TARGET:

    localhost ~ # iwconfig
    lo no wireless extensions.

    wlan0 IEEE 802.11abgn ESSID:off/any
    Mode:Managed Access Point: Not-Associated Tx-Power=0 dBm
    Retry long limit:7 RTS thr:off Fragment thr:off
    Encryption key:off
    Power Management:off

    eth0 no wireless extensions.

    localhost ~ #

    For next step I configure them and upping interface as described later. On host:

    ultra root # cat ./wlanup 
    #!/bin/sh

    iwconfig wlan0 mode ad-hoc
    iwconfig wlan0 essid schtech
    iwconfig wlan0 channel 7
    iwconfig wlan0 rate 1M fixed
    iwconfig wlan0 key 1029384756
    iwconfig wlan0 txpower 20

    ultra root # ./wlanup
    ultra root # iwconfig
    lo no wireless extensions.

    wlan0 IEEE 802.11bg ESSID:"schtech"
    Mode:Ad-Hoc Frequency:2.442 GHz Cell: Not-Associated
    Tx-Power=20 dBm
    Retry long limit:7 RTS thr:off Fragment thr:off
    Encryption key:1029-3847-56
    Power Management:on

    eth0 no wireless extensions.

    eth1 no wireless extensions.

    ultra root #

    And on TARGET:

    localhost ~ # cat ./wlanup 
    #!/bin/sh

    iwconfig wlan0 mode ad-hoc
    iwconfig wlan0 essid schtech
    iwconfig wlan0 channel 7
    iwconfig wlan0 rate 1M fixed
    iwconfig wlan0 key 1029384756
    iwconfig wlan0 txpower 20

    localhost ~ # ./wlanup
    localhost ~ # iwconfig
    lo no wireless extensions.

    wlan0 IEEE 802.11abgn ESSID:"schtech"
    Mode:Ad-Hoc Frequency:2.442 GHz Cell: Not-Associated
    Tx-Power=20 dBm
    Retry long limit:7 RTS thr:off Fragment thr:off
    Encryption key:1029-3847-56
    Power Management:off

    eth0 no wireless extensions.

    localhost ~ #

    At this moment I have no record in dmesg. Next, I up wlan0 interface on both sides. On host:

    ultra root # ifconfig wlan0 192.168.77.2/24 up
    ultra root # ifconfig wlan0
    wlan0 Link encap:Ethernet HWaddr 00:02:72:7b:d2:bf
    inet addr:192.168.77.2 Bcast:192.168.77.255 Mask:255.255.255.0
    inet6 addr: fe80::202:72ff:fe7b:d2bf/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:576 (576.0 B)

    ultra root # iwconfig wlan0
    wlan0 IEEE 802.11bg ESSID:"schtech"
    Mode:Ad-Hoc Frequency:2.442 GHz Cell: 76:67:1F:13:5B:3B
    Tx-Power=20 dBm
    Retry long limit:7 RTS thr:off Fragment thr:off
    Encryption key:1029-3847-56
    Power Management:on

    ultra root # dmesg -c
    zd1211rw 1-9:1.0: firmware version 4725
    zd1211rw 1-9:1.0: zd1211b chip 0ace:1215 v4810 high 00-02-72 AL2230_RF pa0 g--NS
    wlan0: Trigger new scan to find an IBSS to join
    wlan0: Trigger new scan to find an IBSS to join
    wlan0: Trigger new scan to find an IBSS to join
    wlan0: Creating new IBSS network, BSSID 76:67:1f:13:5b:3b
    wlan0: no IPv6 routers present
    ultra root #

    And on target:

    localhost ~ # ifconfig wlan0 192.168.77.1/24 up
    localhost ~ # ifconfig wlan0
    wlan0 Link encap:Ethernet HWaddr de:ad:00:be:ef:01
    inet addr:192.168.77.1 Bcast:192.168.77.255 Mask:255.255.255.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

    localhost ~ # iwconfig wlan0
    wlan0 IEEE 802.11abgn ESSID:"schtech"
    Mode:Ad-Hoc Frequency:2.442 GHz Cell: 76:67:1F:13:5B:3B
    Tx-Power=20 dBm
    Retry long limit:7 RTS thr:off Fragment thr:off
    Encryption key:1029-3847-56
    Power Management:off

    localhost ~ # dmesg -c
    [TiWi_R2] Power enable
    wl1271: firmware booted (Rev 6.3.0.0.77)
    wlan0: Trigger new scan to find an IBSS to join
    localhost ~ #

    As seen both cards use one wireless cell. And both of them configured for use wep key 1029-3847-56 for masking trafic. I can see established cross connection and with another way. On target:

    localhost ~ # ls /sys/kernel/debug/ieee80211/phy0/netdev\:wlan0/stations/
    00:02:72:7b:d2:bf
    localhost ~ #

    And on host:

    ultra root # ls /sys/kernel/debug/ieee80211/phy0/netdev\:wlan0/stations/
    de:ad:00:be:ef:01
    ultra root #

    Ok. Both stations have connected pair (00:27:72:7b:d2:bf is host MAC, de:ad:00:be:ef:01 is target MAC - I use default mac in configurator). Theory, next I may ping host from target, and target from host. But on target:

    localhost ~ # ping 192.168.77.2
    PING 192.168.77.2 (192.168.77.2) 56(84) bytes of data.
    From 192.168.77.1 icmp_seq=1 Destination Host Unreachable
    From 192.168.77.1 icmp_seq=2 Destination Host Unreachable
    From 192.168.77.1 icmp_seq=3 Destination Host Unreachable
    ^C
    --- 192.168.77.2 ping statistics ---
    5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3999ms
    pipe 3
    localhost ~ # dmesg -c
    localhost ~ #

    And on host:

    ultra root # ping 192.168.77.1
    PING 192.168.77.1 (192.168.77.1) 56(84) bytes of data.
    From 192.168.77.2: icmp_seq=1 Destination Host Unreachable
    From 192.168.77.2: icmp_seq=2 Destination Host Unreachable
    From 192.168.77.2: icmp_seq=3 Destination Host Unreachable
    ^C
    --- 192.168.77.1 ping statistics ---
    4 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3002ms
    pipe 3
    ultra root # dmesg -c
    ultra root #

    And ping from host to target (and from target to host) presents if comment WEP key configuration in ./wlanup script (make open wireless network).

    Alex A. Mihaylov

    P.S.

    TexasInstruments configurator have bug with mac address parcing. I use next solution:

    diff --git a/nvs.c b/nvs.c
    --- a/nvs.c
    +++ b/nvs.c
    @@ -65,15 +65,15 @@ char *get_opt_nvsoutfile(int argc, char **argv)
    int nvs_set_mac(char *nvsfile, char *mac)
    {
    unsigned char mac_buff[12];
    - unsigned char in_mac[6];
    + unsigned int in_mac[6];
    int fd;

    if (mac) {
    int ret =
    - sscanf(mac, "%2x:%2x:%2x:%2x:%2x:%2x",
    - (unsigned int *)&in_mac[0], (unsigned int *)&in_mac[1],
    - (unsigned int *)&in_mac[2], (unsigned int *)&in_mac[3],
    - (unsigned int *)&in_mac[4], (unsigned int *)&in_mac[5]);
    + sscanf(mac, "%02x:%02x:%02x:%02x:%02x:%02x",
    + &in_mac[0], &in_mac[1],
    + &in_mac[2], &in_mac[3],
    + &in_mac[4], &in_mac[5]);
    if (ret != 6) {
    fprintf(stderr, "MAC address is not valid: %s\n", mac);
    return -1;

    No resons for use unsigned char type for in_mac array. In function no array specific points, but sscanf with format %X use int type. With original code I have incorrect mac address after configurator.

     

  • Hi Alex,

    In your last post you said: "/sys/kernel/debug/ieee80211/phy0/statistics/failed_count increasing with any transmitted packet." In order to figure out what is going on there, I wanted to turn on the debug at "cmd.c" file. To see which commands the WLAN chip actually gets.

    But now I don't think that the problem is there. 

    Can you grab a WLAN sniffer log and send it to me?

    - Elad.


  • Ok! I make next commands:

    localhost ~ # modprobe wl12xx debug_level=4096
    localhost ~ # modprobe wl12xx_spi
    localhost ~ # ./wlanup
    localhost ~ # ifconfig wlan0 192.168.77.1/24 up
    localhost ~ # dmesg -c [output skipped] wl1271: loaded
    [TiWi_R2] Power enable
    wl1271: TEST_CMD_INI_FILE_RADIO_PARAM: 00000000: 00 00 00 00 19 00 00 00 0c 0c ec f6 00 0c 18 f8
    wl1271: TEST_CMD_INI_FILE_RADIO_PARAM: 00000010: fc 00 08 10 f0 f8 00 0a 14 00 00 00 00 00 00 00
    wl1271: TEST_CMD_INI_FILE_RADIO_PARAM: 00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    wl1271: TEST_CMD_INI_FILE_RADIO_PARAM: 00000030: 00 00 00 00 00 00 77 01 80 0c 15 1b 1f 21 25 26
    wl1271: TEST_CMD_INI_FILE_RADIO_PARAM: 00000040: 12 1b 1f 20 24 25 12 18 1b 1c 20 21 26 26 26 26
    wl1271: TEST_CMD_INI_FILE_RADIO_PARAM: 00000050: 26 26 26 26 26 26 26 26 15 27 27 27 27 27 27 27
    wl1271: TEST_CMD_INI_FILE_RADIO_PARAM: 00000060: 27 27 27 27 27 27 15 2a 01 02 02 02 02 00 11 11
    wl1271: TEST_CMD_INI_FILE_RADIO_PARAM: 00000070: 15 11 15 0f 0e 20 2d 00 00 00 00 00 00 00 00 00
    wl1271: TEST_CMD_INI_FILE_RADIO_PARAM: 00000080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    wl1271: TEST_CMD_INI_FILE_RADIO_PARAM: 00000090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    wl1271: TEST_CMD_INI_FILE_RADIO_PARAM: 000000a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    wl1271: TEST_CMD_INI_FILE_RADIO_PARAM: 000000b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    wl1271: TEST_CMD_INI_FILE_RADIO_PARAM: 000000c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    wl1271: TEST_CMD_INI_FILE_RADIO_PARAM: 000000d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    wl1271: TEST_CMD_INI_FILE_EXT_RADIO_PARAM: 00000000: 00 00 00 00 26 00 00 00 00 00 00 00 00 00 00 00
    wl1271: TEST_CMD_INI_FILE_EXT_RADIO_PARAM: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    wl1271: TEST_CMD_INI_FILE_EXT_RADIO_PARAM: 00000020: 00 00 00 00
    wl1271: firmware booted (Rev 6.3.0.0.77)
    wlan0: Trigger new scan to find an IBSS to join
    localhost ~ #

    And next try to ping host:

    localhost ~ # ping 192.168.77.2
    PING 192.168.77.2 (192.168.77.2) 56(84) bytes of data.
    From 192.168.77.1 icmp_seq=1 Destination Host Unreachable
    From 192.168.77.1 icmp_seq=2 Destination Host Unreachable
    From 192.168.77.1 icmp_seq=3 Destination Host Unreachable
    ^C
    --- 192.168.77.2 ping statistics ---
    4 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3007ms
    pipe 3
    localhost ~ # dmesg -c
    localhost ~ #

    No any data in dmesg :-(

    From host side "tcpdump -i wlan0" show only arp requests

    ultra root # tcpdump -i wlan0
    tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
    listening on wlan0, link-type EN10MB (Ethernet), capture size 96 bytes
    13:27:15.343860 arp who-has 192.168.77.1 tell 192.168.77.2
    13:27:16.343854 arp who-has 192.168.77.1 tell 192.168.77.2
    13:27:17.343849 arp who-has 192.168.77.1 tell 192.168.77.2
    13:27:18.353856 arp who-has 192.168.77.1 tell 192.168.77.2
    13:27:19.353850 arp who-has 192.168.77.1 tell 192.168.77.2
    13:27:20.353849 arp who-has 192.168.77.1 tell 192.168.77.2
    13:27:22.353849 arp who-has 192.168.77.1 tell 192.168.77.2
    13:27:23.353849 arp who-has 192.168.77.1 tell 192.168.77.2
    13:27:24.353851 arp who-has 192.168.77.1 tell 192.168.77.2
    13:27:25.363855 arp who-has 192.168.77.1 tell 192.168.77.2
    13:27:26.363859 arp who-has 192.168.77.1 tell 192.168.77.2
    13:27:27.363850 arp who-has 192.168.77.1 tell 192.168.77.2
    13:27:29.363850 arp who-has 192.168.77.1 tell 192.168.77.2
    13:27:30.363853 arp who-has 192.168.77.1 tell 192.168.77.2
    ^C
    14 packets captured
    14 packets received by filter
    0 packets dropped by kernel
    ultra root #

    at this moment I build tcpdump for my target. I send captured output after build done.

    I try set debug level to 512 (DEBUG_CRYPT)

    wlan0: Trigger new scan to find an IBSS to join
    wl1271: KEY: 00000000: 10 29 38 47 56
    wl1271: TARGET KEY: 00000000: 00 00 00 00 02 02 00 00 01 00 05 01 10 29 38 47
    wl1271: TARGET KEY: 00000010: 56 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    wl1271: TARGET KEY: 00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    wl1271: TARGET KEY: 00000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    wl1271: TARGET KEY: 00000040: 00 00 00 00

    Ok. tcpdump for target builded:

    localhost ~ # tcpdump -i wlan0
    tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
    listening on wlan0, link-type EN10MB (Ethernet), capture size 68 bytes
    12:42:12.399082 arp who-has 192.168.77.2 tell 192.168.77.1
    12:42:13.393695 arp who-has 192.168.77.2 tell 192.168.77.1
    12:42:14.393693 arp who-has 192.168.77.2 tell 192.168.77.1
    12:42:15.402740 arp who-has 192.168.77.2 tell 192.168.77.1
    12:42:16.393682 arp who-has 192.168.77.2 tell 192.168.77.1
    12:42:17.393678 arp who-has 192.168.77.2 tell 192.168.77.1
    12:42:18.413164 arp who-has 192.168.77.2 tell 192.168.77.1
    12:42:19.403687 arp who-has 192.168.77.2 tell 192.168.77.1
    12:42:20.403711 arp who-has 192.168.77.2 tell 192.168.77.1
    ^C
    9 packets captured
    9 packets received by filter
    0 packets dropped by kernel
    localhost ~ #

    result is same - only ARP requests :-(

    And some other idea:

    What is /sys/kernel/debug/ieee80211/phy0/wl12xx/fw-statistics directory? In then placed files wep_packets and wep_key_not_found. Both of them now contents 327. May be firmware not receive WEP key? And file dma_tx_error contents 6909. 

  • One more question regarding the SDIO driver for WL1273: if use SDIO port on DM6446, can TI support the SDIO driver based on Monta vista Linux 2.6.36 rev?

    Thanks,

    Simon

  • Hi Simon,

    could you check this with Jorjin? They can help you.

    BR. Albin

  • Hi Alex,

    It's weird that you see only ARP messages. 

    1. Are you seeing any TX messages over the air? (Can you attach air capture?)

    2. Does you AP configured with security?

    3. Did you enable any rx-filtering? 

    Elad

  • Good day!

    1. Sorry, at this moment I don't know tools for capture messages over the air. Can you say me appliction name for this?

    2. I have no dedicated AP. I try to work with Ad-Hoc mode. Both Ad-Hoc clients configured with security (and not work), or configured without security (and work fine).

    3. I not enable any rx-filtering or firewall. 

    Alex

  • Good day, again!

    I not found any usable air-scan tools, but I change kernel version from 3.2 series to 3.1 series.

    In series 3.1 Both (open and wep crypted) network in Ad-Hoc mode work fine with SPI interface and my platform patches. But this driver not set channel rate:

    localhost~# iwconfig wlan0 rate 1M fixed
    Error for wireless request "Set Bit Rate" (8B20) :
    SET failed on device wlan0 ; Operation not supported.
    localhost ~ #

    Rate setting work fine with open network on kernel series 3.2 with new firmware on SPI interface.

    Kernel seriae 3.1 use another firmware and another instance of wl12xx_spi driver.

    Anybody can try to build wep-crypted network with 3.2 series kernell on SDIO interface? Is this interface (firmware?) trouble, or driver code trouble?

    Alex