From: Aurelio <sk...@us...> - 2006-12-02 14:58:47
|
Update of /cvsroot/zyxel630-11/amedyn/init In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv25449 Modified Files: amfunctions.c Log Message: Remove function jump_to_address and send it a static command. The old funtion jump_to_address was never use with a address other than 0x0000. The Windows driver use two transfers. One to set the base address and other to send the jump to base address command, but it can be send as a single transfer. Probably it can be send with the firmware too, as the speedtch.c driver do. Index: amfunctions.c =================================================================== RCS file: /cvsroot/zyxel630-11/amedyn/init/amfunctions.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** amfunctions.c 28 Sep 2006 20:07:41 -0000 1.18 --- amfunctions.c 2 Dec 2006 14:58:45 -0000 1.19 *************** *** 294,319 **** } - /* start code execution at specified address */ - int jump_to_address(usb_dev_handle *adsl_handle, unsigned int place) - { - char buf[6]; /* buffer */ - - buf[0] = 0x08; // Command (= set base address) - buf[1] = 0x04; // Length (= 4 bytes) - // Value (base address = place) - buf[2] = (place >> 24) & 0xff; - buf[3] = (place >> 16) & 0xff; - buf[4] = (place >> 8) & 0xff; - buf[5] = place & 0xff; - if (send_bulk(adsl_handle, USB_OUT_FIRM, buf, 1, 6)) - return -1; - buf[0] = 0x00; // Command (= jump?) - buf[1] = 0x01; // Length (= 1 byte) - buf[2] = 0x14; // Value (= jump to base address) - if (send_bulk(adsl_handle, USB_OUT_FIRM, buf, 1, 3)) - return -1; - return 0; - } - /* Say modem sync line */ int send_cmds_sync (usb_dev_handle *adsl_handle, int tmodem) --- 294,297 ---- *************** *** 450,453 **** --- 428,443 ---- char bufconf[8]; /* buffer to save config bytes */ + /* + The old funtion jump_to_address was never use with a address other than + 0x0000. + The Windows driver use two transfers. One to set the base address and other + to send the jump to base address command, but it can be send as a single + transfer. Probably it can be send with the firmware too, as the speedtch.c + driver do. + */ + + char jump_to_address_0x0000[9] = + {0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x14} ; + /* clear endpoints */ *************** *** 488,492 **** fclose(soft); ! if (jump_to_address(adsl_handle, 0x00000000)) return -1; --- 478,482 ---- fclose(soft); ! if (send_bulk(adsl_handle, USB_OUT_FIRM, jump_to_address_0x0000, 1, 9)) return -1; *************** *** 529,534 **** fclose(soft); ! if (jump_to_address(adsl_handle, 0x00000000)) return -1; printf(gettext("Firmware is sent!\n")); --- 519,525 ---- fclose(soft); ! if (send_bulk(adsl_handle, USB_OUT_FIRM, jump_to_address_0x0000, 1, 9)) return -1; + printf(gettext("Firmware is sent!\n")); |