From: Aurelio <sk...@us...> - 2006-12-02 16:13:40
|
Update of /cvsroot/zyxel630-11/amedyn2/module In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv24638 Modified Files: amedyn2.c Log Message: Remove function jump_to_address and send it a static command. Look like we need wait more time before start to speek with the modem. The old function jump_to_address was never use with a address other than 0x00000000. 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: amedyn2.c =================================================================== RCS file: /cvsroot/zyxel630-11/amedyn2/module/amedyn2.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** amedyn2.c 18 Nov 2006 15:16:50 -0000 1.14 --- amedyn2.c 2 Dec 2006 16:13:38 -0000 1.15 *************** *** 151,177 **** /* From userspace tool */ - int jump_to_address(struct amedyn_instance_data *instance, unsigned int place) - { - struct usb_device *dev = instance->usbatm->usb_dev; - unsigned 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 (usb_bulk_msg (dev, usb_sndbulkpipe(dev, ENDPOINT_FIRMWARE), buf, 6, NULL, DATA_TIMEOUT)) - return -1; - buf[0] = 0x00; // Command (= jump?) - buf[1] = 0x01; // Length (= 1 byte) - buf[2] = 0x14; // Value (= jump to base address) - if (usb_bulk_msg (dev, usb_sndbulkpipe(dev, ENDPOINT_FIRMWARE), buf, 3, NULL, DATA_TIMEOUT)) - return -1; - return 0; - } - - /* From userspace tool */ /* format a message */ void format_message(int cmd, int ldata, int address, char *bufin) --- 151,154 ---- *************** *** 226,229 **** --- 203,218 ---- int i; + /* + The old function jump_to_address was never use with a address other + than 0x00000000. + 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_0x00000000[9] = + {0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x14} ; + usb_dbg(usbatm, "%s entered\n", __func__); *************** *** 261,265 **** dbg("amedyn_upload_firmware: Init load"); ! if (jump_to_address(instance, 0x00000000)) goto out_free; --- 250,255 ---- dbg("amedyn_upload_firmware: Init load"); ! if (usb_bulk_msg (usb_dev, usb_sndbulkpipe(usb_dev, ENDPOINT_FIRMWARE), ! jump_to_address_0x00000000, 9, NULL, DATA_TIMEOUT)) goto out_free; *************** *** 293,300 **** dbg("amedyn_upload_firmware: Firmware load"); ! if (jump_to_address(instance, 0x00000000)) goto out_free; ! msleep(2000); dbg("PostInit..."); --- 283,291 ---- dbg("amedyn_upload_firmware: Firmware load"); ! if (usb_bulk_msg (usb_dev, usb_sndbulkpipe(usb_dev, ENDPOINT_FIRMWARE), ! jump_to_address_0x00000000, 9, NULL, DATA_TIMEOUT)) goto out_free; ! msleep(10000); dbg("PostInit..."); |