• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/isdn/hardware/mISDN/

Lines Matching refs:hw

56 static void hfcsusb_ph_command(struct hfcsusb *hw, u_char command);
57 static void release_hw(struct hfcsusb *hw);
58 static void reset_hfcsusb(struct hfcsusb *hw);
59 static void setPortMode(struct hfcsusb *hw);
60 static void hfcsusb_start_endpoint(struct hfcsusb *hw, int channel);
61 static void hfcsusb_stop_endpoint(struct hfcsusb *hw, int channel);
64 static void hfcsusb_ph_info(struct hfcsusb *hw);
68 ctrl_start_transfer(struct hfcsusb *hw)
71 printk(KERN_DEBUG "%s: %s\n", hw->name, __func__);
73 if (hw->ctrl_cnt) {
74 hw->ctrl_urb->pipe = hw->ctrl_out_pipe;
75 hw->ctrl_urb->setup_packet = (u_char *)&hw->ctrl_write;
76 hw->ctrl_urb->transfer_buffer = NULL;
77 hw->ctrl_urb->transfer_buffer_length = 0;
78 hw->ctrl_write.wIndex =
79 cpu_to_le16(hw->ctrl_buff[hw->ctrl_out_idx].hfcs_reg);
80 hw->ctrl_write.wValue =
81 cpu_to_le16(hw->ctrl_buff[hw->ctrl_out_idx].reg_val);
83 usb_submit_urb(hw->ctrl_urb, GFP_ATOMIC);
91 static int write_reg(struct hfcsusb *hw, __u8 reg, __u8 val)
97 hw->name, __func__, reg, val);
99 spin_lock(&hw->ctrl_lock);
100 if (hw->ctrl_cnt >= HFC_CTRL_BUFSIZE) {
101 spin_unlock(&hw->ctrl_lock);
104 buf = &hw->ctrl_buff[hw->ctrl_in_idx];
107 if (++hw->ctrl_in_idx >= HFC_CTRL_BUFSIZE)
108 hw->ctrl_in_idx = 0;
109 if (++hw->ctrl_cnt == 1)
110 ctrl_start_transfer(hw);
111 spin_unlock(&hw->ctrl_lock);
120 struct hfcsusb *hw = (struct hfcsusb *) urb->context;
124 printk(KERN_DEBUG "%s: %s\n", hw->name, __func__);
126 urb->dev = hw->dev;
127 if (hw->ctrl_cnt) {
128 buf = &hw->ctrl_buff[hw->ctrl_out_idx];
129 hw->ctrl_cnt--; /* decrement actual count */
130 if (++hw->ctrl_out_idx >= HFC_CTRL_BUFSIZE)
131 hw->ctrl_out_idx = 0; /* pointer wrap */
133 ctrl_start_transfer(hw); /* start next transfer */
139 set_led_bit(struct hfcsusb *hw, signed short led_bits, int set_on)
143 hw->led_state &= ~abs(led_bits);
145 hw->led_state |= led_bits;
148 hw->led_state |= abs(led_bits);
150 hw->led_state &= ~led_bits;
156 handle_led(struct hfcsusb *hw, int event)
159 hfcsusb_idtab[hw->vend_idx].driver_info;
164 tmpled = hw->led_state;
168 set_led_bit(hw, driver_info->led_bits[0], 1);
169 set_led_bit(hw, driver_info->led_bits[1], 0);
170 set_led_bit(hw, driver_info->led_bits[2], 0);
171 set_led_bit(hw, driver_info->led_bits[3], 0);
174 set_led_bit(hw, driver_info->led_bits[0], 0);
175 set_led_bit(hw, driver_info->led_bits[1], 0);
176 set_led_bit(hw, driver_info->led_bits[2], 0);
177 set_led_bit(hw, driver_info->led_bits[3], 0);
180 set_led_bit(hw, driver_info->led_bits[1], 1);
183 set_led_bit(hw, driver_info->led_bits[1], 0);
186 set_led_bit(hw, driver_info->led_bits[2], 1);
189 set_led_bit(hw, driver_info->led_bits[2], 0);
192 set_led_bit(hw, driver_info->led_bits[3], 1);
195 set_led_bit(hw, driver_info->led_bits[3], 0);
199 if (hw->led_state != tmpled) {
202 hw->name, __func__,
203 HFCUSB_P_DATA, hw->led_state);
205 write_reg(hw, HFCUSB_P_DATA, hw->led_state);
216 struct hfcsusb *hw = bch->hw;
222 printk(KERN_DEBUG "%s: %s\n", hw->name, __func__);
226 spin_lock_irqsave(&hw->lock, flags);
228 spin_unlock_irqrestore(&hw->lock, flags);
231 hw->name, __func__, ret);
244 hfcsusb_start_endpoint(hw, bch->nr);
269 hfcsusb_ph_info(struct hfcsusb *hw)
272 struct dchannel *dch = &hw->dch;
277 phi->dch.ch.protocol = hw->protocol;
282 phi->bch[i].protocol = hw->bch[i].ch.protocol;
283 phi->bch[i].Flags = hw->bch[i].Flags;
299 struct hfcsusb *hw = dch->hw;
307 hw->name, __func__);
309 spin_lock_irqsave(&hw->lock, flags);
311 spin_unlock_irqrestore(&hw->lock, flags);
321 hw->name, __func__,
322 (hw->protocol == ISDN_P_NT_S0) ? "NT" : "TE");
324 if (hw->protocol == ISDN_P_NT_S0) {
331 hfcsusb_ph_command(hw,
337 hfcsusb_ph_command(hw, HFC_L1_ACTIVATE_TE);
345 hw->name, __func__);
348 if (hw->protocol == ISDN_P_NT_S0) {
349 hfcsusb_ph_command(hw, HFC_L1_DEACTIVATE_NT);
350 spin_lock_irqsave(&hw->lock, flags);
362 spin_unlock_irqrestore(&hw->lock, flags);
372 hfcsusb_ph_info(hw);
386 struct hfcsusb *hw = dch->hw;
390 hw->name, __func__, cmd);
425 hw->name, __func__, cmd);
428 hfcsusb_ph_info(hw);
433 open_dchannel(struct hfcsusb *hw, struct mISDNchannel *ch,
440 hw->name, __func__, hw->dch.dev.id, rq->adr.channel,
445 test_and_clear_bit(FLG_ACTIVE, &hw->dch.Flags);
446 test_and_clear_bit(FLG_ACTIVE, &hw->ech.Flags);
447 hfcsusb_start_endpoint(hw, HFC_CHAN_D);
451 if (hw->fifos[HFCUSB_PCM_RX].pipe) {
452 hfcsusb_start_endpoint(hw, HFC_CHAN_E);
453 set_bit(FLG_ACTIVE, &hw->ech.Flags);
454 _queue_data(&hw->ech.dev.D, PH_ACTIVATE_IND,
460 if (!hw->initdone) {
461 hw->protocol = rq->protocol;
463 err = create_l1(&hw->dch, hfc_l1callback);
467 setPortMode(hw);
469 hw->initdone = 1;
475 if (((ch->protocol == ISDN_P_NT_S0) && (hw->dch.state == 3)) ||
476 ((ch->protocol == ISDN_P_TE_S0) && (hw->dch.state == 7)))
482 hw->name, __func__);
487 open_bchannel(struct hfcsusb *hw, struct channel_req *rq)
498 hw->name, __func__, rq->adr.channel);
500 bch = &hw->bch[rq->adr.channel - 1];
509 hfcsusb_start_endpoint(hw, HFC_CHAN_B1);
511 hfcsusb_start_endpoint(hw, HFC_CHAN_B2);
515 hw->name, __func__);
520 channel_ctrl(struct hfcsusb *hw, struct mISDN_ctrl_req *cq)
526 hw->name, __func__, (cq->op), (cq->channel));
535 hw->name, __func__, cq->op);
550 struct hfcsusb *hw = dch->hw;
556 hw->name, __func__, cmd, arg);
562 err = open_dchannel(hw, ch, rq);
564 err = open_bchannel(hw, rq);
566 hw->open++;
569 hw->open--;
573 hw->name, __func__, hw->dch.dev.id,
574 __builtin_return_address(0), hw->open);
575 if (!hw->open) {
576 hfcsusb_stop_endpoint(hw, HFC_CHAN_D);
577 if (hw->fifos[HFCUSB_PCM_RX].pipe)
578 hfcsusb_stop_endpoint(hw, HFC_CHAN_E);
579 handle_led(hw, LED_POWER_ON);
584 err = channel_ctrl(hw, arg);
589 hw->name, __func__, cmd);
601 struct hfcsusb *hw = dch->hw;
605 printk(KERN_DEBUG "%s: %s: %s\n", hw->name, __func__,
609 hw->name, __func__, dch->state);
631 handle_led(hw, LED_S0_ON);
633 handle_led(hw, LED_S0_OFF);
642 struct hfcsusb *hw = dch->hw;
647 hw->name, __func__,
652 hw->name, __func__, dch->state);
659 hw->nt_timer = 0;
660 hw->timers &= ~NT_ACTIVATION_TIMER;
661 handle_led(hw, LED_S0_OFF);
665 if (hw->nt_timer < 0) {
666 hw->nt_timer = 0;
667 hw->timers &= ~NT_ACTIVATION_TIMER;
668 hfcsusb_ph_command(dch->hw, HFC_L1_DEACTIVATE_NT);
670 hw->timers |= NT_ACTIVATION_TIMER;
671 hw->nt_timer = NT_T1_COUNT;
673 write_reg(hw, HFCUSB_STATES, 2 | HFCUSB_NT_G2_G3);
677 hw->nt_timer = 0;
678 hw->timers &= ~NT_ACTIVATION_TIMER;
682 handle_led(hw, LED_S0_ON);
685 hw->nt_timer = 0;
686 hw->timers &= ~NT_ACTIVATION_TIMER;
691 hfcsusb_ph_info(hw);
697 struct hfcsusb *hw = dch->hw;
699 if (hw->protocol == ISDN_P_NT_S0)
701 else if (hw->protocol == ISDN_P_TE_S0)
711 struct hfcsusb *hw = bch->hw;
716 hw->name, __func__, bch->state, protocol,
747 hw->name, __func__, protocol);
752 write_reg(hw, HFCUSB_FIFO, (bch->nr == 1) ? 0 : 2);
753 write_reg(hw, HFCUSB_CON_HDLC, conhdlc);
754 write_reg(hw, HFCUSB_INC_RES_F, 2);
755 write_reg(hw, HFCUSB_FIFO, (bch->nr == 1) ? 1 : 3);
756 write_reg(hw, HFCUSB_CON_HDLC, conhdlc);
757 write_reg(hw, HFCUSB_INC_RES_F, 2);
759 sctrl = 0x40 + ((hw->protocol == ISDN_P_TE_S0) ? 0x00 : 0x04);
761 if (test_bit(FLG_ACTIVE, &hw->bch[0].Flags)) {
765 if (test_bit(FLG_ACTIVE, &hw->bch[1].Flags)) {
769 write_reg(hw, HFCUSB_SCTRL, sctrl);
770 write_reg(hw, HFCUSB_SCTRL_R, sctrl_r);
773 handle_led(hw, (bch->nr == 1) ? LED_B1_ON : LED_B2_ON);
775 handle_led(hw, (bch->nr == 1) ? LED_B1_OFF :
778 hfcsusb_ph_info(hw);
783 hfcsusb_ph_command(struct hfcsusb *hw, u_char command)
787 hw->name, __func__, command);
792 write_reg(hw, HFCUSB_STATES, 0x14);
794 write_reg(hw, HFCUSB_STATES, 0x04);
798 write_reg(hw, HFCUSB_STATES, 0x10);
799 write_reg(hw, HFCUSB_STATES, 0x03);
803 if (hw->dch.state == 3)
804 _queue_data(&hw->dch.dev.D, PH_ACTIVATE_IND,
807 write_reg(hw, HFCUSB_STATES, HFCUSB_ACTIVATE |
812 write_reg(hw, HFCUSB_STATES,
849 struct hfcsusb *hw = fifo->hw;
859 hw->name, __func__, fifon, len,
867 hw->name, __func__);
871 spin_lock(&hw->lock);
900 hw->name, __func__);
901 spin_unlock(&hw->lock);
911 hw->name, __func__, fifon);
913 spin_unlock(&hw->lock);
921 hw->name, __func__, fifon);
923 spin_unlock(&hw->lock);
938 hw->name, __func__, fifon,
956 &hw->dch);
962 hw->name, fifon, rx_skb->len);
977 spin_unlock(&hw->lock);
1008 struct hfcsusb *hw = fifo->hw;
1018 spin_lock(&hw->lock);
1022 spin_unlock(&hw->lock);
1025 spin_unlock(&hw->lock);
1035 hw->name, __func__, status, fifon);
1055 hw->name, __func__, k, iso_status);
1063 hw->name, __func__, urb->start_frame,
1078 hw->threshold_mask = buf[1];
1097 if ((s0_state) && (hw->initdone) &&
1098 (s0_state != hw->dch.state)) {
1099 hw->dch.state = s0_state;
1100 schedule_event(&hw->dch, FLG_PHCHANGE);
1103 fill_isoc_urb(urb, fifo->hw->dev, fifo->pipe,
1112 hw->name, __func__, errcode);
1118 hw->name, __func__, status, fifon);
1129 struct hfcsusb *hw = fifo->hw;
1132 spin_lock(&hw->lock);
1136 spin_unlock(&hw->lock);
1139 spin_unlock(&hw->lock);
1146 hw->name, __func__, fifon, urb->status);
1158 hw->name, __func__, len);
1166 hw->threshold_mask = buf[1];
1169 if (hw->initdone && ((buf[0] >> 4) != hw->dch.state)) {
1170 hw->dch.state = (buf[0] >> 4);
1171 schedule_event(&hw->dch, FLG_PHCHANGE);
1190 hw->name, __func__);
1200 struct hfcsusb *hw = fifo->hw;
1208 spin_lock(&hw->lock);
1212 spin_unlock(&hw->lock);
1226 hw->name, __func__);
1227 spin_unlock(&hw->lock);
1244 hw->name, __func__, status, fifon);
1252 threshbit = (hw->threshold_mask & (1 << fifon));
1260 fill_isoc_urb(urb, fifo->hw->dev, fifo->pipe,
1275 hw->name, __func__, k, errcode);
1324 hw->name, __func__,
1356 hw->name, __func__,
1383 hw->name, __func__, errcode);
1391 if ((fifon == HFCUSB_D_TX) && (hw->protocol == ISDN_P_NT_S0)
1392 && (hw->timers & NT_ACTIVATION_TIMER)) {
1393 if ((--hw->nt_timer) < 0)
1394 schedule_event(&hw->dch, FLG_PHCHANGE);
1401 hw->name, __func__,
1404 spin_unlock(&hw->lock);
1415 struct hfcsusb *hw = fifo->hw;
1420 hw->name, __func__, fifo->fifonum);
1430 hw->name, __func__, fifo->fifonum);
1440 fifo->hw->dev, fifo->pipe,
1460 hw->name, __func__);
1470 hw->name, __func__,
1480 struct hfcsusb *hw = fifo->hw;
1485 spin_lock_irqsave(&hw->lock, flags);
1488 hw->name, __func__, fifo->fifonum, i);
1490 spin_unlock_irqrestore(&hw->lock, flags);
1499 hw->name, __func__, fifo->fifonum, i);
1506 struct hfcsusb *hw = fifo->hw;
1510 spin_lock_irqsave(&hw->lock, flags);
1513 hw->name, __func__, fifo->fifonum);
1515 spin_unlock_irqrestore(&hw->lock, flags);
1522 hw->name, __func__, fifo->fifonum);
1529 struct hfcsusb *hw = fifo->hw;
1534 hw->name, __func__, fifo->fifonum);
1541 usb_fill_int_urb(fifo->urb, fifo->hw->dev, fifo->pipe,
1549 hw->name, __func__, errcode);
1555 setPortMode(struct hfcsusb *hw)
1558 printk(KERN_DEBUG "%s: %s %s\n", hw->name, __func__,
1559 (hw->protocol == ISDN_P_TE_S0) ? "TE" : "NT");
1561 if (hw->protocol == ISDN_P_TE_S0) {
1562 write_reg(hw, HFCUSB_SCTRL, 0x40);
1563 write_reg(hw, HFCUSB_SCTRL_E, 0x00);
1564 write_reg(hw, HFCUSB_CLKDEL, CLKDEL_TE);
1565 write_reg(hw, HFCUSB_STATES, 3 | 0x10);
1566 write_reg(hw, HFCUSB_STATES, 3);
1568 write_reg(hw, HFCUSB_SCTRL, 0x44);
1569 write_reg(hw, HFCUSB_SCTRL_E, 0x09);
1570 write_reg(hw, HFCUSB_CLKDEL, CLKDEL_NT);
1571 write_reg(hw, HFCUSB_STATES, 1 | 0x10);
1572 write_reg(hw, HFCUSB_STATES, 1);
1577 reset_hfcsusb(struct hfcsusb *hw)
1583 printk(KERN_DEBUG "%s: %s\n", hw->name, __func__);
1586 write_reg(hw, HFCUSB_CIRM, 8);
1589 write_reg(hw, HFCUSB_CIRM, 0x10);
1592 write_reg(hw, HFCUSB_USB_SIZE, (hw->packet_size / 8) |
1593 ((hw->packet_size / 8) << 4));
1596 write_reg(hw, HFCUSB_USB_SIZE_I, hw->iso_packet_size);
1599 write_reg(hw, HFCUSB_MST_MODE1, 0); /* set default values */
1600 write_reg(hw, HFCUSB_MST_MODE0, 1); /* enable master mode */
1603 write_reg(hw, HFCUSB_F_THRES,
1606 fifo = hw->fifos;
1608 write_reg(hw, HFCUSB_FIFO, i); /* select the desired fifo */
1614 write_reg(hw, HFCUSB_HDLC_PAR, ((i <= HFCUSB_B2_RX) ? 0 : 2));
1618 write_reg(hw, HFCUSB_CON_HDLC,
1619 (hw->protocol == ISDN_P_NT_S0) ? 0x08 : 0x09);
1621 write_reg(hw, HFCUSB_CON_HDLC, 0x08);
1622 write_reg(hw, HFCUSB_INC_RES_F, 2); /* reset the fifo */
1625 write_reg(hw, HFCUSB_SCTRL_R, 0); /* disable both B receivers */
1626 handle_led(hw, LED_POWER_ON);
1631 hfcsusb_start_endpoint(struct hfcsusb *hw, int channel)
1634 if ((channel == HFC_CHAN_D) && (hw->fifos[HFCUSB_D_RX].active))
1636 if ((channel == HFC_CHAN_B1) && (hw->fifos[HFCUSB_B1_RX].active))
1638 if ((channel == HFC_CHAN_B2) && (hw->fifos[HFCUSB_B2_RX].active))
1640 if ((channel == HFC_CHAN_E) && (hw->fifos[HFCUSB_PCM_RX].active))
1644 if (hw->cfg_used == CNF_3INT3ISO || hw->cfg_used == CNF_4INT3ISO)
1645 start_int_fifo(hw->fifos + channel*2 + 1);
1648 if (hw->cfg_used == CNF_3ISO3ISO || hw->cfg_used == CNF_4ISO3ISO) {
1651 start_isoc_chain(hw->fifos + HFCUSB_D_RX,
1657 start_isoc_chain(hw->fifos + HFCUSB_PCM_RX,
1663 start_isoc_chain(hw->fifos + HFCUSB_B1_RX,
1669 start_isoc_chain(hw->fifos + HFCUSB_B2_RX,
1680 start_isoc_chain(hw->fifos + HFCUSB_D_TX,
1685 start_isoc_chain(hw->fifos + HFCUSB_B1_TX,
1690 start_isoc_chain(hw->fifos + HFCUSB_B2_TX,
1699 hfcsusb_stop_endpoint(struct hfcsusb *hw, int channel)
1702 if ((channel == HFC_CHAN_D) && (!hw->fifos[HFCUSB_D_RX].active))
1704 if ((channel == HFC_CHAN_B1) && (!hw->fifos[HFCUSB_B1_RX].active))
1706 if ((channel == HFC_CHAN_B2) && (!hw->fifos[HFCUSB_B2_RX].active))
1708 if ((channel == HFC_CHAN_E) && (!hw->fifos[HFCUSB_PCM_RX].active))
1712 if (hw->cfg_used == CNF_3INT3ISO || hw->cfg_used == CNF_4INT3ISO)
1713 stop_int_gracefull(hw->fifos + channel*2 + 1);
1716 if (hw->cfg_used == CNF_3ISO3ISO || hw->cfg_used == CNF_4ISO3ISO)
1717 stop_iso_gracefull(hw->fifos + channel*2 + 1);
1721 stop_iso_gracefull(hw->fifos + channel*2);
1727 setup_hfcsusb(struct hfcsusb *hw)
1733 printk(KERN_DEBUG "%s: %s\n", hw->name, __func__);
1736 if (read_reg_atomic(hw, HFCUSB_CHIP_ID, &b) != 1) {
1738 hw->name, __func__);
1743 hw->name, __func__, b);
1748 err = usb_set_interface(hw->dev, hw->if_used, hw->alt_used);
1750 hw->led_state = 0;
1753 hw->ctrl_read.bRequestType = 0xc0;
1754 hw->ctrl_read.bRequest = 1;
1755 hw->ctrl_read.wLength = cpu_to_le16(1);
1756 hw->ctrl_write.bRequestType = 0x40;
1757 hw->ctrl_write.bRequest = 0;
1758 hw->ctrl_write.wLength = 0;
1759 usb_fill_control_urb(hw->ctrl_urb, hw->dev, hw->ctrl_out_pipe,
1760 (u_char *)&hw->ctrl_write, NULL, 0,
1761 (usb_complete_t)ctrl_complete, hw);
1763 reset_hfcsusb(hw);
1768 release_hw(struct hfcsusb *hw)
1771 printk(KERN_DEBUG "%s: %s\n", hw->name, __func__);
1778 hfcsusb_stop_endpoint(hw, HFC_CHAN_D);
1779 hfcsusb_stop_endpoint(hw, HFC_CHAN_B1);
1780 hfcsusb_stop_endpoint(hw, HFC_CHAN_B2);
1781 if (hw->fifos[HFCUSB_PCM_RX].pipe)
1782 hfcsusb_stop_endpoint(hw, HFC_CHAN_E);
1783 if (hw->protocol == ISDN_P_TE_S0)
1784 l1_event(hw->dch.l1, CLOSE_CHANNEL);
1786 mISDN_unregister_device(&hw->dch.dev);
1787 mISDN_freebchannel(&hw->bch[1]);
1788 mISDN_freebchannel(&hw->bch[0]);
1789 mISDN_freedchannel(&hw->dch);
1791 if (hw->ctrl_urb) {
1792 usb_kill_urb(hw->ctrl_urb);
1793 usb_free_urb(hw->ctrl_urb);
1794 hw->ctrl_urb = NULL;
1797 if (hw->intf)
1798 usb_set_intfdata(hw->intf, NULL);
1799 list_del(&hw->list);
1800 kfree(hw);
1801 hw = NULL;
1807 struct hfcsusb *hw = bch->hw;
1812 hw->name, __func__, bch->nr);
1814 spin_lock_irqsave(&hw->lock, flags);
1816 spin_unlock_irqrestore(&hw->lock, flags);
1818 hfcsusb_stop_endpoint(hw, bch->nr);
1860 setup_instance(struct hfcsusb *hw, struct device *parent)
1866 printk(KERN_DEBUG "%s: %s\n", hw->name, __func__);
1868 spin_lock_init(&hw->ctrl_lock);
1869 spin_lock_init(&hw->lock);
1871 mISDN_initdchannel(&hw->dch, MAX_DFRAME_LEN_L1, ph_state);
1872 hw->dch.debug = debug & 0xFFFF;
1873 hw->dch.hw = hw;
1874 hw->dch.dev.Dprotocols = (1 << ISDN_P_TE_S0) | (1 << ISDN_P_NT_S0);
1875 hw->dch.dev.D.send = hfcusb_l2l1D;
1876 hw->dch.dev.D.ctrl = hfc_dctrl;
1879 if (hw->fifos[HFCUSB_PCM_RX].pipe)
1880 mISDN_initdchannel(&hw->ech, MAX_DFRAME_LEN_L1, NULL);
1882 hw->dch.dev.Bprotocols = (1 << (ISDN_P_B_RAW & ISDN_P_B_MASK)) |
1884 hw->dch.dev.nrbchan = 2;
1886 hw->bch[i].nr = i + 1;
1887 set_channelmap(i + 1, hw->dch.dev.channelmap);
1888 hw->bch[i].debug = debug;
1889 mISDN_initbchannel(&hw->bch[i], MAX_DATA_MEM);
1890 hw->bch[i].hw = hw;
1891 hw->bch[i].ch.send = hfcusb_l2l1B;
1892 hw->bch[i].ch.ctrl = hfc_bctrl;
1893 hw->bch[i].ch.nr = i + 1;
1894 list_add(&hw->bch[i].ch.list, &hw->dch.dev.bchannels);
1897 hw->fifos[HFCUSB_B1_TX].bch = &hw->bch[0];
1898 hw->fifos[HFCUSB_B1_RX].bch = &hw->bch[0];
1899 hw->fifos[HFCUSB_B2_TX].bch = &hw->bch[1];
1900 hw->fifos[HFCUSB_B2_RX].bch = &hw->bch[1];
1901 hw->fifos[HFCUSB_D_TX].dch = &hw->dch;
1902 hw->fifos[HFCUSB_D_RX].dch = &hw->dch;
1903 hw->fifos[HFCUSB_PCM_RX].ech = &hw->ech;
1904 hw->fifos[HFCUSB_PCM_TX].ech = &hw->ech;
1906 err = setup_hfcsusb(hw);
1910 snprintf(hw->name, MISDN_MAX_IDLEN - 1, "%s.%d", DRIVER_NAME,
1913 DRIVER_NAME, hw->name);
1915 err = mISDN_register_device(&hw->dch.dev, parent, hw->name);
1921 list_add_tail(&hw->list, &HFClist);
1926 mISDN_freebchannel(&hw->bch[1]);
1927 mISDN_freebchannel(&hw->bch[0]);
1928 mISDN_freedchannel(&hw->dch);
1929 kfree(hw);
1936 struct hfcsusb *hw;
2040 hw = kzalloc(sizeof(struct hfcsusb), GFP_KERNEL);
2041 if (!hw)
2043 snprintf(hw->name, MISDN_MAX_IDLEN - 1, "%s", DRIVER_NAME);
2056 f = &hw->fifos[idx & 7];
2096 f->hw = hw;
2103 hw->dev = dev; /* save device */
2104 hw->if_used = ifnum; /* save used interface */
2105 hw->alt_used = alt_used; /* and alternate config */
2106 hw->ctrl_paksize = dev->descriptor.bMaxPacketSize0; /* control size */
2107 hw->cfg_used = vcf[16]; /* store used config */
2108 hw->vend_idx = vend_idx; /* store found vendor */
2109 hw->packet_size = packet_size;
2110 hw->iso_packet_size = iso_packet_size;
2113 hw->ctrl_in_pipe = usb_rcvctrlpipe(hw->dev, 0);
2114 hw->ctrl_out_pipe = usb_sndctrlpipe(hw->dev, 0);
2115 hw->ctrl_urb = usb_alloc_urb(0, GFP_KERNEL);
2120 hw->name, __func__, driver_info->vend_name,
2123 if (setup_instance(hw, dev->dev.parent))
2126 hw->intf = intf;
2127 usb_set_intfdata(hw->intf, hw);
2135 struct hfcsusb *hw = usb_get_intfdata(intf);
2139 printk(KERN_INFO "%s: device disconnected\n", hw->name);
2141 handle_led(hw, LED_POWER_OFF);
2142 release_hw(hw);
2144 list_for_each_entry_safe(hw, next, &HFClist, list)