Contiki 2.6

RNDIS Support

Functions

void rndis_packetFilter (uint32_t newfilter)
 Set the packet filter - currently distinguishes between promiscuous mode and normal mode.
uint8_t rndis_send_encapsulated_command (uint16_t wLength)
 Handles a "SEND ENCAPSULATED COMMAND" message.
void rndis_send_interrupt (void)
 Send an interrupt over the interrupt endpoint to the host.
void rndis_query_process (void)
 Function to handle a RNDIS "QUERY" command in the encapsulated_buffer.
void rndis_set_process (void)
 Function to deal with a RNDIS "SET" command present in the encapsulated_buffer.
uint8_t rndis_get_encapsulated_command (void)
 Handle "GET ENCAPSULATED COMMAND".
uint8_t rndis_send_status (rndis_Status_t stat)
 Send a status packet back to the host.
uint8_t rndis_send (uint8_t *senddata, uint16_t sendlen, uint8_t led)
 Send data over RNDIS interface, data is in uipbuf and length is uiplen.
void rx_start_led (void)
 This will enable the RX_START LED for a period.
void tx_end_led (void)
 This will enable the TRX_END LED for a period.
 PROCESS_THREAD (usb_eth_process, ev, data_proc)
 RNDIS Process.
uint8_t usb_eth_send (uint8_t *senddata, uint16_t sendlen, uint8_t led)
 Sends a single ethernet frame over USB using appropriate low-level protocol (EEM or RNDIS)

Variables

const uint32_t OIDSupportedList[] PROGMEM
 List of supported RNDIS OID's.
uint8_t usb_eth_data_buffer [64]
 Temp data buffer when adding RNDIS headers.
uint8_t usb_eth_data_buffer [64]
 Temp data buffer when adding RNDIS headers.
uint8_t led1_timer
 Timers for LEDs.

Function Documentation

PROCESS_THREAD ( usb_eth_process  ,
ev  ,
data_proc   
)

RNDIS Process.

This is the link between USB and the "good stuff". In this routine data is received and processed by RNDIS, CDC-ECM, or CDC-EEM

Definition at line 243 of file rndis_task.c.

References CLOCK_SECOND, etimer_expired(), etimer_set(), Is_device_enumerated, PROCESS_BEGIN, PROCESS_END, PROCESS_WAIT_EVENT_UNTIL, and usb_configuration_nb.

uint8_t rndis_get_encapsulated_command ( void  )

Handle "GET ENCAPSULATED COMMAND".

Returns:
True on success, false on failure.

This function assumes the message has already set up in the "encapsulated_buffer" variable. This will be done by the "SEND ENCAPSULATED COMMAND" message, which will trigger and interrupt on the host so it knows data is ready.

< Send data until necessary

< Check endpoint 0 size

Definition at line 737 of file rndis.c.

References FALSE, Is_usb_read_control_enabled, Is_usb_receive_out, TRUE, Usb_ack_receive_out, Usb_ack_receive_setup, Usb_send_control_in, and Usb_write_byte.

Referenced by usb_user_read_request().

uint8_t rndis_send_encapsulated_command ( uint16_t  wLength)

Handles a "SEND ENCAPSULATED COMMAND" message.

Returns:
True on success, false on failure.

Definition at line 196 of file rndis.c.

References FALSE, Is_usb_read_control_enabled, Is_usb_receive_nak_in, Is_usb_receive_out, rndis_query_process(), rndis_send_interrupt(), rndis_set_process(), TRUE, Usb_ack_nak_in, Usb_ack_receive_out, Usb_ack_receive_setup, Usb_read_byte, and Usb_send_control_in.

Referenced by usb_user_read_request().

uint8_t rndis_send_status ( rndis_Status_t  stat)

Send a status packet back to the host.

Returns:
Sucess or Failure
Return values:
1Success
0Failure

Definition at line 792 of file rndis.c.

References Is_usb_read_control_enabled, Is_usb_receive_out, Usb_ack_receive_out, Usb_send_control_in, and Usb_write_byte.

void rx_start_led ( void  )

This will enable the RX_START LED for a period.

Hook Documentation USB_ETH_HOOK_RX_START() USB_ETH_HOOK_RX_END() USB_ETH_HOOK_RX_ERROR(string_reason)

USB_ETH_HOOK_TX_START() USB_ETH_HOOK_TX_END() USB_ETH_HOOK_TX_ERROR(string_reason)

USB_ETH_HOOK_INITIALIZED() USB_ETH_HOOK_UNINITIALIZED()

USB_ETH_HOOK_INIT()

USB_ETH_HOOK_SET_PROMISCIOUS_MODE(bool)

USB_ETH_HOOK_HANDLE_INBOUND_PACKET(buffer,len) USB_ETH_HOOK_IS_READY_FOR_INBOUND_PACKET()

Definition at line 147 of file rndis_task.c.

References led1_timer.

uint8_t usb_eth_send ( uint8_t *  senddata,
uint16_t  sendlen,
uint8_t  led 
)

Sends a single ethernet frame over USB using appropriate low-level protocol (EEM or RNDIS)

Parameters:
senddataData to send
sendlenLength of data to send
ledShould the LED be light up for this frame?

Definition at line 303 of file rndis_task.c.

References Is_device_enumerated, rndis_send(), and usb_configuration_nb.

Referenced by mac_LowpanToEthernet().