Lines Matching refs:edge_serial
466 static int process_rcvd_data (struct edgeport_serial *edge_serial, unsigned char *buffer, __u16 b…
467 static void process_rcvd_status (struct edgeport_serial *edge_serial, __u8 byte2, __u8 byte3);
476 static void send_more_port_data (struct edgeport_serial *edge_serial, struct edgeport_port *edge_p…
481 static void get_manufacturing_desc (struct edgeport_serial *edge_serial);
482 static void get_boot_desc (struct edgeport_serial *edge_serial);
483 static void load_application_firmware (struct edgeport_serial *edge_serial);
505 static void update_edgeport_E2PROM (struct edgeport_serial *edge_serial) in update_edgeport_E2PROM() argument
519 switch (edge_serial->product_info.iDownloadFile) { in update_edgeport_E2PROM()
541 BootCurVer = (edge_serial->boot_descriptor.MajorVersion << 24) + in update_edgeport_E2PROM()
542 (edge_serial->boot_descriptor.MinorVersion << 16) + in update_edgeport_E2PROM()
543 le16_to_cpu(edge_serial->boot_descriptor.BuildNumber); in update_edgeport_E2PROM()
550 edge_serial->boot_descriptor.MajorVersion, in update_edgeport_E2PROM()
551 edge_serial->boot_descriptor.MinorVersion, in update_edgeport_E2PROM()
552 le16_to_cpu(edge_serial->boot_descriptor.BuildNumber)); in update_edgeport_E2PROM()
557 edge_serial->boot_descriptor.MajorVersion, in update_edgeport_E2PROM()
558 edge_serial->boot_descriptor.MinorVersion, in update_edgeport_E2PROM()
559 le16_to_cpu(edge_serial->boot_descriptor.BuildNumber), in update_edgeport_E2PROM()
571 …response = rom_write (edge_serial->serial, le16_to_cpu(record->ExtAddr), le16_to_cpu(record->Addr)… in update_edgeport_E2PROM()
654 static void get_product_info(struct edgeport_serial *edge_serial) in get_product_info() argument
656 struct edgeport_product_info *product_info = &edge_serial->product_info; in get_product_info()
660 …product_info->ProductId = (__u16)(edge_serial->serial->dev->descriptor.idProduct & ~ION_DEVICE_ID… in get_product_info()
661 product_info->NumPorts = edge_serial->manuf_descriptor.NumPorts; in get_product_info()
664 product_info->RomSize = edge_serial->manuf_descriptor.RomSize; in get_product_info()
665 product_info->RamSize = edge_serial->manuf_descriptor.RamSize; in get_product_info()
666 product_info->CpuRev = edge_serial->manuf_descriptor.CpuRev; in get_product_info()
667 product_info->BoardRev = edge_serial->manuf_descriptor.BoardRev; in get_product_info()
669 product_info->BootMajorVersion = edge_serial->boot_descriptor.MajorVersion; in get_product_info()
670 product_info->BootMinorVersion = edge_serial->boot_descriptor.MinorVersion; in get_product_info()
671 product_info->BootBuildNumber = edge_serial->boot_descriptor.BuildNumber; in get_product_info()
673 …memcpy(product_info->ManufactureDescDate, edge_serial->manuf_descriptor.DescDate, sizeof(edge_seri… in get_product_info()
676 if (edge_serial->serial->dev->descriptor.idProduct & ION_DEVICE_ID_GENERATION_2) { in get_product_info()
756 struct edgeport_serial *edge_serial = (struct edgeport_serial *)urb->context; in edge_interrupt_callback() local
769 if (serial_paranoia_check (edge_serial->serial, __FUNCTION__)) { in edge_interrupt_callback()
785 edge_serial->rxBytesAvail += bytes_avail; in edge_interrupt_callback()
786 …dbg("%s - bytes_avail = %d, rxBytesAvail %d", __FUNCTION__, bytes_avail, edge_serial->rxBytesAvail… in edge_interrupt_callback()
788 if ((edge_serial->rxBytesAvail > 0) && in edge_interrupt_callback()
789 (edge_serial->read_urb->status != -EINPROGRESS)) { in edge_interrupt_callback()
793 edge_serial->read_urb->dev = edge_serial->serial->dev; in edge_interrupt_callback()
794 result = usb_submit_urb(edge_serial->read_urb); in edge_interrupt_callback()
804 while ((position < length) && (portNumber < edge_serial->serial->num_ports)) { in edge_interrupt_callback()
807 port = &edge_serial->serial->port[portNumber]; in edge_interrupt_callback()
819 send_more_port_data(edge_serial, edge_port); in edge_interrupt_callback()
837 struct edgeport_serial *edge_serial = (struct edgeport_serial *)urb->context; in edge_bulk_in_callback() local
844 if (serial_paranoia_check (edge_serial->serial, __FUNCTION__)) { in edge_bulk_in_callback()
859 edge_serial->rxBytesAvail -= raw_data_length; in edge_bulk_in_callback()
861 …dbg("%s - Received = %d, rxBytesAvail %d", __FUNCTION__, raw_data_length, edge_serial->rxBytesAvai… in edge_bulk_in_callback()
863 process_rcvd_data (edge_serial, data, urb->actual_length); in edge_bulk_in_callback()
866 if ((edge_serial->rxBytesAvail > 0) && in edge_bulk_in_callback()
867 (edge_serial->read_urb->status != -EINPROGRESS)) { in edge_bulk_in_callback()
871 edge_serial->read_urb->dev = edge_serial->serial->dev; in edge_bulk_in_callback()
872 status = usb_submit_urb(edge_serial->read_urb); in edge_bulk_in_callback()
978 struct edgeport_serial *edge_serial; in edge_open() local
999 edge_serial = (struct edgeport_serial *)serial->private; in edge_open()
1000 if (edge_serial == NULL) { in edge_open()
1003 if (edge_serial->interrupt_in_buffer == NULL) { in edge_open()
1007 edge_serial->interrupt_in_buffer = port0->interrupt_in_buffer; in edge_open()
1008 edge_serial->interrupt_in_endpoint = port0->interrupt_in_endpointAddress; in edge_open()
1009 edge_serial->interrupt_read_urb = port0->interrupt_in_urb; in edge_open()
1010 edge_serial->bulk_in_buffer = port0->bulk_in_buffer; in edge_open()
1011 edge_serial->bulk_in_endpoint = port0->bulk_in_endpointAddress; in edge_open()
1012 edge_serial->read_urb = port0->read_urb; in edge_open()
1013 edge_serial->bulk_out_endpoint = port0->bulk_out_endpointAddress; in edge_open()
1016 FILL_INT_URB(edge_serial->interrupt_read_urb, in edge_open()
1021 edge_serial->interrupt_read_urb->transfer_buffer_length, in edge_open()
1022 edge_interrupt_callback, edge_serial, in edge_open()
1023 edge_serial->interrupt_read_urb->interval); in edge_open()
1026 FILL_BULK_URB(edge_serial->read_urb, serial->dev, in edge_open()
1029 edge_serial->read_urb->transfer_buffer_length, in edge_open()
1030 edge_bulk_in_callback, edge_serial); in edge_open()
1034 response = usb_submit_urb (edge_serial->interrupt_read_urb); in edge_open()
1213 struct edgeport_serial *edge_serial; in edge_close() local
1226 edge_serial = (struct edgeport_serial *)serial->private; in edge_close()
1228 if ((edge_serial == NULL) || (edge_port == NULL)) in edge_close()
1381 static void send_more_port_data(struct edgeport_serial *edge_serial, struct edgeport_port *edge_por… in send_more_port_data() argument
1458 FILL_BULK_URB (urb, edge_serial->serial->dev, in send_more_port_data()
1459 usb_sndbulkpipe(edge_serial->serial->dev, edge_serial->bulk_out_endpoint), in send_more_port_data()
1465 urb->dev = edge_serial->serial->dev; in send_more_port_data()
1974 static int process_rcvd_data (struct edgeport_serial *edge_serial, unsigned char * buffer, __u16 bu… in process_rcvd_data() argument
1995 switch (edge_serial->rxState) { in process_rcvd_data()
1997 edge_serial->rxHeader1 = *buffer; in process_rcvd_data()
2002 edge_serial->rxState = EXPECT_HDR2; in process_rcvd_data()
2008 edge_serial->rxHeader2 = *buffer; in process_rcvd_data()
2012 dbg("%s - Hdr1=%02X Hdr2=%02X", __FUNCTION__, edge_serial->rxHeader1, edge_serial->rxHeader2); in process_rcvd_data()
2017 if (IS_CMD_STAT_HDR(edge_serial->rxHeader1)) { in process_rcvd_data()
2022 edge_serial->rxPort = IOSP_GET_HDR_PORT(edge_serial->rxHeader1); in process_rcvd_data()
2023 edge_serial->rxStatusCode = IOSP_GET_STATUS_CODE(edge_serial->rxHeader1); in process_rcvd_data()
2025 if (!IOSP_STATUS_IS_2BYTE(edge_serial->rxStatusCode)) { in process_rcvd_data()
2028 edge_serial->rxStatusParam = edge_serial->rxHeader2; in process_rcvd_data()
2030 edge_serial->rxState = EXPECT_HDR3; in process_rcvd_data()
2035 process_rcvd_status (edge_serial, edge_serial->rxHeader2, 0); in process_rcvd_data()
2037 edge_serial->rxState = EXPECT_HDR1; in process_rcvd_data()
2040 edge_serial->rxPort = IOSP_GET_HDR_PORT(edge_serial->rxHeader1); in process_rcvd_data()
2041 …edge_serial->rxBytesRemaining = IOSP_GET_HDR_DATA_LEN(edge_serial->rxHeader1, edge_serial->rxHeade… in process_rcvd_data()
2043 …dbg("%s - Data for Port %u Len %u", __FUNCTION__, edge_serial->rxPort, edge_serial->rxBytesRemaini… in process_rcvd_data()
2049 edge_serial->rxState = EXPECT_DATA; in process_rcvd_data()
2057 if (bufferLength < edge_serial->rxBytesRemaining) { in process_rcvd_data()
2059 edge_serial->rxState = EXPECT_DATA; // Expect data to start next buffer in process_rcvd_data()
2062 rxLen = edge_serial->rxBytesRemaining; in process_rcvd_data()
2063 edge_serial->rxState = EXPECT_HDR1; // Start another header next time in process_rcvd_data()
2067 edge_serial->rxBytesRemaining -= rxLen; in process_rcvd_data()
2071 port = &edge_serial->serial->port[edge_serial->rxPort]; in process_rcvd_data()
2077 dbg("%s - Sending %d bytes to TTY for port %d", __FUNCTION__, rxLen, edge_serial->rxPort); in process_rcvd_data()
2097 edge_serial->rxHeader3 = *buffer; in process_rcvd_data()
2102 process_rcvd_status (edge_serial, edge_serial->rxStatusParam, edge_serial->rxHeader3); in process_rcvd_data()
2103 edge_serial->rxState = EXPECT_HDR1; in process_rcvd_data()
2117 static void process_rcvd_status (struct edgeport_serial *edge_serial, __u8 byte2, __u8 byte3) in process_rcvd_status() argument
2121 __u8 code = edge_serial->rxStatusCode; in process_rcvd_status()
2124 port = &edge_serial->serial->port[edge_serial->rxPort]; in process_rcvd_status()
2130 err("%s - edge_port == NULL for port %d", __FUNCTION__, edge_serial->rxPort); in process_rcvd_status()
2134 dbg("%s - port %d", __FUNCTION__, edge_serial->rxPort); in process_rcvd_status()
2140 dbg("%s - Port %u EXT CHASE_RSP Data = %02x", __FUNCTION__, edge_serial->rxPort, byte3 ); in process_rcvd_status()
2151 …==== Port %u CHECK_RSP Sequence = %02x =============\n", __FUNCTION__, edge_serial->rxPort, byte3 … in process_rcvd_status()
2160 …dbg("%s - Port %u Open Response Inital MSR = %02x TxBufferSize = %d", __FUNCTION__, edge_serial->r… in process_rcvd_status()
2184 dbg("%s - Port %u LSR Status = %02x", __FUNCTION__, edge_serial->rxPort, byte2); in process_rcvd_status()
2189 …dbg("%s - Port %u LSR Status = %02x, Data = %02x", __FUNCTION__, edge_serial->rxPort, byte2, byte3… in process_rcvd_status()
2200 dbg("%s - Port %u MSR Status = %02x", __FUNCTION__, edge_serial->rxPort, byte2); in process_rcvd_status()
2476 struct edgeport_serial *edge_serial = (struct edgeport_serial *)edge_port->port->serial->private; in write_cmd_usb() local
2491 FILL_BULK_URB (urb, edge_serial->serial->dev, in write_cmd_usb()
2492 usb_sndbulkpipe(edge_serial->serial->dev, edge_serial->bulk_out_endpoint), in write_cmd_usb()
2822 static void get_manufacturing_desc (struct edgeport_serial *edge_serial) in get_manufacturing_desc() argument
2828 response = rom_read (edge_serial->serial, (EDGE_MANUF_DESC_ADDR & 0xffff0000) >> 16, in get_manufacturing_desc()
2830 (__u8 *)(&edge_serial->manuf_descriptor)); in get_manufacturing_desc()
2837 dbg(" RomSize: %dK", edge_serial->manuf_descriptor.RomSize); in get_manufacturing_desc()
2838 dbg(" RamSize: %dK", edge_serial->manuf_descriptor.RamSize); in get_manufacturing_desc()
2839 dbg(" CpuRev: %d", edge_serial->manuf_descriptor.CpuRev); in get_manufacturing_desc()
2840 dbg(" BoardRev: %d", edge_serial->manuf_descriptor.BoardRev); in get_manufacturing_desc()
2841 dbg(" NumPorts: %d", edge_serial->manuf_descriptor.NumPorts); in get_manufacturing_desc()
2842 … DescDate: %d/%d/%d", edge_serial->manuf_descriptor.DescDate[0], edge_serial->manuf_descript… in get_manufacturing_desc()
2843 …unicode_to_ascii (string, edge_serial->manuf_descriptor.SerialNumber, edge_serial->manuf_descripto… in get_manufacturing_desc()
2845 …unicode_to_ascii (string, edge_serial->manuf_descriptor.AssemblyNumber, edge_serial->manuf_descrip… in get_manufacturing_desc()
2847 …unicode_to_ascii (string, edge_serial->manuf_descriptor.OemAssyNumber, edge_serial->manuf_descript… in get_manufacturing_desc()
2849 dbg(" UartType: %d", edge_serial->manuf_descriptor.UartType); in get_manufacturing_desc()
2850 dbg(" IonPid: %d", edge_serial->manuf_descriptor.IonPid); in get_manufacturing_desc()
2851 dbg(" IonConfig: %d", edge_serial->manuf_descriptor.IonConfig); in get_manufacturing_desc()
2861 static void get_boot_desc (struct edgeport_serial *edge_serial) in get_boot_desc() argument
2867 response = rom_read (edge_serial->serial, (EDGE_BOOT_DESC_ADDR & 0xffff0000) >> 16, in get_boot_desc()
2869 (__u8 *)(&edge_serial->boot_descriptor)); in get_boot_desc()
2875 dbg(" BootCodeLength: %d", le16_to_cpu(edge_serial->boot_descriptor.BootCodeLength)); in get_boot_desc()
2876 dbg(" MajorVersion: %d", edge_serial->boot_descriptor.MajorVersion); in get_boot_desc()
2877 dbg(" MinorVersion: %d", edge_serial->boot_descriptor.MinorVersion); in get_boot_desc()
2878 dbg(" BuildNumber: %d", le16_to_cpu(edge_serial->boot_descriptor.BuildNumber)); in get_boot_desc()
2879 dbg(" Capabilities: 0x%x", le16_to_cpu(edge_serial->boot_descriptor.Capabilities)); in get_boot_desc()
2880 dbg(" UConfig0: %d", edge_serial->boot_descriptor.UConfig0); in get_boot_desc()
2881 dbg(" UConfig1: %d", edge_serial->boot_descriptor.UConfig1); in get_boot_desc()
2890 static void load_application_firmware (struct edgeport_serial *edge_serial) in load_application_firmware() argument
2899 switch (edge_serial->product_info.iDownloadFile) { in load_application_firmware()
2931 …response = sram_write (edge_serial->serial, le16_to_cpu(record->ExtAddr), le16_to_cpu(record->Addr… in load_application_firmware()
2943 response = usb_control_msg (edge_serial->serial->dev, in load_application_firmware()
2944 usb_sndctrlpipe(edge_serial->serial->dev, 0), in load_application_firmware()
2959 struct edgeport_serial *edge_serial; in edge_startup() local
2967 edge_serial = kmalloc (sizeof(struct edgeport_serial), GFP_KERNEL); in edge_startup()
2968 if (edge_serial == NULL) { in edge_startup()
2972 memset (edge_serial, 0, sizeof(struct edgeport_serial)); in edge_startup()
2973 edge_serial->serial = serial; in edge_startup()
2974 serial->private = edge_serial; in edge_startup()
2977 if ( (i = get_string(dev, dev->descriptor.iManufacturer, &edge_serial->name[0])) != 0) { in edge_startup()
2978 edge_serial->name[i-1] = ' '; in edge_startup()
2981 get_string(dev, dev->descriptor.iProduct, &edge_serial->name[i]); in edge_startup()
2983 info("%s detected", edge_serial->name); in edge_startup()
2986 get_manufacturing_desc (edge_serial); in edge_startup()
2989 get_boot_desc (edge_serial); in edge_startup()
2991 get_product_info(edge_serial); in edge_startup()
2995 if (edge_serial->product_info.NumPorts != serial->num_ports) { in edge_startup()
2998 __FUNCTION__, edge_serial->product_info.NumPorts, in edge_startup()
3005 load_application_firmware (edge_serial); in edge_startup()
3010 update_edgeport_E2PROM (edge_serial); in edge_startup()