Go back –> iwl3945 kerneldoc
iwl3945_queue_init - Initialize queue's high/low-water and read/write indexes
int iwl3945_queue_init (struct iwl3945_priv * priv, struct iwl3945_queue * q, int count, int slots_num, u32 id)Arguments
iwl3945_tx_queue_alloc - Alloc driver data and TFD CB for one Tx/cmd queue
int iwl3945_tx_queue_alloc (struct iwl3945_priv * priv, struct iwl3945_tx_queue * txq, u32 id)Arguments
iwl3945_tx_queue_init - Allocate and initialize one tx/cmd queue
int iwl3945_tx_queue_init (struct iwl3945_priv * priv, struct iwl3945_tx_queue * txq, int slots_num, u32 txq_id)Arguments
iwl3945_tx_queue_free - Deallocate DMA queue.
void iwl3945_tx_queue_free (struct iwl3945_priv * priv, struct iwl3945_tx_queue * txq)Arguments
- txq
- Transmit queue to deallocate.
Description
Empty queue by removing and destroying all BD's. Free all buffers. 0-fill, but do not free "txq" descriptor structure.
iwl3945_remove_station - Remove driver's knowledge of station.
u8 iwl3945_remove_station (struct iwl3945_priv * priv, const u8 * addr, int is_ap)Arguments
NOTE
This does not remove station from device's station table.
iwl3945_clear_stations_table - Clear the driver's station table
void iwl3945_clear_stations_table (struct iwl3945_priv * priv)Arguments
NOTE
This does not clear or otherwise alter the device's station table.
iwl3945_add_station - Add station to station tables in driver and device
u8 iwl3945_add_station (struct iwl3945_priv * priv, const u8 * addr, int is_ap, u8 flags)Arguments
iwl3945_enqueue_hcmd - enqueue a uCode command
int iwl3945_enqueue_hcmd (struct iwl3945_priv * priv, struct iwl3945_host_cmd * cmd)Arguments
- priv
- device private data point
- cmd
- a point to the ucode command structure
Description
The function returns < 0 values to indicate the operation is failed. On success, it turns the index (> 0) of command in the command queue.
iwl3945_set_rxon_channel - Set the phymode and channel values in staging RXON
int iwl3945_set_rxon_channel (struct iwl3945_priv * priv, enum ieee80211_band band, u16 channel)Arguments
- band
- 2.4 or 5 GHz band
- channel
- Any channel valid for the requested band In addition to setting the staging RXON, priv->band is also set.
NOTE
Does not commit to the hardware; it sets appropriate bit fields in the staging RXON flag structure based on the band
iwl3945_check_rxon_cmd - validate RXON structure is valid
int iwl3945_check_rxon_cmd (struct iwl3945_rxon_cmd * rxon)Arguments
NOTE
This is really only useful during development and can eventually be #ifdef'd out once the driver is stable and folks aren't actively making changes
iwl3945_full_rxon_required - check if full RXON (vs RXON_ASSOC) cmd is needed
int iwl3945_full_rxon_required (struct iwl3945_priv * priv)Arguments
- priv
- staging_rxon is compared to active_rxon
Description
If the RXON structure is changing enough to require a new tune, or is clearing the RXON_FILTER_ASSOC_MSK, then return 1 to indicate that a new tune (full RXON command, rather than RXON_ASSOC cmd) is required.
iwl3945_commit_rxon - commit staging_rxon to hardware
int iwl3945_commit_rxon (struct iwl3945_priv * priv)Arguments
Description
The RXON command in staging_rxon is committed to the hardware and the active_rxon structure is updated with the new data. This function correctly transitions out of the RXON_ASSOC_MSK state if a HW tune is required based on the RXON structure changes.
iwl3945_eeprom_init - read EEPROM contents
int iwl3945_eeprom_init (struct iwl3945_priv * priv)Arguments
Description
Load the EEPROM contents from adapter into priv->eeprom
NOTE
This routine uses the non-debug IO access functions.
iwl3945_supported_rate_to_ie - fill in the supported rate in IE field
u16 iwl3945_supported_rate_to_ie (u8 * ie, u16 supported_rate, u16 basic_rate, int * left)Arguments
return
set the bit for each supported rate insert in ie
iwl3945_fill_probe_req - fill in all required fields and IE for probe request
u16 iwl3945_fill_probe_req (struct iwl3945_priv * priv, struct ieee80211_mgmt * frame, int left, int is_direct)Arguments
iwl3945_scan_cancel - Cancel any currently executing HW scan
int iwl3945_scan_cancel (struct iwl3945_priv * priv)Arguments
NOTE
priv->mutex is not required before calling this function
iwl3945_scan_cancel_timeout - Cancel any currently executing HW scan
int iwl3945_scan_cancel_timeout (struct iwl3945_priv * priv, unsigned long ms)Arguments
- ms
- amount of time to wait (in milliseconds) for scan to abort
NOTE
priv->mutex must be held before calling this function
iwl3945_get_sta_id - Find station's index within station table
int iwl3945_get_sta_id (struct iwl3945_priv * priv, struct ieee80211_hdr * hdr)Arguments
iwl3945_setup_rx_handlers - Initialize Rx handler callbacks
void iwl3945_setup_rx_handlers (struct iwl3945_priv * priv)Arguments
Description
Setup the RX handlers for each of the reply types sent from the uCode to the host.
This function chains into the hardware specific files for them to setup any hardware specific handlers as well.
iwl3945_cmd_queue_reclaim - Reclaim CMD queue entries
void iwl3945_cmd_queue_reclaim (struct iwl3945_priv * priv, int txq_id, int index)Arguments
Description
When FW advances 'R' index, all entries between old and new 'R' index need to be reclaimed.
iwl3945_tx_cmd_complete - Pull unused buffers off the queue and reclaim them
void iwl3945_tx_cmd_complete (struct iwl3945_priv * priv, struct iwl3945_rx_mem_buffer * rxb)Arguments
- rxb
- Rx buffer to reclaim
Description
If an Rx buffer has an async callback associated with it the callback will be executed. The attached skb (if present) will only be freed if the callback returns 1
iwl3945_rx_queue_space - Return number of free slots available in queue.
int iwl3945_rx_queue_space (const struct iwl3945_rx_queue * q)Arguments
iwl3945_rx_queue_update_write_ptr - Update the write pointer for the RX queue
int iwl3945_rx_queue_update_write_ptr (struct iwl3945_priv * priv, struct iwl3945_rx_queue * q)Arguments
iwl3945_dma_addr2rbd_ptr - convert a DMA address to a uCode read buffer ptr
__le32 iwl3945_dma_addr2rbd_ptr (struct iwl3945_priv * priv, dma_addr_t dma_addr)Arguments
iwl3945_rx_queue_restock - refill RX queue from pre-allocated pool
int iwl3945_rx_queue_restock (struct iwl3945_priv * priv)Arguments
Description
If there are slots in the RX queue that need to be restocked, and we have free pre-allocated buffers, fill the ranks as much as we can, pulling from rx_free.
This moves the 'write' index forward to catch up with 'processed', and also updates the memory address in the firmware to reference the new target buffer.
iwl3945_rx_allocate - Move all used packet from rx_used to rx_free
void iwl3945_rx_allocate (struct iwl3945_priv * priv)Arguments
Description
When moving to rx_free an SKB is allocated for the slot.
Also restock the Rx queue via iwl3945_rx_queue_restock. This is called as a scheduled work item (except for during initialization)
iwl3945_rx_handle - Main entry function for receiving responses from uCode
void iwl3945_rx_handle (struct iwl3945_priv * priv)Arguments
Description
Uses the priv->rx_handlers callback function array to invoke the appropriate handlers, including command responses, frame-received notifications, and other notifications.
iwl3945_tx_queue_update_write_ptr - Send new write index to hardware
int iwl3945_tx_queue_update_write_ptr (struct iwl3945_priv * priv, struct iwl3945_tx_queue * txq)Arguments
iwl3945_print_event_log - Dump error event log to syslog
void iwl3945_print_event_log (struct iwl3945_priv * priv, u32 start_idx, u32 num_events, u32 mode)Arguments
NOTE
Must be called with iwl3945_grab_nic_access already obtained!
iwl3945_irq_handle_error - called for HW or SW error interrupt from card
void iwl3945_irq_handle_error (struct iwl3945_priv * priv)Arguments
iwl3945_get_channel_info - Find driver's private channel info
const struct iwl3945_channel_info * iwl3945_get_channel_info (const struct iwl3945_priv * priv, enum ieee80211_band band, u16 channel)Arguments
Description
Based on band and channel number.
iwl3945_init_channel_map - Set up driver's info for all possible channels
int iwl3945_init_channel_map (struct iwl3945_priv * priv)Arguments
iwl3945_init_geos - Initialize mac80211's geo/channel info based from eeprom
int iwl3945_init_geos (struct iwl3945_priv * priv)Arguments
iwl3945_verify_inst_full - verify runtime uCode image in card vs. host,
int iwl3945_verify_inst_full (struct iwl3945_priv * priv, __le32 * image, u32 len)Arguments
Description
looking at all data.
iwl3945_verify_inst_sparse - verify runtime uCode image in card vs. host,
int iwl3945_verify_inst_sparse (struct iwl3945_priv * priv, __le32 * image, u32 len)Arguments
Description
using sample data 100 bytes apart. If these sample points are good, it's a pretty good bet that everything between them is good, too.
iwl3945_verify_ucode - determine which instruction image is in SRAM,
int iwl3945_verify_ucode (struct iwl3945_priv * priv)Arguments
Description
and verify its contents
iwl3945_load_bsm - Load bootstrap instructions
int iwl3945_load_bsm (struct iwl3945_priv * priv)Arguments
BSM operation
The Bootstrap State Machine (BSM) stores a short bootstrap uCode program in special SRAM that does not power down during RFKILL. When powering back up after power-saving sleeps (or during initial uCode load), the BSM loads the bootstrap program into the on-board processor, and starts it.
The bootstrap program loads (via DMA) instructions and data for a new program from host DRAM locations indicated by the host driver in the BSM_DRAM_* registers. Once the new program is loaded, it starts automatically.
When initializing the NIC, the host driver points the BSM to the "initialize" uCode image. This uCode sets up some internal data, then notifies host via "initialize alive" that it is complete.
The host then replaces the BSM_DRAM_* pointer values to point to the normal runtime uCode instructions and a backup uCode data cache buffer (filled initially with starting data values for the on-board processor), then triggers the "initialize" uCode to load and launch the runtime uCode, which begins normal operation.
When doing a power-save shutdown, runtime uCode saves data SRAM into the backup data cache in DRAM before SRAM is powered down.
When powering back up, the BSM loads the bootstrap program. This reloads the runtime uCode instructions and the backup data cache into SRAM, and re-launches the runtime uCode from where it left off.
iwl3945_read_ucode - Read uCode images from disk file.
int iwl3945_read_ucode (struct iwl3945_priv * priv)Arguments
Description
Copy into buffers for card to fetch via bus-mastering
iwl3945_set_ucode_ptrs - Set uCode address location
int iwl3945_set_ucode_ptrs (struct iwl3945_priv * priv)Arguments
Description
Tell initialization uCode where to find runtime uCode.
BSM registers initially contain pointers to initialization uCode. We need to replace them to load runtime uCode inst and data, and to save runtime data when powering down.
iwl3945_init_alive_start - Called after REPLY_ALIVE notification received
void iwl3945_init_alive_start (struct iwl3945_priv * priv)Arguments
Description
Called after REPLY_ALIVE notification received from "initialize" uCode.
Tell "initialize" uCode to go ahead and load the runtime uCode.
iwl3945_alive_start - called after REPLY_ALIVE notification received
void iwl3945_alive_start (struct iwl3945_priv * priv)Arguments
Description
from protocol/runtime uCode (initialization uCode's Alive gets handled by iwl3945_init_alive_start).
iwl3945_mac_config - mac80211 config callback
int iwl3945_mac_config (struct ieee80211_hw * hw, u32 changed)Arguments
Description
We ignore conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME since it seems to be set inappropriately and the driver currently sets the hardware up to use it whenever needed.