Lines Matching +full:idma +full:- +full:addr
1 // SPDX-License-Identifier: (GPL-2.0+ OR BSD-2-Clause)
6 * Copyright (c) 2005-2007 Matthieu Castet <castet.matthieu@free.fr>
7 * Copyright (c) 2005-2007 Stanislaw Gruszka <stf_xl@wp.pl>
41 dev_dbg(&(usb_dev)->dev, \
42 "[ueagle-atm dbg] %s: " format, \
49 dev_dbg(&(usb_dev)->dev, \
50 "[ueagle-atm vdbg] " format, ##args); \
60 dev_err(&(usb_dev)->dev , "[UEAGLE-ATM] " format , ##args)
63 dev_warn(&(usb_dev)->dev , "[Ueagle-atm] " format, ##args)
66 dev_info(&(usb_dev)->dev , "[ueagle-atm] " format, ##args)
241 (!((x)->driver_info & PSTFIRM))
243 ((x)->driver_info & 0xf)
246 ((x)->annex & ANNEXB)
248 #define INS_TO_USBDEV(ins) (ins->usb_dev)
255 (GET_STATUS(sc->stats.phy.state) == 2) : \
256 (sc->stats.phy.state == 7))
265 #define FW_DIR "ueagle-atm/"
279 #define FPGA930_FIRMWARE FW_DIR "930-fpga.bin"
528 [0 ... (NB_MODEM - 1)] = FASTEST_ISO_INTF};
549 int _r = wait_event_freezable_timeout(sc->sync_q, \
552 _r = -ENODEV; \
558 if (sc->usbatm->atm_dev) \
559 sc->usbatm->atm_dev->type = val; \
564 if (sc->usbatm->atm_dev) \
565 atm_dev_signal_change(sc->usbatm->atm_dev, val); \
574 * uea_send_modem_cmd - Send a command for pre-firmware devices.
577 u16 addr, u16 size, const u8 *buff) in uea_send_modem_cmd() argument
579 int ret = -ENOMEM; in uea_send_modem_cmd()
588 USB_RECIP_DEVICE, addr, 0, xfer_buff, in uea_send_modem_cmd()
596 return (ret == size) ? 0 : -EIO; in uea_send_modem_cmd()
614 pfw = fw_entry->data; in uea_upload_pre_firmware()
615 size = fw_entry->size; in uea_upload_pre_firmware()
621 size -= 4; in uea_upload_pre_firmware()
640 size -= len + 3; in uea_upload_pre_firmware()
657 * Tell the modem we finish : de-assert reset in uea_upload_pre_firmware()
662 uea_err(usb, "modem de-assert failed with error %d\n", ret); in uea_upload_pre_firmware()
676 * uea_load_firmware - Load usb firmware for pre-firmware devices.
684 uea_info(usb, "pre-firmware device, uploading firmware\n"); in uea_load_firmware()
704 ret = request_firmware_nowait(THIS_MODULE, 1, fw_name, &usb->dev, in uea_load_firmware()
777 unsigned int sum = p->code - dsp; in check_dsp_e4()
782 if (strcmp("STRATIPHY ANEXA", p->string_header) != 0 && in check_dsp_e4()
783 strcmp("STRATIPHY ANEXB", p->string_header) != 0) in check_dsp_e4()
788 u8 blockno = p->page_number_to_block_index[i]; in check_dsp_e4()
798 blockidx = &p->page_header[blockno++]; in check_dsp_e4()
799 if ((u8 *)(blockidx + 1) - dsp >= len) in check_dsp_e4()
802 if (le16_to_cpu(blockidx->PageNumber) != i) in check_dsp_e4()
805 l = E4_PAGE_BYTES(blockidx->PageSize); in check_dsp_e4()
807 l += le32_to_cpu(blockidx->PageOffset); in check_dsp_e4()
812 } while (blockidx->NotLastBlock); in check_dsp_e4()
819 * send data to the idma pipe
823 int ret = -ENOMEM; in uea_idma_write()
833 ret = usb_bulk_msg(sc->usb_dev, in uea_idma_write()
834 usb_sndbulkpipe(sc->usb_dev, UEA_IDMA_PIPE), in uea_idma_write()
843 return -EIO; in uea_idma_write()
871 ret = request_firmware(&sc->dsp_firm, dsp_name, &sc->usb_dev->dev); in request_dsp()
880 ret = check_dsp_e4(sc->dsp_firm->data, sc->dsp_firm->size); in request_dsp()
882 ret = check_dsp_e1(sc->dsp_firm->data, sc->dsp_firm->size); in request_dsp()
887 release_firmware(sc->dsp_firm); in request_dsp()
888 sc->dsp_firm = NULL; in request_dsp()
889 return -EILSEQ; in request_dsp()
901 u16 pageno = sc->pageno; in uea_load_page_e1()
902 u16 ovl = sc->ovl; in uea_load_page_e1()
913 release_firmware(sc->dsp_firm); in uea_load_page_e1()
914 sc->dsp_firm = NULL; in uea_load_page_e1()
917 if (sc->dsp_firm == NULL && request_dsp(sc) < 0) in uea_load_page_e1()
920 p = sc->dsp_firm->data; in uea_load_page_e1()
933 p = sc->dsp_firm->data + pageoffset; in uea_load_page_e1()
953 bi.wLast = cpu_to_le16((i == blockcount - 1) ? 1 : 0); in uea_load_page_e1()
955 /* send block info through the IDMA pipe */ in uea_load_page_e1()
959 /* send block data through the IDMA pipe */ in uea_load_page_e1()
979 struct l1_code *p = (struct l1_code *) sc->dsp_firm->data; in __uea_load_page_e4()
980 u8 blockno = p->page_number_to_block_index[pageno]; in __uea_load_page_e4()
991 blockidx = &p->page_header[blockno]; in __uea_load_page_e4()
992 blocksize = E4_PAGE_BYTES(blockidx->PageSize); in __uea_load_page_e4()
993 blockoffset = sc->dsp_firm->data + le32_to_cpu( in __uea_load_page_e4()
994 blockidx->PageOffset); in __uea_load_page_e4()
997 bi.dwAddress = cpu_to_be32(le32_to_cpu(blockidx->PageAddress)); in __uea_load_page_e4()
1003 le32_to_cpu(blockidx->PageAddress)); in __uea_load_page_e4()
1005 /* send block info through the IDMA pipe */ in __uea_load_page_e4()
1009 /* send block data through the IDMA pipe */ in __uea_load_page_e4()
1014 } while (blockidx->NotLastBlock); in __uea_load_page_e4()
1026 u8 pageno = sc->pageno; in uea_load_page_e4()
1035 release_firmware(sc->dsp_firm); in uea_load_page_e4()
1036 sc->dsp_firm = NULL; in uea_load_page_e4()
1039 if (sc->dsp_firm == NULL && request_dsp(sc) < 0) in uea_load_page_e4()
1042 p = (struct l1_code *) sc->dsp_firm->data; in uea_load_page_e4()
1043 if (pageno >= le16_to_cpu(p->page_header[0].PageNumber)) { in uea_load_page_e4()
1055 "sending Main DSP page %u\n", p->page_header[0].PageNumber); in uea_load_page_e4()
1057 for (i = 0; i < le16_to_cpu(p->page_header[0].PageNumber); i++) { in uea_load_page_e4()
1058 if (E4_IS_BOOT_PAGE(p->page_header[i].PageSize)) in uea_load_page_e4()
1068 bi.dwSize = cpu_to_be32(E4_PAGE_BYTES(p->page_header[0].PageSize)); in uea_load_page_e4()
1069 bi.dwAddress = cpu_to_be32(le32_to_cpu(p->page_header[0].PageAddress)); in uea_load_page_e4()
1071 /* send block info through the IDMA pipe */ in uea_load_page_e4()
1078 BUG_ON(sc->cmv_ack); in wake_up_cmv_ack()
1079 sc->cmv_ack = 1; in wake_up_cmv_ack()
1080 wake_up(&sc->sync_q); in wake_up_cmv_ack()
1085 int ret = uea_wait(sc, sc->cmv_ack , ACK_TIMEOUT); in wait_cmv_ack()
1087 sc->cmv_ack = 0; in wait_cmv_ack()
1095 return (ret == 0) ? -ETIMEDOUT : 0; in wait_cmv_ack()
1104 int ret = -ENOMEM; in uea_request()
1112 ret = usb_control_msg(sc->usb_dev, usb_sndctrlpipe(sc->usb_dev, 0), in uea_request()
1127 return -EIO; in uea_request()
1140 uea_vdbg(INS_TO_USBDEV(sc), "Function : %d-%d, Address : %c%c%c%c, " in uea_cmv_e1()
1149 sc->cmv_dsc.e1.function = function | 0x2; in uea_cmv_e1()
1150 sc->cmv_dsc.e1.idx++; in uea_cmv_e1()
1151 sc->cmv_dsc.e1.address = address; in uea_cmv_e1()
1152 sc->cmv_dsc.e1.offset = offset; in uea_cmv_e1()
1157 cmv.wIndex = cpu_to_le16(sc->cmv_dsc.e1.idx); in uea_cmv_e1()
1180 uea_vdbg(INS_TO_USBDEV(sc), "Function : %d-%d, Group : 0x%04x, " in uea_cmv_e4()
1186 sc->cmv_dsc.e4.function = function | (0x1 << 4); in uea_cmv_e4()
1187 sc->cmv_dsc.e4.offset = offset; in uea_cmv_e4()
1188 sc->cmv_dsc.e4.address = address; in uea_cmv_e4()
1189 sc->cmv_dsc.e4.group = group; in uea_cmv_e4()
1215 *data = sc->data; in uea_read_cmv_e1()
1230 *data = sc->data; in uea_read_cmv_e4()
1231 /* size is in 16-bit word quantities */ in uea_read_cmv_e4()
1233 *(data + 1) = sc->data1; in uea_read_cmv_e4()
1271 * ADI930 don't support it (-EPIPE error). in uea_set_bulk_timeout()
1275 altsetting[sc->modem_index] > 0 || in uea_set_bulk_timeout()
1276 sc->stats.phy.dsrate == dsrate) in uea_set_bulk_timeout()
1290 * return < 0 if an error occurs (-EAGAIN reboot needed)
1298 data = sc->stats.phy.state; in uea_stat_e1()
1300 ret = uea_read_cmv_e1(sc, E1_SA_STAT, 0, &sc->stats.phy.state); in uea_stat_e1()
1304 switch (GET_STATUS(sc->stats.phy.state)) { in uea_stat_e1()
1321 return -EAGAIN; in uea_stat_e1()
1325 "modem in test mode - not supported\n"); in uea_stat_e1()
1326 return -EAGAIN; in uea_stat_e1()
1328 case 7: /* fast-retain ... */ in uea_stat_e1()
1329 uea_info(INS_TO_USBDEV(sc), "modem in fast-retain mode\n"); in uea_stat_e1()
1333 GET_STATUS(sc->stats.phy.state)); in uea_stat_e1()
1334 return -EAGAIN; in uea_stat_e1()
1344 release_firmware(sc->dsp_firm); in uea_stat_e1()
1345 sc->dsp_firm = NULL; in uea_stat_e1()
1354 wake_up(&sc->sync_q); in uea_stat_e1()
1356 ret = uea_read_cmv_e1(sc, E1_SA_DIAG, 2, &sc->stats.phy.flags); in uea_stat_e1()
1359 sc->stats.phy.mflags |= sc->stats.phy.flags; in uea_stat_e1()
1364 if (sc->stats.phy.flags) { in uea_stat_e1()
1366 sc->stats.phy.flags); in uea_stat_e1()
1375 sc->stats.phy.dsrate = (data >> 16) * 32; in uea_stat_e1()
1376 sc->stats.phy.usrate = (data & 0xffff) * 32; in uea_stat_e1()
1377 UPDATE_ATM_STAT(link_rate, sc->stats.phy.dsrate * 1000 / 424); in uea_stat_e1()
1382 sc->stats.phy.dsattenuation = (data & 0xff) / 2; in uea_stat_e1()
1387 sc->stats.phy.usattenuation = (data & 0xff) / 2; in uea_stat_e1()
1389 ret = uea_read_cmv_e1(sc, E1_SA_DIAG, 25, &sc->stats.phy.dsmargin); in uea_stat_e1()
1393 ret = uea_read_cmv_e1(sc, E1_SA_DIAG, 49, &sc->stats.phy.usmargin); in uea_stat_e1()
1397 ret = uea_read_cmv_e1(sc, E1_SA_DIAG, 51, &sc->stats.phy.rxflow); in uea_stat_e1()
1401 ret = uea_read_cmv_e1(sc, E1_SA_DIAG, 52, &sc->stats.phy.txflow); in uea_stat_e1()
1405 ret = uea_read_cmv_e1(sc, E1_SA_DIAG, 54, &sc->stats.phy.dsunc); in uea_stat_e1()
1409 /* only for atu-c */ in uea_stat_e1()
1410 ret = uea_read_cmv_e1(sc, E1_SA_DIAG, 58, &sc->stats.phy.usunc); in uea_stat_e1()
1414 ret = uea_read_cmv_e1(sc, E1_SA_DIAG, 53, &sc->stats.phy.dscorr); in uea_stat_e1()
1418 /* only for atu-c */ in uea_stat_e1()
1419 ret = uea_read_cmv_e1(sc, E1_SA_DIAG, 57, &sc->stats.phy.uscorr); in uea_stat_e1()
1423 ret = uea_read_cmv_e1(sc, E1_SA_INFO, 8, &sc->stats.phy.vidco); in uea_stat_e1()
1427 ret = uea_read_cmv_e1(sc, E1_SA_INFO, 13, &sc->stats.phy.vidcpe); in uea_stat_e1()
1441 data = sc->stats.phy.state; in uea_stat_e4()
1444 ret = uea_read_cmv_e4(sc, 1, E4_SA_STAT, 0, 0, &sc->stats.phy.state); in uea_stat_e4()
1448 switch (sc->stats.phy.state) { in uea_stat_e4()
1465 return -EAGAIN; in uea_stat_e4()
1470 sc->stats.phy.state); in uea_stat_e4()
1481 release_firmware(sc->dsp_firm); in uea_stat_e4()
1482 sc->dsp_firm = NULL; in uea_stat_e4()
1491 wake_up(&sc->sync_q); in uea_stat_e4()
1495 * we should find the equivalent of eagle3- CMV in uea_stat_e4()
1498 ret = uea_read_cmv_e4(sc, 1, E4_SA_DIAG, 0, 0, &sc->stats.phy.flags); in uea_stat_e4()
1501 sc->stats.phy.mflags |= sc->stats.phy.flags; in uea_stat_e4()
1506 if (sc->stats.phy.flags) { in uea_stat_e4()
1508 sc->stats.phy.flags); in uea_stat_e4()
1509 if (sc->stats.phy.flags & 1) /* delineation LOSS */ in uea_stat_e4()
1510 return -EAGAIN; in uea_stat_e4()
1511 if (sc->stats.phy.flags & 0x4000) /* Reset Flag */ in uea_stat_e4()
1512 return -EAGAIN; in uea_stat_e4()
1521 sc->stats.phy.usrate = data / 1000; in uea_stat_e4()
1528 sc->stats.phy.dsrate = data / 1000; in uea_stat_e4()
1529 UPDATE_ATM_STAT(link_rate, sc->stats.phy.dsrate * 1000 / 424); in uea_stat_e4()
1534 sc->stats.phy.dsattenuation = data / 10; in uea_stat_e4()
1539 sc->stats.phy.usattenuation = data / 10; in uea_stat_e4()
1544 sc->stats.phy.dsmargin = data / 2; in uea_stat_e4()
1549 sc->stats.phy.usmargin = data / 10; in uea_stat_e4()
1561 if (cmv_file[sc->modem_index] == NULL) { in cmvs_file_name()
1572 file = cmv_file[sc->modem_index]; in cmvs_file_name()
1589 ret = request_firmware(fw, cmv_name, &sc->usb_dev->dev); in request_cmvs_old()
1597 data = (u8 *) (*fw)->data; in request_cmvs_old()
1598 size = (*fw)->size; in request_cmvs_old()
1611 return -EILSEQ; in request_cmvs_old()
1623 ret = request_firmware(fw, cmv_name, &sc->usb_dev->dev); in request_cmvs()
1638 size = (*fw)->size; in request_cmvs()
1639 data = (u8 *) (*fw)->data; in request_cmvs()
1653 size -= 4; in request_cmvs()
1659 size -= 4; in request_cmvs()
1672 return -EILSEQ; in request_cmvs()
1682 /* Enter in R-IDLE (cmv) until instructed otherwise */ in uea_send_cmvs_e1()
1688 ret = uea_read_cmv_e1(sc, E1_SA_INFO, 10, &sc->stats.phy.firmid); in uea_send_cmvs_e1()
1691 uea_info(INS_TO_USBDEV(sc), "ATU-R firmware version : %x\n", in uea_send_cmvs_e1()
1692 sc->stats.phy.firmid); in uea_send_cmvs_e1()
1731 /* Enter in R-ACT-REQ */ in uea_send_cmvs_e1()
1733 uea_vdbg(INS_TO_USBDEV(sc), "Entering in R-ACT-REQ state\n"); in uea_send_cmvs_e1()
1748 /* Enter in R-IDLE (cmv) until instructed otherwise */ in uea_send_cmvs_e4()
1755 ret = uea_read_cmv_e4(sc, 2, E4_SA_INFO, 55, 0, &sc->stats.phy.firmid); in uea_send_cmvs_e4()
1758 uea_info(INS_TO_USBDEV(sc), "ATU-R firmware version : %x\n", in uea_send_cmvs_e4()
1759 sc->stats.phy.firmid); in uea_send_cmvs_e4()
1786 /* Enter in R-ACT-REQ */ in uea_send_cmvs_e4()
1788 uea_vdbg(INS_TO_USBDEV(sc), "Entering in R-ACT-REQ state\n"); in uea_send_cmvs_e4()
1797 * - send reset commands through usb control pipe
1798 * - start workqueue for DSP loading
1799 * - send CMV options to modem
1804 u16 zero = 0; /* ;-) */ in uea_start_reset()
1811 sc->booting = 1; in uea_start_reset()
1816 sc->cmv_ack = 0; in uea_start_reset()
1820 memset(&sc->stats, 0, sizeof(struct uea_stats)); in uea_start_reset()
1822 /* tell the modem that we want to boot in IDMA mode */ in uea_start_reset()
1849 sc->cmv_dsc.e4.function = E4_MAKEFUNCTION(E4_ADSLDIRECTIVE, in uea_start_reset()
1852 sc->cmv_dsc.e1.function = E1_MAKEFUNCTION(E1_ADSLDIRECTIVE, in uea_start_reset()
1856 sc->booting = 0; in uea_start_reset()
1859 sc->pageno = 0; in uea_start_reset()
1860 sc->ovl = 0; in uea_start_reset()
1861 schedule_work(&sc->task); in uea_start_reset()
1870 ret = sc->send_cmvs(sc); in uea_start_reset()
1874 sc->reset = 0; in uea_start_reset()
1881 * if the modem don't request reboot (-EAGAIN).
1888 int ret = -EAGAIN; in uea_kthread()
1893 if (ret < 0 || sc->reset) in uea_kthread()
1896 ret = sc->stat(sc); in uea_kthread()
1897 if (ret != -EAGAIN) in uea_kthread()
1915 ret = request_firmware(&fw_entry, fw_name, &sc->usb_dev->dev); in load_XILINX_firmware()
1922 pfw = fw_entry->data; in load_XILINX_firmware()
1923 size = fw_entry->size; in load_XILINX_firmware()
1927 ret = -EILSEQ; in load_XILINX_firmware()
1931 ln = min(size - u, 64); in load_XILINX_firmware()
1948 /* Tell the modem we finish : de-assert reset */ in load_XILINX_firmware()
1950 ret = uea_send_modem_cmd(sc->usb_dev, 0xe, 1, &value); in load_XILINX_firmware()
1952 uea_err(sc->usb_dev, "elsa de-assert failed with error" in load_XILINX_firmware()
1965 struct cmv_dsc_e1 *dsc = &sc->cmv_dsc.e1; in uea_dispatch_cmv_e1()
1966 struct cmv_e1 *cmv = &intr->u.e1.s2.cmv; in uea_dispatch_cmv_e1()
1969 if (le16_to_cpu(cmv->wPreamble) != E1_PREAMBLE) in uea_dispatch_cmv_e1()
1972 if (cmv->bDirection != E1_MODEMTOHOST) in uea_dispatch_cmv_e1()
1978 if (cmv->bFunction != dsc->function) { in uea_dispatch_cmv_e1()
1980 && cmv->bFunction == E1_MAKEFUNCTION(2, 2)) { in uea_dispatch_cmv_e1()
1981 cmv->wIndex = cpu_to_le16(dsc->idx); in uea_dispatch_cmv_e1()
1982 put_unaligned_le32(dsc->address, in uea_dispatch_cmv_e1()
1983 &cmv->dwSymbolicAddress); in uea_dispatch_cmv_e1()
1984 cmv->wOffsetAddress = cpu_to_le16(dsc->offset); in uea_dispatch_cmv_e1()
1989 if (cmv->bFunction == E1_MAKEFUNCTION(E1_ADSLDIRECTIVE, in uea_dispatch_cmv_e1()
1997 if (le16_to_cpu(cmv->wIndex) != dsc->idx || in uea_dispatch_cmv_e1()
1998 get_unaligned_le32(&cmv->dwSymbolicAddress) != dsc->address || in uea_dispatch_cmv_e1()
1999 le16_to_cpu(cmv->wOffsetAddress) != dsc->offset) in uea_dispatch_cmv_e1()
2002 sc->data = get_unaligned_le32(&cmv->dwData); in uea_dispatch_cmv_e1()
2003 sc->data = sc->data << 16 | sc->data >> 16; in uea_dispatch_cmv_e1()
2012 E1_FUNCTION_TYPE(cmv->bFunction), in uea_dispatch_cmv_e1()
2013 E1_FUNCTION_SUBTYPE(cmv->bFunction)); in uea_dispatch_cmv_e1()
2020 le16_to_cpu(cmv->wPreamble), cmv->bDirection); in uea_dispatch_cmv_e1()
2027 struct cmv_dsc_e4 *dsc = &sc->cmv_dsc.e4; in uea_dispatch_cmv_e4()
2028 struct cmv_e4 *cmv = &intr->u.e4.s2.cmv; in uea_dispatch_cmv_e4()
2032 be16_to_cpu(cmv->wGroup), be16_to_cpu(cmv->wFunction), in uea_dispatch_cmv_e4()
2033 be16_to_cpu(cmv->wOffset), be16_to_cpu(cmv->wAddress), in uea_dispatch_cmv_e4()
2034 be32_to_cpu(cmv->dwData[0]), be32_to_cpu(cmv->dwData[1])); in uea_dispatch_cmv_e4()
2036 if (be16_to_cpu(cmv->wFunction) != dsc->function) in uea_dispatch_cmv_e4()
2039 if (be16_to_cpu(cmv->wFunction) == E4_MAKEFUNCTION(E4_ADSLDIRECTIVE, in uea_dispatch_cmv_e4()
2047 if (be16_to_cpu(cmv->wOffset) != dsc->offset || in uea_dispatch_cmv_e4()
2048 be16_to_cpu(cmv->wGroup) != dsc->group || in uea_dispatch_cmv_e4()
2049 be16_to_cpu(cmv->wAddress) != dsc->address) in uea_dispatch_cmv_e4()
2052 sc->data = be32_to_cpu(cmv->dwData[0]); in uea_dispatch_cmv_e4()
2053 sc->data1 = be32_to_cpu(cmv->dwData[1]); in uea_dispatch_cmv_e4()
2061 E4_FUNCTION_TYPE(cmv->wFunction), in uea_dispatch_cmv_e4()
2062 E4_FUNCTION_SUBTYPE(cmv->wFunction)); in uea_dispatch_cmv_e4()
2070 sc->pageno = intr->e1_bSwapPageNo; in uea_schedule_load_page_e1()
2071 sc->ovl = intr->e1_bOvl >> 4 | intr->e1_bOvl << 4; in uea_schedule_load_page_e1()
2072 schedule_work(&sc->task); in uea_schedule_load_page_e1()
2078 sc->pageno = intr->e4_bSwapPageNo; in uea_schedule_load_page_e4()
2079 schedule_work(&sc->task); in uea_schedule_load_page_e4()
2087 struct uea_softc *sc = urb->context; in uea_intr()
2088 struct intr_pkt *intr = urb->transfer_buffer; in uea_intr()
2089 int status = urb->status; in uea_intr()
2099 /* device-to-host interrupt */ in uea_intr()
2100 if (intr->bType != 0x08 || sc->booting) { in uea_intr()
2105 switch (le16_to_cpu(intr->wInterrupt)) { in uea_intr()
2107 sc->schedule_load_page(sc, intr); in uea_intr()
2111 sc->dispatch_cmv(sc, intr); in uea_intr()
2116 le16_to_cpu(intr->wInterrupt)); in uea_intr()
2120 usb_submit_urb(sc->urb_int, GFP_ATOMIC); in uea_intr()
2129 int ret = -ENOMEM; in uea_boot()
2136 sc->dispatch_cmv = uea_dispatch_cmv_e4; in uea_boot()
2137 sc->schedule_load_page = uea_schedule_load_page_e4; in uea_boot()
2138 sc->stat = uea_stat_e4; in uea_boot()
2139 sc->send_cmvs = uea_send_cmvs_e4; in uea_boot()
2140 INIT_WORK(&sc->task, uea_load_page_e4); in uea_boot()
2143 sc->dispatch_cmv = uea_dispatch_cmv_e1; in uea_boot()
2144 sc->schedule_load_page = uea_schedule_load_page_e1; in uea_boot()
2145 sc->stat = uea_stat_e1; in uea_boot()
2146 sc->send_cmvs = uea_send_cmvs_e1; in uea_boot()
2147 INIT_WORK(&sc->task, uea_load_page_e1); in uea_boot()
2150 init_waitqueue_head(&sc->sync_q); in uea_boot()
2155 if (intf->cur_altsetting->desc.bNumEndpoints < 1) { in uea_boot()
2156 ret = -ENODEV; in uea_boot()
2164 sc->urb_int = usb_alloc_urb(0, GFP_KERNEL); in uea_boot()
2165 if (!sc->urb_int) in uea_boot()
2168 usb_fill_int_urb(sc->urb_int, sc->usb_dev, in uea_boot()
2169 usb_rcvintpipe(sc->usb_dev, UEA_INTR_PIPE), in uea_boot()
2171 intf->cur_altsetting->endpoint[0].desc.bInterval); in uea_boot()
2173 ret = usb_submit_urb(sc->urb_int, GFP_KERNEL); in uea_boot()
2183 sc->kthread = kthread_create(uea_kthread, sc, "ueagle-atm"); in uea_boot()
2184 if (IS_ERR(sc->kthread)) { in uea_boot()
2186 ret = PTR_ERR(sc->kthread); in uea_boot()
2194 usb_kill_urb(sc->urb_int); in uea_boot()
2196 usb_free_urb(sc->urb_int); in uea_boot()
2197 sc->urb_int = NULL; in uea_boot()
2211 ret = kthread_stop(sc->kthread); in uea_stop()
2216 usb_kill_urb(sc->urb_int); in uea_stop()
2217 kfree(sc->urb_int->transfer_buffer); in uea_stop()
2218 usb_free_urb(sc->urb_int); in uea_stop()
2221 flush_work(&sc->task); in uea_stop()
2223 release_firmware(sc->dsp_firm); in uea_stop()
2241 return usbatm->driver_data; in dev_to_uea()
2247 int ret = -ENODEV; in stat_status_show()
2254 ret = sysfs_emit(buf, "%08x\n", sc->stats.phy.state); in stat_status_show()
2263 int ret = -ENODEV; in stat_status_store()
2270 sc->reset = 1; in stat_status_store()
2282 int ret = -ENODEV; in stat_human_status_show()
2292 switch (sc->stats.phy.state) { in stat_human_status_show()
2316 modem_state = GET_STATUS(sc->stats.phy.state); in stat_human_status_show()
2345 int ret = -ENODEV; in stat_delin_show()
2355 if (sc->stats.phy.flags & 0x4000) in stat_delin_show()
2357 else if (sc->stats.phy.flags & 0x0001) in stat_delin_show()
2360 if (sc->stats.phy.flags & 0x0C00) in stat_delin_show()
2362 else if (sc->stats.phy.flags & 0x0030) in stat_delin_show()
2379 int ret = -ENODEV; \
2386 ret = sysfs_emit(buf, "%08x\n", sc->stats.phy.name); \
2388 sc->stats.phy.name = 0; \
2419 (sc->usb_dev, sc->usb_dev->descriptor.iSerialNumber, mac_str, in uea_getesi()
2433 struct uea_softc *sc = usbatm->driver_data; in uea_atm_open()
2435 return uea_getesi(sc, atm_dev->esi); in uea_atm_open()
2440 struct uea_softc *sc = usbatm->driver_data; in uea_heavy()
2442 wait_event_interruptible(sc->sync_q, IS_OPERATIONAL(sc)); in uea_heavy()
2456 return -ENODEV; in claim_interface()
2494 int ret, ifnum = intf->altsetting->desc.bInterfaceNumber; in uea_bind()
2501 return -ENODEV; in uea_bind()
2503 usbatm->flags = (sync_wait[modem_index] ? 0 : UDSL_SKIP_HEAVY_INIT); in uea_bind()
2520 return -ENOMEM; in uea_bind()
2522 sc->usb_dev = usb; in uea_bind()
2523 usbatm->driver_data = sc; in uea_bind()
2524 sc->usbatm = usbatm; in uea_bind()
2525 sc->modem_index = (modem_index < NB_MODEM) ? modem_index++ : 0; in uea_bind()
2526 sc->driver_info = id->driver_info; in uea_bind()
2529 if (annex[sc->modem_index] == 1) in uea_bind()
2530 sc->annex = ANNEXA; in uea_bind()
2531 else if (annex[sc->modem_index] == 2) in uea_bind()
2532 sc->annex = ANNEXB; in uea_bind()
2534 else if (sc->driver_info & AUTO_ANNEX_A) in uea_bind()
2535 sc->annex = ANNEXA; in uea_bind()
2536 else if (sc->driver_info & AUTO_ANNEX_B) in uea_bind()
2537 sc->annex = ANNEXB; in uea_bind()
2539 sc->annex = (le16_to_cpu in uea_bind()
2540 (sc->usb_dev->descriptor.bcdDevice) & 0x80) ? ANNEXB : ANNEXA; in uea_bind()
2542 alt = altsetting[sc->modem_index]; in uea_bind()
2549 usbatm->flags |= UDSL_USE_ISOC | UDSL_IGNORE_EILSEQ; in uea_bind()
2569 struct uea_softc *sc = usbatm->driver_data; in uea_unbind()
2576 .driver_name = "ueagle-atm",
2593 le16_to_cpu(usb->descriptor.idVendor), in uea_probe()
2594 le16_to_cpu(usb->descriptor.idProduct), in uea_probe()
2595 le16_to_cpu(usb->descriptor.bcdDevice), in uea_probe()
2606 struct uea_softc *sc = usbatm->driver_data; in uea_probe()
2612 wake_up_process(sc->kthread); in uea_probe()
2621 int ifnum = intf->altsetting->desc.bInterfaceNumber; in uea_disconnect()
2625 * Pre-firmware device has one interface in uea_disconnect()
2627 if (usb->config->desc.bNumInterfaces != 1 && ifnum == 0) { in uea_disconnect()
2716 .name = "ueagle-atm",