Ticket #5144: 0001-Added-event-check-for-firmware-download.patch

File 0001-Added-event-check-for-firmware-download.patch, 2.1 kB (added by mbletsas, 7 years ago)

added event for completion of firmware download (ticket #4637)

  • drivers/net/wireless/libertas/cmdresp.c

    From 0864083a4a4a8a47c9658724e22ce63ff3749615 Mon Sep 17 00:00:00 2001
    From: root <root@localhost.localdomain>
    Date: Thu, 22 Nov 2007 17:14:49 +0530
    Subject: [PATCH] Added event check for firmware download.
    
    ---
     drivers/net/wireless/libertas/cmdresp.c |    5 ++++-
     drivers/net/wireless/libertas/host.h    |    1 +
     drivers/net/wireless/libertas/if_usb.c  |    9 ++++++---
     3 files changed, 11 insertions(+), 4 deletions(-)
    
    diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
    index d391391..dd1e188 100644
    a b  
    982982        case MACREG_INT_CODE_SNR_HIGH: 
    983983                lbs_pr_alert("EVENT: snr high\n"); 
    984984                break; 
    985  
     985        case MACREG_INT_CODE_FIRMWARE_READY: 
     986                priv->adapter->fw_ready = 1; 
     987                lbs_pr_alert("EVENT: Wireless firmware ready\n"); 
     988                break; 
    986989        case MACREG_INT_CODE_MESH_AUTO_STARTED: 
    987990                /* Ignore spurious autostart events if autostart is disabled */ 
    988991                if (!priv->mesh_autostart_enabled) { 
  • drivers/net/wireless/libertas/host.h

    diff --git a/drivers/net/wireless/libertas/host.h b/drivers/net/wireless/libertas/host.h
    index 00d5675..2150ea0 100644
    a b  
    291291#define MACREG_INT_CODE_RSSI_HIGH               0x0000001c 
    292292#define MACREG_INT_CODE_SNR_HIGH                0x0000001d 
    293293#define MACREG_INT_CODE_MESH_AUTO_STARTED       0x00000023 
     294#define MACREG_INT_CODE_FIRMWARE_READY          0x00000030 
    294295 
    295296#endif                          /* _HOST_H_ */ 
  • drivers/net/wireless/libertas/if_usb.c

    diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
    index 6415bd2..c82771d 100644
    a b  
    924924 
    925925        if_usb_submit_rx_urb(priv); 
    926926 
    927         /* Delay 200 ms to waiting for the FW ready */ 
    928         msleep_interruptible(200); 
     927        /* Wait for the FW ready */ 
     928        while (!priv->adapter->fw_ready) { 
     929                msleep_interruptible(10); 
     930                ++i; 
     931        } 
    929932 
    930         priv->adapter->fw_ready = 1; 
     933        lbs_pr_info("FW ready time = %d ms\n", i * 10); 
    931934 
    932935done: 
    933936        lbs_deb_leave_args(LBS_DEB_USB, "ret %d", ret);