• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/linux/linux-2.6.36/drivers/isdn/hisax/

Lines Matching defs:hfc

151 	struct hfcusb_data *hfc;	/* pointer to main structure */
223 ctrl_start_transfer(hfcusb_data * hfc)
225 if (hfc->ctrl_cnt) {
226 hfc->ctrl_urb->pipe = hfc->ctrl_out_pipe;
227 hfc->ctrl_urb->setup_packet = (u_char *) & hfc->ctrl_write;
228 hfc->ctrl_urb->transfer_buffer = NULL;
229 hfc->ctrl_urb->transfer_buffer_length = 0;
230 hfc->ctrl_write.wIndex =
231 cpu_to_le16(hfc->ctrl_buff[hfc->ctrl_out_idx].hfc_reg);
232 hfc->ctrl_write.wValue =
233 cpu_to_le16(hfc->ctrl_buff[hfc->ctrl_out_idx].reg_val);
235 usb_submit_urb(hfc->ctrl_urb, GFP_ATOMIC); /* start transfer */
240 queue_control_request(hfcusb_data * hfc, __u8 reg, __u8 val, int action)
244 if (hfc->ctrl_cnt >= HFC_CTRL_BUFSIZE)
246 buf = &hfc->ctrl_buff[hfc->ctrl_in_idx]; /* pointer to new index */
250 if (++hfc->ctrl_in_idx >= HFC_CTRL_BUFSIZE)
251 hfc->ctrl_in_idx = 0; /* pointer wrap */
252 if (++hfc->ctrl_cnt == 1)
253 ctrl_start_transfer(hfc);
260 hfcusb_data *hfc = (hfcusb_data *) urb->context;
263 urb->dev = hfc->dev;
264 if (hfc->ctrl_cnt) {
265 buf = &hfc->ctrl_buff[hfc->ctrl_out_idx];
266 hfc->ctrl_cnt--; /* decrement actual count */
267 if (++hfc->ctrl_out_idx >= HFC_CTRL_BUFSIZE)
268 hfc->ctrl_out_idx = 0; /* pointer wrap */
270 ctrl_start_transfer(hfc); /* start next transfer */
276 write_led(hfcusb_data * hfc, __u8 led_state)
278 if (led_state != hfc->old_led_state) {
279 hfc->old_led_state = led_state;
280 queue_control_request(hfc, HFCUSB_P_DATA, led_state, 1);
285 set_led_bit(hfcusb_data * hfc, signed short led_bits, int on)
289 hfc->led_state &= ~abs(led_bits);
291 hfc->led_state |= led_bits;
294 hfc->led_state |= abs(led_bits);
296 hfc->led_state &= ~led_bits;
302 handle_led(hfcusb_data * hfc, int event)
305 (hfcsusb_vdata *) hfcusb_idtab[hfc->vend_idx].driver_info;
313 set_led_bit(hfc, driver_info->led_bits[0], 1);
314 set_led_bit(hfc, driver_info->led_bits[1], 0);
315 set_led_bit(hfc, driver_info->led_bits[2], 0);
316 set_led_bit(hfc, driver_info->led_bits[3], 0);
319 set_led_bit(hfc, driver_info->led_bits[0], 0);
320 set_led_bit(hfc, driver_info->led_bits[1], 0);
321 set_led_bit(hfc, driver_info->led_bits[2], 0);
322 set_led_bit(hfc, driver_info->led_bits[3], 0);
325 set_led_bit(hfc, driver_info->led_bits[1], 1);
328 set_led_bit(hfc, driver_info->led_bits[1], 0);
331 set_led_bit(hfc, driver_info->led_bits[2], 1);
334 set_led_bit(hfc, driver_info->led_bits[2], 0);
337 set_led_bit(hfc, driver_info->led_bits[3], 1);
340 set_led_bit(hfc, driver_info->led_bits[3], 0);
343 write_led(hfc, hfc->led_state);
348 l1_timer_expire_t3(hfcusb_data * hfc)
350 hfc->d_if.ifc.l1l2(&hfc->d_if.ifc, PH_DEACTIVATE | INDICATION,
356 hfc->l1_activated = 0;
357 handle_led(hfc, LED_S0_OFF);
359 queue_control_request(hfc, HFCUSB_STATES, 0x10, 1);
360 queue_control_request(hfc, HFCUSB_STATES, 3, 1);
365 l1_timer_expire_t4(hfcusb_data * hfc)
367 hfc->d_if.ifc.l1l2(&hfc->d_if.ifc, PH_DEACTIVATE | INDICATION,
373 hfc->l1_activated = 0;
374 handle_led(hfc, LED_S0_OFF);
379 s0_state_handler(hfcusb_data * hfc, __u8 state)
383 old_state = hfc->l1_state;
391 if (timer_pending(&hfc->t3_timer))
392 del_timer(&hfc->t3_timer);
396 if (timer_pending(&hfc->t4_timer))
397 del_timer(&hfc->t4_timer);
401 if (state == 7 && !hfc->l1_activated) {
402 hfc->d_if.ifc.l1l2(&hfc->d_if.ifc,
405 hfc->l1_activated = 1;
406 handle_led(hfc, LED_S0_ON);
410 if (!timer_pending(&hfc->t4_timer)) {
411 hfc->t4_timer.expires =
413 add_timer(&hfc->t4_timer);
416 hfc->d_if.ifc.l1l2(&hfc->d_if.ifc,
421 hfc->l1_activated = 0;
422 handle_led(hfc, LED_S0_OFF);
425 hfc->l1_state = state;
481 fifo->hfc->dev, fifo->pipe,
548 hfcusb_data *hfc = fifo->hfc;
580 if (fifon < 4 && hfc->b_mode[fifon / 2] == L1_MODE_TRANS)
584 threshbit = (hfc->threshold_mask & (1 << fifon));
593 fill_isoc_urb(urb, fifo->hfc->dev, fifo->pipe,
673 if (status && !hfc->disc_flag) {
686 hfcusb_data *hfc = fifo->hfc;
720 if (iso_status && !hfc->disc_flag)
738 hfc->threshold_mask = buf[1];
744 s0_state_handler(hfc, buf[0] >> 4);
761 fill_isoc_urb(urb, fifo->hfc->dev, fifo->pipe,
772 if (status && !hfc->disc_flag) {
785 hfcusb_data *hfc = fifo->hfc;
790 if (fifon < 4 && hfc->b_mode[fifon / 2] == L1_MODE_TRANS)
858 hfcusb_data *hfc = fifo->hfc;
861 urb->dev = hfc->dev; /* security init */
890 hfc->threshold_mask = buf[1];
892 s0_state_handler(hfc, buf[0] >> 4);
926 usb_fill_int_urb(fifo->urb, fifo->hfc->dev, fifo->pipe,
941 setup_bchannel(hfcusb_data * hfc, int channel, int mode)
945 if (hfc->disc_flag) {
950 hfc->b_mode[channel] = mode;
960 queue_control_request(hfc, HFCUSB_FIFO, idx_table[channel], 1);
961 queue_control_request(hfc, HFCUSB_CON_HDLC, val, 1);
963 queue_control_request(hfc, HFCUSB_INC_RES_F, 2, 1);
965 queue_control_request(hfc, HFCUSB_FIFO, idx_table[channel] + 1, 1);
966 queue_control_request(hfc, HFCUSB_CON_HDLC, val, 1);
968 queue_control_request(hfc, HFCUSB_INC_RES_F, 2, 1);
971 if (hfc->b_mode[0])
973 if (hfc->b_mode[1])
975 queue_control_request(hfc, HFCUSB_SCTRL, val, 1);
978 if (hfc->b_mode[0])
980 if (hfc->b_mode[1])
982 queue_control_request(hfc, HFCUSB_SCTRL_R, val, 1);
986 handle_led(hfc, LED_B2_OFF);
988 handle_led(hfc, LED_B1_OFF);
991 handle_led(hfc, LED_B2_ON);
993 handle_led(hfc, LED_B1_ON);
1001 hfcusb_data *hfc = fifo->hfc;
1009 if (hfc->l1_state != 3
1010 && hfc->l1_state != 7) {
1011 hfc->d_if.ifc.l1l2(&hfc->d_if.ifc,
1018 if (hfc->l1_state == 7) { /* l1 already active */
1019 hfc->d_if.ifc.l1l2(&hfc->
1030 queue_control_request(hfc,
1036 queue_control_request(hfc,
1041 (&hfc->t3_timer)) {
1042 hfc->t3_timer.
1047 add_timer(&hfc->
1055 setup_bchannel(hfc,
1071 setup_bchannel(hfc,
1097 hfc_usb_init(hfcusb_data * hfc)
1105 if (read_usb(hfc, HFCUSB_CHIP_ID, &b) != 1) {
1115 err = usb_set_interface(hfc->dev, hfc->if_used, hfc->alt_used);
1118 write_usb(hfc, HFCUSB_CIRM, 8);
1120 write_usb(hfc, HFCUSB_CIRM, 0x10);
1123 write_usb(hfc, HFCUSB_USB_SIZE,
1124 (hfc->packet_size / 8) | ((hfc->packet_size / 8) << 4));
1127 write_usb(hfc, HFCUSB_USB_SIZE_I, hfc->iso_packet_size);
1130 write_usb(hfc, HFCUSB_MST_MODE1, 0); /* set default values */
1131 write_usb(hfc, HFCUSB_MST_MODE0, 1); /* enable master mode */
1134 write_usb(hfc, HFCUSB_F_THRES,
1138 fifo = hfc->fifos;
1140 write_usb(hfc, HFCUSB_FIFO, i); /* select the desired fifo */
1146 write_usb(hfc, HFCUSB_HDLC_PAR,
1149 write_usb(hfc, HFCUSB_CON_HDLC,
1151 write_usb(hfc, HFCUSB_INC_RES_F, 2); /* reset the fifo */
1154 write_usb(hfc, HFCUSB_CLKDEL, 0x0f); /* clock delay value */
1155 write_usb(hfc, HFCUSB_STATES, 3 | 0x10); /* set deactivated mode */
1156 write_usb(hfc, HFCUSB_STATES, 3); /* enable state machine */
1158 write_usb(hfc, HFCUSB_SCTRL_R, 0); /* disable both B receivers */
1159 write_usb(hfc, HFCUSB_SCTRL, 0x40); /* disable B transmitters + capacitive mode */
1162 hfc->b_mode[0] = L1_MODE_NULL;
1163 hfc->b_mode[1] = L1_MODE_NULL;
1165 hfc->l1_activated = 0;
1166 hfc->disc_flag = 0;
1167 hfc->led_state = 0;
1168 hfc->old_led_state = 0;
1171 init_timer(&hfc->t3_timer);
1172 hfc->t3_timer.data = (long) hfc;
1173 hfc->t3_timer.function = (void *) l1_timer_expire_t3;
1176 init_timer(&hfc->t4_timer);
1177 hfc->t4_timer.data = (long) hfc;
1178 hfc->t4_timer.function = (void *) l1_timer_expire_t4;
1181 hfc->ctrl_read.bRequestType = 0xc0;
1182 hfc->ctrl_read.bRequest = 1;
1183 hfc->ctrl_read.wLength = cpu_to_le16(1);
1184 hfc->ctrl_write.bRequestType = 0x40;
1185 hfc->ctrl_write.bRequest = 0;
1186 hfc->ctrl_write.wLength = 0;
1187 usb_fill_control_urb(hfc->ctrl_urb,
1188 hfc->dev,
1189 hfc->ctrl_out_pipe,
1190 (u_char *) & hfc->ctrl_write,
1191 NULL, 0, ctrl_complete, hfc);
1194 hfc->fifos[i].iso[0].purb = NULL;
1195 hfc->fifos[i].iso[1].purb = NULL;
1196 hfc->fifos[i].active = 0;
1199 hfc->d_if.owner = THIS_MODULE;
1200 hfc->d_if.ifc.priv = &hfc->fifos[HFCUSB_D_TX];
1201 hfc->d_if.ifc.l2l1 = hfc_usb_l2l1;
1203 hfc->b_if[i].ifc.priv = &hfc->fifos[HFCUSB_B1_TX + i * 2];
1204 hfc->b_if[i].ifc.l2l1 = hfc_usb_l2l1;
1205 p_b_if[i] = &hfc->b_if[i];
1208 hfc->protocol = 2;
1209 i = hisax_register(&hfc->d_if, p_b_if, "hfc_usb", hfc->protocol);
1220 hfc->fifos[i].hif = &p_b_if[i / 2]->ifc;
1222 hfc->fifos[i].hif = &hfc->d_if.ifc;
1225 if (hfc->cfg_used == CNF_3INT3ISO || hfc->cfg_used == CNF_4INT3ISO) {
1226 start_int_fifo(hfc->fifos + HFCUSB_D_RX);
1227 if (hfc->fifos[HFCUSB_PCM_RX].pipe)
1228 start_int_fifo(hfc->fifos + HFCUSB_PCM_RX);
1229 start_int_fifo(hfc->fifos + HFCUSB_B1_RX);
1230 start_int_fifo(hfc->fifos + HFCUSB_B2_RX);
1233 if (hfc->cfg_used == CNF_3ISO3ISO || hfc->cfg_used == CNF_4ISO3ISO) {
1234 start_isoc_chain(hfc->fifos + HFCUSB_D_RX, ISOC_PACKETS_D,
1236 if (hfc->fifos[HFCUSB_PCM_RX].pipe)
1237 start_isoc_chain(hfc->fifos + HFCUSB_PCM_RX,
1240 start_isoc_chain(hfc->fifos + HFCUSB_B1_RX, ISOC_PACKETS_B,
1242 start_isoc_chain(hfc->fifos + HFCUSB_B2_RX, ISOC_PACKETS_B,
1246 start_isoc_chain(hfc->fifos + HFCUSB_D_TX, ISOC_PACKETS_D,
1248 start_isoc_chain(hfc->fifos + HFCUSB_B1_TX, ISOC_PACKETS_B,
1250 start_isoc_chain(hfc->fifos + HFCUSB_B2_TX, ISOC_PACKETS_B,
1253 handle_led(hfc, LED_POWER_ON);
1461 context->fifos[cidx].hfc =