aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/atm/ueagle-atm.c
diff options
context:
space:
mode:
authormatthieu castet <castet.matthieu@free.fr>2006-10-03 15:44:11 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-10-17 17:46:31 -0400
commita7a0c9cd1f45c2cae38ebe0951246bf94399818a (patch)
tree2e93104a6328c5d3e1342552783c7917ad1061cb /drivers/usb/atm/ueagle-atm.c
parent531a39bbab213209a9914e68809bcf8b60a54f47 (diff)
UEAGLE : comestic changes
Hi, this patch does some cosmetic changes : - dump firwmare version as soon as possible and export it on sysfs - hint about wrong cmv/dsp - Display a message to warn user when the modem is ready : it can help people to detect problems on the line without debug trace - Fix wrong indent - display modem type (pots/isdn) - increase version number Signed-off-by: Matthieu Castet <castet.matthieu@free.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/atm/ueagle-atm.c')
-rw-r--r--drivers/usb/atm/ueagle-atm.c42
1 files changed, 24 insertions, 18 deletions
diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c
index 88585da262dd..570529842231 100644
--- a/drivers/usb/atm/ueagle-atm.c
+++ b/drivers/usb/atm/ueagle-atm.c
@@ -68,7 +68,7 @@
68 68
69#include "usbatm.h" 69#include "usbatm.h"
70 70
71#define EAGLEUSBVERSION "ueagle 1.3" 71#define EAGLEUSBVERSION "ueagle 1.4"
72 72
73 73
74/* 74/*
@@ -80,14 +80,14 @@
80 dev_dbg(&(usb_dev)->dev, \ 80 dev_dbg(&(usb_dev)->dev, \
81 "[ueagle-atm dbg] %s: " format, \ 81 "[ueagle-atm dbg] %s: " format, \
82 __FUNCTION__, ##args); \ 82 __FUNCTION__, ##args); \
83 } while (0) 83 } while (0)
84 84
85#define uea_vdbg(usb_dev, format, args...) \ 85#define uea_vdbg(usb_dev, format, args...) \
86 do { \ 86 do { \
87 if (debug >= 2) \ 87 if (debug >= 2) \
88 dev_dbg(&(usb_dev)->dev, \ 88 dev_dbg(&(usb_dev)->dev, \
89 "[ueagle-atm vdbg] " format, ##args); \ 89 "[ueagle-atm vdbg] " format, ##args); \
90 } while (0) 90 } while (0)
91 91
92#define uea_enters(usb_dev) \ 92#define uea_enters(usb_dev) \
93 uea_vdbg(usb_dev, "entering %s\n", __FUNCTION__) 93 uea_vdbg(usb_dev, "entering %s\n", __FUNCTION__)
@@ -218,8 +218,8 @@ enum {
218#define UEA_CHIP_VERSION(x) \ 218#define UEA_CHIP_VERSION(x) \
219 ((x)->driver_info & 0xf) 219 ((x)->driver_info & 0xf)
220 220
221#define IS_ISDN(sc) \ 221#define IS_ISDN(usb_dev) \
222 (le16_to_cpu(sc->usb_dev->descriptor.bcdDevice) & 0x80) 222 (le16_to_cpu((usb_dev)->descriptor.bcdDevice) & 0x80)
223 223
224#define INS_TO_USBDEV(ins) ins->usb_dev 224#define INS_TO_USBDEV(ins) ins->usb_dev
225 225
@@ -625,12 +625,12 @@ static int request_dsp(struct uea_softc *sc)
625 char *dsp_name; 625 char *dsp_name;
626 626
627 if (UEA_CHIP_VERSION(sc) == ADI930) { 627 if (UEA_CHIP_VERSION(sc) == ADI930) {
628 if (IS_ISDN(sc)) 628 if (IS_ISDN(sc->usb_dev))
629 dsp_name = FW_DIR "DSP9i.bin"; 629 dsp_name = FW_DIR "DSP9i.bin";
630 else 630 else
631 dsp_name = FW_DIR "DSP9p.bin"; 631 dsp_name = FW_DIR "DSP9p.bin";
632 } else { 632 } else {
633 if (IS_ISDN(sc)) 633 if (IS_ISDN(sc->usb_dev))
634 dsp_name = FW_DIR "DSPei.bin"; 634 dsp_name = FW_DIR "DSPei.bin";
635 else 635 else
636 dsp_name = FW_DIR "DSPep.bin"; 636 dsp_name = FW_DIR "DSPep.bin";
@@ -885,7 +885,8 @@ static int uea_stat(struct uea_softc *sc)
885 break; 885 break;
886 886
887 case 3: /* fail ... */ 887 case 3: /* fail ... */
888 uea_info(INS_TO_USBDEV(sc), "modem synchronization failed\n"); 888 uea_info(INS_TO_USBDEV(sc), "modem synchronization failed"
889 " (may be try other cmv/dsp)\n");
889 return -EAGAIN; 890 return -EAGAIN;
890 891
891 case 4 ... 6: /* test state */ 892 case 4 ... 6: /* test state */
@@ -913,12 +914,6 @@ static int uea_stat(struct uea_softc *sc)
913 release_firmware(sc->dsp_firm); 914 release_firmware(sc->dsp_firm);
914 sc->dsp_firm = NULL; 915 sc->dsp_firm = NULL;
915 } 916 }
916
917 ret = uea_read_cmv(sc, SA_INFO, 10, &sc->stats.phy.firmid);
918 if (ret < 0)
919 return ret;
920 uea_info(INS_TO_USBDEV(sc), "ATU-R firmware version : %x\n",
921 sc->stats.phy.firmid);
922 } 917 }
923 918
924 /* always update it as atm layer could not be init when we switch to 919 /* always update it as atm layer could not be init when we switch to
@@ -1033,9 +1028,9 @@ static int request_cmvs(struct uea_softc *sc,
1033 1028
1034 if (cmv_file[sc->modem_index] == NULL) { 1029 if (cmv_file[sc->modem_index] == NULL) {
1035 if (UEA_CHIP_VERSION(sc) == ADI930) 1030 if (UEA_CHIP_VERSION(sc) == ADI930)
1036 file = (IS_ISDN(sc)) ? "CMV9i.bin" : "CMV9p.bin"; 1031 file = (IS_ISDN(sc->usb_dev)) ? "CMV9i.bin" : "CMV9p.bin";
1037 else 1032 else
1038 file = (IS_ISDN(sc)) ? "CMVei.bin" : "CMVep.bin"; 1033 file = (IS_ISDN(sc->usb_dev)) ? "CMVei.bin" : "CMVep.bin";
1039 } else 1034 } else
1040 file = cmv_file[sc->modem_index]; 1035 file = cmv_file[sc->modem_index];
1041 1036
@@ -1131,6 +1126,13 @@ static int uea_start_reset(struct uea_softc *sc)
1131 if (ret < 0) 1126 if (ret < 0)
1132 return ret; 1127 return ret;
1133 1128
1129 /* Dump firmware version */
1130 ret = uea_read_cmv(sc, SA_INFO, 10, &sc->stats.phy.firmid);
1131 if (ret < 0)
1132 return ret;
1133 uea_info(INS_TO_USBDEV(sc), "ATU-R firmware version : %x\n",
1134 sc->stats.phy.firmid);
1135
1134 /* get options */ 1136 /* get options */
1135 ret = len = request_cmvs(sc, &cmvs, &cmvs_fw); 1137 ret = len = request_cmvs(sc, &cmvs, &cmvs_fw);
1136 if (ret < 0) 1138 if (ret < 0)
@@ -1147,6 +1149,8 @@ static int uea_start_reset(struct uea_softc *sc)
1147 /* Enter in R-ACT-REQ */ 1149 /* Enter in R-ACT-REQ */
1148 ret = uea_write_cmv(sc, SA_CNTL, 0, 2); 1150 ret = uea_write_cmv(sc, SA_CNTL, 0, 2);
1149 uea_vdbg(INS_TO_USBDEV(sc), "Entering in R-ACT-REQ state\n"); 1151 uea_vdbg(INS_TO_USBDEV(sc), "Entering in R-ACT-REQ state\n");
1152 uea_info(INS_TO_USBDEV(sc), "Modem started, "
1153 "waiting synchronization\n");
1150out: 1154out:
1151 release_firmware(cmvs_fw); 1155 release_firmware(cmvs_fw);
1152 sc->reset = 0; 1156 sc->reset = 0;
@@ -1569,6 +1573,7 @@ UEA_ATTR(uscorr, 0);
1569UEA_ATTR(dscorr, 0); 1573UEA_ATTR(dscorr, 0);
1570UEA_ATTR(usunc, 0); 1574UEA_ATTR(usunc, 0);
1571UEA_ATTR(dsunc, 0); 1575UEA_ATTR(dsunc, 0);
1576UEA_ATTR(firmid, 0);
1572 1577
1573/* Retrieve the device End System Identifier (MAC) */ 1578/* Retrieve the device End System Identifier (MAC) */
1574 1579
@@ -1642,6 +1647,7 @@ static struct attribute *attrs[] = {
1642 &dev_attr_stat_dscorr.attr, 1647 &dev_attr_stat_dscorr.attr,
1643 &dev_attr_stat_usunc.attr, 1648 &dev_attr_stat_usunc.attr,
1644 &dev_attr_stat_dsunc.attr, 1649 &dev_attr_stat_dsunc.attr,
1650 &dev_attr_stat_firmid.attr,
1645}; 1651};
1646static struct attribute_group attr_grp = { 1652static struct attribute_group attr_grp = {
1647 .attrs = attrs, 1653 .attrs = attrs,
@@ -1756,10 +1762,10 @@ static int uea_probe(struct usb_interface *intf, const struct usb_device_id *id)
1756 struct usb_device *usb = interface_to_usbdev(intf); 1762 struct usb_device *usb = interface_to_usbdev(intf);
1757 1763
1758 uea_enters(usb); 1764 uea_enters(usb);
1759 uea_info(usb, "ADSL device founded vid (%#X) pid (%#X) : %s\n", 1765 uea_info(usb, "ADSL device founded vid (%#X) pid (%#X) : %s %s\n",
1760 le16_to_cpu(usb->descriptor.idVendor), 1766 le16_to_cpu(usb->descriptor.idVendor),
1761 le16_to_cpu(usb->descriptor.idProduct), 1767 le16_to_cpu(usb->descriptor.idProduct),
1762 chip_name[UEA_CHIP_VERSION(id)]); 1768 chip_name[UEA_CHIP_VERSION(id)], IS_ISDN(usb)?"isdn":"pots");
1763 1769
1764 usb_reset_device(usb); 1770 usb_reset_device(usb);
1765 1771