Belcarra USBLAN for Windows  


 

1.0 Driver Overview

 1.2    Address management and discovery

 1.3    Composite Function

2.0 Evaluation - Demo Driver

3.0 Installation Kit

4.0     OEM Kit Customization

Licensed drivers supplied to OEM’s have a complete installation kit customized to their requirements:

Most of the driver behavior configuration is controlled through registry entries. These can be preset via the installation INF file or after installation through a custom Windows application, registry editing or interactively using the Windows RegEdit application.

Driver distributions are properly versioned with a Windows Plug and Play version number to ensure all driver updates install correctly.

4.1    Registry Location and General Configuration

The registry configuration is stored in:

The typical format of the service name is XyzUSBLAN

USBLAN registry keys are mostly DWORDs (32 bit values). However MAC addresses are QWORDs (64 bit values)

4.1.1     UseZLP

A Zero Length Packet (ZLP) is used to terminate a BULK data transfer that would otherwise be a multiple of the endpoint packet size (typically 64 bytes for Full Speed devices and 512 bytes for High Speed devices.)  Some devices are not able to properly recognize a Zero Length Packet.
If
UseZLP is set to zero then USBLAN will use a Null Byte Packet instead of a ZLP. This is a single null byte (two for CDC-EEM devices) that is sent to terminate any BULK transfer that would otherwise be a multiple of the endpoint packet size.
This option’s value defaults to zero (use NBP).

4.1.2     UseNotifications

Controls how the USBLAN driver will indicate the remote connection status by setting the Media status of the Network interface.

4.1.3     UseCyclePort

If the USB Device stops accepting data for more than four seconds the USBLAN driver will drop the network frames. If the UseCyclePort global option is set (non-zero) then it will use the USB CyclePort operation to cause a re-enumeration of the device. The default setting (zero) disables this option

4.2    DHCP Service Configuration

Several registry parameters may be specified in the INF file and later modified either by use of the RegEdit utility or by a program.  All of them are of type DWORD. They are summarized here and some are explained in more detail in following subsections.

4.2.1    DHCPDType

This parameter influences DHCP as follows. If this parameter is not specified it defaults to 0.

DHCPDTYPE value

Effect for CDC-ECM, CDC-NCM, RNDIS

Effect for CDC-EEM

0 (default)

internal DHCP disabled

internal DHCP enabled

1

internal DHCP enabled

internal DHCP enabled

2

internal DHCP disabled

internal DHCP disabled

This parameter only affects the internal DHCP server. If there is a DHCP server operating on the device or the PC, this parameter has no effect on that.  However, in that case, probably the value DHCPDType=2 is appropriate in those cases to avoid contention.

4.2.2    DHCPBase, DHCPStart, DHCPc248

The registry key DHCPBase specifies a 32-bit value which must have the lower 8 bits 0.  The lower 8 bits, if any, are ignored.  If DHCP is used, this key is mandatory. If not specified, the value A9FE0100 is used, equivalent to 169.254.1.0.  The DHCP system assigns devices addresses in a series of 8-byte blocks starting with DHCPBase + 8*DHCPStart, where the optional DHCPStart key defaults to 0.  The DHCPStart key is provided mostly to support some legacy situations and is not required for new installations.

The key DHCPc248 is used to control the netmask DHCP assigns to the device.  The mask assigned to the host is always 255.255.255.248. On the device side, the netmask defaults to the same value. For some purposes, however, the netmask 255.255.255.0 on the device side only is preferred.  For this purpose set the registry pair DHCPc248=0.  There is no need for the netmasks at the two ends of the tiny 3-node network to be the same. Their only effect is to change the broadcast address.  

4.3    Multi-Frame Protocol Configuration

4.4    Per Adaptor Configuration

Each USB Device is allocated its own NDIS Network interface and there is per adapter configuration available through the Windows Network configuration menus. See the Appendix G for more information on setting a Network MAC Address.
Currently the following is supported:

4.5    Smart Device and the NdisDeviceType registry key

Installation kits by default include a key that sets the NDIS Device Type for NDIS (network) interfaces created by USBLAN to 1, meaning a smart device.  For Windows 7 and later editions of Windows, this option indicates that the device has a network interface, but is not a full-featured network device.

A smart device is a limited network device.  In particular, the default gateway property does not apply to such interfaces, and this field is omitted from the device properties.

In addition, since they are not general purpose network interfaces, they do not appear in the main screen of the Network and Sharing Centre in the Control Panel of Windows 7 or Windows  8 (In Windows XP, this registry key has no effect and so if present the device will act like any other NDIS/network interface).

4.6    Protocol-Specific Configuration

4.6.1    NCM

Most NCM configuration is done by using device requests to get the device’s required configuration.  The maximum send transfer and minimum receive transfer sizes can be set but these may be overridden by the device settings.

The NCMCRC option can be used to enable CRC but this will only be used if the device allows CRC.


The UseZLP option can be used to allow the host to send Zero Length packets to terminate a transfer. The default is to send a Null Byte packet.

The UseNotifications option can be used if the device does not properly indicate network connection status using Network Notifications.

4.6.2    EEM

The EEM protocol does not specify a mechanism for setting a maximum transfer size. Two common schemes are in use:

          

The EEMSendCRC option can be used to enable CRC. If set the CRC is computed and appended to the network frames. If not set the CDC-EEM standard option is to send the constant 0xdeadbeef instead of the computed CRC.

 

By default the USBLAN driver will default to the following:

The driver also implements the Belcarra EEM Echo Response Configuration Request (see appendix). This allows it to query the device, once connected, to determine the device's actual operating parameters. If the device does not support this, then it is merely another ECHO request.

4.6.3    ECM

The UseNotifications option can be used to if the device does not properly indicate network connection status using Network Notifications.

4.6.3.1    Zero Length versus Null Byte Packets

Some USB devices do not properly support Zero Length packets.

For CDC-ECM and CDC-NCM the UseZLP option can be used to allow the host to send Zero Length packets to terminate a transfer. The default is to send a Null Byte packet. Note that for CDC-EEM two NULL bytes are sent (as this is a legal EEM command.) To activate sending of zero-length packets for CDC-ECM and CDC-NCM, create a DWORD registry parameter called UzeZLP and set its value to 1.

4.6.4    RNDIS

4.7    DHCP IP Address Allocation

The USBLAN built-in DHCP service can optionally be used to coordinate IP address assignment between the host and multiple devices.

Each device that is attached will get its own NDIS network interface so the requirement is for every network interface and every device to be assigned a distinct IP address.

This is done by allocating CIDR /29[2] networks out of a (normally non-routable) network block. of 256 addresses, e.g. 192.168.100.* Each IP address is assigned offsets from DHCPBase (See Section 5.4 above) according to the following scheme for the N’th device (the first device is Device 0).

The DHCP reply includes a route that properly describes the allocated sub-network so that the host and device can properly route network traffic.

In hex the base address (DHCPBase) is C0A86400 with the following assignments for the first three devices: 

Device Index

Host

Device

Broadcast

Hex

Dotted decimal

Hex

Dotted decimal

Hex

Dotted decimal

0

C0A86401

192.168.100.1

C0A86402

192.168.100.2

C0A86407

192.168.100.7

1

C0A86409

192.168.100.9

C0A8640A

192.168.100.10

C0A8640F

192.168.100.15

2

C0A86411

192.168.100.17

C0A86412

192.168.100.18

C0A86417

192.168.100.23

Note that DHCPBase must always be a multiple of 256 (hex 0x100), i.e. the last byte is ignored.  If the optional parameter DHCPStart is nonzero, then N is replaced by N+DHCPStart in the above formulas.

4.8    Notifications

The CDC-NCM and CDC-ECM protocols require the device to send notifications to the host representing the current network speed and connection status.

The host uses the network connection status to enable or disable the data endpoints and to indicate to Windows NDIS a CABLE CONNECTED or DISCONNECTED status.

Some devices do not properly implement this part of the CDC protocols.

To work around this, the UseNotifications configuration option is available. Setting UseNotifications to two (0x2) will disable the use of Notifications for CDC ECM and CDC NCM devices.

N.B.  The UseNotifications option is ignored for RNDIS devices. The RNDIS protocol uses a different style of Notification to signal when an RNDIS query is complete. The device must implement the RNDIS notification for RNDIS to function correctly.

5.0  Driver Operation

6.0  Debug


Copyright ©2005 - 2016 Belcarra Technologies (2005) Corp.

http://usblan.belcarra.com


[1] CyclePort is part of a six-step procedure to clear clogged USB pipes. The complete procedure is described here: http://msdn.microsoft.com/en-us/library/windows/hardware/hh968307(v=vs.85).aspx

[2] More precisely a CIDR (Classless Inter Domain Routing) block with a 29-bit prefix. Netmask is 255.255.255.248. Subnet size is 8