/* defines how much ISO packets are handled in one URB */ staticint iso_packets[8] =
{ ISOC_PACKETS_B, ISOC_PACKETS_B, ISOC_PACKETS_B, ISOC_PACKETS_B,
ISOC_PACKETS_D, ISOC_PACKETS_D, ISOC_PACKETS_D, ISOC_PACKETS_D
};
/* Fifo flow Control for TX ISO */ #define SINK_MAX 68 #define SINK_MIN 48 #define SINK_DMIN 12 #define SINK_DMAX 18 #define BITLINE_INF (-96 * 8)
struct ctrl_buf {
__u8 hfcs_reg; /* register number */
__u8 reg_val; /* value to be written (or read) */
};
/* * URB error codes * Used to represent a list of values and their respective symbolic names
*/ struct hfcusb_symbolic_list { constint num; constchar *name;
};
staticstruct hfcusb_symbolic_list urb_errlist[] = {
{-ENOMEM, "No memory for allocation of internal structures"},
{-ENOSPC, "The host controller's bandwidth is already consumed"},
{-ENOENT, "URB was canceled by unlink_urb"},
{-EXDEV, "ISO transfer only partially completed"},
{-EAGAIN, "Too match scheduled for the future"},
{-ENXIO, "URB already queued"},
{-EFBIG, "Too much ISO frames requested"},
{-ENOSR, "Buffer error (overrun)"},
{-EPIPE, "Specified endpoint is stalled (device not responding)"},
{-EOVERFLOW, "Babble (bad cable?)"},
{-EPROTO, "Bit-stuff error (bad cable?)"},
{-EILSEQ, "CRC/Timeout"},
{-ETIMEDOUT, "NAK (device does not respond)"},
{-ESHUTDOWN, "Device unplugged"},
{-1, NULL}
};
staticinlineconstchar *
symbolic(struct hfcusb_symbolic_list list[], constint num)
{ int i; for (i = 0; list[i].name != NULL; i++) if (list[i].num == num) return list[i].name; return"";
}
/* USB descriptor need to contain one of the following EndPoint combination: */ #define CNF_4INT3ISO 1 /* 4 INT IN, 3 ISO OUT */ #define CNF_3INT3ISO 2 /* 3 INT IN, 3 ISO OUT */ #define CNF_4ISO3ISO 3 /* 4 ISO IN, 3 ISO OUT */ #define CNF_3ISO3ISO 4 /* 3 ISO IN, 3 ISO OUT */
#define EP_NUL 1 /* Endpoint at this position not allowed */ #define EP_NOP 2 /* all type of endpoints allowed at this position */ #define EP_ISO 3 /* Isochron endpoint mandatory at this position */ #define EP_BLK 4 /* Bulk endpoint mandatory at this position */ #define EP_INT 5 /* Interrupt endpoint mandatory at this position */
#define LED_NORMAL 0 /* LEDs are normal */ #define LED_INVERTED 1 /* LEDs are inverted */
/* time in ms to perform a Flashing LED when B-Channel has traffic */ #define LED_TIME 250
struct hfcsusb; struct usb_fifo;
/* structure defining input+output fifos (interrupt/bulk mode) */ struct iso_urb { struct urb *urb;
__u8 buffer[ISO_BUFFER_SIZE]; /* buffer rx/tx USB URB data */ struct usb_fifo *owner_fifo; /* pointer to owner fifo */
__u8 indx; /* Fifos's ISO double buffer 0 or 1 ? */ #ifdef ISO_FRAME_START_DEBUG int start_frames[ISO_FRAME_START_RING_COUNT];
__u8 iso_frm_strt_pos; /* index in start_frame[] */ #endif
};
struct usb_fifo { int fifonum; /* fifo index attached to this structure */ int active; /* fifo is currently active */ struct hfcsusb *hw; /* pointer to main structure */ int pipe; /* address of endpoint */
__u8 usb_packet_maxlen; /* maximum length for usb transfer */ unsignedint max_size; /* maximum size of receive/send packet */
__u8 intervall; /* interrupt interval */ struct urb *urb; /* transfer structure for usb routines */
__u8 buffer[128]; /* buffer USB INT OUT URB data */ int bit_line; /* how much bits are in the fifo? */
__u8 usb_transfer_mode; /* switched between ISO and INT */ struct iso_urb iso[2]; /* two urbs to have one always
one pending */
struct dchannel *dch; /* link to hfcsusb_t->dch */ struct bchannel *bch; /* link to hfcsusb_t->bch */ struct dchannel *ech; /* link to hfcsusb_t->ech, TODO: E-CHANNEL */ int last_urblen; /* remember length of last packet */
__u8 stop_gracefull; /* stops URB retransmission */
};
struct usb_device *dev; /* our device */ struct usb_interface *intf; /* used interface */ int if_used; /* used interface number */ int alt_used; /* used alternate config */ int cfg_used; /* configuration index used */ int vend_idx; /* index in hfcsusb_idtab */ int packet_size; int iso_packet_size; struct usb_fifo fifos[HFCUSB_NUM_FIFOS];
/* control pipe background handling */ struct ctrl_buf ctrl_buff[HFC_CTRL_BUFSIZE]; int ctrl_in_idx, ctrl_out_idx, ctrl_cnt; struct urb *ctrl_urb; struct usb_ctrlrequest ctrl_write; struct usb_ctrlrequest ctrl_read; int ctrl_paksize; int ctrl_in_pipe, ctrl_out_pipe;
spinlock_t ctrl_lock; /* lock for ctrl */
spinlock_t lock;
__u8 threshold_mask;
__u8 led_state;
__u8 protocol; int nt_timer; int open;
__u8 timers;
__u8 initdone; char name[MISDN_MAX_IDLEN];
};
/* private vendor specific data */ struct hfcsusb_vdata {
__u8 led_scheme; /* led display scheme */ signedshort led_bits[8]; /* array of 8 possible LED bitmask */ char *vend_name; /* device name */
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.