Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
f_ncm.c File Reference
#include <linux/kernel.h>
#include <linux/device.h>
#include <linux/etherdevice.h>
#include <linux/crc32.h>
#include <linux/usb/cdc.h>
#include "u_ether.h"

Go to the source code of this file.

Data Structures

struct  f_ncm
 
struct  ndp_parser_opts
 

Macros

#define NCM_NDP_HDR_CRC_MASK   0x01000000
 
#define NCM_NDP_HDR_CRC   0x01000000
 
#define NCM_NDP_HDR_NOCRC   0x00000000
 
#define NTB_DEFAULT_IN_SIZE   USB_CDC_NCM_NTB_MIN_IN_SIZE
 
#define NTB_OUT_SIZE   16384
 
#define MAX_TX_NONFIXED   (512 * 3)
 
#define FORMATS_SUPPORTED
 
#define LOG2_STATUS_INTERVAL_MSEC   5 /* 1 << 5 == 32 msec */
 
#define NCM_STATUS_BYTECOUNT   16 /* 8 byte header + data */
 
#define NCAPS   (USB_CDC_NCM_NCAP_ETH_FILTER | USB_CDC_NCM_NCAP_CRC_MODE)
 
#define STRING_CTRL_IDX   0
 
#define STRING_MAC_IDX   1
 
#define STRING_DATA_IDX   2
 
#define STRING_IAD_IDX   3
 
#define INIT_NDP16_OPTS
 
#define INIT_NDP32_OPTS
 

Enumerations

enum  ncm_notify_state { NCM_NOTIFY_NONE, NCM_NOTIFY_CONNECT, NCM_NOTIFY_SPEED }
 

Functions

int __init ncm_bind_config (struct usb_configuration *c, u8 ethaddr[ETH_ALEN])
 

Macro Definition Documentation

#define FORMATS_SUPPORTED
Value:
USB_CDC_NCM_NTB32_SUPPORTED)

Definition at line 101 of file f_ncm.c.

#define INIT_NDP16_OPTS
Value:
{ \
.nth_sign = USB_CDC_NCM_NTH16_SIGN, \
.nth_size = sizeof(struct usb_cdc_ncm_nth16), \
.ndp_size = sizeof(struct usb_cdc_ncm_ndp16), \
.ndplen_align = 4, \
.dgram_item_len = 1, \
.block_length = 1, \
.fp_index = 1, \
.reserved1 = 0, \
.reserved2 = 0, \
.next_fp_index = 1, \
}

Definition at line 364 of file f_ncm.c.

#define INIT_NDP32_OPTS
Value:
{ \
.nth_sign = USB_CDC_NCM_NTH32_SIGN, \
.nth_size = sizeof(struct usb_cdc_ncm_nth32), \
.ndp_size = sizeof(struct usb_cdc_ncm_ndp32), \
.ndplen_align = 8, \
.dgram_item_len = 2, \
.block_length = 2, \
.fp_index = 2, \
.reserved1 = 1, \
.reserved2 = 2, \
.next_fp_index = 2, \
}

Definition at line 379 of file f_ncm.c.

#define LOG2_STATUS_INTERVAL_MSEC   5 /* 1 << 5 == 32 msec */

Definition at line 124 of file f_ncm.c.

#define MAX_TX_NONFIXED   (512 * 3)

Definition at line 99 of file f_ncm.c.

Definition at line 182 of file f_ncm.c.

#define NCM_NDP_HDR_CRC   0x01000000

Definition at line 39 of file f_ncm.c.

#define NCM_NDP_HDR_CRC_MASK   0x01000000

Definition at line 38 of file f_ncm.c.

#define NCM_NDP_HDR_NOCRC   0x00000000

Definition at line 40 of file f_ncm.c.

#define NCM_STATUS_BYTECOUNT   16 /* 8 byte header + data */

Definition at line 125 of file f_ncm.c.

#define NTB_DEFAULT_IN_SIZE   USB_CDC_NCM_NTB_MIN_IN_SIZE

Definition at line 91 of file f_ncm.c.

#define NTB_OUT_SIZE   16384

Definition at line 92 of file f_ncm.c.

#define STRING_CTRL_IDX   0

Definition at line 317 of file f_ncm.c.

#define STRING_DATA_IDX   2

Definition at line 319 of file f_ncm.c.

#define STRING_IAD_IDX   3

Definition at line 320 of file f_ncm.c.

#define STRING_MAC_IDX   1

Definition at line 318 of file f_ncm.c.

Enumeration Type Documentation

Enumerator:
NCM_NOTIFY_NONE 
NCM_NOTIFY_CONNECT 
NCM_NOTIFY_SPEED 

Definition at line 42 of file f_ncm.c.

Function Documentation

int __init ncm_bind_config ( struct usb_configuration c,
u8  ethaddr[ETH_ALEN] 
)

ncm_bind_config - add CDC Network link to a configuration : the configuration to support the network link : a buffer in which the ethernet address of the host side side of the link was recorded Context: single threaded during gadget setup

Returns zero on success, else negative errno.

Caller must have called (). Caller is also responsible for calling () before module unload.

Definition at line 1302 of file f_ncm.c.