Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Include Page
css.webworks.css
css.webworks.css

Anchor
104170810642591041708
1064259
Starting a Network Device

Anchor
104170910494701041709
1049470
NetDev_Start() is called once each time an interface is started. It performs the following actions:

  1. Anchor
    104171010495811041710
    1049581
    Call the NetOS_Dev_CfgTxRdySignal() function to configure the transmit ready semaphore count. This function call is optional and is performed if the hardware device supports queuing multiple transmit frames. By default, the semaphore count is initialized to one. However, DMA wireless devices should set the semaphore count equal to the number of configured transmit descriptors for optimal performance. Non-DMA devices that support queuing more than one transmit frame may also benefit from a non-default value. Anchor10417111041711queues size for optimal performance.
  2. Anchor
    1049582
    1049582
    Power up the wireless module, this is performed via the network device’s BSP function pointer, NetDev_WiFi_Start().
  3. Anchor
    1050405
    1050405
    The wireless device driver must initializes and start the communication between the host and the wireless module.
  4. Anchor
    1049922
    1049922
    The device driver should validate the current firmware loaded in the wireless device and upgrade the device firmware if required.

Anchor
1067132
1067132
Note: After a firmware upgrade, most of the time the wireless device requires to be reset, reinitialized and restarted.

  1. Anchor
    1049586
    1049586
    Initialize the device MAC address, if applicable. For Ethernet wireless devices, this step is mandatory. The MAC address data may come from one of three sources and should be set using the following priority scheme:

Anchor
104171210495061041712
1049506
Configure the MAC address using the string found within the device configuration structure. This is a form of static MAC address configuration and may be performed by calling NetASCII_Str_to_MAC() and NetIF_AddrHW_SetHandler(). If the device configuration string has been left empty, or is specified as all 0’s, an error will be returned and the next method should be attempted.

Anchor
104171310495071041713
1049507
Check if the application developer has called NetIF_AddrHW_Set() by making a call to NetIF_AddrHW_GetHandler() and NetIF_AddrHW_IsValidHandler() in order to check if the specified MAC address is valid. This method may be used as a static method for configuring the MAC address during run-time, or a dynamic method should a pre-programmed external memory device exist. If the acquired MAC address does not pass the check function, then:

Anchor
104171410495081041714
1049508
Call NetIF_AddrHW_SetHandler() using the data found within the individual MAC address registers. If an auto-loading EEPROM is attached to the MAC, the registers will contain valid data. If not, then a configuration error has occurred. This method is often used with a production process where the MAC supports automatically loading individual address registers from a serial EEPROM. When using this method, you should specify an empty string for the MAC address within the device configuration, and refrain from calling NetIF_AddrHW_Set() from within the application.

  1. Anchor
    104171510495091041715
    1049509
    Initialize additional MAC registers required by the MAC for proper operation.
  2. Anchor
    104171610495101041716
    1049510
    Clear all interrupt flags.
  3. Anchor
    104171710495111041717
    1049511
    Locally enable interrupts on the hardware device. This is performed via the network device’s BSP function pointer, NetDev_WiFi_IntCtrl(). The host interrupt controller should have already been configured within the device driver NetDev_Init() function.
  4. Anchor
    104171810495121041718
    1049512
    Enable the receiver and transmitter.
  5. Anchor
    104171910699331041719
    1069933
    Set perr equal to NET_DEV_ERR_NONE if no errors have occurred. Otherwise, set perr to an appropriate network device error code
HTML Table
summary
classWarning
Table Row (tr)
Table Cell (td)

Anchor
1069936
1069936
 

Table Cell (td)

Anchor
1069938
1069938
Some wireless module return result of commands via a response. The device’s Wireless Manager function pointer, NetWiFiMgr_Mgmt() should be used to perform these type of command since it will return only when the response is received and processed.