wl_api.h File Reference


Detailed Description

Basic WiFi API.

**************************************************************

This file provides the wl_api interface.

Author:
H&D Wireless AB:

Introduction

This is the documentation for the generic WiFi Driver API wl_api.

Main Files

#include <stdint.h>
#include <stdlib.h>
#include "spb.h"

Go to the source code of this file.

Data Structures

struct  wl_event_t
struct  wl_ssid_t
 SSID representation. More...
struct  wl_mac_addr_t
struct  wl_network_t

Functions

wl_err_t wl_register_event_cb (wl_event_cb_t cb, void *ctx)
 Register an event handler.
wl_err_t wl_init (void *ctx, wl_fw_download_cb_t fw_download_cb, wl_init_complete_cb_t init_complete_cb)
 Initialize the wl_api library.
void wl_poll (uint32_t tick)
 WiFi driver forward progress function.
wl_err_t wl_scan (void)
 Scan all channels.
wl_err_t wl_get_network_list (struct wl_network_t **network_list, uint8_t *network_cnt)
 Get the list of currently known networks.
wl_err_t wl_connect (char *ssid, size_t ssid_len)
 Connect to a SSID.
wl_err_t wl_connect_bssid (struct wl_mac_addr_t bssid)
 Connect to a BSSID.
wl_err_t wl_disconnect (void)
 Disconnect from the network.
wl_err_t wl_set_auth_mode (enum wl_auth_mode mode)
 Set the WEP authentication mode of the driver.
wl_err_t wl_add_wep_key (uint8_t key_idx, size_t key_len, const void *key, struct wl_mac_addr_t *bssid)
 Add a WEP encryption key to the device.
wl_err_t wl_set_default_wep_key (uint8_t key_idx)
 Set the default WEP key index.
wl_err_t wl_delete_wep_key (uint8_t key_idx, struct wl_mac_addr_t *bssid)
 Delete a WEP key.
wl_err_t wl_set_passphrase (const struct wl_network_t *net, const char *passphrase, const size_t len, const enum wl_enc_type enc_type, const enum wl_auth_mode auth_mode)
 Set a WPA/WPA2 passphase.
wl_err_t wl_clear_passphrase (struct wl_network_t *net)
 Remove a WPA/WPA2 passphase.
wl_err_t wl_enable_ps (void)
 Enable legacy power save mode.
wl_err_t wl_disable_ps (void)
 Disable legacy power save mode.
wl_err_t wl_conf_ps (uint8_t use_ps_poll, uint32_t ps_traffic_timeout, uint32_t ps_delay, uint8_t rx_all_dtim, uint16_t listen_interval)
 Configure power save parameters.
wl_err_t wl_get_mac_addr (uint8_t *buf)
 Get the interface MAC address.
struct wl_network_twl_get_current_network (void)
 Return the associated network.
wl_err_t wl_process_rx (char *pkt, size_t pkt_len, char **stripped_pkt, size_t *stripped_pkt_len, uint16_t *vlanid_prio)
 Process rx packet.
wl_err_t wl_process_tx (char *eth_hdr, size_t eth_hdr_len, size_t pkt_len, char *hdr, uint16_t vlanid_prio)
 Process tx packet.
wl_err_t wl_register_rx_isr (wl_rx_isr_t isr, void *ctx)
 Register RX callback.
wl_err_t wl_rx (uint8_t *buf, uint16_t *len)
 Read pending packet.
wl_err_t wl_tx (const uint8_t *buf, uint16_t len)
 Send processed tx packet.

Defines

#define WL_API_RELEASE_NAME   "unknown"
#define WL_HEADER_SIZE   14
#define WL_MAX_PKT_LEN   1600
#define WL_SSID_MAX_LENGTH   32
#define WL_MAC_ADDR_LENGTH   6
#define ALIGN   __attribute__ ((aligned (4)))

Typedefs

typedef void(* wl_event_cb_t )(struct wl_event_t event, void *ctx)
 WiFi event callback.
typedef void(* wl_rx_isr_t )(void *ctx)
 WiFi event callback.
typedef void( wl_fw_download_cb_t )(void *ctx, uint8_t **buf, uint32_t *len)
 Firmware access function.
typedef void( wl_init_complete_cb_t )(void *ctx)
 Initialization complete callback function.

Enumerations

enum  wl_err_t {
  WL_FAILURE = -1, WL_SUCCESS = 1, WL_OOM, WL_INVALID_LENGTH,
  WL_NOT_SUPPORTED, WL_ABSORBED, WL_RESOURCES, WL_BUSY,
  WL_RETRY, WL_INVALID_ARGS, WL_AVAIL, WL_CARD_FAILURE,
  WL_FIRMWARE_INVALID
}
enum  wl_event_id_t {
  WL_EVENT_MEDIA_CONNECTED = 0, WL_EVENT_CONN_FAILURE, WL_EVENT_MEDIA_DISCONNECTED, WL_EVENT_CONN_LOST,
  WL_EVENT_SCAN_COMPLETE, MAX_WL_EVENT
}
enum  wl_auth_mode {
  AUTH_MODE_INVALID, AUTH_MODE_AUTO, AUTH_MODE_OPEN_SYSTEM, AUTH_MODE_SHARED_KEY,
  AUTH_MODE_WPA, AUTH_MODE_WPA2, AUTH_MODE_WPA_PSK, AUTH_MODE_WPA2_PSK
}
enum  wl_enc_type {
  ENC_TYPE_WEP = 5, ENC_TYPE_TKIP = 2, ENC_TYPE_CCMP = 4, ENC_TYPE_NONE = 7,
  ENC_TYPE_AUTO = 8
}

Variables

struct wl_ssid_t ALIGN
 SSID representation.


Define Documentation

#define WL_HEADER_SIZE   14

Size of the wl_api packet header

#define WL_MAC_ADDR_LENGTH   6

Size of a MAC-address or BSSID

#define WL_MAX_PKT_LEN   1600

Maximum packet size (including wl_api headers and paddings

#define WL_SSID_MAX_LENGTH   32

Maximum size of a SSID


API Reference Manual Copyright © 2009 H&D Wireless AB, All rights reserved.