Fwd: Feature addition to DRIVER_NDIS module

Braghadeswaran T braghades
Wed Aug 26 05:56:07 PDT 2015


========================================


Hello Everyone,
    I had an opportunity to make wpa_supplicant work under windows embedded
compact. As part of it I'm
making an NDIS 5 driver work with wpa_supplicant.
   Following are some changes I'd to do to make for certain features to
work.I hope they'll be needed by many others.

-------------------
[1] # NDIS_STATUS_MEDIA_SPECIFIC_INDICATION handling:
Issue: The data field under specific handlers are passed wrong pointers.
Fix  : Offset addition to current pointer.
File and Code changes:
/src/drivers/driver_ndis.c:1659
        case Ndis802_11StatusType_Authentication:
--              wpa_driver_ndis_event_auth(drv, data, data_len);
++        wpa_driver_ndis_event_auth(drv,
(data+sizeof(NDIS_802_11_STATUS_INDICATION)), data_len);


/src/drivers/driver_ndis.c:1662
    case Ndis802_11StatusType_PMKID_CandidateList:
--             wpa_driver_ndis_event_pmkid(drv, data, data_len);
++             wpa_driver_ndis_event_pmkid(drv,
(data+sizeof(NDIS_802_11_STATUS_INDICATION)), data_len);

http://w1.fi/cgit/hostap/tree/src/drivers/driver_ndis.c?h=pending#n1659

-------------------
[2] # Support for SSID SPECIFIC SCAN_REQUEST:
Issue: No support for SSID SPECIFIC SCAN_REQUEST
Fix  : Handle SSID request from UsrSpace and pass it to
Miniport_Driver(i.e.Kernel space of Network device driver)
File and Code changes:
/src/drivers/driver_ndis.c:750
This entire function is recoded to dynamically allocate memory as needed and
send additional param(i.e. SSID and SSID_LENGTH) if found.

static int wpa_driver_ndis_scan_native80211(
    struct wpa_driver_ndis_data *drv,
    struct wpa_driver_scan_params *params)
{
    DOT11_SCAN_REQUEST_V2 *req;
    int res;
        int len = 0;

        len = sizeof(DOT11_SCAN_REQUEST_V2);
        if(params->ssids[0].ssid_len && (MAX_SSID_LEN >=
params->ssids[0].ssid_len))
            len += sizeof(DOT11_SSID);//sizeof(int) +
(params->ssids[0].ssid_len);

        wpa_printf(MSG_ERROR,"len:%d",len);
        if(NULL == (req = os_malloc(len)))
            return -1;

    os_memset(req, 0, len);
    req->dot11BSSType = dot11_BSS_type_any;
        if(!(params->ssids[0].ssid_len) || (MAX_SSID_LEN <
params->ssids[0].ssid_len)){
    os_memset(req->dot11BSSID, 0xff, ETH_ALEN);
    req->dot11ScanType = dot11_scan_type_auto;
        } else {
        req->dot11ScanType = dot11_scan_type_active;
        req->udot11SSIDsOffset =  0;
        req->uNumOfdot11SSIDs = 1;
        *(unsigned long *)(req->ucBuffer) = params->ssids[0].ssid_len;
        os_memcpy((req->ucBuffer + sizeof(unsigned
long)),params->ssids[0].ssid,params->ssids[0].ssid_len);
        }
        wpa_printf(MSG_ERROR,"ssid:%s",(req->ucBuffer + sizeof(unsigned
long)));

    res = ndis_set_oid(drv, OID_DOT11_SCAN_REQUEST, (char *) req,len);
    eloop_cancel_timeout(wpa_driver_ndis_scan_timeout, drv, drv->ctx);
    eloop_register_timeout(7, 0, wpa_driver_ndis_scan_timeout, drv,
                   drv->ctx);
        if(req)
            os_free(req);
    return res;
}
-------------------

PS:This is just start of my work with (y)our wpa_supplicant and hope to
add many functionalities to it.

-- 
With gratitude,
Braghadeswaran T
Embedded System Technologist

========================================



-- 
With gratitude,
Braghadeswaran T
M.E.-Embedded System Technology
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.shmoo.com/pipermail/hostap/attachments/20150826/49ccbdee/attachment-0001.htm>



More information about the Hostap mailing list