====== Differences ====== This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
soc:2008:balajirrao:notes:usb_outline [2008/05/25 12:24]
balajirrao
soc:2008:balajirrao:notes:usb_outline [2008/05/25 13:04] (current)
mdc
Line 45: Line 45:
  
 Finally, once we know how TDs and QHs are arranged in memory, we'll describe how the Host Controller processes them. The Frame Counter register is incremented every millisecond. It indexes into the Frame list and selects a frame. From the frame, TDs one by one are executed, and their status marked in the TD itself. The TDs can be optionally marked to generate Interrupts on Completion (IOCs). This goes on and on. When interrupts are not available for use, we can poll for their status and recognize their completion. Finally, once we know how TDs and QHs are arranged in memory, we'll describe how the Host Controller processes them. The Frame Counter register is incremented every millisecond. It indexes into the Frame list and selects a frame. From the frame, TDs one by one are executed, and their status marked in the TD itself. The TDs can be optionally marked to generate Interrupts on Completion (IOCs). This goes on and on. When interrupts are not available for use, we can poll for their status and recognize their completion.
- 
 ===== How do we use this in a USB NIC ===== ===== How do we use this in a USB NIC =====
  
Line 64: Line 63:
 === Receiving Packets === === Receiving Packets ===
  
-First, we allocate empty buffers for incoming packets.Now, we need to instruct the device to put data into that buffer. To do this, we create a chain of TDs in a way similar to the transmit part. The host controller can figure out the direction of data transfer from the endpoint we've addressed the TDs to. (Remember ​each endpoint is a simplex channel) Once our TDs get '​executed'​ in the schedule, ​we have data in them.+First, we allocate empty buffers for incoming packets. ​Next, we need to instruct the device to put data into that buffer. To do this, we create a chain of TDs in a way similar to the method used for transmitting packets. The host controller can figure out the direction of data transfer from the endpoint we've addressed the TDs to since each endpoint is a simplex channel. When our TDs get '​executed'​ in the schedule, ​they will have data in them.
  
-So ,when the device is opened, ​we create many empty buffers and ask USB to insert it into the schedule. In the poll() method, we check for filled buffers. We hand away received packets to upper layers and introduce more number of buffers in the schedule for receiving data, and this goes on.+When the device is initialized ​we create many empty buffers and ask the USB controller ​to insert it into the schedule. In the poll method, we check for filled buffers. We hand away received packets to upper layers and add buffers in the schedule for receiving data. This process continues as long as the device is open.
  
 Also, in the poll method, we handle completion of tx packets by signalling (un)successful transmission of data to the upper layers. Also, in the poll method, we handle completion of tx packets by signalling (un)successful transmission of data to the upper layers.
 +
 +

QR Code
QR Code soc:2008:balajirrao:notes:usb_outline (generated for current page)