diff options
author | matthieu castet <castet.matthieu@free.fr> | 2006-04-02 12:43:53 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-04-14 14:12:23 -0400 |
commit | 2a99b50719d3bff0a090fa8daf56d519c338296c (patch) | |
tree | 436b51f6f6dfeb466de9db7815844cdb2bf0039a /drivers/usb/atm | |
parent | 87ed0aeba8d59fe5d68df8d10ba469d63b254914 (diff) |
[PATCH] USB: UEAGLE : cosmetic
- improve debug trace in order to make easy to solve user problems.
- indent some code
- 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')
-rw-r--r-- | drivers/usb/atm/ueagle-atm.c | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c index 830d2c982670..8ec9e031e0d1 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.2" | 71 | #define EAGLEUSBVERSION "ueagle 1.3" |
72 | 72 | ||
73 | 73 | ||
74 | /* | 74 | /* |
@@ -314,6 +314,10 @@ struct cmv { | |||
314 | ((d) & 0xff) << 16 | \ | 314 | ((d) & 0xff) << 16 | \ |
315 | ((a) & 0xff) << 8 | \ | 315 | ((a) & 0xff) << 8 | \ |
316 | ((b) & 0xff)) | 316 | ((b) & 0xff)) |
317 | #define GETSA1(a) ((a >> 8) & 0xff) | ||
318 | #define GETSA2(a) (a & 0xff) | ||
319 | #define GETSA3(a) ((a >> 24) & 0xff) | ||
320 | #define GETSA4(a) ((a >> 16) & 0xff) | ||
317 | 321 | ||
318 | #define SA_CNTL MAKESA('C', 'N', 'T', 'L') | 322 | #define SA_CNTL MAKESA('C', 'N', 'T', 'L') |
319 | #define SA_DIAG MAKESA('D', 'I', 'A', 'G') | 323 | #define SA_DIAG MAKESA('D', 'I', 'A', 'G') |
@@ -728,11 +732,12 @@ bad2: | |||
728 | uea_err(INS_TO_USBDEV(sc), "sending DSP block %u failed\n", i); | 732 | uea_err(INS_TO_USBDEV(sc), "sending DSP block %u failed\n", i); |
729 | return; | 733 | return; |
730 | bad1: | 734 | bad1: |
731 | uea_err(INS_TO_USBDEV(sc), "invalid DSP page %u requested\n",pageno); | 735 | uea_err(INS_TO_USBDEV(sc), "invalid DSP page %u requested\n", pageno); |
732 | } | 736 | } |
733 | 737 | ||
734 | static inline void wake_up_cmv_ack(struct uea_softc *sc) | 738 | static inline void wake_up_cmv_ack(struct uea_softc *sc) |
735 | { | 739 | { |
740 | BUG_ON(sc->cmv_ack); | ||
736 | sc->cmv_ack = 1; | 741 | sc->cmv_ack = 1; |
737 | wake_up(&sc->cmv_ack_wait); | 742 | wake_up(&sc->cmv_ack_wait); |
738 | } | 743 | } |
@@ -743,6 +748,9 @@ static inline int wait_cmv_ack(struct uea_softc *sc) | |||
743 | sc->cmv_ack, ACK_TIMEOUT); | 748 | sc->cmv_ack, ACK_TIMEOUT); |
744 | sc->cmv_ack = 0; | 749 | sc->cmv_ack = 0; |
745 | 750 | ||
751 | uea_dbg(INS_TO_USBDEV(sc), "wait_event_timeout : %d ms\n", | ||
752 | jiffies_to_msecs(ret)); | ||
753 | |||
746 | if (ret < 0) | 754 | if (ret < 0) |
747 | return ret; | 755 | return ret; |
748 | 756 | ||
@@ -791,6 +799,12 @@ static int uea_cmv(struct uea_softc *sc, | |||
791 | struct cmv cmv; | 799 | struct cmv cmv; |
792 | int ret; | 800 | int ret; |
793 | 801 | ||
802 | uea_enters(INS_TO_USBDEV(sc)); | ||
803 | uea_vdbg(INS_TO_USBDEV(sc), "Function : %d-%d, Address : %c%c%c%c, " | ||
804 | "offset : 0x%04x, data : 0x%08x\n", | ||
805 | FUNCTION_TYPE(function), FUNCTION_SUBTYPE(function), | ||
806 | GETSA1(address), GETSA2(address), GETSA3(address), | ||
807 | GETSA4(address), offset, data); | ||
794 | /* we send a request, but we expect a reply */ | 808 | /* we send a request, but we expect a reply */ |
795 | sc->cmv_function = function | 0x2; | 809 | sc->cmv_function = function | 0x2; |
796 | sc->cmv_idx++; | 810 | sc->cmv_idx++; |
@@ -808,7 +822,9 @@ static int uea_cmv(struct uea_softc *sc, | |||
808 | ret = uea_request(sc, UEA_SET_BLOCK, UEA_MPTX_START, CMV_SIZE, &cmv); | 822 | ret = uea_request(sc, UEA_SET_BLOCK, UEA_MPTX_START, CMV_SIZE, &cmv); |
809 | if (ret < 0) | 823 | if (ret < 0) |
810 | return ret; | 824 | return ret; |
811 | return wait_cmv_ack(sc); | 825 | ret = wait_cmv_ack(sc); |
826 | uea_leaves(INS_TO_USBDEV(sc)); | ||
827 | return ret; | ||
812 | } | 828 | } |
813 | 829 | ||
814 | static inline int uea_read_cmv(struct uea_softc *sc, | 830 | static inline int uea_read_cmv(struct uea_softc *sc, |
@@ -922,7 +938,7 @@ static int uea_stat(struct uea_softc *sc) | |||
922 | * we check the status again in order to detect the failure earlier | 938 | * we check the status again in order to detect the failure earlier |
923 | */ | 939 | */ |
924 | if (sc->stats.phy.flags) { | 940 | if (sc->stats.phy.flags) { |
925 | uea_dbg(INS_TO_USBDEV(sc), "Stat flag = %d\n", | 941 | uea_dbg(INS_TO_USBDEV(sc), "Stat flag = 0x%x\n", |
926 | sc->stats.phy.flags); | 942 | sc->stats.phy.flags); |
927 | return 0; | 943 | return 0; |
928 | } | 944 | } |
@@ -1101,6 +1117,8 @@ static int uea_start_reset(struct uea_softc *sc) | |||
1101 | if (ret < 0) | 1117 | if (ret < 0) |
1102 | return ret; | 1118 | return ret; |
1103 | 1119 | ||
1120 | uea_vdbg(INS_TO_USBDEV(sc), "Ready CMV received\n"); | ||
1121 | |||
1104 | /* Enter in R-IDLE (cmv) until instructed otherwise */ | 1122 | /* Enter in R-IDLE (cmv) until instructed otherwise */ |
1105 | ret = uea_write_cmv(sc, SA_CNTL, 0, 1); | 1123 | ret = uea_write_cmv(sc, SA_CNTL, 0, 1); |
1106 | if (ret < 0) | 1124 | if (ret < 0) |
@@ -1121,6 +1139,7 @@ static int uea_start_reset(struct uea_softc *sc) | |||
1121 | } | 1139 | } |
1122 | /* Enter in R-ACT-REQ */ | 1140 | /* Enter in R-ACT-REQ */ |
1123 | ret = uea_write_cmv(sc, SA_CNTL, 0, 2); | 1141 | ret = uea_write_cmv(sc, SA_CNTL, 0, 2); |
1142 | uea_vdbg(INS_TO_USBDEV(sc), "Entering in R-ACT-REQ state\n"); | ||
1124 | out: | 1143 | out: |
1125 | release_firmware(cmvs_fw); | 1144 | release_firmware(cmvs_fw); |
1126 | sc->reset = 0; | 1145 | sc->reset = 0; |
@@ -1235,6 +1254,7 @@ static void uea_dispatch_cmv(struct uea_softc *sc, struct cmv* cmv) | |||
1235 | 1254 | ||
1236 | if (cmv->bFunction == MAKEFUNCTION(ADSLDIRECTIVE, MODEMREADY)) { | 1255 | if (cmv->bFunction == MAKEFUNCTION(ADSLDIRECTIVE, MODEMREADY)) { |
1237 | wake_up_cmv_ack(sc); | 1256 | wake_up_cmv_ack(sc); |
1257 | uea_leaves(INS_TO_USBDEV(sc)); | ||
1238 | return; | 1258 | return; |
1239 | } | 1259 | } |
1240 | 1260 | ||
@@ -1249,6 +1269,7 @@ static void uea_dispatch_cmv(struct uea_softc *sc, struct cmv* cmv) | |||
1249 | sc->data = sc->data << 16 | sc->data >> 16; | 1269 | sc->data = sc->data << 16 | sc->data >> 16; |
1250 | 1270 | ||
1251 | wake_up_cmv_ack(sc); | 1271 | wake_up_cmv_ack(sc); |
1272 | uea_leaves(INS_TO_USBDEV(sc)); | ||
1252 | return; | 1273 | return; |
1253 | 1274 | ||
1254 | bad2: | 1275 | bad2: |
@@ -1256,12 +1277,14 @@ bad2: | |||
1256 | "Function : %d, Subfunction : %d\n", | 1277 | "Function : %d, Subfunction : %d\n", |
1257 | FUNCTION_TYPE(cmv->bFunction), | 1278 | FUNCTION_TYPE(cmv->bFunction), |
1258 | FUNCTION_SUBTYPE(cmv->bFunction)); | 1279 | FUNCTION_SUBTYPE(cmv->bFunction)); |
1280 | uea_leaves(INS_TO_USBDEV(sc)); | ||
1259 | return; | 1281 | return; |
1260 | 1282 | ||
1261 | bad1: | 1283 | bad1: |
1262 | uea_err(INS_TO_USBDEV(sc), "invalid cmv received, " | 1284 | uea_err(INS_TO_USBDEV(sc), "invalid cmv received, " |
1263 | "wPreamble %d, bDirection %d\n", | 1285 | "wPreamble %d, bDirection %d\n", |
1264 | le16_to_cpu(cmv->wPreamble), cmv->bDirection); | 1286 | le16_to_cpu(cmv->wPreamble), cmv->bDirection); |
1287 | uea_leaves(INS_TO_USBDEV(sc)); | ||
1265 | } | 1288 | } |
1266 | 1289 | ||
1267 | /* | 1290 | /* |
@@ -1508,7 +1531,7 @@ static ssize_t read_##name(struct device *dev, \ | |||
1508 | int ret = -ENODEV; \ | 1531 | int ret = -ENODEV; \ |
1509 | struct uea_softc *sc; \ | 1532 | struct uea_softc *sc; \ |
1510 | \ | 1533 | \ |
1511 | mutex_lock(&uea_mutex); \ | 1534 | mutex_lock(&uea_mutex); \ |
1512 | sc = dev_to_uea(dev); \ | 1535 | sc = dev_to_uea(dev); \ |
1513 | if (!sc) \ | 1536 | if (!sc) \ |
1514 | goto out; \ | 1537 | goto out; \ |
@@ -1516,7 +1539,7 @@ static ssize_t read_##name(struct device *dev, \ | |||
1516 | if (reset) \ | 1539 | if (reset) \ |
1517 | sc->stats.phy.name = 0; \ | 1540 | sc->stats.phy.name = 0; \ |
1518 | out: \ | 1541 | out: \ |
1519 | mutex_unlock(&uea_mutex); \ | 1542 | mutex_unlock(&uea_mutex); \ |
1520 | return ret; \ | 1543 | return ret; \ |
1521 | } \ | 1544 | } \ |
1522 | \ | 1545 | \ |