Commit fb4b1e40 authored by Linus Torvalds's avatar Linus Torvalds

Merge master.kernel.org:/home/davem/BK/sparc-2.5

into home.transmeta.com:/home/torvalds/v2.5/linux
parents 1849a36f 20c77dc6
Linux Kernel SCTP
This is the current BETA release of the Linux Kernel SCTP reference
implementation.
SCTP (Stream Control Transmission Protocol) is a IP based, message oriented,
reliable transport protocol, with congestion control, support for
transparent multi-homing, and multiple ordered streams of messages.
RFC2960 defines the core protocol. The IETF SIGTRAN working group originally
developed the SCTP protocol and later handed the protocol over to the
Transport Area (TSVWG) working group for the continued evolvement of SCTP as a
general purpose transport.
See the IETF website (http://www.ietf.org) for further documents on SCTP.
See http://www.ietf.org/rfc/rfc2960.txt
The initial project goal is to create an Linux kernel reference implementation
of SCTP that is RFC 2960 compliant and provides an programming interface
referred to as the UDP-style API of the Sockets Extensions for SCTP, as
proposed in IETF Internet-Drafts.
Caveats:
-lksctp can be built as statically or as a module. However, be aware that
module removal of lksctp is not yet a safe activity.
-There is tentative support for IPv6, but most work has gone towards
implementation and testing lksctp on IPv4.
For more information, please visit the lksctp project website:
http://www.sf.net/projects/lksctp
Or contact the lksctp developers through the mailing list:
<lksctp-developers@lists.sourceforge.net>
26-Apr-2002 23-Aug-2002
The EHCI driver is used to talk to high speed USB 2.0 devices using The EHCI driver is used to talk to high speed USB 2.0 devices using
USB 2.0-capable host controller hardware. The USB 2.0 standard is USB 2.0-capable host controller hardware. The USB 2.0 standard is
...@@ -21,11 +21,15 @@ high speed "split transactions" that don't waste transfer bandwidth. ...@@ -21,11 +21,15 @@ high speed "split transactions" that don't waste transfer bandwidth.
At this writing, this driver has been seen to work with implementations At this writing, this driver has been seen to work with implementations
of EHCI from (in alphabetical order): Intel, NEC, Philips, and VIA. of EHCI from (in alphabetical order): Intel, NEC, Philips, and VIA.
Other EHCI implementations are becoming available from other vendors;
you should expect this driver to work with them too.
At this writing, high speed devices are finally beginning to appear. While usb-storage devices have been available since mid-2001 (working
While usb-storage devices have been available for some time (working
quite speedily on the 2.4 version of this driver), hubs have only quite speedily on the 2.4 version of this driver), hubs have only
very recently become available. been available since late 2001, and other kinds of high speed devices
appear to be on hold until more systems come with USB 2.0 built-in.
Such new systems have been available since early 2002, and became much
more typical in the second half of 2002.
Note that USB 2.0 support involves more than just EHCI. It requires Note that USB 2.0 support involves more than just EHCI. It requires
other changes to the Linux-USB core APIs, including the hub driver, other changes to the Linux-USB core APIs, including the hub driver,
...@@ -43,26 +47,25 @@ used on PPC hardware so big/little endianness issues should be gone. ...@@ -43,26 +47,25 @@ used on PPC hardware so big/little endianness issues should be gone.
It's believed to do all the right PCI magic so that I/O works even on It's believed to do all the right PCI magic so that I/O works even on
systems with interesting DMA mapping issues. systems with interesting DMA mapping issues.
At this writing the driver should comfortably handle all control and bulk At this writing the driver should comfortably handle all control, bulk,
transfers, including requests to USB 1.1 devices through transaction and interrupt transfers, including requests to USB 1.1 devices through
translators (TTs) in USB 2.0 hubs. However, there some situations where transaction translators (TTs) in USB 2.0 hubs.
the hub driver needs to clear TT error state, which it doesn't yet do.
Interrupt transfer support is newly functional and not yet as robust as High Speed Isochronous (ISO) transfer support is also functional, but
control and bulk traffic. As yet there is no support for split transaction at this writing no Linux drivers have been using that support.
scheduling for interrupt transfers, which means among other things that
connecting USB 1.1 hubs, keyboards, and mice to USB 2.0 hubs won't work.
Connect them to USB 1.1 hubs, or to a root hub.
Isochronous (ISO) transfer support is also newly functional. No production Full Speed Isochronous transfer support, through transaction translators,
high speed devices are available which would need it (though high quality is not yet available. Note that split transaction support for ISO
webcams are in the works!). Note that split transaction support for ISO
transfers can't share much code with the code for high speed ISO transfers, transfers can't share much code with the code for high speed ISO transfers,
since EHCI represents these with a different data structure. So for now, since EHCI represents these with a different data structure. So for now,
most USB audio and video devices have the same restrictions as hubs, mice, most USB audio and video devices can't be connected to high speed buses.
and keyboards: don't connect them using high speed USB hubs.
The EHCI root hub code should hand off USB 1.1 devices to its companion Transfers of all types can be queued. This means that control transfers
from a driver on one interface (or through usbfs) won't interfere with
ones from another driver, and that interrupt transfers can use periods
of one frame without risking data loss due to interrupt processing costs.
The EHCI root hub code hands off USB 1.1 devices to its companion
controller. This driver doesn't need to know anything about those controller. This driver doesn't need to know anything about those
drivers; a OHCI or UHCI driver that works already doesn't need to change drivers; a OHCI or UHCI driver that works already doesn't need to change
just because the EHCI driver is also present. just because the EHCI driver is also present.
...@@ -70,6 +73,11 @@ just because the EHCI driver is also present. ...@@ -70,6 +73,11 @@ just because the EHCI driver is also present.
There are some issues with power management; suspend/resume doesn't There are some issues with power management; suspend/resume doesn't
behave quite right at the moment. behave quite right at the moment.
Also, some shortcuts have been taken with the scheduling periodic
transactions (interrupt and isochronous transfers). These place some
limits on the number of periodic transactions that can be scheduled,
and prevent use of polling intervals of less than one frame.
USE BY USE BY
...@@ -83,10 +91,10 @@ and remove it by: ...@@ -83,10 +91,10 @@ and remove it by:
# rmmod ehci-hcd # rmmod ehci-hcd
You should also have a driver for a "companion controller", such as You should also have a driver for a "companion controller", such as
"ohci-hcd", "usb-ohci", "usb-uhci", or "uhci". In case of any trouble "ohci-hcd" or "uhci-hcd". In case of any trouble with the EHCI driver,
with the EHCI driver, remove its module and then the driver for that remove its module and then the driver for that companion controller will
companion controller will take over (at lower speed) all the devices take over (at lower speed) all the devices that were previously handled
that were previously handled by the EHCI driver. by the EHCI driver.
Module parameters (pass to "modprobe") include: Module parameters (pass to "modprobe") include:
...@@ -122,13 +130,18 @@ good to keep in mind that bulk transfers are always in 512 byte packets, ...@@ -122,13 +130,18 @@ good to keep in mind that bulk transfers are always in 512 byte packets,
and at most 13 of those fit into one USB 2.0 microframe. Eight USB 2.0 and at most 13 of those fit into one USB 2.0 microframe. Eight USB 2.0
microframes fit in a USB 1.1 frame; a microframe is 1 msec/8 = 125 usec. microframes fit in a USB 1.1 frame; a microframe is 1 msec/8 = 125 usec.
So more than 50 MByte/sec is available for bulk transfers, when both
hardware and device driver software allow it. Periodic transfer modes
(isochronous and interrupt) allow the larger packet sizes which let you
approach the quoted 480 MBit/sec transfer rate.
Hardware Performance Hardware Performance
At this writing, individual USB 2.0 devices tend to max out at around At this writing, individual USB 2.0 devices tend to max out at around
20 MByte/sec transfer rates. This is of course subject to change; 20 MByte/sec transfer rates. This is of course subject to change;
and some devices now go faster, while others go slower. and some devices now go faster, while others go slower.
The NEC implementation of EHCI seems to have a hardware bottleneck The first NEC implementation of EHCI seems to have a hardware bottleneck
at around 28 MByte/sec aggregate transfer rate. While this is clearly at around 28 MByte/sec aggregate transfer rate. While this is clearly
enough for a single device at 20 MByte/sec, putting three such devices enough for a single device at 20 MByte/sec, putting three such devices
onto one bus does not get you 60 MByte/sec. The issue appears to be onto one bus does not get you 60 MByte/sec. The issue appears to be
...@@ -136,9 +149,11 @@ that the controller hardware won't do concurrent USB and PCI access, ...@@ -136,9 +149,11 @@ that the controller hardware won't do concurrent USB and PCI access,
so that it's only trying six (or maybe seven) USB transactions each so that it's only trying six (or maybe seven) USB transactions each
microframe rather than thirteen. (Seems like a reasonable trade off microframe rather than thirteen. (Seems like a reasonable trade off
for a product that beat all the others to market by over a year!) for a product that beat all the others to market by over a year!)
It's expected that newer implementations will better this, throwing It's expected that newer implementations will better this, throwing
more silicon real estate at the problem so that new motherboard chip more silicon real estate at the problem so that new motherboard chip
sets will get closer to that 60 MByte/sec target. sets will get closer to that 60 MByte/sec target. That includes an
updated implementation from NEC, as well as other vendors' silicon.
There's a minimum latency of one microframe (125 usec) for the host There's a minimum latency of one microframe (125 usec) for the host
to receive interrupts from the EHCI controller indicating completion to receive interrupts from the EHCI controller indicating completion
......
23-Aug-2002
The OHCI HCD layer is a simple but nearly complete implementation of what the
USB people would call a HCD for the OHCI. The "ohci-hcd" driver is a USB Host Controller Driver (HCD) that is derived
(ISO coming soon, Bulk, INT u. CTRL transfers enabled) from the "usb-ohci" driver from the 2.4 kernel series. The "usb-ohci" code
It is based on Linus Torvalds UHCI code and Gregory Smith OHCI fragments (0.03 source tree). was written primarily by Roman Weissgaerber <weissg@vienna.at> but with
The layer (functions) on top of it, is for interfacing to the alternate-usb device-drivers. contributions from many others (read its copyright/licencing header).
- Roman Weissgaerber <weissg@vienna.at> It supports the "Open Host Controller Interface" (OHCI), which standardizes
hardware register protocols used to talk to USB 1.1 host controllers. As
* v4.0 1999/08/18 removed all dummy eds, unlink unused eds, code cleanup, bulk transfers compared to the earlier "Universal Host Controller Interface" (UHCI) from
* v2.1 1999/05/09 ep_addr correction, code cleanup Intel, it pushes more intelligence into the hardware. USB 1.1 controllers
* v0.2.0 1999/05/04 from vendors other than Intel and VIA generally use OHCI.
* everything has been moved into 2 files (ohci-hcd.c, ohci-hub-root.c and headers)
* virtual root hub is now an option, Changes since the 2.4 kernel include
* memory allocation based on kmalloc and kfree now, simple Bus error handling,
* INT and CTRL transfers enabled, Bulk included but disabled, ISO needs completion - improved robustness; bugfixes; and less overhead
* - supports the updated and simplified usbcore APIs
* from Linus Torvalds (uhci.c): APM (not tested); hub, usb_device, bus and related stuff - interrupt transfers can be larger, and can be queued
* from Greg Smith (ohci.c): better reset ohci-controller handling, hub - less code, by using the upper level "hcd" framework
* - supports some non-PCI implementations of OHCI
* v0.1.0 1999/04/27 initial release - ... more
to remove the module try: The "ohci-hcd" driver handles all USB 1.1 transfer types. Transfers of all
rmmod usb-ohci types can be queued. That was also true in "usb-ohci", except for interrupt
transfers. Previously, using periods of one frame would risk data loss due
Features: to overhead in IRQ processing. When interrupt transfers are queued, those
- virtual root hub, all basic hub descriptors and commands (state: complete) risks can be minimized by making sure the hardware always has transfers to
this is an option now (v0.2.0) work on while the OS is getting around to the relevant IRQ processing.
#define CONFIG_USB_OHCI_VROOTHUB includes the virtual hub code, (VROOTHUB)
default is with. - David Brownell
(at the moment: the Virtual Root Hub is included automatically) <dbrownell@users.sourceforge.net>
files: ohci-root-hub.c, ohci-root-hub.h
- Endpoint Descriptor (ED) handling more static approach
(EDs should be allocated in parallel to the SET CONFIGURATION command and they live
as long as the function (device) is alive or another configuration is chosen.
In the HCD layer the EDs has to be allocated manually either by calling a subroutine
or by sending a USB root hub vendor specific command to the virtual root hub.
At the alternate linux usb stack EDs will be added (allocated) at their first use.
ED will be unlinked from the HC chains if they are not busy.
files: ohci-hcd.c ohci-hcd.h
routines: (do not use for drivers, use the top layer alternate usb commands instead)
int usb_ohci_add_ep(struct ohci * ohci, unsigned int ep_addr1,
int interval, int load, f_handler handler, int ep_size, int speed)
adds an endpoint, (if the endpoint already exists some parameters will be updated)
int usb_ohci_rm_ep( )
removes an endpoint and all pending TDs of that EP
usb_ohci_rm_function( )
removes all Endpoints of a function (device)
- Transfer Descriptors (TD): handling and allocation of TDs is transparent to the upper layers
The HCD takes care of TDs and EDs memory allocation whereas the upper layers (UBSD ...) has
to take care of buffer allocation.
files: ohci-hcd.c ohci-hcd.h
There is one basic command for all types of bus transfers (INT, BULK, ISO, CTRL):
int ohci_trans_req(struct ohci * ohci, hcd_ed, int ctrl_len, void *ctrl, void * data, int data_len, __OHCI_BAG lw0, __OHCI_BAG lw1)
CTRL: ctrl, ctrl_len ... cmd buffer
data, data_len ... data buffer (in or out)
INT, BULK: ctrl = NULL, ctrl_len=0,
data, data_len ... data buffer (in or out)
ISO: tbd
There is no buffer reinsertion done by the internal HCD function.
(The interface layer does this for a INT-pipe on request.)
If you want a transfer then you have to
provide buffers by sending ohci_trans_req requests. As they are queued as TDs on an ED
you can send as many as you like. They should come back by the callback f_handler in
the same order (for each endpoint, not globally) If an error occurs all
queued transfers of an endpoint will return unsent. They will be marked with an error status.
e.g double-buffering for int transfers:
ohci_trans_req(ohci, ep_addr, 0, NULL, data0, data0_len, 0,0)
ohci_trans_req(ohci, ep_addr, 0, NULL, data1, data1_len, 0,0)
and when a data0 packet returns by the callback f_handler requeue it:
ohci_trans_req(ohci, ep_addr, 0, NULL, data0, data0_len, 0,0)
and when a data1 packet returns by the callback f_handler requeue it:
ohci_trans_req(ohci, ep_addr, 0, NULL, data1, data1_len, 0,0)
lw0, lw1 are private fields for upper layers for ids or fine grained handlers.
The alternate usb uses them for dev_id and usb_device_irq handler.
- Done list handling: returns the requests (callback f_handler in ED) and does
some error handling, root-hub request dequeuing
(files: ohci-done-list.c in ohci-hcd.c now(v0.2.0))
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
#include <net/pkt_sched.h> #include <net/pkt_sched.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/reboot.h> #include <linux/reboot.h>
#include <net/checksum.h>
#include <linux/tqueue.h> #include <linux/tqueue.h>
#include <linux/ethtool.h> #include <linux/ethtool.h>
#include <linux/if_vlan.h> #include <linux/if_vlan.h>
......
...@@ -427,6 +427,11 @@ e1000_probe(struct pci_dev *pdev, ...@@ -427,6 +427,11 @@ e1000_probe(struct pci_dev *pdev,
netdev->features = NETIF_F_SG; netdev->features = NETIF_F_SG;
} }
#ifdef NETIF_F_TSO
if(adapter->hw.mac_type >= e1000_82544)
netdev->features |= NETIF_F_TSO;
#endif
if(pci_using_dac) if(pci_using_dac)
netdev->features |= NETIF_F_HIGHDMA; netdev->features |= NETIF_F_HIGHDMA;
...@@ -1284,9 +1289,62 @@ e1000_watchdog(unsigned long data) ...@@ -1284,9 +1289,62 @@ e1000_watchdog(unsigned long data)
#define E1000_TX_FLAGS_CSUM 0x00000001 #define E1000_TX_FLAGS_CSUM 0x00000001
#define E1000_TX_FLAGS_VLAN 0x00000002 #define E1000_TX_FLAGS_VLAN 0x00000002
#define E1000_TX_FLAGS_TSO 0x00000004
#define E1000_TX_FLAGS_VLAN_MASK 0xffff0000 #define E1000_TX_FLAGS_VLAN_MASK 0xffff0000
#define E1000_TX_FLAGS_VLAN_SHIFT 16 #define E1000_TX_FLAGS_VLAN_SHIFT 16
static inline boolean_t
e1000_tso(struct e1000_adapter *adapter, struct sk_buff *skb, int tx_flags)
{
#ifdef NETIF_F_TSO
struct e1000_context_desc *context_desc;
int i;
uint8_t ipcss, ipcso, tucss, tucso, hdr_len;
uint16_t ipcse, tucse, mss;
if(skb_shinfo(skb)->tso_size) {
hdr_len = ((skb->h.raw - skb->data) + (skb->h.th->doff << 2));
mss = skb_shinfo(skb)->tso_size;
skb->nh.iph->tot_len = 0;
skb->nh.iph->check = 0;
skb->h.th->check = ~csum_tcpudp_magic(skb->nh.iph->saddr,
skb->nh.iph->daddr,
0,
IPPROTO_TCP,
0);
ipcss = skb->nh.raw - skb->data;
ipcso = (void *)&(skb->nh.iph->check) - (void *)skb->data;
ipcse = skb->h.raw - skb->data - 1;
tucss = skb->h.raw - skb->data;
tucso = (void *)&(skb->h.th->check) - (void *)skb->data;
tucse = 0;
i = adapter->tx_ring.next_to_use;
context_desc = E1000_CONTEXT_DESC(adapter->tx_ring, i);
context_desc->lower_setup.ip_fields.ipcss = ipcss;
context_desc->lower_setup.ip_fields.ipcso = ipcso;
context_desc->lower_setup.ip_fields.ipcse = cpu_to_le16(ipcse);
context_desc->upper_setup.tcp_fields.tucss = tucss;
context_desc->upper_setup.tcp_fields.tucso = tucso;
context_desc->upper_setup.tcp_fields.tucse = cpu_to_le16(tucse);
context_desc->tcp_seg_setup.fields.mss = cpu_to_le16(mss);
context_desc->tcp_seg_setup.fields.hdr_len = hdr_len;
context_desc->cmd_and_length = cpu_to_le32(adapter->txd_cmd |
E1000_TXD_CMD_DEXT | E1000_TXD_CMD_TSE |
E1000_TXD_CMD_IP | E1000_TXD_CMD_TCP |
(skb->len - (hdr_len)));
i = (i + 1) % adapter->tx_ring.count;
adapter->tx_ring.next_to_use = i;
return TRUE;
}
#endif
return FALSE;
}
static inline boolean_t static inline boolean_t
e1000_tx_csum(struct e1000_adapter *adapter, struct sk_buff *skb) e1000_tx_csum(struct e1000_adapter *adapter, struct sk_buff *skb)
{ {
...@@ -1386,6 +1444,12 @@ e1000_tx_queue(struct e1000_adapter *adapter, int count, int tx_flags) ...@@ -1386,6 +1444,12 @@ e1000_tx_queue(struct e1000_adapter *adapter, int count, int tx_flags)
txd_upper = 0; txd_upper = 0;
txd_lower = adapter->txd_cmd; txd_lower = adapter->txd_cmd;
if(tx_flags & E1000_TX_FLAGS_TSO) {
txd_lower |= E1000_TXD_CMD_DEXT | E1000_TXD_DTYP_D |
E1000_TXD_CMD_TSE;
txd_upper |= (E1000_TXD_POPTS_IXSM | E1000_TXD_POPTS_TXSM) << 8;
}
if(tx_flags & E1000_TX_FLAGS_CSUM) { if(tx_flags & E1000_TX_FLAGS_CSUM) {
txd_lower |= E1000_TXD_CMD_DEXT | E1000_TXD_DTYP_D; txd_lower |= E1000_TXD_CMD_DEXT | E1000_TXD_DTYP_D;
txd_upper |= E1000_TXD_POPTS_TXSM << 8; txd_upper |= E1000_TXD_POPTS_TXSM << 8;
...@@ -1435,22 +1499,29 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) ...@@ -1435,22 +1499,29 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
for(f = 0; f < skb_shinfo(skb)->nr_frags; f++) for(f = 0; f < skb_shinfo(skb)->nr_frags; f++)
count += TXD_USE_COUNT(skb_shinfo(skb)->frags[f].size, count += TXD_USE_COUNT(skb_shinfo(skb)->frags[f].size,
adapter->max_data_per_txd); adapter->max_data_per_txd);
#ifdef NETIF_F_TSO
if((skb_shinfo(skb)->tso_size) || (skb->ip_summed == CHECKSUM_HW))
count++;
#else
if(skb->ip_summed == CHECKSUM_HW) if(skb->ip_summed == CHECKSUM_HW)
count++; count++;
#endif
if(E1000_DESC_UNUSED(&adapter->tx_ring) < count) { if(E1000_DESC_UNUSED(&adapter->tx_ring) < count) {
netif_stop_queue(netdev); netif_stop_queue(netdev);
return 1; return 1;
} }
if(e1000_tx_csum(adapter, skb))
tx_flags |= E1000_TX_FLAGS_CSUM;
if(adapter->vlgrp && vlan_tx_tag_present(skb)) { if(adapter->vlgrp && vlan_tx_tag_present(skb)) {
tx_flags |= E1000_TX_FLAGS_VLAN; tx_flags |= E1000_TX_FLAGS_VLAN;
tx_flags |= (vlan_tx_tag_get(skb) << E1000_TX_FLAGS_VLAN_SHIFT); tx_flags |= (vlan_tx_tag_get(skb) << E1000_TX_FLAGS_VLAN_SHIFT);
} }
if(e1000_tso(adapter, skb, tx_flags))
tx_flags |= E1000_TX_FLAGS_TSO;
else if(e1000_tx_csum(adapter, skb))
tx_flags |= E1000_TX_FLAGS_CSUM;
count = e1000_tx_map(adapter, skb); count = e1000_tx_map(adapter, skb);
e1000_tx_queue(adapter, count, tx_flags); e1000_tx_queue(adapter, count, tx_flags);
......
...@@ -622,9 +622,12 @@ e1000_proc_list_setup(struct e1000_adapter *adapter) ...@@ -622,9 +622,12 @@ e1000_proc_list_setup(struct e1000_adapter *adapter)
LIST_ADD_U("Rx_Long_Length_Errors", &adapter->stats.roc); LIST_ADD_U("Rx_Long_Length_Errors", &adapter->stats.roc);
LIST_ADD_U("Rx_Short_Length_Errors", &adapter->stats.ruc); LIST_ADD_U("Rx_Short_Length_Errors", &adapter->stats.ruc);
/* The 82542 does not have an alignment error count register */ /* The 82542 does not have some of these stats */
if(adapter->hw.mac_type >= e1000_82543) if(adapter->hw.mac_type >= e1000_82543) {
LIST_ADD_U("Rx_Align_Errors", &adapter->stats.algnerrc); LIST_ADD_U("Rx_Align_Errors", &adapter->stats.algnerrc);
LIST_ADD_U("Tx_TCP_Seg_Good", &adapter->stats.tsctc);
LIST_ADD_U("Tx_TCP_Seg_Failed", &adapter->stats.tsctfc);
}
LIST_ADD_U("Rx_Flow_Control_XON", &adapter->stats.xonrxc); LIST_ADD_U("Rx_Flow_Control_XON", &adapter->stats.xonrxc);
LIST_ADD_U("Rx_Flow_Control_XOFF", &adapter->stats.xoffrxc); LIST_ADD_U("Rx_Flow_Control_XOFF", &adapter->stats.xoffrxc);
......
...@@ -49,11 +49,72 @@ ...@@ -49,11 +49,72 @@
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <linux/skbuff.h> #include <linux/skbuff.h>
#include <net/sock.h> #include <net/sock.h>
#include <net/checksum.h>
#include <linux/if_ether.h> /* For the statistics structure. */ #include <linux/if_ether.h> /* For the statistics structure. */
#include <linux/if_arp.h> /* For ARPHRD_ETHER */ #include <linux/if_arp.h> /* For ARPHRD_ETHER */
#include <linux/ip.h>
#include <linux/tcp.h>
#define LOOPBACK_OVERHEAD (128 + MAX_HEADER + 16 + 16) #define LOOPBACK_OVERHEAD (128 + MAX_HEADER + 16 + 16)
/* KISS: just allocate small chunks and copy bits.
*
* So, in fact, this is documentation, explaining what we expect
* of largesending device modulo TCP checksum, which is ignored for loopback.
*/
static void emulate_large_send_offload(struct sk_buff *skb)
{
struct iphdr *iph = skb->nh.iph;
struct tcphdr *th = (struct tcphdr*)(skb->nh.raw + (iph->ihl * 4));
unsigned int doffset = (iph->ihl + th->doff) * 4;
unsigned int mtu = skb_shinfo(skb)->tso_size + doffset;
unsigned int offset = 0;
u32 seq = ntohl(th->seq);
u16 id = ntohs(iph->id);
while (offset + doffset < skb->len) {
unsigned int frag_size = min(mtu, skb->len - offset) - doffset;
struct sk_buff *nskb = alloc_skb(mtu + 32, GFP_ATOMIC);
if (!nskb)
break;
skb_reserve(nskb, 32);
nskb->mac.raw = nskb->data - 14;
nskb->nh.raw = nskb->data;
iph = nskb->nh.iph;
memcpy(nskb->data, skb->nh.raw, doffset);
if (skb_copy_bits(skb,
doffset + offset,
nskb->data + doffset,
frag_size))
BUG();
skb_put(nskb, doffset + frag_size);
nskb->ip_summed = CHECKSUM_UNNECESSARY;
nskb->dev = skb->dev;
nskb->priority = skb->priority;
nskb->protocol = skb->protocol;
nskb->dst = dst_clone(skb->dst);
memcpy(nskb->cb, skb->cb, sizeof(skb->cb));
nskb->pkt_type = skb->pkt_type;
th = (struct tcphdr*)(nskb->nh.raw + iph->ihl*4);
iph->tot_len = htons(frag_size + doffset);
iph->id = htons(id);
iph->check = 0;
iph->check = ip_fast_csum((unsigned char *) iph, iph->ihl);
th->seq = htonl(seq);
if (offset + doffset + frag_size < skb->len)
th->fin = th->psh = 0;
netif_rx(nskb);
offset += frag_size;
seq += frag_size;
id++;
}
dev_kfree_skb(skb);
}
/* /*
* The higher levels take care of making this non-reentrant (it's * The higher levels take care of making this non-reentrant (it's
* called with bh's disabled). * called with bh's disabled).
...@@ -86,6 +147,18 @@ static int loopback_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -86,6 +147,18 @@ static int loopback_xmit(struct sk_buff *skb, struct net_device *dev)
skb->ip_summed = CHECKSUM_UNNECESSARY; skb->ip_summed = CHECKSUM_UNNECESSARY;
#endif #endif
if (skb_shinfo(skb)->tso_size) {
struct iphdr *iph = skb->nh.iph;
if (skb->protocol != htons(ETH_P_IP))
BUG();
if (iph->protocol != IPPROTO_TCP)
BUG();
emulate_large_send_offload(skb);
return 0;
}
dev->last_rx = jiffies; dev->last_rx = jiffies;
stats->rx_bytes+=skb->len; stats->rx_bytes+=skb->len;
stats->tx_bytes+=skb->len; stats->tx_bytes+=skb->len;
...@@ -117,6 +190,12 @@ int __init loopback_init(struct net_device *dev) ...@@ -117,6 +190,12 @@ int __init loopback_init(struct net_device *dev)
dev->rebuild_header = eth_rebuild_header; dev->rebuild_header = eth_rebuild_header;
dev->flags = IFF_LOOPBACK; dev->flags = IFF_LOOPBACK;
dev->features = NETIF_F_SG|NETIF_F_FRAGLIST|NETIF_F_NO_CSUM|NETIF_F_HIGHDMA; dev->features = NETIF_F_SG|NETIF_F_FRAGLIST|NETIF_F_NO_CSUM|NETIF_F_HIGHDMA;
/* Current netfilter will die with oom linearizing large skbs,
* however this will be cured before 2.5.x is done.
*/
dev->features |= NETIF_F_TSO;
dev->priv = kmalloc(sizeof(struct net_device_stats), GFP_KERNEL); dev->priv = kmalloc(sizeof(struct net_device_stats), GFP_KERNEL);
if (dev->priv == NULL) if (dev->priv == NULL)
return -ENOMEM; return -ENOMEM;
......
This diff is collapsed.
...@@ -182,5 +182,47 @@ void hcd_buffer_unmap ( ...@@ -182,5 +182,47 @@ void hcd_buffer_unmap (
: PCI_DMA_TODEVICE); : PCI_DMA_TODEVICE);
} }
int hcd_buffer_map_sg (
struct usb_bus *bus,
struct scatterlist *sg,
int *n_hw_ents,
int nents,
int direction
) {
struct usb_hcd *hcd = bus->hcpriv;
// FIXME pci_map_sg() has no standard failure mode!
*n_hw_ents = pci_map_sg(hcd->pdev, sg, nents,
(direction == USB_DIR_IN)
? PCI_DMA_FROMDEVICE
: PCI_DMA_TODEVICE);
return 0;
}
void hcd_buffer_sync_sg (
struct usb_bus *bus,
struct scatterlist *sg,
int n_hw_ents,
int direction
) {
struct usb_hcd *hcd = bus->hcpriv;
// FIXME DMA-Mappings for struct scatterlist pci_dma_sync_sg(hcd->pdev, sg, n_hw_ents,
(direction == USB_DIR_IN)
? PCI_DMA_FROMDEVICE
: PCI_DMA_TODEVICE);
}
void hcd_buffer_unmap_sg (
struct usb_bus *bus,
struct scatterlist *sg,
int n_hw_ents,
int direction
) {
struct usb_hcd *hcd = bus->hcpriv;
pci_unmap_sg(hcd->pdev, sg, n_hw_ents,
(direction == USB_DIR_IN)
? PCI_DMA_FROMDEVICE
: PCI_DMA_TODEVICE);
}
...@@ -58,7 +58,6 @@ int usb_hcd_pci_probe (struct pci_dev *dev, const struct pci_device_id *id) ...@@ -58,7 +58,6 @@ int usb_hcd_pci_probe (struct pci_dev *dev, const struct pci_device_id *id)
struct hc_driver *driver; struct hc_driver *driver;
unsigned long resource, len; unsigned long resource, len;
void *base; void *base;
u8 latency, limit;
struct usb_hcd *hcd; struct usb_hcd *hcd;
int retval, region; int retval, region;
char buf [8], *bufp = buf; char buf [8], *bufp = buf;
...@@ -145,15 +144,6 @@ int usb_hcd_pci_probe (struct pci_dev *dev, const struct pci_device_id *id) ...@@ -145,15 +144,6 @@ int usb_hcd_pci_probe (struct pci_dev *dev, const struct pci_device_id *id)
info ("%s @ %s, %s", hcd->description, dev->slot_name, dev->name); info ("%s @ %s, %s", hcd->description, dev->slot_name, dev->name);
pci_read_config_byte (dev, PCI_LATENCY_TIMER, &latency);
if (latency) {
pci_read_config_byte (dev, PCI_MAX_LAT, &limit);
if (limit && limit < latency) {
dbg ("PCI latency reduced to max %d", limit);
pci_write_config_byte (dev, PCI_LATENCY_TIMER, limit);
}
}
#ifndef __sparc__ #ifndef __sparc__
sprintf (buf, "%d", dev->irq); sprintf (buf, "%d", dev->irq);
#else #else
......
...@@ -1270,6 +1270,9 @@ struct usb_operations usb_hcd_operations = { ...@@ -1270,6 +1270,9 @@ struct usb_operations usb_hcd_operations = {
.buffer_map = hcd_buffer_map, .buffer_map = hcd_buffer_map,
.buffer_dmasync = hcd_buffer_dmasync, .buffer_dmasync = hcd_buffer_dmasync,
.buffer_unmap = hcd_buffer_unmap, .buffer_unmap = hcd_buffer_unmap,
.buffer_map_sg = hcd_buffer_map_sg,
.buffer_dmasync_sg = hcd_buffer_sync_sg,
.buffer_unmap_sg = hcd_buffer_unmap_sg,
}; };
EXPORT_SYMBOL (usb_hcd_operations); EXPORT_SYMBOL (usb_hcd_operations);
......
...@@ -155,7 +155,15 @@ struct usb_operations { ...@@ -155,7 +155,15 @@ struct usb_operations {
dma_addr_t dma, dma_addr_t dma,
size_t size, int direction); size_t size, int direction);
// FIXME also: buffer_sg_map (), buffer_sg_unmap () int (*buffer_map_sg) (struct usb_bus *bus,
struct scatterlist *sg, int *n_hw_ents,
int nents, int direction);
void (*buffer_dmasync_sg) (struct usb_bus *bus,
struct scatterlist *sg,
int n_hw_ents, int direction);
void (*buffer_unmap_sg) (struct usb_bus *bus,
struct scatterlist *sg,
int n_hw_ents, int direction);
}; };
/* each driver provides one of these, and hardware init support */ /* each driver provides one of these, and hardware init support */
...@@ -246,6 +254,13 @@ void hcd_buffer_dmasync (struct usb_bus *bus, ...@@ -246,6 +254,13 @@ void hcd_buffer_dmasync (struct usb_bus *bus,
void hcd_buffer_unmap (struct usb_bus *bus, void hcd_buffer_unmap (struct usb_bus *bus,
dma_addr_t dma, dma_addr_t dma,
size_t size, int direction); size_t size, int direction);
int hcd_buffer_map_sg (struct usb_bus *bus, struct scatterlist *sg,
int *n_hw_ents, int nents, int direction);
void hcd_buffer_sync_sg (struct usb_bus *bus, struct scatterlist *sg,
int n_hw_ents, int direction);
void hcd_buffer_unmap_sg (struct usb_bus *bus, struct scatterlist *sg,
int n_hw_ents, int direction);
/* generic bus glue, needed for host controllers that don't use PCI */ /* generic bus glue, needed for host controllers that don't use PCI */
extern struct usb_operations usb_hcd_operations; extern struct usb_operations usb_hcd_operations;
......
...@@ -278,6 +278,7 @@ int usb_submit_urb(struct urb *urb, int mem_flags) ...@@ -278,6 +278,7 @@ int usb_submit_urb(struct urb *urb, int mem_flags)
/* enforce simple/standard policy */ /* enforce simple/standard policy */
allowed = USB_ASYNC_UNLINK; // affects later unlinks allowed = USB_ASYNC_UNLINK; // affects later unlinks
allowed |= URB_NO_DMA_MAP;
switch (temp) { switch (temp) {
case PIPE_BULK: case PIPE_BULK:
allowed |= URB_NO_INTERRUPT; allowed |= URB_NO_INTERRUPT;
......
...@@ -1532,6 +1532,116 @@ void usb_buffer_unmap (struct urb *urb) ...@@ -1532,6 +1532,116 @@ void usb_buffer_unmap (struct urb *urb)
: USB_DIR_OUT); : USB_DIR_OUT);
} }
/**
* usb_buffer_map_sg - create scatterlist DMA mapping(s) for an endpoint
* @dev: device to which the scatterlist will be mapped
* @pipe: endpoint defining the mapping direction
* @sg: the scatterlist to map
* @nents: the number of entries in the scatterlist
*
* Return value is either < 0 (indicating no buffers could be mapped), or
* the number of DMA mapping array entries in the scatterlist.
*
* The caller is responsible for placing the resulting DMA addresses from
* the scatterlist into URB transfer buffer pointers, and for setting the
* URB_NO_DMA_MAP transfer flag in each of those URBs.
*
* Top I/O rates come from queuing URBs, instead of waiting for each one
* to complete before starting the next I/O. This is particularly easy
* to do with scatterlists. Just allocate and submit one URB for each DMA
* mapping entry returned, stopping on the first error or when all succeed.
*
* This call would normally be used when translating scatterlist requests,
* rather than usb_buffer_map(), since on some hardware (with IOMMUs) it
* may be able to coalesce mappings for improved I/O efficiency.
*
* Reverse the effect of this call with usb_buffer_unmap_sg().
*/
int usb_buffer_map_sg (struct usb_device *dev, unsigned pipe,
struct scatterlist *sg, int nents)
{
struct usb_bus *bus;
struct usb_operations *op;
int n_hw_ents;
if (!dev
|| usb_pipecontrol (pipe)
|| !(bus = dev->bus)
|| !(op = bus->op)
|| !op->buffer_map_sg)
return -1;
if (op->buffer_map_sg (bus,
sg,
&n_hw_ents,
nents,
usb_pipein (pipe)
? USB_DIR_IN
: USB_DIR_OUT))
return -1;
return n_hw_ents;
}
/**
* usb_buffer_dmasync_sg - synchronize DMA and CPU view of scatterlist buffer(s)
* @dev: device to which the scatterlist will be mapped
* @pipe: endpoint defining the mapping direction
* @sg: the scatterlist to synchronize
* @n_hw_ents: the positive return value from usb_buffer_map_sg
*
* Use this when you are re-using a scatterlist's data buffers for
* another USB request.
*/
void usb_buffer_dmasync_sg (struct usb_device *dev, unsigned pipe,
struct scatterlist *sg, int n_hw_ents)
{
struct usb_bus *bus;
struct usb_operations *op;
if (!dev
|| !(bus = dev->bus)
|| !(op = bus->op)
|| !op->buffer_dmasync_sg)
return;
op->buffer_dmasync_sg (bus,
sg,
n_hw_ents,
usb_pipein (pipe)
? USB_DIR_IN
: USB_DIR_OUT);
}
/**
* usb_buffer_unmap_sg - free DMA mapping(s) for a scatterlist
* @dev: device to which the scatterlist will be mapped
* @pipe: endpoint defining the mapping direction
* @sg: the scatterlist to unmap
* @n_hw_ents: the positive return value from usb_buffer_map_sg
*
* Reverses the effect of usb_buffer_map_sg().
*/
void usb_buffer_unmap_sg (struct usb_device *dev, unsigned pipe,
struct scatterlist *sg, int n_hw_ents)
{
struct usb_bus *bus;
struct usb_operations *op;
if (!dev
|| !(bus = dev->bus)
|| !(op = bus->op)
|| !op->buffer_unmap_sg)
return;
op->buffer_unmap_sg (bus,
sg,
n_hw_ents,
usb_pipein (pipe)
? USB_DIR_IN
: USB_DIR_OUT);
}
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
struct list_head *usb_driver_get_list(void) struct list_head *usb_driver_get_list(void)
{ {
...@@ -1612,4 +1722,8 @@ EXPORT_SYMBOL (usb_buffer_map); ...@@ -1612,4 +1722,8 @@ EXPORT_SYMBOL (usb_buffer_map);
EXPORT_SYMBOL (usb_buffer_dmasync); EXPORT_SYMBOL (usb_buffer_dmasync);
EXPORT_SYMBOL (usb_buffer_unmap); EXPORT_SYMBOL (usb_buffer_unmap);
EXPORT_SYMBOL (usb_buffer_map_sg);
EXPORT_SYMBOL (usb_buffer_dmasync_sg);
EXPORT_SYMBOL (usb_buffer_unmap_sg);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
This diff is collapsed.
...@@ -79,6 +79,12 @@ static inline void intr_resub (struct ohci_hcd *hc, struct urb *urb) ...@@ -79,6 +79,12 @@ static inline void intr_resub (struct ohci_hcd *hc, struct urb *urb)
urb->status = 0; urb->status = 0;
spin_unlock_irqrestore (&urb->lock, flags); spin_unlock_irqrestore (&urb->lock, flags);
if (!(urb->transfer_flags & URB_NO_DMA_MAP)
&& usb_pipein (urb->pipe))
pci_dma_sync_single (hc->hcd.pdev, urb->transfer_dma,
urb->transfer_buffer_length,
PCI_DMA_FROMDEVICE);
#ifdef OHCI_VERBOSE_DEBUG #ifdef OHCI_VERBOSE_DEBUG
urb_print (urb, "INTR", usb_pipeout (urb->pipe)); urb_print (urb, "INTR", usb_pipeout (urb->pipe));
#endif #endif
...@@ -93,6 +99,8 @@ static inline void intr_resub (struct ohci_hcd *hc, struct urb *urb) ...@@ -93,6 +99,8 @@ static inline void intr_resub (struct ohci_hcd *hc, struct urb *urb)
urb->status = -EINPROGRESS; urb->status = -EINPROGRESS;
spin_unlock (&urb->lock); spin_unlock (&urb->lock);
/* syncing with PCI_DMA_TODEVICE is evidently trouble... */
spin_lock (&hc->lock); spin_lock (&hc->lock);
td_submit_urb (hc, urb); td_submit_urb (hc, urb);
spin_unlock_irqrestore (&hc->lock, flags); spin_unlock_irqrestore (&hc->lock, flags);
......
...@@ -251,7 +251,7 @@ static videosize_t ibmcam_size_to_videosize(int size) ...@@ -251,7 +251,7 @@ static videosize_t ibmcam_size_to_videosize(int size)
*/ */
static ParseState_t ibmcam_find_header(struct uvd *uvd) /* FIXME: Add frame here */ static ParseState_t ibmcam_find_header(struct uvd *uvd) /* FIXME: Add frame here */
{ {
usbvideo_frame_t *frame; struct usbvideo_frame *frame;
ibmcam_t *icam; ibmcam_t *icam;
if ((uvd->curframe) < 0 || (uvd->curframe >= USBVIDEO_NUMFRAMES)) { if ((uvd->curframe) < 0 || (uvd->curframe >= USBVIDEO_NUMFRAMES)) {
...@@ -399,7 +399,7 @@ case IBMCAM_MODEL_4: ...@@ -399,7 +399,7 @@ case IBMCAM_MODEL_4:
*/ */
static ParseState_t ibmcam_parse_lines( static ParseState_t ibmcam_parse_lines(
struct uvd *uvd, struct uvd *uvd,
usbvideo_frame_t *frame, struct usbvideo_frame *frame,
long *pcopylen) long *pcopylen)
{ {
unsigned char *f; unsigned char *f;
...@@ -664,7 +664,7 @@ static ParseState_t ibmcam_parse_lines( ...@@ -664,7 +664,7 @@ static ParseState_t ibmcam_parse_lines(
*/ */
static ParseState_t ibmcam_model2_320x240_parse_lines( static ParseState_t ibmcam_model2_320x240_parse_lines(
struct uvd *uvd, struct uvd *uvd,
usbvideo_frame_t *frame, struct usbvideo_frame *frame,
long *pcopylen) long *pcopylen)
{ {
unsigned char *f, *la, *lb; unsigned char *f, *la, *lb;
...@@ -818,7 +818,7 @@ static ParseState_t ibmcam_model2_320x240_parse_lines( ...@@ -818,7 +818,7 @@ static ParseState_t ibmcam_model2_320x240_parse_lines(
static ParseState_t ibmcam_model3_parse_lines( static ParseState_t ibmcam_model3_parse_lines(
struct uvd *uvd, struct uvd *uvd,
usbvideo_frame_t *frame, struct usbvideo_frame *frame,
long *pcopylen) long *pcopylen)
{ {
unsigned char *data; unsigned char *data;
...@@ -963,7 +963,7 @@ static ParseState_t ibmcam_model3_parse_lines( ...@@ -963,7 +963,7 @@ static ParseState_t ibmcam_model3_parse_lines(
*/ */
static ParseState_t ibmcam_model4_128x96_parse_lines( static ParseState_t ibmcam_model4_128x96_parse_lines(
struct uvd *uvd, struct uvd *uvd,
usbvideo_frame_t *frame, struct usbvideo_frame *frame,
long *pcopylen) long *pcopylen)
{ {
const unsigned char *data_rv, *data_gv, *data_bv; const unsigned char *data_rv, *data_gv, *data_bv;
...@@ -1049,7 +1049,7 @@ static ParseState_t ibmcam_model4_128x96_parse_lines( ...@@ -1049,7 +1049,7 @@ static ParseState_t ibmcam_model4_128x96_parse_lines(
* History: * History:
* 1/21/00 Created. * 1/21/00 Created.
*/ */
void ibmcam_ProcessIsocData(struct uvd *uvd, usbvideo_frame_t *frame) void ibmcam_ProcessIsocData(struct uvd *uvd, struct usbvideo_frame *frame)
{ {
ParseState_t newstate; ParseState_t newstate;
long copylen = 0; long copylen = 0;
...@@ -3921,7 +3921,7 @@ static struct usb_device_id id_table[] = { ...@@ -3921,7 +3921,7 @@ static struct usb_device_id id_table[] = {
*/ */
static int __init ibmcam_init(void) static int __init ibmcam_init(void)
{ {
usbvideo_cb_t cbTbl; struct usbvideo_cb cbTbl;
memset(&cbTbl, 0, sizeof(cbTbl)); memset(&cbTbl, 0, sizeof(cbTbl));
cbTbl.probe = ibmcam_probe; cbTbl.probe = ibmcam_probe;
cbTbl.setupOnOpen = ibmcam_setup_on_open; cbTbl.setupOnOpen = ibmcam_setup_on_open;
......
...@@ -488,7 +488,7 @@ static void konicawc_stop_data(struct uvd *uvd) ...@@ -488,7 +488,7 @@ static void konicawc_stop_data(struct uvd *uvd)
} }
static void konicawc_process_isoc(struct uvd *uvd, usbvideo_frame_t *frame) static void konicawc_process_isoc(struct uvd *uvd, struct usbvideo_frame *frame)
{ {
struct konicawc *cam = (struct konicawc *)uvd->user_data; struct konicawc *cam = (struct konicawc *)uvd->user_data;
int maxline = cam->maxline; int maxline = cam->maxline;
...@@ -881,7 +881,7 @@ static struct usb_device_id id_table[] = { ...@@ -881,7 +881,7 @@ static struct usb_device_id id_table[] = {
static int __init konicawc_init(void) static int __init konicawc_init(void)
{ {
usbvideo_cb_t cbTbl; struct usbvideo_cb cbTbl;
info(DRIVER_DESC " " DRIVER_VERSION); info(DRIVER_DESC " " DRIVER_VERSION);
memset(&cbTbl, 0, sizeof(cbTbl)); memset(&cbTbl, 0, sizeof(cbTbl));
cbTbl.probe = konicawc_probe; cbTbl.probe = konicawc_probe;
......
...@@ -103,7 +103,7 @@ MODULE_PARM_DESC(hue_correction, "YUV colorspace regulation: 0-255 (default=128) ...@@ -103,7 +103,7 @@ MODULE_PARM_DESC(hue_correction, "YUV colorspace regulation: 0-255 (default=128)
* 02-Nov-2000 First (mostly dummy) version. * 02-Nov-2000 First (mostly dummy) version.
* 06-Nov-2000 Rewrote to dump all data into frame. * 06-Nov-2000 Rewrote to dump all data into frame.
*/ */
void ultracam_ProcessIsocData(struct uvd *uvd, usbvideo_frame_t *frame) void ultracam_ProcessIsocData(struct uvd *uvd, struct usbvideo_frame *frame)
{ {
int n; int n;
...@@ -672,7 +672,7 @@ static struct usb_device_id id_table[] = { ...@@ -672,7 +672,7 @@ static struct usb_device_id id_table[] = {
*/ */
static int __init ultracam_init(void) static int __init ultracam_init(void)
{ {
usbvideo_cb_t cbTbl; struct usbvideo_cb cbTbl;
memset(&cbTbl, 0, sizeof(cbTbl)); memset(&cbTbl, 0, sizeof(cbTbl));
cbTbl.probe = ultracam_probe; cbTbl.probe = ultracam_probe;
cbTbl.setupOnOpen = ultracam_setup_on_open; cbTbl.setupOnOpen = ultracam_setup_on_open;
......
...@@ -70,7 +70,7 @@ static void usbvideo_StopDataPump(struct uvd *uvd); ...@@ -70,7 +70,7 @@ static void usbvideo_StopDataPump(struct uvd *uvd);
static int usbvideo_GetFrame(struct uvd *uvd, int frameNum); static int usbvideo_GetFrame(struct uvd *uvd, int frameNum);
static int usbvideo_NewFrame(struct uvd *uvd, int framenum); static int usbvideo_NewFrame(struct uvd *uvd, int framenum);
static void usbvideo_SoftwareContrastAdjustment(struct uvd *uvd, static void usbvideo_SoftwareContrastAdjustment(struct uvd *uvd,
usbvideo_frame_t *frame); struct usbvideo_frame *frame);
/*******************************/ /*******************************/
/* Memory management functions */ /* Memory management functions */
...@@ -127,13 +127,13 @@ static void usbvideo_rvfree(void *mem, unsigned long size) ...@@ -127,13 +127,13 @@ static void usbvideo_rvfree(void *mem, unsigned long size)
vfree(mem); vfree(mem);
} }
static void RingQueue_Initialize(RingQueue_t *rq) static void RingQueue_Initialize(struct RingQueue *rq)
{ {
assert(rq != NULL); assert(rq != NULL);
init_waitqueue_head(&rq->wqh); init_waitqueue_head(&rq->wqh);
} }
static void RingQueue_Allocate(RingQueue_t *rq, int rqLen) static void RingQueue_Allocate(struct RingQueue *rq, int rqLen)
{ {
/* Make sure the requested size is a power of 2 and /* Make sure the requested size is a power of 2 and
round up if necessary. This allows index wrapping round up if necessary. This allows index wrapping
...@@ -154,14 +154,14 @@ static void RingQueue_Allocate(RingQueue_t *rq, int rqLen) ...@@ -154,14 +154,14 @@ static void RingQueue_Allocate(RingQueue_t *rq, int rqLen)
assert(rq->queue != NULL); assert(rq->queue != NULL);
} }
static int RingQueue_IsAllocated(const RingQueue_t *rq) static int RingQueue_IsAllocated(const struct RingQueue *rq)
{ {
if (rq == NULL) if (rq == NULL)
return 0; return 0;
return (rq->queue != NULL) && (rq->length > 0); return (rq->queue != NULL) && (rq->length > 0);
} }
static void RingQueue_Free(RingQueue_t *rq) static void RingQueue_Free(struct RingQueue *rq)
{ {
assert(rq != NULL); assert(rq != NULL);
if (RingQueue_IsAllocated(rq)) { if (RingQueue_IsAllocated(rq)) {
...@@ -171,7 +171,7 @@ static void RingQueue_Free(RingQueue_t *rq) ...@@ -171,7 +171,7 @@ static void RingQueue_Free(RingQueue_t *rq)
} }
} }
int RingQueue_Dequeue(RingQueue_t *rq, unsigned char *dst, int len) int RingQueue_Dequeue(struct RingQueue *rq, unsigned char *dst, int len)
{ {
int rql, toread; int rql, toread;
...@@ -205,7 +205,7 @@ int RingQueue_Dequeue(RingQueue_t *rq, unsigned char *dst, int len) ...@@ -205,7 +205,7 @@ int RingQueue_Dequeue(RingQueue_t *rq, unsigned char *dst, int len)
EXPORT_SYMBOL(RingQueue_Dequeue); EXPORT_SYMBOL(RingQueue_Dequeue);
int RingQueue_Enqueue(RingQueue_t *rq, const unsigned char *cdata, int n) int RingQueue_Enqueue(struct RingQueue *rq, const unsigned char *cdata, int n)
{ {
int enqueued = 0; int enqueued = 0;
...@@ -237,13 +237,13 @@ int RingQueue_Enqueue(RingQueue_t *rq, const unsigned char *cdata, int n) ...@@ -237,13 +237,13 @@ int RingQueue_Enqueue(RingQueue_t *rq, const unsigned char *cdata, int n)
EXPORT_SYMBOL(RingQueue_Enqueue); EXPORT_SYMBOL(RingQueue_Enqueue);
static void RingQueue_InterruptibleSleepOn(RingQueue_t *rq) static void RingQueue_InterruptibleSleepOn(struct RingQueue *rq)
{ {
assert(rq != NULL); assert(rq != NULL);
interruptible_sleep_on(&rq->wqh); interruptible_sleep_on(&rq->wqh);
} }
void RingQueue_WakeUpInterruptible(RingQueue_t *rq) void RingQueue_WakeUpInterruptible(struct RingQueue *rq)
{ {
assert(rq != NULL); assert(rq != NULL);
if (waitqueue_active(&rq->wqh)) if (waitqueue_active(&rq->wqh))
...@@ -252,7 +252,7 @@ void RingQueue_WakeUpInterruptible(RingQueue_t *rq) ...@@ -252,7 +252,7 @@ void RingQueue_WakeUpInterruptible(RingQueue_t *rq)
EXPORT_SYMBOL(RingQueue_WakeUpInterruptible); EXPORT_SYMBOL(RingQueue_WakeUpInterruptible);
void RingQueue_Flush(RingQueue_t *rq) void RingQueue_Flush(struct RingQueue *rq)
{ {
assert(rq != NULL); assert(rq != NULL);
rq->ri = 0; rq->ri = 0;
...@@ -290,7 +290,7 @@ static void usbvideo_VideosizeToString(char *buf, int bufLen, videosize_t vs) ...@@ -290,7 +290,7 @@ static void usbvideo_VideosizeToString(char *buf, int bufLen, videosize_t vs)
* History: * History:
* 01-Feb-2000 Created. * 01-Feb-2000 Created.
*/ */
static void usbvideo_OverlayChar(struct uvd *uvd, usbvideo_frame_t *frame, static void usbvideo_OverlayChar(struct uvd *uvd, struct usbvideo_frame *frame,
int x, int y, int ch) int x, int y, int ch)
{ {
static const unsigned short digits[16] = { static const unsigned short digits[16] = {
...@@ -345,7 +345,7 @@ static void usbvideo_OverlayChar(struct uvd *uvd, usbvideo_frame_t *frame, ...@@ -345,7 +345,7 @@ static void usbvideo_OverlayChar(struct uvd *uvd, usbvideo_frame_t *frame,
* History: * History:
* 01-Feb-2000 Created. * 01-Feb-2000 Created.
*/ */
static void usbvideo_OverlayString(struct uvd *uvd, usbvideo_frame_t *frame, static void usbvideo_OverlayString(struct uvd *uvd, struct usbvideo_frame *frame,
int x, int y, const char *str) int x, int y, const char *str)
{ {
while (*str) { while (*str) {
...@@ -363,7 +363,7 @@ static void usbvideo_OverlayString(struct uvd *uvd, usbvideo_frame_t *frame, ...@@ -363,7 +363,7 @@ static void usbvideo_OverlayString(struct uvd *uvd, usbvideo_frame_t *frame,
* History: * History:
* 01-Feb-2000 Created. * 01-Feb-2000 Created.
*/ */
static void usbvideo_OverlayStats(struct uvd *uvd, usbvideo_frame_t *frame) static void usbvideo_OverlayStats(struct uvd *uvd, struct usbvideo_frame *frame)
{ {
const int y_diff = 8; const int y_diff = 8;
char tmp[16]; char tmp[16];
...@@ -542,7 +542,7 @@ static void usbvideo_ReportStatistics(const struct uvd *uvd) ...@@ -542,7 +542,7 @@ static void usbvideo_ReportStatistics(const struct uvd *uvd)
* purposes. * purposes.
*/ */
void usbvideo_DrawLine( void usbvideo_DrawLine(
usbvideo_frame_t *frame, struct usbvideo_frame *frame,
int x1, int y1, int x1, int y1,
int x2, int y2, int x2, int y2,
unsigned char cr, unsigned char cg, unsigned char cb) unsigned char cr, unsigned char cg, unsigned char cb)
...@@ -616,7 +616,7 @@ EXPORT_SYMBOL(usbvideo_DrawLine); ...@@ -616,7 +616,7 @@ EXPORT_SYMBOL(usbvideo_DrawLine);
*/ */
void usbvideo_TestPattern(struct uvd *uvd, int fullframe, int pmode) void usbvideo_TestPattern(struct uvd *uvd, int fullframe, int pmode)
{ {
usbvideo_frame_t *frame; struct usbvideo_frame *frame;
int num_cell = 0; int num_cell = 0;
int scan_length = 0; int scan_length = 0;
static int num_pass = 0; static int num_pass = 0;
...@@ -769,7 +769,7 @@ int usbvideo_register( ...@@ -769,7 +769,7 @@ int usbvideo_register(
const int num_cams, const int num_cams,
const int num_extra, const int num_extra,
const char *driverName, const char *driverName,
const usbvideo_cb_t *cbTbl, const struct usbvideo_cb *cbTbl,
struct module *md, struct module *md,
const struct usb_device_id *id_table) const struct usb_device_id *id_table)
{ {
...@@ -1640,7 +1640,7 @@ static int usbvideo_v4l_read(struct file *file, char *buf, ...@@ -1640,7 +1640,7 @@ static int usbvideo_v4l_read(struct file *file, char *buf,
struct uvd *uvd = file->private_data; struct uvd *uvd = file->private_data;
int noblock = file->f_flags & O_NONBLOCK; int noblock = file->f_flags & O_NONBLOCK;
int frmx = -1, i; int frmx = -1, i;
usbvideo_frame_t *frame; struct usbvideo_frame *frame;
if (!CAMERA_IS_OPERATIONAL(uvd) || (buf == NULL)) if (!CAMERA_IS_OPERATIONAL(uvd) || (buf == NULL))
return -EFAULT; return -EFAULT;
...@@ -1990,7 +1990,7 @@ static void usbvideo_StopDataPump(struct uvd *uvd) ...@@ -1990,7 +1990,7 @@ static void usbvideo_StopDataPump(struct uvd *uvd)
*/ */
static int usbvideo_NewFrame(struct uvd *uvd, int framenum) static int usbvideo_NewFrame(struct uvd *uvd, int framenum)
{ {
usbvideo_frame_t *frame; struct usbvideo_frame *frame;
int n; int n;
if (uvd->debug > 1) if (uvd->debug > 1)
...@@ -2064,7 +2064,7 @@ static int usbvideo_NewFrame(struct uvd *uvd, int framenum) ...@@ -2064,7 +2064,7 @@ static int usbvideo_NewFrame(struct uvd *uvd, int framenum)
* FLAGS_NO_DECODING set. Therefore, any regular build of any driver * FLAGS_NO_DECODING set. Therefore, any regular build of any driver
* based on usbvideo can use this feature at any time. * based on usbvideo can use this feature at any time.
*/ */
static void usbvideo_CollectRawData(struct uvd *uvd, usbvideo_frame_t *frame) static void usbvideo_CollectRawData(struct uvd *uvd, struct usbvideo_frame *frame)
{ {
int n; int n;
...@@ -2096,7 +2096,7 @@ static void usbvideo_CollectRawData(struct uvd *uvd, usbvideo_frame_t *frame) ...@@ -2096,7 +2096,7 @@ static void usbvideo_CollectRawData(struct uvd *uvd, usbvideo_frame_t *frame)
static int usbvideo_GetFrame(struct uvd *uvd, int frameNum) static int usbvideo_GetFrame(struct uvd *uvd, int frameNum)
{ {
usbvideo_frame_t *frame = &uvd->frame[frameNum]; struct usbvideo_frame *frame = &uvd->frame[frameNum];
if (uvd->debug >= 2) if (uvd->debug >= 2)
info("%s($%p,%d.)", __FUNCTION__, uvd, frameNum); info("%s($%p,%d.)", __FUNCTION__, uvd, frameNum);
...@@ -2226,7 +2226,7 @@ static int usbvideo_GetFrame(struct uvd *uvd, int frameNum) ...@@ -2226,7 +2226,7 @@ static int usbvideo_GetFrame(struct uvd *uvd, int frameNum)
* line above then we just copy next line. Similarly, if we need to * line above then we just copy next line. Similarly, if we need to
* create a last line then preceding line is used. * create a last line then preceding line is used.
*/ */
void usbvideo_DeinterlaceFrame(struct uvd *uvd, usbvideo_frame_t *frame) void usbvideo_DeinterlaceFrame(struct uvd *uvd, struct usbvideo_frame *frame)
{ {
if ((uvd == NULL) || (frame == NULL)) if ((uvd == NULL) || (frame == NULL))
return; return;
...@@ -2297,7 +2297,7 @@ EXPORT_SYMBOL(usbvideo_DeinterlaceFrame); ...@@ -2297,7 +2297,7 @@ EXPORT_SYMBOL(usbvideo_DeinterlaceFrame);
* 09-Feb-2001 Created. * 09-Feb-2001 Created.
*/ */
static void usbvideo_SoftwareContrastAdjustment(struct uvd *uvd, static void usbvideo_SoftwareContrastAdjustment(struct uvd *uvd,
usbvideo_frame_t *frame) struct usbvideo_frame *frame)
{ {
int i, j, v4l_linesize; int i, j, v4l_linesize;
signed long adj; signed long adj;
......
...@@ -118,13 +118,13 @@ typedef unsigned long videosize_t; ...@@ -118,13 +118,13 @@ typedef unsigned long videosize_t;
#define RING_QUEUE_DEQUEUE_BYTES(rq,n) RING_QUEUE_ADVANCE_INDEX(rq,ri,n) #define RING_QUEUE_DEQUEUE_BYTES(rq,n) RING_QUEUE_ADVANCE_INDEX(rq,ri,n)
#define RING_QUEUE_PEEK(rq,ofs) ((rq)->queue[((ofs) + (rq)->ri) & ((rq)->length-1)]) #define RING_QUEUE_PEEK(rq,ofs) ((rq)->queue[((ofs) + (rq)->ri) & ((rq)->length-1)])
typedef struct { struct RingQueue {
unsigned char *queue; /* Data from the Isoc data pump */ unsigned char *queue; /* Data from the Isoc data pump */
int length; /* How many bytes allocated for the queue */ int length; /* How many bytes allocated for the queue */
int wi; /* That's where we write */ int wi; /* That's where we write */
int ri; /* Read from here until you hit write index */ int ri; /* Read from here until you hit write index */
wait_queue_head_t wqh; /* Processes waiting */ wait_queue_head_t wqh; /* Processes waiting */
} RingQueue_t; };
typedef enum { typedef enum {
ScanState_Scanning, /* Scanning for header */ ScanState_Scanning, /* Scanning for header */
...@@ -158,18 +158,16 @@ typedef enum { ...@@ -158,18 +158,16 @@ typedef enum {
Deinterlace_FillEvenLines Deinterlace_FillEvenLines
} Deinterlace_t; } Deinterlace_t;
struct usb_device;
#define USBVIDEO_NUMFRAMES 2 /* How many frames we work with */ #define USBVIDEO_NUMFRAMES 2 /* How many frames we work with */
#define USBVIDEO_NUMSBUF 2 /* How many URBs linked in a ring */ #define USBVIDEO_NUMSBUF 2 /* How many URBs linked in a ring */
/* This structure represents one Isoc request - URB and buffer */ /* This structure represents one Isoc request - URB and buffer */
typedef struct { struct usbvideo_sbuf {
char *data; char *data;
struct urb *urb; struct urb *urb;
} usbvideo_sbuf_t; };
typedef struct { struct usbvideo_frame {
char *data; /* Frame buffer */ char *data; /* Frame buffer */
unsigned long header; /* Significant bits from the header */ unsigned long header; /* Significant bits from the header */
...@@ -188,10 +186,10 @@ typedef struct { ...@@ -188,10 +186,10 @@ typedef struct {
long seqRead_Index; /* Amount of data that has been already read */ long seqRead_Index; /* Amount of data that has been already read */
void *user; /* Additional data that user may need */ void *user; /* Additional data that user may need */
} usbvideo_frame_t; };
/* Statistics that can be overlaid on screen */ /* Statistics that can be overlaid on screen */
typedef struct { struct usbvideo_statistics {
unsigned long frame_num; /* Sequential number of the frame */ unsigned long frame_num; /* Sequential number of the frame */
unsigned long urb_count; /* How many URBs we received so far */ unsigned long urb_count; /* How many URBs we received so far */
unsigned long urb_length; /* Length of last URB */ unsigned long urb_length; /* Length of last URB */
...@@ -199,7 +197,7 @@ typedef struct { ...@@ -199,7 +197,7 @@ typedef struct {
unsigned long header_count; /* How many frame headers we found */ unsigned long header_count; /* How many frame headers we found */
unsigned long iso_skip_count; /* How many empty ISO packets received */ unsigned long iso_skip_count; /* How many empty ISO packets received */
unsigned long iso_err_count; /* How many bad ISO packets received */ unsigned long iso_err_count; /* How many bad ISO packets received */
} usbvideo_statistics_t; };
struct s_usbvideo_t; struct s_usbvideo_t;
...@@ -236,16 +234,16 @@ struct uvd { ...@@ -236,16 +234,16 @@ struct uvd {
int curframe; int curframe;
int iso_packet_len; /* Videomode-dependent, saves bus bandwidth */ int iso_packet_len; /* Videomode-dependent, saves bus bandwidth */
RingQueue_t dp; /* Isoc data pump */ struct RingQueue dp; /* Isoc data pump */
usbvideo_frame_t frame[USBVIDEO_NUMFRAMES]; struct usbvideo_frame frame[USBVIDEO_NUMFRAMES];
usbvideo_sbuf_t sbuf[USBVIDEO_NUMSBUF]; struct usbvideo_sbuf sbuf[USBVIDEO_NUMSBUF];
volatile int remove_pending; /* If set then about to exit */ volatile int remove_pending; /* If set then about to exit */
struct video_picture vpic, vpic_old; /* Picture settings */ struct video_picture vpic, vpic_old; /* Picture settings */
struct video_capability vcap; /* Video capabilities */ struct video_capability vcap; /* Video capabilities */
struct video_channel vchan; /* May be used for tuner support */ struct video_channel vchan; /* May be used for tuner support */
usbvideo_statistics_t stats; struct usbvideo_statistics stats;
struct proc_dir_entry *procfs_vEntry; /* /proc/video/MYDRIVER/video2 */ struct proc_dir_entry *procfs_vEntry; /* /proc/video/MYDRIVER/video2 */
char videoName[32]; /* Holds name like "video7" */ char videoName[32]; /* Holds name like "video7" */
}; };
...@@ -255,32 +253,32 @@ struct uvd { ...@@ -255,32 +253,32 @@ struct uvd {
* services are registered. All of these default to NULL, except those * services are registered. All of these default to NULL, except those
* that default to usbvideo-provided methods. * that default to usbvideo-provided methods.
*/ */
typedef struct { struct usbvideo_cb {
void *(*probe)(struct usb_device *, unsigned int,const struct usb_device_id *); void *(*probe)(struct usb_device *, unsigned int,const struct usb_device_id *);
void (*userFree)(struct uvd *); void (*userFree)(struct uvd *);
void (*disconnect)(struct usb_device *, void *); void (*disconnect)(struct usb_device *, void *);
int (*setupOnOpen)(struct uvd *); int (*setupOnOpen)(struct uvd *);
void (*videoStart)(struct uvd *); void (*videoStart)(struct uvd *);
void (*videoStop)(struct uvd *); void (*videoStop)(struct uvd *);
void (*processData)(struct uvd *, usbvideo_frame_t *); void (*processData)(struct uvd *, struct usbvideo_frame *);
void (*postProcess)(struct uvd *, usbvideo_frame_t *); void (*postProcess)(struct uvd *, struct usbvideo_frame *);
void (*adjustPicture)(struct uvd *); void (*adjustPicture)(struct uvd *);
int (*getFPS)(struct uvd *); int (*getFPS)(struct uvd *);
int (*overlayHook)(struct uvd *, usbvideo_frame_t *); int (*overlayHook)(struct uvd *, struct usbvideo_frame *);
int (*getFrame)(struct uvd *, int); int (*getFrame)(struct uvd *, int);
int (*procfs_read)(char *page,char **start,off_t off,int count,int *eof,void *data); int (*procfs_read)(char *page,char **start,off_t off,int count,int *eof,void *data);
int (*procfs_write)(struct file *file,const char *buffer,unsigned long count,void *data); int (*procfs_write)(struct file *file,const char *buffer,unsigned long count,void *data);
int (*startDataPump)(struct uvd *uvd); int (*startDataPump)(struct uvd *uvd);
void (*stopDataPump)(struct uvd *uvd); void (*stopDataPump)(struct uvd *uvd);
int (*setVideoMode)(struct uvd *uvd, struct video_window *vw); int (*setVideoMode)(struct uvd *uvd, struct video_window *vw);
} usbvideo_cb_t; };
struct s_usbvideo_t { struct s_usbvideo_t {
int num_cameras; /* As allocated */ int num_cameras; /* As allocated */
struct usb_driver usbdrv; /* Interface to the USB stack */ struct usb_driver usbdrv; /* Interface to the USB stack */
char drvName[80]; /* Driver name */ char drvName[80]; /* Driver name */
struct semaphore lock; /* Mutex protecting camera structures */ struct semaphore lock; /* Mutex protecting camera structures */
usbvideo_cb_t cb; /* Table of callbacks (virtual methods) */ struct usbvideo_cb cb; /* Table of callbacks (virtual methods) */
struct video_device vdt; /* Video device template */ struct video_device vdt; /* Video device template */
struct uvd *cam; /* Array of camera structures */ struct uvd *cam; /* Array of camera structures */
int uses_procfs; /* Non-zero if we create /proc entries */ int uses_procfs; /* Non-zero if we create /proc entries */
...@@ -306,23 +304,23 @@ typedef struct s_usbvideo_t usbvideo_t; ...@@ -306,23 +304,23 @@ typedef struct s_usbvideo_t usbvideo_t;
#define VALID_CALLBACK(uvd,cbName) ((((uvd) != NULL) && \ #define VALID_CALLBACK(uvd,cbName) ((((uvd) != NULL) && \
((uvd)->handle != NULL)) ? GET_CALLBACK(uvd,cbName) : NULL) ((uvd)->handle != NULL)) ? GET_CALLBACK(uvd,cbName) : NULL)
int RingQueue_Dequeue(RingQueue_t *rq, unsigned char *dst, int len); int RingQueue_Dequeue(struct RingQueue *rq, unsigned char *dst, int len);
int RingQueue_Enqueue(RingQueue_t *rq, const unsigned char *cdata, int n); int RingQueue_Enqueue(struct RingQueue *rq, const unsigned char *cdata, int n);
void RingQueue_WakeUpInterruptible(RingQueue_t *rq); void RingQueue_WakeUpInterruptible(struct RingQueue *rq);
void RingQueue_Flush(RingQueue_t *rq); void RingQueue_Flush(struct RingQueue *rq);
static inline int RingQueue_GetLength(const RingQueue_t *rq) static inline int RingQueue_GetLength(const struct RingQueue *rq)
{ {
return (rq->wi - rq->ri + rq->length) & (rq->length-1); return (rq->wi - rq->ri + rq->length) & (rq->length-1);
} }
static inline int RingQueue_GetFreeSpace(const RingQueue_t *rq) static inline int RingQueue_GetFreeSpace(const struct RingQueue *rq)
{ {
return rq->length - RingQueue_GetLength(rq); return rq->length - RingQueue_GetLength(rq);
} }
void usbvideo_DrawLine( void usbvideo_DrawLine(
usbvideo_frame_t *frame, struct usbvideo_frame *frame,
int x1, int y1, int x1, int y1,
int x2, int y2, int x2, int y2,
unsigned char cr, unsigned char cg, unsigned char cb); unsigned char cr, unsigned char cg, unsigned char cb);
...@@ -338,7 +336,7 @@ int usbvideo_register( ...@@ -338,7 +336,7 @@ int usbvideo_register(
const int num_cams, const int num_cams,
const int num_extra, const int num_extra,
const char *driverName, const char *driverName,
const usbvideo_cb_t *cbTable, const struct usbvideo_cb *cbTable,
struct module *md, struct module *md,
const struct usb_device_id *id_table); const struct usb_device_id *id_table);
struct uvd *usbvideo_AllocateDevice(usbvideo_t *cams); struct uvd *usbvideo_AllocateDevice(usbvideo_t *cams);
...@@ -347,7 +345,7 @@ void usbvideo_Deregister(usbvideo_t **uvt); ...@@ -347,7 +345,7 @@ void usbvideo_Deregister(usbvideo_t **uvt);
int usbvideo_v4l_initialize(struct video_device *dev); int usbvideo_v4l_initialize(struct video_device *dev);
void usbvideo_DeinterlaceFrame(struct uvd *uvd, usbvideo_frame_t *frame); void usbvideo_DeinterlaceFrame(struct uvd *uvd, struct usbvideo_frame *frame);
/* /*
* This code performs bounds checking - use it when working with * This code performs bounds checking - use it when working with
...@@ -363,7 +361,7 @@ void usbvideo_DeinterlaceFrame(struct uvd *uvd, usbvideo_frame_t *frame); ...@@ -363,7 +361,7 @@ void usbvideo_DeinterlaceFrame(struct uvd *uvd, usbvideo_frame_t *frame);
* VIDEOSIZE_X(fr->request), total VIDEOSIZE_Y(frame->request) lines. * VIDEOSIZE_X(fr->request), total VIDEOSIZE_Y(frame->request) lines.
*/ */
static inline void RGB24_PUTPIXEL( static inline void RGB24_PUTPIXEL(
usbvideo_frame_t *fr, struct usbvideo_frame *fr,
int ix, int iy, int ix, int iy,
unsigned char vr, unsigned char vr,
unsigned char vg, unsigned char vg,
......
...@@ -208,8 +208,8 @@ static DECLARE_WAIT_QUEUE_HEAD(open_wait); ...@@ -208,8 +208,8 @@ static DECLARE_WAIT_QUEUE_HEAD(open_wait);
#define err(args...) \ #define err(args...) \
({ printk(KERN_ERR "Voyager: " args); \ ({ printk(KERN_ERR "Voyager: " args); \
printk("\n"); }) printk("\n"); })
#define dbgprint(args...) \ #define dbgprint(fmt, args...) \
({ printk(KERN_DEBUG "Voyager: " __FUNCTION__ ": " args); \ ({ printk(KERN_DEBUG "Voyager: %s: " fmt, __FUNCTION__ , ##args); \
printk("\n"); }) printk("\n"); })
#define dbg(args...) \ #define dbg(args...) \
({ if(debug >= 1) dbgprint(args); }) ({ if(debug >= 1) dbgprint(args); })
......
...@@ -184,7 +184,7 @@ static void belkin_sa_shutdown (struct usb_serial *serial) ...@@ -184,7 +184,7 @@ static void belkin_sa_shutdown (struct usb_serial *serial)
{ {
int i; int i;
dbg (__FUNCTION__); dbg ("%s", __FUNCTION__);
/* stop reads and writes on all ports */ /* stop reads and writes on all ports */
for (i=0; i < serial->num_ports; ++i) { for (i=0; i < serial->num_ports; ++i) {
...@@ -199,7 +199,7 @@ static int belkin_sa_open (struct usb_serial_port *port, struct file *filp) ...@@ -199,7 +199,7 @@ static int belkin_sa_open (struct usb_serial_port *port, struct file *filp)
{ {
int retval = 0; int retval = 0;
dbg(__FUNCTION__" port %d", port->number); dbg("%s port %d", __FUNCTION__, port->number);
/*Start reading from the device*/ /*Start reading from the device*/
/* TODO: Look at possibility of submitting mulitple URBs to device to /* TODO: Look at possibility of submitting mulitple URBs to device to
...@@ -233,7 +233,7 @@ static void belkin_sa_close (struct usb_serial_port *port, struct file *filp) ...@@ -233,7 +233,7 @@ static void belkin_sa_close (struct usb_serial_port *port, struct file *filp)
if (!serial) if (!serial)
return; return;
dbg(__FUNCTION__" port %d", port->number); dbg("%s port %d", __FUNCTION__, port->number);
if (serial->dev) { if (serial->dev) {
/* shutdown our bulk reads and writes */ /* shutdown our bulk reads and writes */
......
...@@ -103,7 +103,7 @@ static int cyberjack_startup (struct usb_serial *serial) ...@@ -103,7 +103,7 @@ static int cyberjack_startup (struct usb_serial *serial)
{ {
struct cyberjack_private *priv; struct cyberjack_private *priv;
dbg (__FUNCTION__); dbg("%s", __FUNCTION__);
/* allocate the private data structure */ /* allocate the private data structure */
serial->port->private = kmalloc(sizeof(struct cyberjack_private), GFP_KERNEL); serial->port->private = kmalloc(sizeof(struct cyberjack_private), GFP_KERNEL);
...@@ -125,7 +125,7 @@ static void cyberjack_shutdown (struct usb_serial *serial) ...@@ -125,7 +125,7 @@ static void cyberjack_shutdown (struct usb_serial *serial)
{ {
int i; int i;
dbg (__FUNCTION__); dbg("%s", __FUNCTION__);
for (i=0; i < serial->num_ports; ++i) { for (i=0; i < serial->num_ports; ++i) {
/* My special items, the standard routines free my urbs */ /* My special items, the standard routines free my urbs */
...@@ -142,7 +142,7 @@ static int cyberjack_open (struct usb_serial_port *port, struct file *filp) ...@@ -142,7 +142,7 @@ static int cyberjack_open (struct usb_serial_port *port, struct file *filp)
if (port_paranoia_check (port, __FUNCTION__)) if (port_paranoia_check (port, __FUNCTION__))
return -ENODEV; return -ENODEV;
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
/* force low_latency on so that our tty_push actually forces /* force low_latency on so that our tty_push actually forces
* the data through, otherwise it is scheduled, and with high * the data through, otherwise it is scheduled, and with high
...@@ -164,14 +164,14 @@ static int cyberjack_open (struct usb_serial_port *port, struct file *filp) ...@@ -164,14 +164,14 @@ static int cyberjack_open (struct usb_serial_port *port, struct file *filp)
result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
if (result) if (result)
err(" usb_submit_urb(read int) failed"); err(" usb_submit_urb(read int) failed");
dbg(__FUNCTION__ " - usb_submit_urb(int urb)"); dbg("%s - usb_submit_urb(int urb)", __FUNCTION__);
return result; return result;
} }
static void cyberjack_close (struct usb_serial_port *port, struct file *filp) static void cyberjack_close (struct usb_serial_port *port, struct file *filp)
{ {
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if (port->serial->dev) { if (port->serial->dev) {
/* shutdown any bulk reads that might be going on */ /* shutdown any bulk reads that might be going on */
...@@ -188,16 +188,16 @@ static int cyberjack_write (struct usb_serial_port *port, int from_user, const u ...@@ -188,16 +188,16 @@ static int cyberjack_write (struct usb_serial_port *port, int from_user, const u
int result; int result;
int wrexpected; int wrexpected;
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
dbg(__FUNCTION__ " - from_user %d", from_user); dbg("%s - from_user %d", __FUNCTION__, from_user);
if (count == 0) { if (count == 0) {
dbg(__FUNCTION__ " - write request of 0 bytes"); dbg("%s - write request of 0 bytes", __FUNCTION__);
return (0); return (0);
} }
if (port->write_urb->status == -EINPROGRESS) { if (port->write_urb->status == -EINPROGRESS) {
dbg (__FUNCTION__ " - already writing"); dbg("%s - already writing", __FUNCTION__);
return (0); return (0);
} }
...@@ -221,7 +221,7 @@ static int cyberjack_write (struct usb_serial_port *port, int from_user, const u ...@@ -221,7 +221,7 @@ static int cyberjack_write (struct usb_serial_port *port, int from_user, const u
if( priv->wrfilled >= 3 ) { if( priv->wrfilled >= 3 ) {
wrexpected = ((int)priv->wrbuf[2]<<8)+priv->wrbuf[1]+3; wrexpected = ((int)priv->wrbuf[2]<<8)+priv->wrbuf[1]+3;
dbg(__FUNCTION__ " - expected data: %d", wrexpected); dbg("%s - expected data: %d", __FUNCTION__, wrexpected);
} else { } else {
wrexpected = sizeof(priv->wrbuf); wrexpected = sizeof(priv->wrbuf);
} }
...@@ -230,7 +230,7 @@ static int cyberjack_write (struct usb_serial_port *port, int from_user, const u ...@@ -230,7 +230,7 @@ static int cyberjack_write (struct usb_serial_port *port, int from_user, const u
/* We have enough data to begin transmission */ /* We have enough data to begin transmission */
int length; int length;
dbg(__FUNCTION__ " - transmitting data (frame 1)"); dbg("%s - transmitting data (frame 1)", __FUNCTION__);
length = (wrexpected > port->bulk_out_size) ? port->bulk_out_size : wrexpected; length = (wrexpected > port->bulk_out_size) ? port->bulk_out_size : wrexpected;
memcpy (port->write_urb->transfer_buffer, priv->wrbuf, length ); memcpy (port->write_urb->transfer_buffer, priv->wrbuf, length );
...@@ -248,18 +248,18 @@ static int cyberjack_write (struct usb_serial_port *port, int from_user, const u ...@@ -248,18 +248,18 @@ static int cyberjack_write (struct usb_serial_port *port, int from_user, const u
/* send the data out the bulk port */ /* send the data out the bulk port */
result = usb_submit_urb(port->write_urb, GFP_ATOMIC); result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
if (result) { if (result) {
err(__FUNCTION__ " - failed submitting write urb, error %d", result); err("%s - failed submitting write urb, error %d", __FUNCTION__, result);
/* Throw away data. No better idea what to do with it. */ /* Throw away data. No better idea what to do with it. */
priv->wrfilled=0; priv->wrfilled=0;
priv->wrsent=0; priv->wrsent=0;
return 0; return 0;
} }
dbg(__FUNCTION__ " - priv->wrsent=%d",priv->wrsent); dbg("%s - priv->wrsent=%d", __FUNCTION__,priv->wrsent);
dbg(__FUNCTION__ " - priv->wrfilled=%d",priv->wrfilled); dbg("%s - priv->wrfilled=%d", __FUNCTION__,priv->wrfilled);
if( priv->wrsent>=priv->wrfilled ) { if( priv->wrsent>=priv->wrfilled ) {
dbg(__FUNCTION__ " - buffer cleaned"); dbg("%s - buffer cleaned", __FUNCTION__);
memset( priv->wrbuf, 0, sizeof(priv->wrbuf) ); memset( priv->wrbuf, 0, sizeof(priv->wrbuf) );
priv->wrfilled=0; priv->wrfilled=0;
priv->wrsent=0; priv->wrsent=0;
...@@ -278,7 +278,7 @@ static void cyberjack_read_int_callback( struct urb *urb ) ...@@ -278,7 +278,7 @@ static void cyberjack_read_int_callback( struct urb *urb )
if (port_paranoia_check (port, __FUNCTION__)) return; if (port_paranoia_check (port, __FUNCTION__)) return;
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
/* the urb might have been killed. */ /* the urb might have been killed. */
if (urb->status) if (urb->status)
...@@ -311,14 +311,14 @@ static void cyberjack_read_int_callback( struct urb *urb ) ...@@ -311,14 +311,14 @@ static void cyberjack_read_int_callback( struct urb *urb )
/* "+=" is probably more fault tollerant than "=" */ /* "+=" is probably more fault tollerant than "=" */
priv->rdtodo += size; priv->rdtodo += size;
dbg(__FUNCTION__ " - rdtodo: %d", priv->rdtodo); dbg("%s - rdtodo: %d", __FUNCTION__, priv->rdtodo);
if( !old_rdtodo ) { if( !old_rdtodo ) {
port->read_urb->dev = port->serial->dev; port->read_urb->dev = port->serial->dev;
result = usb_submit_urb(port->read_urb, GFP_ATOMIC); result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
if( result ) if( result )
err(__FUNCTION__ " - failed resubmitting read urb, error %d", result); err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result);
dbg(__FUNCTION__ " - usb_submit_urb(read urb)"); dbg("%s - usb_submit_urb(read urb)", __FUNCTION__);
} }
} }
} }
...@@ -333,16 +333,16 @@ static void cyberjack_read_bulk_callback (struct urb *urb) ...@@ -333,16 +333,16 @@ static void cyberjack_read_bulk_callback (struct urb *urb)
int i; int i;
int result; int result;
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if (!serial) { if (!serial) {
dbg(__FUNCTION__ " - bad serial pointer, exiting"); dbg("%s - bad serial pointer, exiting", __FUNCTION__);
return; return;
} }
if (urb->status) { if (urb->status) {
usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, urb->transfer_buffer); usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, urb->transfer_buffer);
dbg(__FUNCTION__ " - nonzero read bulk status received: %d", urb->status); dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, urb->status);
return; return;
} }
...@@ -366,15 +366,15 @@ static void cyberjack_read_bulk_callback (struct urb *urb) ...@@ -366,15 +366,15 @@ static void cyberjack_read_bulk_callback (struct urb *urb)
/* Just to be sure */ /* Just to be sure */
if( priv->rdtodo<0 ) priv->rdtodo=0; if( priv->rdtodo<0 ) priv->rdtodo=0;
dbg(__FUNCTION__ " - rdtodo: %d", priv->rdtodo); dbg("%s - rdtodo: %d", __FUNCTION__, priv->rdtodo);
/* Continue to read if we have still urbs to do. */ /* Continue to read if we have still urbs to do. */
if( priv->rdtodo /* || (urb->actual_length==port->bulk_in_endpointAddress)*/ ) { if( priv->rdtodo /* || (urb->actual_length==port->bulk_in_endpointAddress)*/ ) {
port->read_urb->dev = port->serial->dev; port->read_urb->dev = port->serial->dev;
result = usb_submit_urb(port->read_urb, GFP_ATOMIC); result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
if (result) if (result)
err(__FUNCTION__ " - failed resubmitting read urb, error %d", result); err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result);
dbg(__FUNCTION__ " - usb_submit_urb(read urb)"); dbg("%s - usb_submit_urb(read urb)", __FUNCTION__);
} }
} }
...@@ -384,15 +384,15 @@ static void cyberjack_write_bulk_callback (struct urb *urb) ...@@ -384,15 +384,15 @@ static void cyberjack_write_bulk_callback (struct urb *urb)
struct cyberjack_private *priv = (struct cyberjack_private *)port->private; struct cyberjack_private *priv = (struct cyberjack_private *)port->private;
struct usb_serial *serial = get_usb_serial (port, __FUNCTION__); struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if (!serial) { if (!serial) {
dbg(__FUNCTION__ " - bad serial pointer, exiting"); dbg("%s - bad serial pointer, exiting", __FUNCTION__);
return; return;
} }
if (urb->status) { if (urb->status) {
dbg(__FUNCTION__ " - nonzero write bulk status received: %d", urb->status); dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status);
return; return;
} }
...@@ -401,11 +401,11 @@ static void cyberjack_write_bulk_callback (struct urb *urb) ...@@ -401,11 +401,11 @@ static void cyberjack_write_bulk_callback (struct urb *urb)
int length, blksize, result; int length, blksize, result;
if (port->write_urb->status == -EINPROGRESS) { if (port->write_urb->status == -EINPROGRESS) {
dbg (__FUNCTION__ " - already writing"); dbg("%s - already writing", __FUNCTION__);
return; return;
} }
dbg(__FUNCTION__ " - transmitting data (frame n)"); dbg("%s - transmitting data (frame n)", __FUNCTION__);
length = ((priv->wrfilled - priv->wrsent) > port->bulk_out_size) ? length = ((priv->wrfilled - priv->wrsent) > port->bulk_out_size) ?
port->bulk_out_size : (priv->wrfilled - priv->wrsent); port->bulk_out_size : (priv->wrfilled - priv->wrsent);
...@@ -426,7 +426,7 @@ static void cyberjack_write_bulk_callback (struct urb *urb) ...@@ -426,7 +426,7 @@ static void cyberjack_write_bulk_callback (struct urb *urb)
/* send the data out the bulk port */ /* send the data out the bulk port */
result = usb_submit_urb(port->write_urb, GFP_ATOMIC); result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
if (result) { if (result) {
err(__FUNCTION__ " - failed submitting write urb, error %d", result); err("%s - failed submitting write urb, error %d", __FUNCTION__, result);
/* Throw away data. No better idea what to do with it. */ /* Throw away data. No better idea what to do with it. */
priv->wrfilled=0; priv->wrfilled=0;
priv->wrsent=0; priv->wrsent=0;
...@@ -435,13 +435,13 @@ static void cyberjack_write_bulk_callback (struct urb *urb) ...@@ -435,13 +435,13 @@ static void cyberjack_write_bulk_callback (struct urb *urb)
return; return;
} }
dbg(__FUNCTION__ " - priv->wrsent=%d",priv->wrsent); dbg("%s - priv->wrsent=%d", __FUNCTION__,priv->wrsent);
dbg(__FUNCTION__ " - priv->wrfilled=%d",priv->wrfilled); dbg("%s - priv->wrfilled=%d", __FUNCTION__,priv->wrfilled);
blksize = ((int)priv->wrbuf[2]<<8)+priv->wrbuf[1]+3; blksize = ((int)priv->wrbuf[2]<<8)+priv->wrbuf[1]+3;
if( (priv->wrsent>=priv->wrfilled) || (priv->wrsent>=blksize) ) { if( (priv->wrsent>=priv->wrfilled) || (priv->wrsent>=blksize) ) {
dbg(__FUNCTION__ " - buffer cleaned"); dbg("%s - buffer cleaned", __FUNCTION__);
memset( priv->wrbuf, 0, sizeof(priv->wrbuf) ); memset( priv->wrbuf, 0, sizeof(priv->wrbuf) );
priv->wrfilled=0; priv->wrfilled=0;
priv->wrsent=0; priv->wrsent=0;
......
...@@ -684,7 +684,7 @@ dbg( "digi_write_oob_command: TOP: port=%d, count=%d", oob_priv->dp_port_num, co ...@@ -684,7 +684,7 @@ dbg( "digi_write_oob_command: TOP: port=%d, count=%d", oob_priv->dp_port_num, co
spin_unlock_irqrestore( &oob_priv->dp_port_lock, flags ); spin_unlock_irqrestore( &oob_priv->dp_port_lock, flags );
if( ret ) { if( ret ) {
err( __FUNCTION__ ": usb_submit_urb failed, ret=%d", err("%s: usb_submit_urb failed, ret=%d", __FUNCTION__,
ret ); ret );
} }
...@@ -773,7 +773,7 @@ count ); ...@@ -773,7 +773,7 @@ count );
spin_unlock_irqrestore( &priv->dp_port_lock, flags ); spin_unlock_irqrestore( &priv->dp_port_lock, flags );
if( ret ) { if( ret ) {
err( __FUNCTION__ ": usb_submit_urb failed, ret=%d, port=%d", err("%s: usb_submit_urb failed, ret=%d, port=%d", __FUNCTION__,
ret, priv->dp_port_num ); ret, priv->dp_port_num );
} }
...@@ -849,7 +849,7 @@ port_priv->dp_port_num, modem_signals ); ...@@ -849,7 +849,7 @@ port_priv->dp_port_num, modem_signals );
spin_unlock_irqrestore( &oob_priv->dp_port_lock, flags ); spin_unlock_irqrestore( &oob_priv->dp_port_lock, flags );
if( ret ) { if( ret ) {
err( __FUNCTION__ ": usb_submit_urb failed, ret=%d", err("%s: usb_submit_urb failed, ret=%d", __FUNCTION__,
ret ); ret );
} }
...@@ -970,7 +970,7 @@ dbg( "digi_rx_unthrottle: TOP: port=%d", priv->dp_port_num ); ...@@ -970,7 +970,7 @@ dbg( "digi_rx_unthrottle: TOP: port=%d", priv->dp_port_num );
spin_unlock_irqrestore( &priv->dp_port_lock, flags ); spin_unlock_irqrestore( &priv->dp_port_lock, flags );
if( ret ) { if( ret ) {
err( __FUNCTION__ ": usb_submit_urb failed, ret=%d, port=%d", err("%s: usb_submit_urb failed, ret=%d, port=%d", __FUNCTION__,
ret, priv->dp_port_num ); ret, priv->dp_port_num );
} }
...@@ -1329,7 +1329,7 @@ priv->dp_port_num, count, from_user, in_interrupt() ); ...@@ -1329,7 +1329,7 @@ priv->dp_port_num, count, from_user, in_interrupt() );
/* return length of new data written, or error */ /* return length of new data written, or error */
spin_unlock_irqrestore( &priv->dp_port_lock, flags ); spin_unlock_irqrestore( &priv->dp_port_lock, flags );
if( ret < 0 ) { if( ret < 0 ) {
err( __FUNCTION__ ": usb_submit_urb failed, ret=%d, port=%d", err("%s: usb_submit_urb failed, ret=%d, port=%d", __FUNCTION__,
ret, priv->dp_port_num ); ret, priv->dp_port_num );
} }
...@@ -1352,13 +1352,13 @@ dbg( "digi_write_bulk_callback: TOP, urb->status=%d", urb->status ); ...@@ -1352,13 +1352,13 @@ dbg( "digi_write_bulk_callback: TOP, urb->status=%d", urb->status );
/* port and serial sanity check */ /* port and serial sanity check */
if( port == NULL || (priv=(struct digi_port *)(port->private)) == NULL ) { if( port == NULL || (priv=(struct digi_port *)(port->private)) == NULL ) {
err( __FUNCTION__ ": port or port->private is NULL, status=%d", err("%s: port or port->private is NULL, status=%d", __FUNCTION__,
urb->status ); urb->status );
return; return;
} }
serial = port->serial; serial = port->serial;
if( serial == NULL || serial->private == NULL ) { if( serial == NULL || serial->private == NULL ) {
err( __FUNCTION__ ": serial or serial->private is NULL, status=%d", urb->status ); err("%s: serial or serial->private is NULL, status=%d", __FUNCTION__, urb->status );
return; return;
} }
...@@ -1413,7 +1413,7 @@ dbg( "digi_write_bulk_callback: TOP, urb->status=%d", urb->status ); ...@@ -1413,7 +1413,7 @@ dbg( "digi_write_bulk_callback: TOP, urb->status=%d", urb->status );
spin_unlock( &priv->dp_port_lock ); spin_unlock( &priv->dp_port_lock );
if( ret ) { if( ret ) {
err( __FUNCTION__ ": usb_submit_urb failed, ret=%d, port=%d", err("%s: usb_submit_urb failed, ret=%d, port=%d", __FUNCTION__,
ret, priv->dp_port_num ); ret, priv->dp_port_num );
} }
...@@ -1655,8 +1655,7 @@ static int digi_startup_device( struct usb_serial *serial ) ...@@ -1655,8 +1655,7 @@ static int digi_startup_device( struct usb_serial *serial )
port->write_urb->dev = port->serial->dev; port->write_urb->dev = port->serial->dev;
if( (ret=usb_submit_urb(port->read_urb, GFP_KERNEL)) != 0 ) { if( (ret=usb_submit_urb(port->read_urb, GFP_KERNEL)) != 0 ) {
err( err("%s: usb_submit_urb failed, ret=%d, port=%d", __FUNCTION__,
__FUNCTION__ ": usb_submit_urb failed, ret=%d, port=%d",
ret, i ); ret, i );
break; break;
} }
...@@ -1773,20 +1772,20 @@ dbg( "digi_read_bulk_callback: TOP" ); ...@@ -1773,20 +1772,20 @@ dbg( "digi_read_bulk_callback: TOP" );
/* port sanity check, do not resubmit if port is not valid */ /* port sanity check, do not resubmit if port is not valid */
if( port == NULL || (priv=(struct digi_port *)(port->private)) == NULL ) { if( port == NULL || (priv=(struct digi_port *)(port->private)) == NULL ) {
err( __FUNCTION__ ": port or port->private is NULL, status=%d", err("%s: port or port->private is NULL, status=%d", __FUNCTION__,
urb->status ); urb->status );
return; return;
} }
if( port->serial == NULL if( port->serial == NULL
|| serial_paranoia_check( port->serial, __FUNCTION__ ) || serial_paranoia_check( port->serial, __FUNCTION__ )
|| port->serial->private == NULL ) { || port->serial->private == NULL ) {
err( __FUNCTION__ ": serial is bad or serial->private is NULL, status=%d", urb->status ); err("%s: serial is bad or serial->private is NULL, status=%d", __FUNCTION__, urb->status );
return; return;
} }
/* do not resubmit urb if it has any status error */ /* do not resubmit urb if it has any status error */
if( urb->status ) { if( urb->status ) {
err( __FUNCTION__ ": nonzero read bulk status: status=%d, port=%d", urb->status, priv->dp_port_num ); err("%s: nonzero read bulk status: status=%d, port=%d", __FUNCTION__, urb->status, priv->dp_port_num );
return; return;
} }
...@@ -1803,7 +1802,7 @@ dbg( "digi_read_bulk_callback: TOP" ); ...@@ -1803,7 +1802,7 @@ dbg( "digi_read_bulk_callback: TOP" );
/* continue read */ /* continue read */
urb->dev = port->serial->dev; urb->dev = port->serial->dev;
if( (ret=usb_submit_urb(urb, GFP_ATOMIC)) != 0 ) { if( (ret=usb_submit_urb(urb, GFP_ATOMIC)) != 0 ) {
err( __FUNCTION__ ": failed resubmitting urb, ret=%d, port=%d", err("%s: failed resubmitting urb, ret=%d, port=%d", __FUNCTION__,
ret, priv->dp_port_num ); ret, priv->dp_port_num );
} }
...@@ -1844,7 +1843,7 @@ static int digi_read_inb_callback( struct urb *urb ) ...@@ -1844,7 +1843,7 @@ static int digi_read_inb_callback( struct urb *urb )
/* short/multiple packet check */ /* short/multiple packet check */
if( urb->actual_length != len + 2 ) { if( urb->actual_length != len + 2 ) {
err( __FUNCTION__ ": INCOMPLETE OR MULTIPLE PACKET, urb->status=%d, port=%d, opcode=%d, len=%d, actual_length=%d, status=%d", urb->status, priv->dp_port_num, opcode, len, urb->actual_length, status ); err("%s: INCOMPLETE OR MULTIPLE PACKET, urb->status=%d, port=%d, opcode=%d, len=%d, actual_length=%d, status=%d", __FUNCTION__, urb->status, priv->dp_port_num, opcode, len, urb->actual_length, status );
return( -1 ); return( -1 );
} }
...@@ -1913,9 +1912,9 @@ static int digi_read_inb_callback( struct urb *urb ) ...@@ -1913,9 +1912,9 @@ static int digi_read_inb_callback( struct urb *urb )
spin_unlock( &priv->dp_port_lock ); spin_unlock( &priv->dp_port_lock );
if( opcode == DIGI_CMD_RECEIVE_DISABLE ) { if( opcode == DIGI_CMD_RECEIVE_DISABLE ) {
dbg( __FUNCTION__ ": got RECEIVE_DISABLE" ); dbg("%s: got RECEIVE_DISABLE", __FUNCTION__ );
} else if( opcode != DIGI_CMD_RECEIVE_DATA ) { } else if( opcode != DIGI_CMD_RECEIVE_DATA ) {
dbg( __FUNCTION__ ": unknown opcode: %d", opcode ); dbg("%s: unknown opcode: %d", __FUNCTION__, opcode );
} }
return( throttled ? 1 : 0 ); return( throttled ? 1 : 0 );
......
...@@ -152,7 +152,7 @@ static int empeg_open (struct usb_serial_port *port, struct file *filp) ...@@ -152,7 +152,7 @@ static int empeg_open (struct usb_serial_port *port, struct file *filp)
if (port_paranoia_check (port, __FUNCTION__)) if (port_paranoia_check (port, __FUNCTION__))
return -ENODEV; return -ENODEV;
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
/* Force default termio settings */ /* Force default termio settings */
empeg_set_termios (port, NULL) ; empeg_set_termios (port, NULL) ;
...@@ -174,7 +174,7 @@ static int empeg_open (struct usb_serial_port *port, struct file *filp) ...@@ -174,7 +174,7 @@ static int empeg_open (struct usb_serial_port *port, struct file *filp)
result = usb_submit_urb(port->read_urb, GFP_KERNEL); result = usb_submit_urb(port->read_urb, GFP_KERNEL);
if (result) if (result)
err(__FUNCTION__ " - failed submitting read urb, error %d", result); err("%s - failed submitting read urb, error %d", __FUNCTION__, result);
return result; return result;
} }
...@@ -187,7 +187,7 @@ static void empeg_close (struct usb_serial_port *port, struct file * filp) ...@@ -187,7 +187,7 @@ static void empeg_close (struct usb_serial_port *port, struct file * filp)
if (port_paranoia_check (port, __FUNCTION__)) if (port_paranoia_check (port, __FUNCTION__))
return; return;
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
serial = get_usb_serial (port, __FUNCTION__); serial = get_usb_serial (port, __FUNCTION__);
if (!serial) if (!serial)
...@@ -213,7 +213,7 @@ static int empeg_write (struct usb_serial_port *port, int from_user, const unsig ...@@ -213,7 +213,7 @@ static int empeg_write (struct usb_serial_port *port, int from_user, const unsig
int bytes_sent = 0; int bytes_sent = 0;
int transfer_size; int transfer_size;
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
usb_serial_debug_data (__FILE__, __FUNCTION__, count, buf); usb_serial_debug_data (__FILE__, __FUNCTION__, count, buf);
...@@ -234,14 +234,14 @@ static int empeg_write (struct usb_serial_port *port, int from_user, const unsig ...@@ -234,14 +234,14 @@ static int empeg_write (struct usb_serial_port *port, int from_user, const unsig
spin_unlock_irqrestore (&write_urb_pool_lock, flags); spin_unlock_irqrestore (&write_urb_pool_lock, flags);
if (urb == NULL) { if (urb == NULL) {
dbg (__FUNCTION__ " - no more free urbs"); dbg("%s - no more free urbs", __FUNCTION__);
goto exit; goto exit;
} }
if (urb->transfer_buffer == NULL) { if (urb->transfer_buffer == NULL) {
urb->transfer_buffer = kmalloc (URB_TRANSFER_BUFFER_SIZE, GFP_ATOMIC); urb->transfer_buffer = kmalloc (URB_TRANSFER_BUFFER_SIZE, GFP_ATOMIC);
if (urb->transfer_buffer == NULL) { if (urb->transfer_buffer == NULL) {
err(__FUNCTION__" no more kernel memory..."); err("%s no more kernel memory...", __FUNCTION__);
goto exit; goto exit;
} }
} }
...@@ -271,7 +271,7 @@ static int empeg_write (struct usb_serial_port *port, int from_user, const unsig ...@@ -271,7 +271,7 @@ static int empeg_write (struct usb_serial_port *port, int from_user, const unsig
/* send it down the pipe */ /* send it down the pipe */
status = usb_submit_urb(urb, GFP_ATOMIC); status = usb_submit_urb(urb, GFP_ATOMIC);
if (status) { if (status) {
err(__FUNCTION__ " - usb_submit_urb(write bulk) failed with status = %d", status); err("%s - usb_submit_urb(write bulk) failed with status = %d", __FUNCTION__, status);
bytes_sent = status; bytes_sent = status;
break; break;
} }
...@@ -295,7 +295,7 @@ static int empeg_write_room (struct usb_serial_port *port) ...@@ -295,7 +295,7 @@ static int empeg_write_room (struct usb_serial_port *port)
int i; int i;
int room = 0; int room = 0;
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
spin_lock_irqsave (&write_urb_pool_lock, flags); spin_lock_irqsave (&write_urb_pool_lock, flags);
...@@ -308,7 +308,7 @@ static int empeg_write_room (struct usb_serial_port *port) ...@@ -308,7 +308,7 @@ static int empeg_write_room (struct usb_serial_port *port)
spin_unlock_irqrestore (&write_urb_pool_lock, flags); spin_unlock_irqrestore (&write_urb_pool_lock, flags);
dbg(__FUNCTION__ " - returns %d", room); dbg("%s - returns %d", __FUNCTION__, room);
return (room); return (room);
...@@ -321,7 +321,7 @@ static int empeg_chars_in_buffer (struct usb_serial_port *port) ...@@ -321,7 +321,7 @@ static int empeg_chars_in_buffer (struct usb_serial_port *port)
int i; int i;
int chars = 0; int chars = 0;
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
spin_lock_irqsave (&write_urb_pool_lock, flags); spin_lock_irqsave (&write_urb_pool_lock, flags);
...@@ -334,7 +334,7 @@ static int empeg_chars_in_buffer (struct usb_serial_port *port) ...@@ -334,7 +334,7 @@ static int empeg_chars_in_buffer (struct usb_serial_port *port)
spin_unlock_irqrestore (&write_urb_pool_lock, flags); spin_unlock_irqrestore (&write_urb_pool_lock, flags);
dbg (__FUNCTION__ " - returns %d", chars); dbg("%s - returns %d", __FUNCTION__, chars);
return (chars); return (chars);
...@@ -348,10 +348,10 @@ static void empeg_write_bulk_callback (struct urb *urb) ...@@ -348,10 +348,10 @@ static void empeg_write_bulk_callback (struct urb *urb)
if (port_paranoia_check (port, __FUNCTION__)) if (port_paranoia_check (port, __FUNCTION__))
return; return;
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if (urb->status) { if (urb->status) {
dbg(__FUNCTION__ " - nonzero write bulk status received: %d", urb->status); dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status);
return; return;
} }
...@@ -375,15 +375,15 @@ static void empeg_read_bulk_callback (struct urb *urb) ...@@ -375,15 +375,15 @@ static void empeg_read_bulk_callback (struct urb *urb)
if (port_paranoia_check (port, __FUNCTION__)) if (port_paranoia_check (port, __FUNCTION__))
return; return;
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if (!serial) { if (!serial) {
dbg(__FUNCTION__ " - bad serial pointer, exiting"); dbg("%s - bad serial pointer, exiting", __FUNCTION__);
return; return;
} }
if (urb->status) { if (urb->status) {
dbg(__FUNCTION__ " - nonzero read bulk status received: %d", urb->status); dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, urb->status);
return; return;
} }
...@@ -423,7 +423,7 @@ static void empeg_read_bulk_callback (struct urb *urb) ...@@ -423,7 +423,7 @@ static void empeg_read_bulk_callback (struct urb *urb)
result = usb_submit_urb(port->read_urb, GFP_ATOMIC); result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
if (result) if (result)
err(__FUNCTION__ " - failed resubmitting read urb, error %d", result); err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result);
return; return;
...@@ -432,7 +432,7 @@ static void empeg_read_bulk_callback (struct urb *urb) ...@@ -432,7 +432,7 @@ static void empeg_read_bulk_callback (struct urb *urb)
static void empeg_throttle (struct usb_serial_port *port) static void empeg_throttle (struct usb_serial_port *port)
{ {
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
usb_unlink_urb (port->read_urb); usb_unlink_urb (port->read_urb);
} }
...@@ -441,14 +441,14 @@ static void empeg_unthrottle (struct usb_serial_port *port) ...@@ -441,14 +441,14 @@ static void empeg_unthrottle (struct usb_serial_port *port)
{ {
int result; int result;
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
port->read_urb->dev = port->serial->dev; port->read_urb->dev = port->serial->dev;
result = usb_submit_urb(port->read_urb, GFP_ATOMIC); result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
if (result) if (result)
err(__FUNCTION__ " - failed submitting read urb, error %d", result); err("%s - failed submitting read urb, error %d", __FUNCTION__, result);
return; return;
} }
...@@ -457,9 +457,9 @@ static void empeg_unthrottle (struct usb_serial_port *port) ...@@ -457,9 +457,9 @@ static void empeg_unthrottle (struct usb_serial_port *port)
static int empeg_startup (struct usb_serial *serial) static int empeg_startup (struct usb_serial *serial)
{ {
dbg(__FUNCTION__); dbg("%s", __FUNCTION__);
dbg(__FUNCTION__ " - Set config to 1"); dbg("%s - Set config to 1", __FUNCTION__);
usb_set_configuration (serial->dev, 1); usb_set_configuration (serial->dev, 1);
/* continue on with initialization */ /* continue on with initialization */
...@@ -470,13 +470,13 @@ static int empeg_startup (struct usb_serial *serial) ...@@ -470,13 +470,13 @@ static int empeg_startup (struct usb_serial *serial)
static void empeg_shutdown (struct usb_serial *serial) static void empeg_shutdown (struct usb_serial *serial)
{ {
dbg (__FUNCTION__); dbg ("%s", __FUNCTION__);
} }
static int empeg_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg) static int empeg_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg)
{ {
dbg(__FUNCTION__ " - port %d, cmd 0x%.4x", port->number, cmd); dbg("%s - port %d, cmd 0x%.4x", __FUNCTION__, port->number, cmd);
return -ENOIOCTLCMD; return -ENOIOCTLCMD;
} }
...@@ -485,10 +485,10 @@ static int empeg_ioctl (struct usb_serial_port *port, struct file * file, unsign ...@@ -485,10 +485,10 @@ static int empeg_ioctl (struct usb_serial_port *port, struct file * file, unsign
static void empeg_set_termios (struct usb_serial_port *port, struct termios *old_termios) static void empeg_set_termios (struct usb_serial_port *port, struct termios *old_termios)
{ {
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if ((!port->tty) || (!port->tty->termios)) { if ((!port->tty) || (!port->tty->termios)) {
dbg(__FUNCTION__" - no tty structures"); dbg("%s - no tty structures", __FUNCTION__);
return; return;
} }
...@@ -565,7 +565,8 @@ static int __init empeg_init (void) ...@@ -565,7 +565,8 @@ static int __init empeg_init (void)
urb->transfer_buffer = NULL; urb->transfer_buffer = NULL;
urb->transfer_buffer = kmalloc (URB_TRANSFER_BUFFER_SIZE, GFP_KERNEL); urb->transfer_buffer = kmalloc (URB_TRANSFER_BUFFER_SIZE, GFP_KERNEL);
if (!urb->transfer_buffer) { if (!urb->transfer_buffer) {
err (__FUNCTION__ " - out of memory for urb buffers."); err("%s - out of memory for urb buffers.",
__FUNCTION__);
continue; continue;
} }
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -1626,7 +1626,7 @@ static void edge_interrupt_callback (struct urb *urb) ...@@ -1626,7 +1626,7 @@ static void edge_interrupt_callback (struct urb *urb)
} }
if (urb->status) { if (urb->status) {
dbg(__FUNCTION__" - nonzero control read status received: %d", urb->status); dbg("%s - nonzero control read status received: %d", __FUNCTION__, urb->status);
return; return;
} }
...@@ -1959,7 +1959,7 @@ static void edge_close (struct usb_serial_port *port, struct file * filp) ...@@ -1959,7 +1959,7 @@ static void edge_close (struct usb_serial_port *port, struct file * filp)
if (port_paranoia_check (port, __FUNCTION__)) if (port_paranoia_check (port, __FUNCTION__))
return; return;
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
serial = get_usb_serial (port, __FUNCTION__); serial = get_usb_serial (port, __FUNCTION__);
if (!serial) if (!serial)
...@@ -1999,7 +1999,7 @@ static void edge_close (struct usb_serial_port *port, struct file * filp) ...@@ -1999,7 +1999,7 @@ static void edge_close (struct usb_serial_port *port, struct file * filp)
edge_port->close_pending = 0; edge_port->close_pending = 0;
} }
dbg(__FUNCTION__" exited"); dbg("%s - exited", __FUNCTION__);
} }
static int edge_write (struct usb_serial_port *port, int from_user, const unsigned char *data, int count) static int edge_write (struct usb_serial_port *port, int from_user, const unsigned char *data, int count)
...@@ -2047,7 +2047,7 @@ static int edge_write (struct usb_serial_port *port, int from_user, const unsign ...@@ -2047,7 +2047,7 @@ static int edge_write (struct usb_serial_port *port, int from_user, const unsign
/* send the data out the bulk port */ /* send the data out the bulk port */
result = usb_submit_urb(port->write_urb, GFP_ATOMIC); result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
if (result) if (result)
err(__FUNCTION__ " - failed submitting write urb, error %d", result); err("%s - failed submitting write urb, error %d", __FUNCTION__, result);
else else
result = count; result = count;
...@@ -2062,19 +2062,19 @@ static int edge_write_room (struct usb_serial_port *port) ...@@ -2062,19 +2062,19 @@ static int edge_write_room (struct usb_serial_port *port)
struct edgeport_port *edge_port = (struct edgeport_port *)(port->private); struct edgeport_port *edge_port = (struct edgeport_port *)(port->private);
int room = 0; int room = 0;
dbg(__FUNCTION__); dbg("%s", __FUNCTION__);
if (edge_port == NULL) if (edge_port == NULL)
return -ENODEV; return -ENODEV;
if (edge_port->close_pending == 1) if (edge_port->close_pending == 1)
return -ENODEV; return -ENODEV;
dbg(__FUNCTION__" - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if (port->write_urb->status != -EINPROGRESS) if (port->write_urb->status != -EINPROGRESS)
room = port->bulk_out_size; room = port->bulk_out_size;
dbg(__FUNCTION__ " - returns %d", room); dbg("%s - returns %d", __FUNCTION__, room);
return room; return room;
} }
...@@ -2083,7 +2083,7 @@ static int edge_chars_in_buffer (struct usb_serial_port *port) ...@@ -2083,7 +2083,7 @@ static int edge_chars_in_buffer (struct usb_serial_port *port)
struct edgeport_port *edge_port = (struct edgeport_port *)(port->private); struct edgeport_port *edge_port = (struct edgeport_port *)(port->private);
int chars = 0; int chars = 0;
dbg(__FUNCTION__); dbg("%s", __FUNCTION__);
if (edge_port == NULL) if (edge_port == NULL)
return -ENODEV; return -ENODEV;
...@@ -2138,7 +2138,7 @@ static void edge_unthrottle (struct usb_serial_port *port) ...@@ -2138,7 +2138,7 @@ static void edge_unthrottle (struct usb_serial_port *port)
struct tty_struct *tty; struct tty_struct *tty;
int status; int status;
dbg(__FUNCTION__" - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if (edge_port == NULL) if (edge_port == NULL)
return; return;
...@@ -2229,32 +2229,32 @@ static void change_port_settings (struct edgeport_port *edge_port, struct termio ...@@ -2229,32 +2229,32 @@ static void change_port_settings (struct edgeport_port *edge_port, struct termio
if (cflag & PARODD) { if (cflag & PARODD) {
config->wFlags |= UMP_MASK_UART_FLAGS_PARITY; config->wFlags |= UMP_MASK_UART_FLAGS_PARITY;
config->bParity = UMP_UART_ODDPARITY; config->bParity = UMP_UART_ODDPARITY;
dbg(__FUNCTION__" - parity = odd"); dbg("%s - parity = odd", __FUNCTION__);
} else { } else {
config->wFlags |= UMP_MASK_UART_FLAGS_PARITY; config->wFlags |= UMP_MASK_UART_FLAGS_PARITY;
config->bParity = UMP_UART_EVENPARITY; config->bParity = UMP_UART_EVENPARITY;
dbg(__FUNCTION__" - parity = even"); dbg("%s - parity = even", __FUNCTION__);
} }
} else { } else {
config->bParity = UMP_UART_NOPARITY; config->bParity = UMP_UART_NOPARITY;
dbg(__FUNCTION__" - parity = none"); dbg("%s - parity = none", __FUNCTION__);
} }
if (cflag & CSTOPB) { if (cflag & CSTOPB) {
config->bStopBits = UMP_UART_STOPBIT2; config->bStopBits = UMP_UART_STOPBIT2;
dbg(__FUNCTION__" - stop bits = 2"); dbg("%s - stop bits = 2", __FUNCTION__);
} else { } else {
config->bStopBits = UMP_UART_STOPBIT1; config->bStopBits = UMP_UART_STOPBIT1;
dbg(__FUNCTION__" - stop bits = 1"); dbg("%s - stop bits = 1", __FUNCTION__);
} }
/* figure out the flow control settings */ /* figure out the flow control settings */
if (cflag & CRTSCTS) { if (cflag & CRTSCTS) {
config->wFlags |= UMP_MASK_UART_FLAGS_OUT_X_CTS_FLOW; config->wFlags |= UMP_MASK_UART_FLAGS_OUT_X_CTS_FLOW;
config->wFlags |= UMP_MASK_UART_FLAGS_RTS_FLOW; config->wFlags |= UMP_MASK_UART_FLAGS_RTS_FLOW;
dbg(__FUNCTION__" - RTS/CTS is enabled"); dbg("%s - RTS/CTS is enabled", __FUNCTION__);
} else { } else {
dbg(__FUNCTION__" - RTS/CTS is disabled"); dbg("%s - RTS/CTS is disabled", __FUNCTION__);
} }
/* if we are implementing XON/XOFF, set the start and stop character in the device */ /* if we are implementing XON/XOFF, set the start and stop character in the device */
...@@ -2422,7 +2422,7 @@ static int get_modem_info (struct edgeport_port *edge_port, unsigned int *value) ...@@ -2422,7 +2422,7 @@ static int get_modem_info (struct edgeport_port *edge_port, unsigned int *value)
| ((msr & MSR_DSR) ? TIOCM_DSR: 0); /* 0x100 */ | ((msr & MSR_DSR) ? TIOCM_DSR: 0); /* 0x100 */
dbg(__FUNCTION__" -- %x", result); dbg("%s -- %x", __FUNCTION__, result);
if (copy_to_user(value, &result, sizeof(int))) if (copy_to_user(value, &result, sizeof(int)))
return -EFAULT; return -EFAULT;
...@@ -2463,42 +2463,42 @@ static int edge_ioctl (struct usb_serial_port *port, struct file *file, unsigned ...@@ -2463,42 +2463,42 @@ static int edge_ioctl (struct usb_serial_port *port, struct file *file, unsigned
struct async_icount cnow; struct async_icount cnow;
struct async_icount cprev; struct async_icount cprev;
dbg(__FUNCTION__" - port %d, cmd = 0x%x", port->number, cmd); dbg("%s - port %d, cmd = 0x%x", __FUNCTION__, port->number, cmd);
switch (cmd) { switch (cmd) {
case TIOCINQ: case TIOCINQ:
dbg(__FUNCTION__" (%d) TIOCINQ", port->number); dbg("%s - (%d) TIOCINQ", __FUNCTION__, port->number);
// return get_number_bytes_avail(edge_port, (unsigned int *) arg); // return get_number_bytes_avail(edge_port, (unsigned int *) arg);
break; break;
case TIOCSERGETLSR: case TIOCSERGETLSR:
dbg(__FUNCTION__" (%d) TIOCSERGETLSR", port->number); dbg("%s - (%d) TIOCSERGETLSR", __FUNCTION__, port->number);
// return get_lsr_info(edge_port, (unsigned int *) arg); // return get_lsr_info(edge_port, (unsigned int *) arg);
break; break;
case TIOCMBIS: case TIOCMBIS:
case TIOCMBIC: case TIOCMBIC:
case TIOCMSET: case TIOCMSET:
dbg(__FUNCTION__" (%d) TIOCMSET/TIOCMBIC/TIOCMSET", port->number); dbg("%s - (%d) TIOCMSET/TIOCMBIC/TIOCMSET", __FUNCTION__, port->number);
return set_modem_info(edge_port, cmd, (unsigned int *) arg); return set_modem_info(edge_port, cmd, (unsigned int *) arg);
break; break;
case TIOCMGET: case TIOCMGET:
dbg(__FUNCTION__" (%d) TIOCMGET", port->number); dbg("%s - (%d) TIOCMGET", __FUNCTION__, port->number);
return get_modem_info(edge_port, (unsigned int *) arg); return get_modem_info(edge_port, (unsigned int *) arg);
break; break;
case TIOCGSERIAL: case TIOCGSERIAL:
dbg(__FUNCTION__" (%d) TIOCGSERIAL", port->number); dbg("%s - (%d) TIOCGSERIAL", __FUNCTION__, port->number);
return get_serial_info(edge_port, (struct serial_struct *) arg); return get_serial_info(edge_port, (struct serial_struct *) arg);
break; break;
case TIOCSSERIAL: case TIOCSSERIAL:
dbg(__FUNCTION__" (%d) TIOCSSERIAL", port->number); dbg("%s - (%d) TIOCSSERIAL", __FUNCTION__, port->number);
break; break;
case TIOCMIWAIT: case TIOCMIWAIT:
dbg(__FUNCTION__" (%d) TIOCMIWAIT", port->number); dbg("%s - (%d) TIOCMIWAIT", __FUNCTION__, port->number);
cprev = edge_port->icount; cprev = edge_port->icount;
while (1) { while (1) {
interruptible_sleep_on(&edge_port->delta_msr_wait); interruptible_sleep_on(&edge_port->delta_msr_wait);
...@@ -2565,7 +2565,7 @@ static int edge_startup (struct usb_serial *serial) ...@@ -2565,7 +2565,7 @@ static int edge_startup (struct usb_serial *serial)
/* create our private serial structure */ /* create our private serial structure */
edge_serial = kmalloc (sizeof(struct edgeport_serial), GFP_KERNEL); edge_serial = kmalloc (sizeof(struct edgeport_serial), GFP_KERNEL);
if (edge_serial == NULL) { if (edge_serial == NULL) {
err(__FUNCTION__" - Out of memory"); err("%s - Out of memory", __FUNCTION__);
return -ENOMEM; return -ENOMEM;
} }
memset (edge_serial, 0, sizeof(struct edgeport_serial)); memset (edge_serial, 0, sizeof(struct edgeport_serial));
...@@ -2582,7 +2582,7 @@ static int edge_startup (struct usb_serial *serial) ...@@ -2582,7 +2582,7 @@ static int edge_startup (struct usb_serial *serial)
for (i = 0; i < serial->num_ports; ++i) { for (i = 0; i < serial->num_ports; ++i) {
edge_port = kmalloc (sizeof(struct edgeport_port), GFP_KERNEL); edge_port = kmalloc (sizeof(struct edgeport_port), GFP_KERNEL);
if (edge_port == NULL) { if (edge_port == NULL) {
err(__FUNCTION__" - Out of memory"); err("%s - Out of memory", __FUNCTION__);
return -ENOMEM; return -ENOMEM;
} }
memset (edge_port, 0, sizeof(struct edgeport_port)); memset (edge_port, 0, sizeof(struct edgeport_port));
...@@ -2598,7 +2598,7 @@ static void edge_shutdown (struct usb_serial *serial) ...@@ -2598,7 +2598,7 @@ static void edge_shutdown (struct usb_serial *serial)
{ {
int i; int i;
dbg (__FUNCTION__); dbg ("%s", __FUNCTION__);
for (i=0; i < serial->num_ports; ++i) { for (i=0; i < serial->num_ports; ++i) {
kfree (serial->port[i].private); kfree (serial->port[i].private);
......
...@@ -130,13 +130,13 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp) ...@@ -130,13 +130,13 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp)
return -ENODEV; return -ENODEV;
} }
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
bytes_in = 0; bytes_in = 0;
bytes_out = 0; bytes_out = 0;
priv = (struct ipaq_private *)kmalloc(sizeof(struct ipaq_private), GFP_KERNEL); priv = (struct ipaq_private *)kmalloc(sizeof(struct ipaq_private), GFP_KERNEL);
if (priv == NULL) { if (priv == NULL) {
err(__FUNCTION__ " - Out of memory"); err("%s - Out of memory", __FUNCTION__);
return -ENOMEM; return -ENOMEM;
} }
port->private = (void *)priv; port->private = (void *)priv;
...@@ -198,7 +198,7 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp) ...@@ -198,7 +198,7 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp)
ipaq_read_bulk_callback, port); ipaq_read_bulk_callback, port);
result = usb_submit_urb(port->read_urb, GFP_KERNEL); result = usb_submit_urb(port->read_urb, GFP_KERNEL);
if (result) { if (result) {
err(__FUNCTION__ " - failed submitting read urb, error %d", result); err("%s - failed submitting read urb, error %d", __FUNCTION__, result);
goto error; goto error;
} }
...@@ -218,12 +218,12 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp) ...@@ -218,12 +218,12 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp)
return 0; return 0;
} }
} }
err(__FUNCTION__ " - failed doing control urb, error %d", result); err("%s - failed doing control urb, error %d", __FUNCTION__, result);
goto error; goto error;
enomem: enomem:
result = -ENOMEM; result = -ENOMEM;
err(__FUNCTION__ " - Out of memory"); err("%s - Out of memory", __FUNCTION__);
error: error:
ipaq_destroy_lists(port); ipaq_destroy_lists(port);
kfree(priv); kfree(priv);
...@@ -240,7 +240,7 @@ static void ipaq_close(struct usb_serial_port *port, struct file *filp) ...@@ -240,7 +240,7 @@ static void ipaq_close(struct usb_serial_port *port, struct file *filp)
return; return;
} }
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
serial = get_usb_serial(port, __FUNCTION__); serial = get_usb_serial(port, __FUNCTION__);
if (!serial) if (!serial)
...@@ -271,15 +271,15 @@ static void ipaq_read_bulk_callback(struct urb *urb) ...@@ -271,15 +271,15 @@ static void ipaq_read_bulk_callback(struct urb *urb)
if (port_paranoia_check(port, __FUNCTION__)) if (port_paranoia_check(port, __FUNCTION__))
return; return;
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if (!serial) { if (!serial) {
dbg(__FUNCTION__ " - bad serial pointer, exiting"); dbg("%s - bad serial pointer, exiting", __FUNCTION__);
return; return;
} }
if (urb->status) { if (urb->status) {
dbg(__FUNCTION__ " - nonzero read bulk status received: %d", urb->status); dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, urb->status);
return; return;
} }
...@@ -306,7 +306,7 @@ static void ipaq_read_bulk_callback(struct urb *urb) ...@@ -306,7 +306,7 @@ static void ipaq_read_bulk_callback(struct urb *urb)
ipaq_read_bulk_callback, port); ipaq_read_bulk_callback, port);
result = usb_submit_urb(port->read_urb, GFP_ATOMIC); result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
if (result) if (result)
err(__FUNCTION__ " - failed resubmitting read urb, error %d", result); err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result);
return; return;
} }
...@@ -317,7 +317,7 @@ static int ipaq_write(struct usb_serial_port *port, int from_user, const unsigne ...@@ -317,7 +317,7 @@ static int ipaq_write(struct usb_serial_port *port, int from_user, const unsigne
int bytes_sent = 0; int bytes_sent = 0;
int transfer_size; int transfer_size;
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
usb_serial_debug_data(__FILE__, __FUNCTION__, count, buf); usb_serial_debug_data(__FILE__, __FUNCTION__, count, buf);
...@@ -344,7 +344,7 @@ static int ipaq_write_bulk(struct usb_serial_port *port, int from_user, const un ...@@ -344,7 +344,7 @@ static int ipaq_write_bulk(struct usb_serial_port *port, int from_user, const un
unsigned long flags; unsigned long flags;
if (priv->free_len <= 0) { if (priv->free_len <= 0) {
dbg(__FUNCTION__ " - we're stuffed"); dbg("%s - we're stuffed", __FUNCTION__);
return -EAGAIN; return -EAGAIN;
} }
...@@ -356,7 +356,7 @@ static int ipaq_write_bulk(struct usb_serial_port *port, int from_user, const un ...@@ -356,7 +356,7 @@ static int ipaq_write_bulk(struct usb_serial_port *port, int from_user, const un
} }
spin_unlock_irqrestore(&write_list_lock, flags); spin_unlock_irqrestore(&write_list_lock, flags);
if (pkt == NULL) { if (pkt == NULL) {
dbg(__FUNCTION__ " - we're stuffed"); dbg("%s - we're stuffed", __FUNCTION__);
return -EAGAIN; return -EAGAIN;
} }
...@@ -379,7 +379,7 @@ static int ipaq_write_bulk(struct usb_serial_port *port, int from_user, const un ...@@ -379,7 +379,7 @@ static int ipaq_write_bulk(struct usb_serial_port *port, int from_user, const un
spin_unlock_irqrestore(&write_list_lock, flags); spin_unlock_irqrestore(&write_list_lock, flags);
result = usb_submit_urb(port->write_urb, GFP_ATOMIC); result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
if (result) { if (result) {
err(__FUNCTION__ " - failed submitting write urb, error %d", result); err("%s - failed submitting write urb, error %d", __FUNCTION__, result);
} }
} else { } else {
spin_unlock_irqrestore(&write_list_lock, flags); spin_unlock_irqrestore(&write_list_lock, flags);
...@@ -398,7 +398,7 @@ static void ipaq_write_gather(struct usb_serial_port *port) ...@@ -398,7 +398,7 @@ static void ipaq_write_gather(struct usb_serial_port *port)
if (urb->status == -EINPROGRESS) { if (urb->status == -EINPROGRESS) {
/* Should never happen */ /* Should never happen */
err(__FUNCTION__ " - flushing while urb is active !"); err("%s - flushing while urb is active !", __FUNCTION__);
return; return;
} }
room = URBDATA_SIZE; room = URBDATA_SIZE;
...@@ -439,10 +439,10 @@ static void ipaq_write_bulk_callback(struct urb *urb) ...@@ -439,10 +439,10 @@ static void ipaq_write_bulk_callback(struct urb *urb)
return; return;
} }
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if (urb->status) { if (urb->status) {
dbg(__FUNCTION__ " - nonzero write bulk status received: %d", urb->status); dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status);
} }
spin_lock_irqsave(&write_list_lock, flags); spin_lock_irqsave(&write_list_lock, flags);
...@@ -451,7 +451,7 @@ static void ipaq_write_bulk_callback(struct urb *urb) ...@@ -451,7 +451,7 @@ static void ipaq_write_bulk_callback(struct urb *urb)
spin_unlock_irqrestore(&write_list_lock, flags); spin_unlock_irqrestore(&write_list_lock, flags);
result = usb_submit_urb(port->write_urb, GFP_ATOMIC); result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
if (result) { if (result) {
err(__FUNCTION__ " - failed submitting write urb, error %d", result); err("%s - failed submitting write urb, error %d", __FUNCTION__, result);
} }
} else { } else {
priv->active = 0; priv->active = 0;
...@@ -467,7 +467,7 @@ static int ipaq_write_room(struct usb_serial_port *port) ...@@ -467,7 +467,7 @@ static int ipaq_write_room(struct usb_serial_port *port)
{ {
struct ipaq_private *priv = (struct ipaq_private *)port->private; struct ipaq_private *priv = (struct ipaq_private *)port->private;
dbg(__FUNCTION__ " - freelen %d", priv->free_len); dbg("%s - freelen %d", __FUNCTION__, priv->free_len);
return priv->free_len; return priv->free_len;
} }
...@@ -475,7 +475,7 @@ static int ipaq_chars_in_buffer(struct usb_serial_port *port) ...@@ -475,7 +475,7 @@ static int ipaq_chars_in_buffer(struct usb_serial_port *port)
{ {
struct ipaq_private *priv = (struct ipaq_private *)port->private; struct ipaq_private *priv = (struct ipaq_private *)port->private;
dbg(__FUNCTION__ " - queuelen %d", priv->queue_len); dbg("%s - queuelen %d", __FUNCTION__, priv->queue_len);
return priv->queue_len; return priv->queue_len;
} }
...@@ -503,14 +503,14 @@ static void ipaq_destroy_lists(struct usb_serial_port *port) ...@@ -503,14 +503,14 @@ static void ipaq_destroy_lists(struct usb_serial_port *port)
static int ipaq_startup(struct usb_serial *serial) static int ipaq_startup(struct usb_serial *serial)
{ {
dbg(__FUNCTION__); dbg("%s", __FUNCTION__);
usb_set_configuration(serial->dev, 1); usb_set_configuration(serial->dev, 1);
return 0; return 0;
} }
static void ipaq_shutdown(struct usb_serial *serial) static void ipaq_shutdown(struct usb_serial *serial)
{ {
dbg (__FUNCTION__); dbg("%s", __FUNCTION__);
} }
static int __init ipaq_init(void) static int __init ipaq_init(void)
......
...@@ -261,7 +261,7 @@ static int ir_startup (struct usb_serial *serial) ...@@ -261,7 +261,7 @@ static int ir_startup (struct usb_serial *serial)
case 0x20: ir_add_bof = 2; break; case 0x20: ir_add_bof = 2; break;
case 0x40: ir_add_bof = 1; break; case 0x40: ir_add_bof = 1; break;
case 0x80: ir_add_bof = 0; break; case 0x80: ir_add_bof = 0; break;
default: default:;
} }
kfree (irda_desc); kfree (irda_desc);
......
...@@ -1363,8 +1363,6 @@ static int keyspan_usa28_calc_baud(u32 baud_rate, u32 baudclk, u8 *rate_hi, ...@@ -1363,8 +1363,6 @@ static int keyspan_usa28_calc_baud(u32 baud_rate, u32 baudclk, u8 *rate_hi,
return (KEYSPAN_BAUD_RATE_OK); return (KEYSPAN_BAUD_RATE_OK);
} }
static int keyspan_usa26_send_setup(struct usb_serial *serial, static int keyspan_usa26_send_setup(struct usb_serial *serial,
struct usb_serial_port *port, struct usb_serial_port *port,
int reset_port) int reset_port)
......
...@@ -521,6 +521,7 @@ static struct usb_serial_device_type keyspan_2port_device = { ...@@ -521,6 +521,7 @@ static struct usb_serial_device_type keyspan_2port_device = {
unthrottle: keyspan_rx_unthrottle, unthrottle: keyspan_rx_unthrottle,
ioctl: keyspan_ioctl, ioctl: keyspan_ioctl,
set_termios: keyspan_set_termios, set_termios: keyspan_set_termios,
break_ctl: keyspan_break_ctl,
attach: keyspan_startup, attach: keyspan_startup,
shutdown: keyspan_shutdown, shutdown: keyspan_shutdown,
}; };
......
...@@ -679,11 +679,11 @@ static int keyspan_pda_open (struct usb_serial_port *port, struct file *filp) ...@@ -679,11 +679,11 @@ static int keyspan_pda_open (struct usb_serial_port *port, struct file *filp)
1, 1,
2*HZ); 2*HZ);
if (rc < 0) { if (rc < 0) {
dbg(__FUNCTION__" - roomquery failed"); dbg("%s - roomquery failed", __FUNCTION__);
goto error; goto error;
} }
if (rc == 0) { if (rc == 0) {
dbg(__FUNCTION__" - roomquery returned 0 bytes"); dbg("%s - roomquery returned 0 bytes", __FUNCTION__);
rc = -EIO; rc = -EIO;
goto error; goto error;
} }
...@@ -702,7 +702,7 @@ static int keyspan_pda_open (struct usb_serial_port *port, struct file *filp) ...@@ -702,7 +702,7 @@ static int keyspan_pda_open (struct usb_serial_port *port, struct file *filp)
port->interrupt_in_urb->dev = serial->dev; port->interrupt_in_urb->dev = serial->dev;
rc = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); rc = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
if (rc) { if (rc) {
dbg(__FUNCTION__" - usb_submit_urb(read int) failed"); dbg("%s - usb_submit_urb(read int) failed", __FUNCTION__);
goto error; goto error;
} }
...@@ -746,7 +746,7 @@ static int keyspan_pda_fake_startup (struct usb_serial *serial) ...@@ -746,7 +746,7 @@ static int keyspan_pda_fake_startup (struct usb_serial *serial)
record = &xircom_pgs_firmware[0]; record = &xircom_pgs_firmware[0];
#endif #endif
if (record == NULL) { if (record == NULL) {
err(__FUNCTION__": unknown vendor, aborting."); err("%s: unknown vendor, aborting.", __FUNCTION__);
return -ENODEV; return -ENODEV;
} }
...@@ -797,7 +797,7 @@ static int keyspan_pda_startup (struct usb_serial *serial) ...@@ -797,7 +797,7 @@ static int keyspan_pda_startup (struct usb_serial *serial)
static void keyspan_pda_shutdown (struct usb_serial *serial) static void keyspan_pda_shutdown (struct usb_serial *serial)
{ {
dbg (__FUNCTION__); dbg("%s", __FUNCTION__);
kfree(serial->port[0].private); kfree(serial->port[0].private);
} }
......
This diff is collapsed.
...@@ -317,7 +317,7 @@ static void mct_u232_shutdown (struct usb_serial *serial) ...@@ -317,7 +317,7 @@ static void mct_u232_shutdown (struct usb_serial *serial)
{ {
int i; int i;
dbg (__FUNCTION__); dbg("%s", __FUNCTION__);
/* stop reads and writes on all ports */ /* stop reads and writes on all ports */
for (i=0; i < serial->num_ports; ++i) { for (i=0; i < serial->num_ports; ++i) {
...@@ -333,7 +333,7 @@ static int mct_u232_open (struct usb_serial_port *port, struct file *filp) ...@@ -333,7 +333,7 @@ static int mct_u232_open (struct usb_serial_port *port, struct file *filp)
struct mct_u232_private *priv = (struct mct_u232_private *)port->private; struct mct_u232_private *priv = (struct mct_u232_private *)port->private;
int retval = 0; int retval = 0;
dbg(__FUNCTION__" port %d", port->number); dbg("%s port %d", __FUNCTION__, port->number);
/* Compensate for a hardware bug: although the Sitecom U232-P25 /* Compensate for a hardware bug: although the Sitecom U232-P25
* device reports a maximum output packet size of 32 bytes, * device reports a maximum output packet size of 32 bytes,
...@@ -391,7 +391,7 @@ static int mct_u232_open (struct usb_serial_port *port, struct file *filp) ...@@ -391,7 +391,7 @@ static int mct_u232_open (struct usb_serial_port *port, struct file *filp)
static void mct_u232_close (struct usb_serial_port *port, struct file *filp) static void mct_u232_close (struct usb_serial_port *port, struct file *filp)
{ {
dbg(__FUNCTION__" port %d", port->number); dbg("%s port %d", __FUNCTION__, port->number);
if (port->serial->dev) { if (port->serial->dev) {
/* shutdown our urbs */ /* shutdown our urbs */
...@@ -411,10 +411,10 @@ static int mct_u232_write (struct usb_serial_port *port, int from_user, ...@@ -411,10 +411,10 @@ static int mct_u232_write (struct usb_serial_port *port, int from_user,
struct usb_serial *serial = port->serial; struct usb_serial *serial = port->serial;
int result, bytes_sent, size; int result, bytes_sent, size;
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if (count == 0) { if (count == 0) {
dbg(__FUNCTION__ " - write request of 0 bytes"); dbg("%s - write request of 0 bytes", __FUNCTION__);
return (0); return (0);
} }
...@@ -424,7 +424,7 @@ static int mct_u232_write (struct usb_serial_port *port, int from_user, ...@@ -424,7 +424,7 @@ static int mct_u232_write (struct usb_serial_port *port, int from_user,
/* another write is still pending? */ /* another write is still pending? */
if (port->write_urb->status == -EINPROGRESS) { if (port->write_urb->status == -EINPROGRESS) {
dbg (__FUNCTION__ " - already writing"); dbg("%s - already writing", __FUNCTION__);
return (0); return (0);
} }
...@@ -456,8 +456,7 @@ static int mct_u232_write (struct usb_serial_port *port, int from_user, ...@@ -456,8 +456,7 @@ static int mct_u232_write (struct usb_serial_port *port, int from_user,
/* send the data out the bulk port */ /* send the data out the bulk port */
result = usb_submit_urb(port->write_urb, GFP_ATOMIC); result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
if (result) { if (result) {
err(__FUNCTION__ err("%s - failed submitting write urb, error %d", __FUNCTION__, result);
" - failed submitting write urb, error %d", result);
return result; return result;
} }
...@@ -480,15 +479,15 @@ static void mct_u232_write_bulk_callback (struct urb *urb) ...@@ -480,15 +479,15 @@ static void mct_u232_write_bulk_callback (struct urb *urb)
struct usb_serial *serial = port->serial; struct usb_serial *serial = port->serial;
struct tty_struct *tty = port->tty; struct tty_struct *tty = port->tty;
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if (!serial) { if (!serial) {
dbg(__FUNCTION__ " - bad serial pointer, exiting"); dbg("%s - bad serial pointer, exiting", __FUNCTION__);
return; return;
} }
if (urb->status) { if (urb->status) {
dbg(__FUNCTION__ " - nonzero write bulk status received: %d", dbg("%s - nonzero write bulk status received: %d", __FUNCTION__,
urb->status); urb->status);
return; return;
} }
...@@ -518,16 +517,16 @@ static void mct_u232_read_int_callback (struct urb *urb) ...@@ -518,16 +517,16 @@ static void mct_u232_read_int_callback (struct urb *urb)
struct tty_struct *tty; struct tty_struct *tty;
unsigned char *data = urb->transfer_buffer; unsigned char *data = urb->transfer_buffer;
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
/* The urb might have been killed. */ /* The urb might have been killed. */
if (urb->status) { if (urb->status) {
dbg(__FUNCTION__ " - nonzero read bulk status received: %d", dbg("%s - nonzero read bulk status received: %d", __FUNCTION__,
urb->status); urb->status);
return; return;
} }
if (!serial) { if (!serial) {
dbg(__FUNCTION__ " - bad serial pointer, exiting"); dbg("%s - bad serial pointer, exiting", __FUNCTION__);
return; return;
} }
...@@ -604,7 +603,7 @@ static void mct_u232_set_termios (struct usb_serial_port *port, ...@@ -604,7 +603,7 @@ static void mct_u232_set_termios (struct usb_serial_port *port,
if( (cflag & CBAUD) != (old_cflag & CBAUD) ) { if( (cflag & CBAUD) != (old_cflag & CBAUD) ) {
/* reassert DTR and (maybe) RTS on transition from B0 */ /* reassert DTR and (maybe) RTS on transition from B0 */
if( (old_cflag & CBAUD) == B0 ) { if( (old_cflag & CBAUD) == B0 ) {
dbg(__FUNCTION__ ": baud was B0"); dbg("%s: baud was B0", __FUNCTION__);
priv->control_state |= TIOCM_DTR; priv->control_state |= TIOCM_DTR;
/* don't set RTS if using hardware flow control */ /* don't set RTS if using hardware flow control */
if (!(old_cflag & CRTSCTS)) { if (!(old_cflag & CRTSCTS)) {
...@@ -640,7 +639,7 @@ static void mct_u232_set_termios (struct usb_serial_port *port, ...@@ -640,7 +639,7 @@ static void mct_u232_set_termios (struct usb_serial_port *port,
mct_u232_set_baud_rate(serial, 9600); break; mct_u232_set_baud_rate(serial, 9600); break;
} }
if ((cflag & CBAUD) == B0 ) { if ((cflag & CBAUD) == B0 ) {
dbg(__FUNCTION__ ": baud is B0"); dbg("%s: baud is B0", __FUNCTION__);
/* Drop RTS and DTR */ /* Drop RTS and DTR */
priv->control_state &= ~(TIOCM_DTR | TIOCM_RTS); priv->control_state &= ~(TIOCM_DTR | TIOCM_RTS);
mct_u232_set_modem_ctrl(serial, priv->control_state); mct_u232_set_modem_ctrl(serial, priv->control_state);
...@@ -711,7 +710,7 @@ static void mct_u232_break_ctl( struct usb_serial_port *port, int break_state ) ...@@ -711,7 +710,7 @@ static void mct_u232_break_ctl( struct usb_serial_port *port, int break_state )
struct mct_u232_private *priv = (struct mct_u232_private *)port->private; struct mct_u232_private *priv = (struct mct_u232_private *)port->private;
unsigned char lcr = priv->last_lcr; unsigned char lcr = priv->last_lcr;
dbg (__FUNCTION__ "state=%d", break_state); dbg("%sstate=%d", __FUNCTION__, break_state);
if (break_state) if (break_state)
lcr |= MCT_U232_SET_BREAK; lcr |= MCT_U232_SET_BREAK;
...@@ -727,7 +726,7 @@ static int mct_u232_ioctl (struct usb_serial_port *port, struct file * file, ...@@ -727,7 +726,7 @@ static int mct_u232_ioctl (struct usb_serial_port *port, struct file * file,
struct mct_u232_private *priv = (struct mct_u232_private *)port->private; struct mct_u232_private *priv = (struct mct_u232_private *)port->private;
int mask; int mask;
dbg (__FUNCTION__ "cmd=0x%x", cmd); dbg("%scmd=0x%x", __FUNCTION__, cmd);
/* Based on code from acm.c and others */ /* Based on code from acm.c and others */
switch (cmd) { switch (cmd) {
...@@ -772,7 +771,7 @@ static int mct_u232_ioctl (struct usb_serial_port *port, struct file * file, ...@@ -772,7 +771,7 @@ static int mct_u232_ioctl (struct usb_serial_port *port, struct file * file,
return 0; return 0;
default: default:
dbg(__FUNCTION__ ": arg not supported - 0x%04x",cmd); dbg("%s: arg not supported - 0x%04x", __FUNCTION__,cmd);
return(-ENOIOCTLCMD); return(-ENOIOCTLCMD);
break; break;
} }
......
...@@ -148,7 +148,7 @@ static int omninet_open (struct usb_serial_port *port, struct file *filp) ...@@ -148,7 +148,7 @@ static int omninet_open (struct usb_serial_port *port, struct file *filp)
if (port_paranoia_check (port, __FUNCTION__)) if (port_paranoia_check (port, __FUNCTION__))
return -ENODEV; return -ENODEV;
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
serial = get_usb_serial (port, __FUNCTION__); serial = get_usb_serial (port, __FUNCTION__);
if (!serial) if (!serial)
...@@ -156,7 +156,7 @@ static int omninet_open (struct usb_serial_port *port, struct file *filp) ...@@ -156,7 +156,7 @@ static int omninet_open (struct usb_serial_port *port, struct file *filp)
od = kmalloc( sizeof(struct omninet_data), GFP_KERNEL ); od = kmalloc( sizeof(struct omninet_data), GFP_KERNEL );
if( !od ) { if( !od ) {
err(__FUNCTION__"- kmalloc(%Zd) failed.", sizeof(struct omninet_data)); err("%s- kmalloc(%Zd) failed.", __FUNCTION__, sizeof(struct omninet_data));
return -ENOMEM; return -ENOMEM;
} }
...@@ -171,7 +171,7 @@ static int omninet_open (struct usb_serial_port *port, struct file *filp) ...@@ -171,7 +171,7 @@ static int omninet_open (struct usb_serial_port *port, struct file *filp)
omninet_read_bulk_callback, port); omninet_read_bulk_callback, port);
result = usb_submit_urb(port->read_urb, GFP_KERNEL); result = usb_submit_urb(port->read_urb, GFP_KERNEL);
if (result) if (result)
err(__FUNCTION__ " - failed submitting read urb, error %d", result); err("%s - failed submitting read urb, error %d", __FUNCTION__, result);
return result; return result;
} }
...@@ -185,7 +185,7 @@ static void omninet_close (struct usb_serial_port *port, struct file * filp) ...@@ -185,7 +185,7 @@ static void omninet_close (struct usb_serial_port *port, struct file * filp)
if (port_paranoia_check (port, __FUNCTION__)) if (port_paranoia_check (port, __FUNCTION__))
return; return;
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
serial = get_usb_serial (port, __FUNCTION__); serial = get_usb_serial (port, __FUNCTION__);
if (!serial) if (!serial)
...@@ -221,12 +221,12 @@ static void omninet_read_bulk_callback (struct urb *urb) ...@@ -221,12 +221,12 @@ static void omninet_read_bulk_callback (struct urb *urb)
// dbg("omninet_read_bulk_callback"); // dbg("omninet_read_bulk_callback");
if (!serial) { if (!serial) {
dbg(__FUNCTION__ " - bad serial pointer, exiting"); dbg("%s - bad serial pointer, exiting", __FUNCTION__);
return; return;
} }
if (urb->status) { if (urb->status) {
dbg(__FUNCTION__ " - nonzero read bulk status received: %d", urb->status); dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, urb->status);
return; return;
} }
...@@ -254,7 +254,7 @@ static void omninet_read_bulk_callback (struct urb *urb) ...@@ -254,7 +254,7 @@ static void omninet_read_bulk_callback (struct urb *urb)
omninet_read_bulk_callback, port); omninet_read_bulk_callback, port);
result = usb_submit_urb(urb, GFP_ATOMIC); result = usb_submit_urb(urb, GFP_ATOMIC);
if (result) if (result)
err(__FUNCTION__ " - failed resubmitting read urb, error %d", result); err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result);
return; return;
} }
...@@ -272,11 +272,11 @@ static int omninet_write (struct usb_serial_port *port, int from_user, const uns ...@@ -272,11 +272,11 @@ static int omninet_write (struct usb_serial_port *port, int from_user, const uns
// dbg("omninet_write port %d", port->number); // dbg("omninet_write port %d", port->number);
if (count == 0) { if (count == 0) {
dbg(__FUNCTION__" - write request of 0 bytes"); dbg("%s - write request of 0 bytes", __FUNCTION__);
return (0); return (0);
} }
if (wport->write_urb->status == -EINPROGRESS) { if (wport->write_urb->status == -EINPROGRESS) {
dbg (__FUNCTION__" - already writing"); dbg("%s - already writing", __FUNCTION__);
return (0); return (0);
} }
...@@ -305,7 +305,7 @@ static int omninet_write (struct usb_serial_port *port, int from_user, const uns ...@@ -305,7 +305,7 @@ static int omninet_write (struct usb_serial_port *port, int from_user, const uns
wport->write_urb->dev = serial->dev; wport->write_urb->dev = serial->dev;
result = usb_submit_urb(wport->write_urb, GFP_ATOMIC); result = usb_submit_urb(wport->write_urb, GFP_ATOMIC);
if (result) if (result)
err(__FUNCTION__ " - failed submitting write urb, error %d", result); err("%s - failed submitting write urb, error %d", __FUNCTION__, result);
else else
result = count; result = count;
...@@ -348,7 +348,7 @@ static void omninet_write_bulk_callback (struct urb *urb) ...@@ -348,7 +348,7 @@ static void omninet_write_bulk_callback (struct urb *urb)
} }
if (urb->status) { if (urb->status) {
dbg(__FUNCTION__" - nonzero write bulk status received: %d", urb->status); dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status);
return; return;
} }
...@@ -363,7 +363,7 @@ static void omninet_write_bulk_callback (struct urb *urb) ...@@ -363,7 +363,7 @@ static void omninet_write_bulk_callback (struct urb *urb)
static void omninet_shutdown (struct usb_serial *serial) static void omninet_shutdown (struct usb_serial *serial)
{ {
dbg (__FUNCTION__); dbg ("%s", __FUNCTION__);
} }
......
This diff is collapsed.
...@@ -22,3 +22,6 @@ ...@@ -22,3 +22,6 @@
#define ITEGNO_VENDOR_ID 0x0eba #define ITEGNO_VENDOR_ID 0x0eba
#define ITEGNO_PRODUCT_ID 0x1080 #define ITEGNO_PRODUCT_ID 0x1080
#define MA620_VENDOR_ID 0x0df7
#define MA620_PRODUCT_ID 0x0620
...@@ -211,12 +211,12 @@ static void safe_read_bulk_callback (struct urb *urb) ...@@ -211,12 +211,12 @@ static void safe_read_bulk_callback (struct urb *urb)
dbg ("%s", __FUNCTION__); dbg ("%s", __FUNCTION__);
if (!serial) { if (!serial) {
dbg (__FUNCTION__ " - bad serial pointer, exiting"); dbg ("%s - bad serial pointer, exiting", __FUNCTION__);
return; return;
} }
if (urb->status) { if (urb->status) {
dbg (__FUNCTION__ " - nonzero read bulk status received: %d", urb->status); dbg ("%s - nonzero read bulk status received: %d", __FUNCTION__, urb->status);
return; return;
} }
...@@ -242,18 +242,18 @@ static void safe_read_bulk_callback (struct urb *urb) ...@@ -242,18 +242,18 @@ static void safe_read_bulk_callback (struct urb *urb)
if (actual_length <= (length - 2)) { if (actual_length <= (length - 2)) {
info (__FUNCTION__ " - actual: %d", actual_length); info ("%s - actual: %d", __FUNCTION__, actual_length);
for (i = 0; i < actual_length; i++) { for (i = 0; i < actual_length; i++) {
tty_insert_flip_char (port->tty, data[i], 0); tty_insert_flip_char (port->tty, data[i], 0);
} }
tty_flip_buffer_push (port->tty); tty_flip_buffer_push (port->tty);
} else { } else {
err (__FUNCTION__ " - inconsistant lengths %d:%d", actual_length, err ("%s - inconsistant lengths %d:%d", __FUNCTION__,
length); actual_length, length);
} }
} else { } else {
err (__FUNCTION__ " - bad CRC %x", fcs); err ("%s - bad CRC %x", __FUNCTION__, fcs);
} }
} else { } else {
for (i = 0; i < length; i++) { for (i = 0; i < length; i++) {
...@@ -269,7 +269,7 @@ static void safe_read_bulk_callback (struct urb *urb) ...@@ -269,7 +269,7 @@ static void safe_read_bulk_callback (struct urb *urb)
safe_read_bulk_callback, port); safe_read_bulk_callback, port);
if ((result = usb_submit_urb (urb, GFP_ATOMIC))) { if ((result = usb_submit_urb (urb, GFP_ATOMIC))) {
err (__FUNCTION__ " - failed resubmitting read urb, error %d", result); err ("%s - failed resubmitting read urb, error %d", __FUNCTION__, result);
} }
} }
...@@ -285,7 +285,7 @@ static int safe_write (struct usb_serial_port *port, int from_user, const unsign ...@@ -285,7 +285,7 @@ static int safe_write (struct usb_serial_port *port, int from_user, const unsign
count); count);
if (!port->write_urb) { if (!port->write_urb) {
dbg (__FUNCTION__ " - write urb NULL"); dbg ("%s - write urb NULL", __FUNCTION__);
return (0); return (0);
} }
...@@ -293,15 +293,15 @@ static int safe_write (struct usb_serial_port *port, int from_user, const unsign ...@@ -293,15 +293,15 @@ static int safe_write (struct usb_serial_port *port, int from_user, const unsign
port->write_urb->transfer_buffer_length); port->write_urb->transfer_buffer_length);
if (!port->write_urb->transfer_buffer_length) { if (!port->write_urb->transfer_buffer_length) {
dbg (__FUNCTION__ " - write urb transfer_buffer_length zero"); dbg ("%s - write urb transfer_buffer_length zero", __FUNCTION__);
return (0); return (0);
} }
if (count == 0) { if (count == 0) {
dbg (__FUNCTION__ " - write request of 0 bytes"); dbg ("%s - write request of 0 bytes", __FUNCTION__);
return (0); return (0);
} }
if (port->write_urb->status == -EINPROGRESS) { if (port->write_urb->status == -EINPROGRESS) {
dbg (__FUNCTION__ " - already writing"); dbg ("%s - already writing", __FUNCTION__);
return (0); return (0);
} }
...@@ -360,10 +360,10 @@ static int safe_write (struct usb_serial_port *port, int from_user, const unsign ...@@ -360,10 +360,10 @@ static int safe_write (struct usb_serial_port *port, int from_user, const unsign
#endif #endif
port->write_urb->dev = serial->dev; port->write_urb->dev = serial->dev;
if ((result = usb_submit_urb (port->write_urb, GFP_KERNEL))) { if ((result = usb_submit_urb (port->write_urb, GFP_KERNEL))) {
err (__FUNCTION__ " - failed submitting write urb, error %d", result); err ("%s - failed submitting write urb, error %d", __FUNCTION__, result);
return 0; return 0;
} }
dbg (__FUNCTION__ " urb: %p submitted", port->write_urb); dbg ("%s urb: %p submitted", __FUNCTION__, port->write_urb);
return (count); return (count);
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -37,11 +37,12 @@ enum { ...@@ -37,11 +37,12 @@ enum {
IPPROTO_IPV6 = 41, /* IPv6-in-IPv4 tunnelling */ IPPROTO_IPV6 = 41, /* IPv6-in-IPv4 tunnelling */
IPPROTO_PIM = 103, /* Protocol Independent Multicast */
IPPROTO_ESP = 50, /* Encapsulation Security Payload protocol */ IPPROTO_ESP = 50, /* Encapsulation Security Payload protocol */
IPPROTO_AH = 51, /* Authentication Header protocol */ IPPROTO_AH = 51, /* Authentication Header protocol */
IPPROTO_PIM = 103, /* Protocol Independent Multicast */
IPPROTO_COMP = 108, /* Compression Header protocol */ IPPROTO_COMP = 108, /* Compression Header protocol */
IPPROTO_SCTP = 132, /* Stream Control Transport Protocol */
IPPROTO_RAW = 255, /* Raw IP packets */ IPPROTO_RAW = 255, /* Raw IP packets */
IPPROTO_MAX IPPROTO_MAX
......
...@@ -137,6 +137,7 @@ extern int sock_sendmsg(struct socket *, struct msghdr *m, int len); ...@@ -137,6 +137,7 @@ extern int sock_sendmsg(struct socket *, struct msghdr *m, int len);
extern int sock_recvmsg(struct socket *, struct msghdr *m, int len, int flags); extern int sock_recvmsg(struct socket *, struct msghdr *m, int len, int flags);
extern int sock_readv_writev(int type, struct inode * inode, struct file * file, extern int sock_readv_writev(int type, struct inode * inode, struct file * file,
const struct iovec * iov, long count, long size); const struct iovec * iov, long count, long size);
extern int sock_map_fd(struct socket *sock);
extern int net_ratelimit(void); extern int net_ratelimit(void);
extern unsigned long net_random(void); extern unsigned long net_random(void);
......
...@@ -365,6 +365,7 @@ struct net_device ...@@ -365,6 +365,7 @@ struct net_device
#define NETIF_F_HW_VLAN_RX 256 /* Receive VLAN hw acceleration */ #define NETIF_F_HW_VLAN_RX 256 /* Receive VLAN hw acceleration */
#define NETIF_F_HW_VLAN_FILTER 512 /* Receive filtering on VLAN */ #define NETIF_F_HW_VLAN_FILTER 512 /* Receive filtering on VLAN */
#define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */ #define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */
#define NETIF_F_TSO 2048 /* Can offload TCP/IP segmentation */
/* Called after device is detached from network. */ /* Called after device is detached from network. */
void (*uninit)(struct net_device *dev); void (*uninit)(struct net_device *dev);
......
This diff is collapsed.
...@@ -109,7 +109,8 @@ struct sk_buff_head { ...@@ -109,7 +109,8 @@ struct sk_buff_head {
struct sk_buff; struct sk_buff;
#define MAX_SKB_FRAGS 6 /* To allow 64K frame to be packed as single skb without frag_list */
#define MAX_SKB_FRAGS (65536/PAGE_SIZE + 2)
typedef struct skb_frag_struct skb_frag_t; typedef struct skb_frag_struct skb_frag_t;
...@@ -125,6 +126,8 @@ struct skb_frag_struct { ...@@ -125,6 +126,8 @@ struct skb_frag_struct {
struct skb_shared_info { struct skb_shared_info {
atomic_t dataref; atomic_t dataref;
unsigned int nr_frags; unsigned int nr_frags;
unsigned short tso_size;
unsigned short tso_segs;
struct sk_buff *frag_list; struct sk_buff *frag_list;
skb_frag_t frags[MAX_SKB_FRAGS]; skb_frag_t frags[MAX_SKB_FRAGS];
}; };
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment