Hello... I'm using the Moschip USB-serial driver code available here: http://www.moschip.com/html/MCS7840.html I have verified that it works with the 2.6.11-1.1369_FC4 kernel in Fedora Core 4.
I am, however, wanting to use it with the latest 2.6.17-1.2157_FC5 in Fedora Core 5. I've made minor updates to their driver so that it will compile and load with the newer kernel. i.e. Changed 'struct usb_serial_device_type' to 'struct usb_serial_driver' and minor tty flip buffer changes. But I am experiencing issues in code that I have not changed and am looking for clues as to why it would not work in the latest Fedora kernel version. A call to usb_control_msg seems to be returning a negative error status where it didn't before. It worked just fine with the earlier kernel version, but it seems to be returning -EPIPE now. The code below is being called from the driver's usb_serial_driver.attach function.. mos7840_get_reg_sync works fine. The error occurs in the call to mos7840_set_reg_sync. Doesn't seem to be anything fancy going on here, so I'm wondering if there is simply some sort of setup or config that need/could be done?? If anybody has any tips, it would be appreciated.. Thanks...Paul... ------------------------------------------------------------- //enable rx_disable bit in control register status=mos7840_get_reg_sync(serial->port[i],mos7840_port->ControlRegOffset,&Data); if(status<0) { DPRINTK("Reading ControlReg failed status-0x%x\n", status); break; } else DPRINTK("ControlReg Reading success val is %x, status%d\n",Data,status); Data |= 0x08;//setting driver done bit Data |= 0x04;//sp1_bit to have cts change reflect in modem status reg //Data |= 0x20; //rx_disable bit status=0; status=mos7840_set_reg_sync(serial->port[i],mos7840_port->ControlRegOffset,Data); if(status<0) { DPRINTK("Writing ControlReg failed(rx_disable) status-0x%x\n", status); break; } else DPRINTK("ControlReg Writing success(rx_disable) status%d\n",status); ---------------------------------------------------------------- /* Description:- To set the Control register by calling usb_fill_control_urb function by passing usb_sndctrlpipe function as parameter. Input Parameters: usb_serial_port: Data Structure usb_serialport correponding to that seril port.Reg: Register Address Val: Value to set in the Register. */ static int mos7840_set_reg_sync(struct usb_serial_port *port, __u16 reg, __u16 val) { struct usb_device *dev = port->serial->dev; DPRINTK("mos7840_set_reg_sync offset is %x, value %x\n",reg,val); return usb_control_msg(dev, usb_sndctrlpipe(dev, 0), MCS_WRREQ, MCS_WR_RTYPE, val, reg, NULL, 0,MOS_WDR_TIMEOUT); } /* Description:- To set the Uart register by calling usb_fill_control_urb function by passing usb_rcvctrlpipe function as parameter. Input Parameters: usb_serial_port: Data Structure usb_serialport correponding to that seril port.Reg: Register Address Val: Value to receive from the Register. */ static int mos7840_get_reg_sync(struct usb_serial_port *port, __u16 reg, __u16 * val) { struct usb_device *dev = port->serial->dev; int ret=0; ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), MCS_RDREQ, MCS_RD_RTYPE, 0, reg, val, VENDOR_READ_LENGTH,MOS_WDR_TIMEOUT); DPRINTK("mos7840_get_reg_sync offset is %x, return val %x\n",reg,*val); return ret; } -- --- Paul B Schroeder <pschroeder "at" uplogix "dot" com> Senior Software Engineer Uplogix, Inc. (http://www.uplogix.com/) ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel