Commit f647e3df authored by Andy Grover's avatar Andy Grover

Merge groveronline.com:/root/bk/linux-2.5

into groveronline.com:/root/bk/linux-acpi
parents d08b4405 cea2e2d2
26-Apr-2002
23-Aug-2002
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
......@@ -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
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 for some time (working
While usb-storage devices have been available since mid-2001 (working
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
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.
It's believed to do all the right PCI magic so that I/O works even on
systems with interesting DMA mapping issues.
At this writing the driver should comfortably handle all control and bulk
transfers, including requests to USB 1.1 devices through transaction
translators (TTs) in USB 2.0 hubs. However, there some situations where
the hub driver needs to clear TT error state, which it doesn't yet do.
At this writing the driver should comfortably handle all control, bulk,
and interrupt transfers, including requests to USB 1.1 devices through
transaction translators (TTs) in USB 2.0 hubs.
Interrupt transfer support is newly functional and not yet as robust as
control and bulk traffic. As yet there is no support for split transaction
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.
High Speed Isochronous (ISO) transfer support is also functional, but
at this writing no Linux drivers have been using that support.
Isochronous (ISO) transfer support is also newly functional. No production
high speed devices are available which would need it (though high quality
webcams are in the works!). Note that split transaction support for ISO
Full Speed Isochronous transfer support, through transaction translators,
is not yet available. Note that split transaction support for ISO
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,
most USB audio and video devices have the same restrictions as hubs, mice,
and keyboards: don't connect them using high speed USB hubs.
most USB audio and video devices can't be connected to high speed buses.
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
drivers; a OHCI or UHCI driver that works already doesn't need to change
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
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
......@@ -83,10 +91,10 @@ and remove it by:
# rmmod ehci-hcd
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
with the EHCI driver, remove its module and then the driver for that
companion controller will take over (at lower speed) all the devices
that were previously handled by the EHCI driver.
"ohci-hcd" or "uhci-hcd". In case of any trouble with the EHCI driver,
remove its module and then the driver for that companion controller will
take over (at lower speed) all the devices that were previously handled
by the EHCI driver.
Module parameters (pass to "modprobe") include:
......@@ -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
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
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;
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
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
......@@ -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
microframe rather than thirteen. (Seems like a reasonable trade off
for a product that beat all the others to market by over a year!)
It's expected that newer implementations will better this, throwing
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
to receive interrupts from the EHCI controller indicating completion
......
23-Aug-2002
The "ohci-hcd" driver is a USB Host Controller Driver (HCD) that is derived
from the "usb-ohci" driver from the 2.4 kernel series. The "usb-ohci" code
was written primarily by Roman Weissgaerber <weissg@vienna.at> but with
contributions from many others (read its copyright/licencing header).
It supports the "Open Host Controller Interface" (OHCI), which standardizes
hardware register protocols used to talk to USB 1.1 host controllers. As
compared to the earlier "Universal Host Controller Interface" (UHCI) from
Intel, it pushes more intelligence into the hardware. USB 1.1 controllers
from vendors other than Intel and VIA generally use OHCI.
Changes since the 2.4 kernel include
- improved robustness; bugfixes; and less overhead
- supports the updated and simplified usbcore APIs
- interrupt transfers can be larger, and can be queued
- less code, by using the upper level "hcd" framework
- supports some non-PCI implementations of OHCI
- ... more
The "ohci-hcd" driver handles all USB 1.1 transfer types. Transfers of all
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
to overhead in IRQ processing. When interrupt transfers are queued, those
risks can be minimized by making sure the hardware always has transfers to
work on while the OS is getting around to the relevant IRQ processing.
- David Brownell
<dbrownell@users.sourceforge.net>
The OHCI HCD layer is a simple but nearly complete implementation of what the
USB people would call a HCD for the OHCI.
(ISO coming soon, Bulk, INT u. CTRL transfers enabled)
It is based on Linus Torvalds UHCI code and Gregory Smith OHCI fragments (0.03 source tree).
The layer (functions) on top of it, is for interfacing to the alternate-usb device-drivers.
- Roman Weissgaerber <weissg@vienna.at>
* v4.0 1999/08/18 removed all dummy eds, unlink unused eds, code cleanup, bulk transfers
* v2.1 1999/05/09 ep_addr correction, code cleanup
* v0.2.0 1999/05/04
* everything has been moved into 2 files (ohci-hcd.c, ohci-hub-root.c and headers)
* virtual root hub is now an option,
* memory allocation based on kmalloc and kfree now, simple Bus error handling,
* INT and CTRL transfers enabled, Bulk included but disabled, ISO needs completion
*
* from Linus Torvalds (uhci.c): APM (not tested); hub, usb_device, bus and related stuff
* from Greg Smith (ohci.c): better reset ohci-controller handling, hub
*
* v0.1.0 1999/04/27 initial release
to remove the module try:
rmmod usb-ohci
Features:
- virtual root hub, all basic hub descriptors and commands (state: complete)
this is an option now (v0.2.0)
#define CONFIG_USB_OHCI_VROOTHUB includes the virtual hub code, (VROOTHUB)
default is with.
(at the moment: the Virtual Root Hub is included automatically)
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))
......@@ -165,7 +165,7 @@
#define pte_unmap(pte)
#endif
#if LINUX_VERSION_CODE < 0x020500
#if LINUX_VERSION_CODE < 0x020413 /* KERNEL_VERSION(2,4,19) */
static inline struct page * vmalloc_to_page(void * vmalloc_addr)
{
unsigned long addr = (unsigned long) vmalloc_addr;
......
......@@ -268,11 +268,11 @@ drm_agp_head_t *DRM(agp_init)(void)
case INTEL_I810: head->chipset = "Intel i810"; break;
case INTEL_I815: head->chipset = "Intel i815"; break;
#if LINUX_VERSION_CODE >= 0x020415
#if LINUX_VERSION_CODE >= 0x02040f /* KERNEL_VERSION(2,4,15) */
case INTEL_I820: head->chipset = "Intel i820"; break;
#endif
case INTEL_I840: head->chipset = "Intel i840"; break;
#if LINUX_VERSION_CODE >= 0x020415
#if LINUX_VERSION_CODE >= 0x02040f /* KERNEL_VERSION(2,4,15) */
case INTEL_I845: head->chipset = "Intel i845"; break;
#endif
case INTEL_I850: head->chipset = "Intel i850"; break;
......
......@@ -115,15 +115,15 @@
#ifndef DRIVER_FOPS
#define DRIVER_FOPS \
static struct file_operations DRM(fops) = { \
owner: THIS_MODULE, \
open: DRM(open), \
flush: DRM(flush), \
release: DRM(release), \
ioctl: DRM(ioctl), \
mmap: DRM(mmap), \
read: DRM(read), \
fasync: DRM(fasync), \
poll: DRM(poll), \
.owner = THIS_MODULE, \
.open = DRM(open), \
.flush = DRM(flush), \
.release = DRM(release), \
.ioctl = DRM(ioctl), \
.mmap = DRM(mmap), \
.read = DRM(read), \
.fasync = DRM(fasync), \
.poll = DRM(poll), \
}
#endif
......
......@@ -66,8 +66,8 @@ static int DRM(stub_open)(struct inode *inode, struct file *filp)
}
static struct file_operations DRM(stub_fops) = {
owner: THIS_MODULE,
open: DRM(stub_open)
.owner = THIS_MODULE,
.open = DRM(stub_open)
};
static int DRM(stub_getminor)(const char *name, struct file_operations *fops,
......
......@@ -33,27 +33,27 @@
#include "drmP.h"
struct vm_operations_struct DRM(vm_ops) = {
nopage: DRM(vm_nopage),
open: DRM(vm_open),
close: DRM(vm_close),
.nopage = DRM(vm_nopage),
.open = DRM(vm_open),
.close = DRM(vm_close),
};
struct vm_operations_struct DRM(vm_shm_ops) = {
nopage: DRM(vm_shm_nopage),
open: DRM(vm_open),
close: DRM(vm_shm_close),
.nopage = DRM(vm_shm_nopage),
.open = DRM(vm_open),
.close = DRM(vm_shm_close),
};
struct vm_operations_struct DRM(vm_dma_ops) = {
nopage: DRM(vm_dma_nopage),
open: DRM(vm_open),
close: DRM(vm_close),
.nopage = DRM(vm_dma_nopage),
.open = DRM(vm_open),
.close = DRM(vm_close),
};
struct vm_operations_struct DRM(vm_sg_ops) = {
nopage: DRM(vm_sg_nopage),
open: DRM(vm_open),
close: DRM(vm_close),
.nopage = DRM(vm_sg_nopage),
.open = DRM(vm_open),
.close = DRM(vm_close),
};
struct page *DRM(vm_nopage)(struct vm_area_struct *vma,
......@@ -343,7 +343,7 @@ int DRM(mmap_dma)(struct file *filp, struct vm_area_struct *vma)
vma->vm_ops = &DRM(vm_dma_ops);
#if LINUX_VERSION_CODE <= 0x020414
#if LINUX_VERSION_CODE <= 0x02040e /* KERNEL_VERSION(2,4,14) */
vma->vm_flags |= VM_LOCKED | VM_SHM; /* Don't swap */
#else
vma->vm_flags |= VM_RESERVED; /* Don't swap */
......@@ -473,7 +473,7 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma)
vma->vm_private_data = (void *)map;
/* Don't let this area swap. Change when
DRM_KERNEL advisory is supported. */
#if LINUX_VERSION_CODE <= 0x020414
#if LINUX_VERSION_CODE <= 0x02040e /* KERNEL_VERSION(2,4,14) */
vma->vm_flags |= VM_LOCKED;
#else
vma->vm_flags |= VM_RESERVED;
......@@ -482,7 +482,7 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma)
case _DRM_SCATTER_GATHER:
vma->vm_ops = &DRM(vm_sg_ops);
vma->vm_private_data = (void *)map;
#if LINUX_VERSION_CODE <= 0x020414
#if LINUX_VERSION_CODE <= 0x02040e /* KERNEL_VERSION(2,4,14) */
vma->vm_flags |= VM_LOCKED;
#else
vma->vm_flags |= VM_RESERVED;
......@@ -491,7 +491,7 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma)
default:
return -EINVAL; /* This should never happen. */
}
#if LINUX_VERSION_CODE <= 0x020414
#if LINUX_VERSION_CODE <= 0x02040e /* KERNEL_VERSION(2,4,14) */
vma->vm_flags |= VM_LOCKED | VM_SHM; /* Don't swap */
#else
vma->vm_flags |= VM_RESERVED; /* Don't swap */
......
......@@ -131,14 +131,14 @@ static int i810_freelist_put(drm_device_t *dev, drm_buf_t *buf)
}
static struct file_operations i810_buffer_fops = {
open: DRM(open),
flush: DRM(flush),
release: DRM(release),
ioctl: DRM(ioctl),
mmap: i810_mmap_buffers,
read: DRM(read),
fasync: DRM(fasync),
poll: DRM(poll),
.open = DRM(open),
.flush = DRM(flush),
.release = DRM(release),
.ioctl = DRM(ioctl),
.mmap = i810_mmap_buffers,
.read = DRM(read),
.fasync = DRM(fasync),
.poll = DRM(poll),
};
int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
......@@ -272,12 +272,16 @@ static unsigned long i810_alloc_page(drm_device_t *dev)
if(address == 0UL)
return 0;
#if LINUX_VERSION_CODE < 0x020500
#if LINUX_VERSION_CODE < 0x020409
atomic_inc(&virt_to_page(address)->count);
set_bit(PG_locked, &virt_to_page(address)->flags);
#else
get_page(virt_to_page(address));
#if LINUX_VERSION_CODE < 0x020500
LockPage(virt_to_page(address));
#else
SetPageLocked(virt_to_page(address));
#endif
#endif
return address;
}
......@@ -285,7 +289,7 @@ static unsigned long i810_alloc_page(drm_device_t *dev)
static void i810_free_page(drm_device_t *dev, unsigned long page)
{
if (page) {
#if LINUX_VERSION_CODE < 0x020500
#if LINUX_VERSION_CODE < 0x020409
atomic_dec(&virt_to_page(page)->count);
clear_bit(PG_locked, &virt_to_page(page)->flags);
wake_up(&virt_to_page(page)->wait);
......@@ -339,8 +343,6 @@ static int i810_wait_ring(drm_device_t *dev, int n)
end = jiffies + (HZ*3);
while (ring->space < n) {
int i;
ring->head = I810_READ(LP_RING + RING_HEAD) & HEAD_ADDR;
ring->space = ring->head - (ring->tail+8);
if (ring->space < 0) ring->space += ring->Size;
......
......@@ -153,14 +153,14 @@ static int i830_freelist_put(drm_device_t *dev, drm_buf_t *buf)
}
static struct file_operations i830_buffer_fops = {
open: DRM(open),
flush: DRM(flush),
release: DRM(release),
ioctl: DRM(ioctl),
mmap: i830_mmap_buffers,
read: DRM(read),
fasync: DRM(fasync),
poll: DRM(poll),
.open = DRM(open),
.flush = DRM(flush),
.release = DRM(release),
.ioctl = DRM(ioctl),
.mmap = i830_mmap_buffers,
.read = DRM(read),
.fasync = DRM(fasync),
.poll = DRM(poll),
};
int i830_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
......@@ -303,12 +303,16 @@ static unsigned long i830_alloc_page(drm_device_t *dev)
if(address == 0UL)
return 0;
#if LINUX_VERSION_CODE < 0x020500
#if LINUX_VERSION_CODE < 0x020409
atomic_inc(&virt_to_page(address)->count);
set_bit(PG_locked, &virt_to_page(address)->flags);
#else
get_page(virt_to_page(address));
#if LINUX_VERSION_CODE < 0x020500
LockPage(virt_to_page(address));
#else
SetPageLocked(virt_to_page(address));
#endif
#endif
return address;
}
......@@ -316,7 +320,7 @@ static unsigned long i830_alloc_page(drm_device_t *dev)
static void i830_free_page(drm_device_t *dev, unsigned long page)
{
if (page) {
#if LINUX_VERSION_CODE < 0x020500
#if LINUX_VERSION_CODE < 0x020409
atomic_dec(&virt_to_page(page)->count);
clear_bit(PG_locked, &virt_to_page(page)->flags);
wake_up(&virt_to_page(page)->wait);
......
......@@ -38,7 +38,7 @@ typedef struct drm_mga_primary_buffer {
u32 tail;
int space;
int wrapped;
volatile long wrapped;
volatile u32 *status;
......
......@@ -51,7 +51,7 @@
#define DRIVER_DATE "20020611"
#define DRIVER_MAJOR 1
#define DRIVER_MINOR 4
#define DRIVER_MINOR 5
#define DRIVER_PATCHLEVEL 0
/* Interface history:
......@@ -64,9 +64,10 @@
* - Add support for new radeon packets (keith)
* - Add getparam ioctl (keith)
* - Add flip-buffers ioctl, deprecate fullscreen foo (keith).
* 1.4 - Add r200 packets to cmdbuf ioctl
* 1.4 - Add scratch registers to get_param ioctl.
* 1.5 - Add r200 packets to cmdbuf ioctl
* - Add r200 function to init ioctl
* - Add 'scalar2' hack to cmdbuf ioctl (must die)
* - Add 'scalar2' instruction to cmdbuf
*/
#define DRIVER_IOCTLS \
[DRM_IOCTL_NR(DRM_IOCTL_DMA)] = { radeon_cp_buffers, 1, 0 }, \
......
......@@ -925,6 +925,24 @@ static void radeon_cp_init_ring_buffer( drm_device_t *dev,
RADEON_WRITE( RADEON_SCRATCH_UMSK, 0x7 );
/* Writeback doesn't seem to work everywhere, test it first */
DRM_WRITE32( &dev_priv->scratch[1], 0 );
RADEON_WRITE( RADEON_SCRATCH_REG1, 0xdeadbeef );
for ( tmp = 0 ; tmp < dev_priv->usec_timeout ; tmp++ ) {
if ( DRM_READ32( &dev_priv->scratch[1] ) == 0xdeadbeef )
break;
DRM_UDELAY( 1 );
}
if ( tmp < dev_priv->usec_timeout ) {
dev_priv->writeback_works = 1;
DRM_DEBUG( "writeback test succeeded, tmp=%d\n", tmp );
} else {
dev_priv->writeback_works = 0;
DRM_DEBUG( "writeback test failed\n" );
}
dev_priv->sarea_priv->last_frame = dev_priv->scratch[0] = 0;
RADEON_WRITE( RADEON_LAST_FRAME_REG,
dev_priv->sarea_priv->last_frame );
......@@ -1000,7 +1018,7 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init )
}
dev_priv->is_r200 = (init->func == RADEON_INIT_R200_CP);
dev_priv->do_boxes = 1;
dev_priv->do_boxes = 0;
dev_priv->cp_mode = init->cp_mode;
/* We don't support anything other than bus-mastering ring mode,
......@@ -1456,8 +1474,8 @@ drm_buf_t *radeon_freelist_get( drm_device_t *dev )
start = dev_priv->last_buf;
for ( t = 0 ; t < dev_priv->usec_timeout ; t++ ) {
u32 done_age = DRM_READ32(&dev_priv->scratch[1]);
u32 done_age = GET_SCRATCH( 1 );
DRM_DEBUG("done_age = %d\n",done_age);
for ( i = start ; i < dma->buf_count ; i++ ) {
buf = dma->buflist[i];
buf_priv = buf->dev_private;
......
......@@ -76,6 +76,7 @@ typedef struct drm_radeon_private {
drm_radeon_freelist_t *tail;
int last_buf;
volatile u32 *scratch;
int writeback_works;
int usec_timeout;
......@@ -233,6 +234,10 @@ extern int radeon_cp_flip( DRM_IOCTL_ARGS );
#define RADEON_SCRATCH_UMSK 0x0770
#define RADEON_SCRATCH_ADDR 0x0774
#define GET_SCRATCH( x ) (dev_priv->writeback_works \
? DRM_READ32( &dev_priv->scratch[(x)] ) \
: RADEON_READ( RADEON_SCRATCH_REG0 + 4*(x) ) )
#define RADEON_HOST_PATH_CNTL 0x0130
# define RADEON_HDP_SOFT_RESET (1 << 26)
# define RADEON_HDP_WC_TIMEOUT_MASK (7 << 28)
......
......@@ -50,8 +50,7 @@ static __inline__ void radeon_emit_clip_rect( drm_radeon_private_t *dev_priv,
OUT_RING( CP_PACKET0( RADEON_RE_TOP_LEFT, 0 ) );
OUT_RING( (box->y1 << 16) | box->x1 );
OUT_RING( CP_PACKET0( RADEON_RE_WIDTH_HEIGHT, 0 ) );
/* OUT_RING( ((box->y2 - 1) << 16) | (box->x2 - 1) );*/
OUT_RING( (box->y2 << 16) | box->x2 );
OUT_RING( ((box->y2 - 1) << 16) | (box->x2 - 1) );
ADVANCE_RING();
}
......@@ -412,7 +411,6 @@ static void radeon_cp_dispatch_clear( drm_device_t *dev,
RING_LOCALS;
DRM_DEBUG( "flags = 0x%x\n", flags );
dev_priv->stats.clears++;
if ( dev_priv->page_flipping && dev_priv->current_page == 1 ) {
......@@ -810,9 +808,6 @@ static void radeon_cp_dispatch_flip( drm_device_t *dev )
BEGIN_RING( 4 );
RADEON_WAIT_UNTIL_3D_IDLE();
/*
RADEON_WAIT_UNTIL_PAGE_FLIPPED();
*/
OUT_RING( CP_PACKET0( RADEON_CRTC_OFFSET, 0 ) );
if ( dev_priv->current_page == 0 ) {
......@@ -1941,6 +1936,19 @@ static int radeon_emit_packet3_cliprect( drm_device_t *dev,
if ( i < cmdbuf->nbox ) {
if (DRM_COPY_FROM_USER_UNCHECKED( &box, &boxes[i], sizeof(box) ))
return DRM_ERR(EFAULT);
/* FIXME The second and subsequent times round this loop, send a
* WAIT_UNTIL_3D_IDLE before calling emit_clip_rect(). This
* fixes a lockup on fast machines when sending several
* cliprects with a cmdbuf, as when waving a 2D window over
* a 3D window. Something in the commands from user space
* seems to hang the card when they're sent several times
* in a row. That would be the correct place to fix it but
* this works around it until I can figure that out - Tim Smith */
if ( i ) {
BEGIN_RING( 2 );
RADEON_WAIT_UNTIL_3D_IDLE();
ADVANCE_RING();
}
radeon_emit_clip_rect( dev_priv, &box );
}
......@@ -1949,7 +1957,6 @@ static int radeon_emit_packet3_cliprect( drm_device_t *dev,
ADVANCE_RING();
} while ( ++i < cmdbuf->nbox );
if (cmdbuf->nbox == 1)
cmdbuf->nbox = 0;
......@@ -2112,14 +2119,14 @@ int radeon_cp_getparam( DRM_IOCTL_ARGS )
break;
case RADEON_PARAM_LAST_FRAME:
dev_priv->stats.last_frame_reads++;
value = DRM_READ32(&dev_priv->scratch[0]);
value = GET_SCRATCH( 0 );
break;
case RADEON_PARAM_LAST_DISPATCH:
value = DRM_READ32(&dev_priv->scratch[1]);
value = GET_SCRATCH( 1 );
break;
case RADEON_PARAM_LAST_CLEAR:
dev_priv->stats.last_clear_reads++;
value = DRM_READ32(&dev_priv->scratch[2]);
value = GET_SCRATCH( 2 );
break;
default:
return DRM_ERR(EINVAL);
......
This diff is collapsed.
......@@ -182,5 +182,47 @@ void hcd_buffer_unmap (
: 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 DMA-Mappings for struct scatterlist
// 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;
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)
struct hc_driver *driver;
unsigned long resource, len;
void *base;
u8 latency, limit;
struct usb_hcd *hcd;
int retval, region;
char buf [8], *bufp = buf;
......@@ -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);
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__
sprintf (buf, "%d", dev->irq);
#else
......
......@@ -1270,6 +1270,9 @@ struct usb_operations usb_hcd_operations = {
.buffer_map = hcd_buffer_map,
.buffer_dmasync = hcd_buffer_dmasync,
.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);
......
......@@ -155,7 +155,15 @@ struct usb_operations {
dma_addr_t dma,
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 */
......@@ -246,6 +254,13 @@ void hcd_buffer_dmasync (struct usb_bus *bus,
void hcd_buffer_unmap (struct usb_bus *bus,
dma_addr_t dma,
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 */
extern struct usb_operations usb_hcd_operations;
......
......@@ -278,6 +278,7 @@ int usb_submit_urb(struct urb *urb, int mem_flags)
/* enforce simple/standard policy */
allowed = USB_ASYNC_UNLINK; // affects later unlinks
allowed |= URB_NO_DMA_MAP;
switch (temp) {
case PIPE_BULK:
allowed |= URB_NO_INTERRUPT;
......
......@@ -1532,6 +1532,116 @@ void usb_buffer_unmap (struct urb *urb)
: 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
struct list_head *usb_driver_get_list(void)
{
......@@ -1612,4 +1722,8 @@ EXPORT_SYMBOL (usb_buffer_map);
EXPORT_SYMBOL (usb_buffer_dmasync);
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");
This diff is collapsed.
......@@ -79,6 +79,12 @@ static inline void intr_resub (struct ohci_hcd *hc, struct urb *urb)
urb->status = 0;
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
urb_print (urb, "INTR", usb_pipeout (urb->pipe));
#endif
......@@ -93,6 +99,8 @@ static inline void intr_resub (struct ohci_hcd *hc, struct urb *urb)
urb->status = -EINPROGRESS;
spin_unlock (&urb->lock);
/* syncing with PCI_DMA_TODEVICE is evidently trouble... */
spin_lock (&hc->lock);
td_submit_urb (hc, urb);
spin_unlock_irqrestore (&hc->lock, flags);
......
......@@ -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 */
{
usbvideo_frame_t *frame;
struct usbvideo_frame *frame;
ibmcam_t *icam;
if ((uvd->curframe) < 0 || (uvd->curframe >= USBVIDEO_NUMFRAMES)) {
......@@ -399,7 +399,7 @@ case IBMCAM_MODEL_4:
*/
static ParseState_t ibmcam_parse_lines(
struct uvd *uvd,
usbvideo_frame_t *frame,
struct usbvideo_frame *frame,
long *pcopylen)
{
unsigned char *f;
......@@ -664,7 +664,7 @@ static ParseState_t ibmcam_parse_lines(
*/
static ParseState_t ibmcam_model2_320x240_parse_lines(
struct uvd *uvd,
usbvideo_frame_t *frame,
struct usbvideo_frame *frame,
long *pcopylen)
{
unsigned char *f, *la, *lb;
......@@ -818,7 +818,7 @@ static ParseState_t ibmcam_model2_320x240_parse_lines(
static ParseState_t ibmcam_model3_parse_lines(
struct uvd *uvd,
usbvideo_frame_t *frame,
struct usbvideo_frame *frame,
long *pcopylen)
{
unsigned char *data;
......@@ -963,7 +963,7 @@ static ParseState_t ibmcam_model3_parse_lines(
*/
static ParseState_t ibmcam_model4_128x96_parse_lines(
struct uvd *uvd,
usbvideo_frame_t *frame,
struct usbvideo_frame *frame,
long *pcopylen)
{
const unsigned char *data_rv, *data_gv, *data_bv;
......@@ -1049,7 +1049,7 @@ static ParseState_t ibmcam_model4_128x96_parse_lines(
* History:
* 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;
long copylen = 0;
......@@ -3921,7 +3921,7 @@ static struct usb_device_id id_table[] = {
*/
static int __init ibmcam_init(void)
{
usbvideo_cb_t cbTbl;
struct usbvideo_cb cbTbl;
memset(&cbTbl, 0, sizeof(cbTbl));
cbTbl.probe = ibmcam_probe;
cbTbl.setupOnOpen = ibmcam_setup_on_open;
......
......@@ -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;
int maxline = cam->maxline;
......@@ -881,7 +881,7 @@ static struct usb_device_id id_table[] = {
static int __init konicawc_init(void)
{
usbvideo_cb_t cbTbl;
struct usbvideo_cb cbTbl;
info(DRIVER_DESC " " DRIVER_VERSION);
memset(&cbTbl, 0, sizeof(cbTbl));
cbTbl.probe = konicawc_probe;
......
......@@ -103,7 +103,7 @@ MODULE_PARM_DESC(hue_correction, "YUV colorspace regulation: 0-255 (default=128)
* 02-Nov-2000 First (mostly dummy) version.
* 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;
......@@ -672,7 +672,7 @@ static struct usb_device_id id_table[] = {
*/
static int __init ultracam_init(void)
{
usbvideo_cb_t cbTbl;
struct usbvideo_cb cbTbl;
memset(&cbTbl, 0, sizeof(cbTbl));
cbTbl.probe = ultracam_probe;
cbTbl.setupOnOpen = ultracam_setup_on_open;
......
......@@ -70,7 +70,7 @@ static void usbvideo_StopDataPump(struct uvd *uvd);
static int usbvideo_GetFrame(struct uvd *uvd, int frameNum);
static int usbvideo_NewFrame(struct uvd *uvd, int framenum);
static void usbvideo_SoftwareContrastAdjustment(struct uvd *uvd,
usbvideo_frame_t *frame);
struct usbvideo_frame *frame);
/*******************************/
/* Memory management functions */
......@@ -127,13 +127,13 @@ static void usbvideo_rvfree(void *mem, unsigned long size)
vfree(mem);
}
static void RingQueue_Initialize(RingQueue_t *rq)
static void RingQueue_Initialize(struct RingQueue *rq)
{
assert(rq != NULL);
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
round up if necessary. This allows index wrapping
......@@ -154,14 +154,14 @@ static void RingQueue_Allocate(RingQueue_t *rq, int rqLen)
assert(rq->queue != NULL);
}
static int RingQueue_IsAllocated(const RingQueue_t *rq)
static int RingQueue_IsAllocated(const struct RingQueue *rq)
{
if (rq == NULL)
return 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);
if (RingQueue_IsAllocated(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;
......@@ -205,7 +205,7 @@ int RingQueue_Dequeue(RingQueue_t *rq, unsigned char *dst, int len)
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;
......@@ -237,13 +237,13 @@ int RingQueue_Enqueue(RingQueue_t *rq, const unsigned char *cdata, int n)
EXPORT_SYMBOL(RingQueue_Enqueue);
static void RingQueue_InterruptibleSleepOn(RingQueue_t *rq)
static void RingQueue_InterruptibleSleepOn(struct RingQueue *rq)
{
assert(rq != NULL);
interruptible_sleep_on(&rq->wqh);
}
void RingQueue_WakeUpInterruptible(RingQueue_t *rq)
void RingQueue_WakeUpInterruptible(struct RingQueue *rq)
{
assert(rq != NULL);
if (waitqueue_active(&rq->wqh))
......@@ -252,7 +252,7 @@ void RingQueue_WakeUpInterruptible(RingQueue_t *rq)
EXPORT_SYMBOL(RingQueue_WakeUpInterruptible);
void RingQueue_Flush(RingQueue_t *rq)
void RingQueue_Flush(struct RingQueue *rq)
{
assert(rq != NULL);
rq->ri = 0;
......@@ -290,7 +290,7 @@ static void usbvideo_VideosizeToString(char *buf, int bufLen, videosize_t vs)
* History:
* 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)
{
static const unsigned short digits[16] = {
......@@ -345,7 +345,7 @@ static void usbvideo_OverlayChar(struct uvd *uvd, usbvideo_frame_t *frame,
* History:
* 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)
{
while (*str) {
......@@ -363,7 +363,7 @@ static void usbvideo_OverlayString(struct uvd *uvd, usbvideo_frame_t *frame,
* History:
* 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;
char tmp[16];
......@@ -542,7 +542,7 @@ static void usbvideo_ReportStatistics(const struct uvd *uvd)
* purposes.
*/
void usbvideo_DrawLine(
usbvideo_frame_t *frame,
struct usbvideo_frame *frame,
int x1, int y1,
int x2, int y2,
unsigned char cr, unsigned char cg, unsigned char cb)
......@@ -616,7 +616,7 @@ EXPORT_SYMBOL(usbvideo_DrawLine);
*/
void usbvideo_TestPattern(struct uvd *uvd, int fullframe, int pmode)
{
usbvideo_frame_t *frame;
struct usbvideo_frame *frame;
int num_cell = 0;
int scan_length = 0;
static int num_pass = 0;
......@@ -769,7 +769,7 @@ int usbvideo_register(
const int num_cams,
const int num_extra,
const char *driverName,
const usbvideo_cb_t *cbTbl,
const struct usbvideo_cb *cbTbl,
struct module *md,
const struct usb_device_id *id_table)
{
......@@ -1640,7 +1640,7 @@ static int usbvideo_v4l_read(struct file *file, char *buf,
struct uvd *uvd = file->private_data;
int noblock = file->f_flags & O_NONBLOCK;
int frmx = -1, i;
usbvideo_frame_t *frame;
struct usbvideo_frame *frame;
if (!CAMERA_IS_OPERATIONAL(uvd) || (buf == NULL))
return -EFAULT;
......@@ -1990,7 +1990,7 @@ static void usbvideo_StopDataPump(struct uvd *uvd)
*/
static int usbvideo_NewFrame(struct uvd *uvd, int framenum)
{
usbvideo_frame_t *frame;
struct usbvideo_frame *frame;
int n;
if (uvd->debug > 1)
......@@ -2064,7 +2064,7 @@ static int usbvideo_NewFrame(struct uvd *uvd, int framenum)
* FLAGS_NO_DECODING set. Therefore, any regular build of any driver
* 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;
......@@ -2096,7 +2096,7 @@ static void usbvideo_CollectRawData(struct uvd *uvd, usbvideo_frame_t *frame)
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)
info("%s($%p,%d.)", __FUNCTION__, uvd, 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
* 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))
return;
......@@ -2297,7 +2297,7 @@ EXPORT_SYMBOL(usbvideo_DeinterlaceFrame);
* 09-Feb-2001 Created.
*/
static void usbvideo_SoftwareContrastAdjustment(struct uvd *uvd,
usbvideo_frame_t *frame)
struct usbvideo_frame *frame)
{
int i, j, v4l_linesize;
signed long adj;
......
......@@ -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_PEEK(rq,ofs) ((rq)->queue[((ofs) + (rq)->ri) & ((rq)->length-1)])
typedef struct {
struct RingQueue {
unsigned char *queue; /* Data from the Isoc data pump */
int length; /* How many bytes allocated for the queue */
int wi; /* That's where we write */
int ri; /* Read from here until you hit write index */
wait_queue_head_t wqh; /* Processes waiting */
} RingQueue_t;
};
typedef enum {
ScanState_Scanning, /* Scanning for header */
......@@ -158,18 +158,16 @@ typedef enum {
Deinterlace_FillEvenLines
} Deinterlace_t;
struct usb_device;
#define USBVIDEO_NUMFRAMES 2 /* How many frames we work with */
#define USBVIDEO_NUMSBUF 2 /* How many URBs linked in a ring */
/* This structure represents one Isoc request - URB and buffer */
typedef struct {
struct usbvideo_sbuf {
char *data;
struct urb *urb;
} usbvideo_sbuf_t;
};
typedef struct {
struct usbvideo_frame {
char *data; /* Frame buffer */
unsigned long header; /* Significant bits from the header */
......@@ -188,10 +186,10 @@ typedef struct {
long seqRead_Index; /* Amount of data that has been already read */
void *user; /* Additional data that user may need */
} usbvideo_frame_t;
};
/* Statistics that can be overlaid on screen */
typedef struct {
struct usbvideo_statistics {
unsigned long frame_num; /* Sequential number of the frame */
unsigned long urb_count; /* How many URBs we received so far */
unsigned long urb_length; /* Length of last URB */
......@@ -199,7 +197,7 @@ typedef struct {
unsigned long header_count; /* How many frame headers we found */
unsigned long iso_skip_count; /* How many empty ISO packets received */
unsigned long iso_err_count; /* How many bad ISO packets received */
} usbvideo_statistics_t;
};
struct s_usbvideo_t;
......@@ -236,16 +234,16 @@ struct uvd {
int curframe;
int iso_packet_len; /* Videomode-dependent, saves bus bandwidth */
RingQueue_t dp; /* Isoc data pump */
usbvideo_frame_t frame[USBVIDEO_NUMFRAMES];
usbvideo_sbuf_t sbuf[USBVIDEO_NUMSBUF];
struct RingQueue dp; /* Isoc data pump */
struct usbvideo_frame frame[USBVIDEO_NUMFRAMES];
struct usbvideo_sbuf sbuf[USBVIDEO_NUMSBUF];
volatile int remove_pending; /* If set then about to exit */
struct video_picture vpic, vpic_old; /* Picture settings */
struct video_capability vcap; /* Video capabilities */
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 */
char videoName[32]; /* Holds name like "video7" */
};
......@@ -255,32 +253,32 @@ struct uvd {
* services are registered. All of these default to NULL, except those
* that default to usbvideo-provided methods.
*/
typedef struct {
struct usbvideo_cb {
void *(*probe)(struct usb_device *, unsigned int,const struct usb_device_id *);
void (*userFree)(struct uvd *);
void (*disconnect)(struct usb_device *, void *);
int (*setupOnOpen)(struct uvd *);
void (*videoStart)(struct uvd *);
void (*videoStop)(struct uvd *);
void (*processData)(struct uvd *, usbvideo_frame_t *);
void (*postProcess)(struct uvd *, usbvideo_frame_t *);
void (*processData)(struct uvd *, struct usbvideo_frame *);
void (*postProcess)(struct uvd *, struct usbvideo_frame *);
void (*adjustPicture)(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 (*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 (*startDataPump)(struct uvd *uvd);
void (*stopDataPump)(struct uvd *uvd);
int (*setVideoMode)(struct uvd *uvd, struct video_window *vw);
} usbvideo_cb_t;
};
struct s_usbvideo_t {
int num_cameras; /* As allocated */
struct usb_driver usbdrv; /* Interface to the USB stack */
char drvName[80]; /* Driver name */
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 uvd *cam; /* Array of camera structures */
int uses_procfs; /* Non-zero if we create /proc entries */
......@@ -306,23 +304,23 @@ typedef struct s_usbvideo_t usbvideo_t;
#define VALID_CALLBACK(uvd,cbName) ((((uvd) != NULL) && \
((uvd)->handle != NULL)) ? GET_CALLBACK(uvd,cbName) : NULL)
int RingQueue_Dequeue(RingQueue_t *rq, unsigned char *dst, int len);
int RingQueue_Enqueue(RingQueue_t *rq, const unsigned char *cdata, int n);
void RingQueue_WakeUpInterruptible(RingQueue_t *rq);
void RingQueue_Flush(RingQueue_t *rq);
int RingQueue_Dequeue(struct RingQueue *rq, unsigned char *dst, int len);
int RingQueue_Enqueue(struct RingQueue *rq, const unsigned char *cdata, int n);
void RingQueue_WakeUpInterruptible(struct RingQueue *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);
}
static inline int RingQueue_GetFreeSpace(const RingQueue_t *rq)
static inline int RingQueue_GetFreeSpace(const struct RingQueue *rq)
{
return rq->length - RingQueue_GetLength(rq);
}
void usbvideo_DrawLine(
usbvideo_frame_t *frame,
struct usbvideo_frame *frame,
int x1, int y1,
int x2, int y2,
unsigned char cr, unsigned char cg, unsigned char cb);
......@@ -338,7 +336,7 @@ int usbvideo_register(
const int num_cams,
const int num_extra,
const char *driverName,
const usbvideo_cb_t *cbTable,
const struct usbvideo_cb *cbTable,
struct module *md,
const struct usb_device_id *id_table);
struct uvd *usbvideo_AllocateDevice(usbvideo_t *cams);
......@@ -347,7 +345,7 @@ void usbvideo_Deregister(usbvideo_t **uvt);
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
......@@ -363,7 +361,7 @@ void usbvideo_DeinterlaceFrame(struct uvd *uvd, usbvideo_frame_t *frame);
* VIDEOSIZE_X(fr->request), total VIDEOSIZE_Y(frame->request) lines.
*/
static inline void RGB24_PUTPIXEL(
usbvideo_frame_t *fr,
struct usbvideo_frame *fr,
int ix, int iy,
unsigned char vr,
unsigned char vg,
......
......@@ -208,8 +208,8 @@ static DECLARE_WAIT_QUEUE_HEAD(open_wait);
#define err(args...) \
({ printk(KERN_ERR "Voyager: " args); \
printk("\n"); })
#define dbgprint(args...) \
({ printk(KERN_DEBUG "Voyager: " __FUNCTION__ ": " args); \
#define dbgprint(fmt, args...) \
({ printk(KERN_DEBUG "Voyager: %s: " fmt, __FUNCTION__ , ##args); \
printk("\n"); })
#define dbg(args...) \
({ if(debug >= 1) dbgprint(args); })
......
......@@ -184,7 +184,7 @@ static void belkin_sa_shutdown (struct usb_serial *serial)
{
int i;
dbg (__FUNCTION__);
dbg ("%s", __FUNCTION__);
/* stop reads and writes on all ports */
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)
{
int retval = 0;
dbg(__FUNCTION__" port %d", port->number);
dbg("%s port %d", __FUNCTION__, port->number);
/*Start reading from the device*/
/* 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)
if (!serial)
return;
dbg(__FUNCTION__" port %d", port->number);
dbg("%s port %d", __FUNCTION__, port->number);
if (serial->dev) {
/* shutdown our bulk reads and writes */
......
......@@ -81,7 +81,7 @@ static struct usb_serial_device_type cyberjack_device = {
.num_bulk_in = 1,
.num_bulk_out = 1,
.num_ports = 1,
.attach = cyberjack_startup,
.attach = cyberjack_startup,
.shutdown = cyberjack_shutdown,
.open = cyberjack_open,
.close = cyberjack_close,
......@@ -103,7 +103,7 @@ static int cyberjack_startup (struct usb_serial *serial)
{
struct cyberjack_private *priv;
dbg (__FUNCTION__);
dbg("%s", __FUNCTION__);
/* allocate the private data structure */
serial->port->private = kmalloc(sizeof(struct cyberjack_private), GFP_KERNEL);
......@@ -125,7 +125,7 @@ static void cyberjack_shutdown (struct usb_serial *serial)
{
int i;
dbg (__FUNCTION__);
dbg("%s", __FUNCTION__);
for (i=0; i < serial->num_ports; ++i) {
/* 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)
if (port_paranoia_check (port, __FUNCTION__))
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
* 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)
result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
if (result)
err(" usb_submit_urb(read int) failed");
dbg(__FUNCTION__ " - usb_submit_urb(int urb)");
dbg("%s - usb_submit_urb(int urb)", __FUNCTION__);
return result;
}
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) {
/* 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
int result;
int wrexpected;
dbg(__FUNCTION__ " - port %d", port->number);
dbg(__FUNCTION__ " - from_user %d", from_user);
dbg("%s - port %d", __FUNCTION__, port->number);
dbg("%s - from_user %d", __FUNCTION__, from_user);
if (count == 0) {
dbg(__FUNCTION__ " - write request of 0 bytes");
dbg("%s - write request of 0 bytes", __FUNCTION__);
return (0);
}
if (port->write_urb->status == -EINPROGRESS) {
dbg (__FUNCTION__ " - already writing");
dbg("%s - already writing", __FUNCTION__);
return (0);
}
......@@ -221,7 +221,7 @@ static int cyberjack_write (struct usb_serial_port *port, int from_user, const u
if( priv->wrfilled >= 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 {
wrexpected = sizeof(priv->wrbuf);
}
......@@ -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 */
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;
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
/* send the data out the bulk port */
result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
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. */
priv->wrfilled=0;
priv->wrsent=0;
return 0;
}
dbg(__FUNCTION__ " - priv->wrsent=%d",priv->wrsent);
dbg(__FUNCTION__ " - priv->wrfilled=%d",priv->wrfilled);
dbg("%s - priv->wrsent=%d", __FUNCTION__,priv->wrsent);
dbg("%s - priv->wrfilled=%d", __FUNCTION__,priv->wrfilled);
if( priv->wrsent>=priv->wrfilled ) {
dbg(__FUNCTION__ " - buffer cleaned");
dbg("%s - buffer cleaned", __FUNCTION__);
memset( priv->wrbuf, 0, sizeof(priv->wrbuf) );
priv->wrfilled=0;
priv->wrsent=0;
......@@ -278,7 +278,7 @@ static void cyberjack_read_int_callback( struct urb *urb )
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. */
if (urb->status)
......@@ -311,14 +311,14 @@ static void cyberjack_read_int_callback( struct urb *urb )
/* "+=" is probably more fault tollerant than "=" */
priv->rdtodo += size;
dbg(__FUNCTION__ " - rdtodo: %d", priv->rdtodo);
dbg("%s - rdtodo: %d", __FUNCTION__, priv->rdtodo);
if( !old_rdtodo ) {
port->read_urb->dev = port->serial->dev;
result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
if( result )
err(__FUNCTION__ " - failed resubmitting read urb, error %d", result);
dbg(__FUNCTION__ " - usb_submit_urb(read urb)");
err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result);
dbg("%s - usb_submit_urb(read urb)", __FUNCTION__);
}
}
}
......@@ -333,16 +333,16 @@ static void cyberjack_read_bulk_callback (struct urb *urb)
int i;
int result;
dbg(__FUNCTION__ " - port %d", port->number);
dbg("%s - port %d", __FUNCTION__, port->number);
if (!serial) {
dbg(__FUNCTION__ " - bad serial pointer, exiting");
dbg("%s - bad serial pointer, exiting", __FUNCTION__);
return;
}
if (urb->status) {
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;
}
......@@ -366,15 +366,15 @@ static void cyberjack_read_bulk_callback (struct urb *urb)
/* Just to be sure */
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. */
if( priv->rdtodo /* || (urb->actual_length==port->bulk_in_endpointAddress)*/ ) {
port->read_urb->dev = port->serial->dev;
result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
if (result)
err(__FUNCTION__ " - failed resubmitting read urb, error %d", result);
dbg(__FUNCTION__ " - usb_submit_urb(read urb)");
err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result);
dbg("%s - usb_submit_urb(read urb)", __FUNCTION__);
}
}
......@@ -384,15 +384,15 @@ static void cyberjack_write_bulk_callback (struct urb *urb)
struct cyberjack_private *priv = (struct cyberjack_private *)port->private;
struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
dbg(__FUNCTION__ " - port %d", port->number);
dbg("%s - port %d", __FUNCTION__, port->number);
if (!serial) {
dbg(__FUNCTION__ " - bad serial pointer, exiting");
dbg("%s - bad serial pointer, exiting", __FUNCTION__);
return;
}
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;
}
......@@ -401,11 +401,11 @@ static void cyberjack_write_bulk_callback (struct urb *urb)
int length, blksize, result;
if (port->write_urb->status == -EINPROGRESS) {
dbg (__FUNCTION__ " - already writing");
dbg("%s - already writing", __FUNCTION__);
return;
}
dbg(__FUNCTION__ " - transmitting data (frame n)");
dbg("%s - transmitting data (frame n)", __FUNCTION__);
length = ((priv->wrfilled - priv->wrsent) > port->bulk_out_size) ?
port->bulk_out_size : (priv->wrfilled - priv->wrsent);
......@@ -426,7 +426,7 @@ static void cyberjack_write_bulk_callback (struct urb *urb)
/* send the data out the bulk port */
result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
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. */
priv->wrfilled=0;
priv->wrsent=0;
......@@ -435,13 +435,13 @@ static void cyberjack_write_bulk_callback (struct urb *urb)
return;
}
dbg(__FUNCTION__ " - priv->wrsent=%d",priv->wrsent);
dbg(__FUNCTION__ " - priv->wrfilled=%d",priv->wrfilled);
dbg("%s - priv->wrsent=%d", __FUNCTION__,priv->wrsent);
dbg("%s - priv->wrfilled=%d", __FUNCTION__,priv->wrfilled);
blksize = ((int)priv->wrbuf[2]<<8)+priv->wrbuf[1]+3;
if( (priv->wrsent>=priv->wrfilled) || (priv->wrsent>=blksize) ) {
dbg(__FUNCTION__ " - buffer cleaned");
dbg("%s - buffer cleaned", __FUNCTION__);
memset( priv->wrbuf, 0, sizeof(priv->wrbuf) );
priv->wrfilled=0;
priv->wrsent=0;
......
......@@ -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 );
if( ret ) {
err( __FUNCTION__ ": usb_submit_urb failed, ret=%d",
err("%s: usb_submit_urb failed, ret=%d", __FUNCTION__,
ret );
}
......@@ -773,7 +773,7 @@ count );
spin_unlock_irqrestore( &priv->dp_port_lock, flags );
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 );
}
......@@ -849,7 +849,7 @@ port_priv->dp_port_num, modem_signals );
spin_unlock_irqrestore( &oob_priv->dp_port_lock, flags );
if( ret ) {
err( __FUNCTION__ ": usb_submit_urb failed, ret=%d",
err("%s: usb_submit_urb failed, ret=%d", __FUNCTION__,
ret );
}
......@@ -970,7 +970,7 @@ dbg( "digi_rx_unthrottle: TOP: port=%d", priv->dp_port_num );
spin_unlock_irqrestore( &priv->dp_port_lock, flags );
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 );
}
......@@ -1329,7 +1329,7 @@ priv->dp_port_num, count, from_user, in_interrupt() );
/* return length of new data written, or error */
spin_unlock_irqrestore( &priv->dp_port_lock, flags );
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 );
}
......@@ -1352,13 +1352,13 @@ dbg( "digi_write_bulk_callback: TOP, urb->status=%d", urb->status );
/* port and serial sanity check */
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 );
return;
}
serial = port->serial;
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;
}
......@@ -1413,7 +1413,7 @@ dbg( "digi_write_bulk_callback: TOP, urb->status=%d", urb->status );
spin_unlock( &priv->dp_port_lock );
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 );
}
......@@ -1655,8 +1655,7 @@ static int digi_startup_device( struct usb_serial *serial )
port->write_urb->dev = port->serial->dev;
if( (ret=usb_submit_urb(port->read_urb, GFP_KERNEL)) != 0 ) {
err(
__FUNCTION__ ": usb_submit_urb failed, ret=%d, port=%d",
err("%s: usb_submit_urb failed, ret=%d, port=%d", __FUNCTION__,
ret, i );
break;
}
......@@ -1773,20 +1772,20 @@ dbg( "digi_read_bulk_callback: TOP" );
/* port sanity check, do not resubmit if port is not valid */
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 );
return;
}
if( port->serial == NULL
|| serial_paranoia_check( port->serial, __FUNCTION__ )
|| 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;
}
/* do not resubmit urb if it has any status error */
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;
}
......@@ -1803,7 +1802,7 @@ dbg( "digi_read_bulk_callback: TOP" );
/* continue read */
urb->dev = port->serial->dev;
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 );
}
......@@ -1844,7 +1843,7 @@ static int digi_read_inb_callback( struct urb *urb )
/* short/multiple packet check */
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 );
}
......@@ -1913,9 +1912,9 @@ static int digi_read_inb_callback( struct urb *urb )
spin_unlock( &priv->dp_port_lock );
if( opcode == DIGI_CMD_RECEIVE_DISABLE ) {
dbg( __FUNCTION__ ": got RECEIVE_DISABLE" );
dbg("%s: got RECEIVE_DISABLE", __FUNCTION__ );
} else if( opcode != DIGI_CMD_RECEIVE_DATA ) {
dbg( __FUNCTION__ ": unknown opcode: %d", opcode );
dbg("%s: unknown opcode: %d", __FUNCTION__, opcode );
}
return( throttled ? 1 : 0 );
......
......@@ -152,7 +152,7 @@ static int empeg_open (struct usb_serial_port *port, struct file *filp)
if (port_paranoia_check (port, __FUNCTION__))
return -ENODEV;
dbg(__FUNCTION__ " - port %d", port->number);
dbg("%s - port %d", __FUNCTION__, port->number);
/* Force default termio settings */
empeg_set_termios (port, NULL) ;
......@@ -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);
if (result)
err(__FUNCTION__ " - failed submitting read urb, error %d", result);
err("%s - failed submitting read urb, error %d", __FUNCTION__, result);
return result;
}
......@@ -187,7 +187,7 @@ static void empeg_close (struct usb_serial_port *port, struct file * filp)
if (port_paranoia_check (port, __FUNCTION__))
return;
dbg(__FUNCTION__ " - port %d", port->number);
dbg("%s - port %d", __FUNCTION__, port->number);
serial = get_usb_serial (port, __FUNCTION__);
if (!serial)
......@@ -213,7 +213,7 @@ static int empeg_write (struct usb_serial_port *port, int from_user, const unsig
int bytes_sent = 0;
int transfer_size;
dbg(__FUNCTION__ " - port %d", port->number);
dbg("%s - port %d", __FUNCTION__, port->number);
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
spin_unlock_irqrestore (&write_urb_pool_lock, flags);
if (urb == NULL) {
dbg (__FUNCTION__ " - no more free urbs");
dbg("%s - no more free urbs", __FUNCTION__);
goto exit;
}
if (urb->transfer_buffer == NULL) {
urb->transfer_buffer = kmalloc (URB_TRANSFER_BUFFER_SIZE, GFP_ATOMIC);
if (urb->transfer_buffer == NULL) {
err(__FUNCTION__" no more kernel memory...");
err("%s no more kernel memory...", __FUNCTION__);
goto exit;
}
}
......@@ -271,7 +271,7 @@ static int empeg_write (struct usb_serial_port *port, int from_user, const unsig
/* send it down the pipe */
status = usb_submit_urb(urb, GFP_ATOMIC);
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;
break;
}
......@@ -295,7 +295,7 @@ static int empeg_write_room (struct usb_serial_port *port)
int i;
int room = 0;
dbg(__FUNCTION__ " - port %d", port->number);
dbg("%s - port %d", __FUNCTION__, port->number);
spin_lock_irqsave (&write_urb_pool_lock, flags);
......@@ -308,7 +308,7 @@ static int empeg_write_room (struct usb_serial_port *port)
spin_unlock_irqrestore (&write_urb_pool_lock, flags);
dbg(__FUNCTION__ " - returns %d", room);
dbg("%s - returns %d", __FUNCTION__, room);
return (room);
......@@ -321,7 +321,7 @@ static int empeg_chars_in_buffer (struct usb_serial_port *port)
int i;
int chars = 0;
dbg(__FUNCTION__ " - port %d", port->number);
dbg("%s - port %d", __FUNCTION__, port->number);
spin_lock_irqsave (&write_urb_pool_lock, flags);
......@@ -334,7 +334,7 @@ static int empeg_chars_in_buffer (struct usb_serial_port *port)
spin_unlock_irqrestore (&write_urb_pool_lock, flags);
dbg (__FUNCTION__ " - returns %d", chars);
dbg("%s - returns %d", __FUNCTION__, chars);
return (chars);
......@@ -348,10 +348,10 @@ static void empeg_write_bulk_callback (struct urb *urb)
if (port_paranoia_check (port, __FUNCTION__))
return;
dbg(__FUNCTION__ " - port %d", port->number);
dbg("%s - port %d", __FUNCTION__, port->number);
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;
}
......@@ -375,15 +375,15 @@ static void empeg_read_bulk_callback (struct urb *urb)
if (port_paranoia_check (port, __FUNCTION__))
return;
dbg(__FUNCTION__ " - port %d", port->number);
dbg("%s - port %d", __FUNCTION__, port->number);
if (!serial) {
dbg(__FUNCTION__ " - bad serial pointer, exiting");
dbg("%s - bad serial pointer, exiting", __FUNCTION__);
return;
}
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;
}
......@@ -423,7 +423,7 @@ static void empeg_read_bulk_callback (struct urb *urb)
result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
if (result)
err(__FUNCTION__ " - failed resubmitting read urb, error %d", result);
err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result);
return;
......@@ -432,7 +432,7 @@ static void empeg_read_bulk_callback (struct urb *urb)
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);
}
......@@ -441,14 +441,14 @@ static void empeg_unthrottle (struct usb_serial_port *port)
{
int result;
dbg(__FUNCTION__ " - port %d", port->number);
dbg("%s - port %d", __FUNCTION__, port->number);
port->read_urb->dev = port->serial->dev;
result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
if (result)
err(__FUNCTION__ " - failed submitting read urb, error %d", result);
err("%s - failed submitting read urb, error %d", __FUNCTION__, result);
return;
}
......@@ -457,9 +457,9 @@ static void empeg_unthrottle (struct usb_serial_port *port)
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);
/* continue on with initialization */
......@@ -470,13 +470,13 @@ static int empeg_startup (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)
{
dbg(__FUNCTION__ " - port %d, cmd 0x%.4x", port->number, cmd);
dbg("%s - port %d, cmd 0x%.4x", __FUNCTION__, port->number, cmd);
return -ENOIOCTLCMD;
}
......@@ -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)
{
dbg(__FUNCTION__ " - port %d", port->number);
dbg("%s - port %d", __FUNCTION__, port->number);
if ((!port->tty) || (!port->tty->termios)) {
dbg(__FUNCTION__" - no tty structures");
dbg("%s - no tty structures", __FUNCTION__);
return;
}
......@@ -565,7 +565,8 @@ static int __init empeg_init (void)
urb->transfer_buffer = NULL;
urb->transfer_buffer = kmalloc (URB_TRANSFER_BUFFER_SIZE, GFP_KERNEL);
if (!urb->transfer_buffer) {
err (__FUNCTION__ " - out of memory for urb buffers.");
err("%s - out of memory for urb buffers.",
__FUNCTION__);
continue;
}
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -1626,7 +1626,7 @@ static void edge_interrupt_callback (struct urb *urb)
}
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;
}
......@@ -1959,7 +1959,7 @@ static void edge_close (struct usb_serial_port *port, struct file * filp)
if (port_paranoia_check (port, __FUNCTION__))
return;
dbg(__FUNCTION__ " - port %d", port->number);
dbg("%s - port %d", __FUNCTION__, port->number);
serial = get_usb_serial (port, __FUNCTION__);
if (!serial)
......@@ -1999,7 +1999,7 @@ static void edge_close (struct usb_serial_port *port, struct file * filp)
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)
......@@ -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 */
result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
if (result)
err(__FUNCTION__ " - failed submitting write urb, error %d", result);
err("%s - failed submitting write urb, error %d", __FUNCTION__, result);
else
result = count;
......@@ -2062,19 +2062,19 @@ static int edge_write_room (struct usb_serial_port *port)
struct edgeport_port *edge_port = (struct edgeport_port *)(port->private);
int room = 0;
dbg(__FUNCTION__);
dbg("%s", __FUNCTION__);
if (edge_port == NULL)
return -ENODEV;
if (edge_port->close_pending == 1)
return -ENODEV;
dbg(__FUNCTION__" - port %d", port->number);
dbg("%s - port %d", __FUNCTION__, port->number);
if (port->write_urb->status != -EINPROGRESS)
room = port->bulk_out_size;
dbg(__FUNCTION__ " - returns %d", room);
dbg("%s - returns %d", __FUNCTION__, room);
return room;
}
......@@ -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);
int chars = 0;
dbg(__FUNCTION__);
dbg("%s", __FUNCTION__);
if (edge_port == NULL)
return -ENODEV;
......@@ -2138,7 +2138,7 @@ static void edge_unthrottle (struct usb_serial_port *port)
struct tty_struct *tty;
int status;
dbg(__FUNCTION__" - port %d", port->number);
dbg("%s - port %d", __FUNCTION__, port->number);
if (edge_port == NULL)
return;
......@@ -2229,32 +2229,32 @@ static void change_port_settings (struct edgeport_port *edge_port, struct termio
if (cflag & PARODD) {
config->wFlags |= UMP_MASK_UART_FLAGS_PARITY;
config->bParity = UMP_UART_ODDPARITY;
dbg(__FUNCTION__" - parity = odd");
dbg("%s - parity = odd", __FUNCTION__);
} else {
config->wFlags |= UMP_MASK_UART_FLAGS_PARITY;
config->bParity = UMP_UART_EVENPARITY;
dbg(__FUNCTION__" - parity = even");
dbg("%s - parity = even", __FUNCTION__);
}
} else {
config->bParity = UMP_UART_NOPARITY;
dbg(__FUNCTION__" - parity = none");
dbg("%s - parity = none", __FUNCTION__);
}
if (cflag & CSTOPB) {
config->bStopBits = UMP_UART_STOPBIT2;
dbg(__FUNCTION__" - stop bits = 2");
dbg("%s - stop bits = 2", __FUNCTION__);
} else {
config->bStopBits = UMP_UART_STOPBIT1;
dbg(__FUNCTION__" - stop bits = 1");
dbg("%s - stop bits = 1", __FUNCTION__);
}
/* figure out the flow control settings */
if (cflag & CRTSCTS) {
config->wFlags |= UMP_MASK_UART_FLAGS_OUT_X_CTS_FLOW;
config->wFlags |= UMP_MASK_UART_FLAGS_RTS_FLOW;
dbg(__FUNCTION__" - RTS/CTS is enabled");
dbg("%s - RTS/CTS is enabled", __FUNCTION__);
} 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 */
......@@ -2422,7 +2422,7 @@ static int get_modem_info (struct edgeport_port *edge_port, unsigned int *value)
| ((msr & MSR_DSR) ? TIOCM_DSR: 0); /* 0x100 */
dbg(__FUNCTION__" -- %x", result);
dbg("%s -- %x", __FUNCTION__, result);
if (copy_to_user(value, &result, sizeof(int)))
return -EFAULT;
......@@ -2463,42 +2463,42 @@ static int edge_ioctl (struct usb_serial_port *port, struct file *file, unsigned
struct async_icount cnow;
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) {
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);
break;
case TIOCSERGETLSR:
dbg(__FUNCTION__" (%d) TIOCSERGETLSR", port->number);
dbg("%s - (%d) TIOCSERGETLSR", __FUNCTION__, port->number);
// return get_lsr_info(edge_port, (unsigned int *) arg);
break;
case TIOCMBIS:
case TIOCMBIC:
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);
break;
case TIOCMGET:
dbg(__FUNCTION__" (%d) TIOCMGET", port->number);
dbg("%s - (%d) TIOCMGET", __FUNCTION__, port->number);
return get_modem_info(edge_port, (unsigned int *) arg);
break;
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);
break;
case TIOCSSERIAL:
dbg(__FUNCTION__" (%d) TIOCSSERIAL", port->number);
dbg("%s - (%d) TIOCSSERIAL", __FUNCTION__, port->number);
break;
case TIOCMIWAIT:
dbg(__FUNCTION__" (%d) TIOCMIWAIT", port->number);
dbg("%s - (%d) TIOCMIWAIT", __FUNCTION__, port->number);
cprev = edge_port->icount;
while (1) {
interruptible_sleep_on(&edge_port->delta_msr_wait);
......@@ -2565,7 +2565,7 @@ static int edge_startup (struct usb_serial *serial)
/* create our private serial structure */
edge_serial = kmalloc (sizeof(struct edgeport_serial), GFP_KERNEL);
if (edge_serial == NULL) {
err(__FUNCTION__" - Out of memory");
err("%s - Out of memory", __FUNCTION__);
return -ENOMEM;
}
memset (edge_serial, 0, sizeof(struct edgeport_serial));
......@@ -2582,7 +2582,7 @@ static int edge_startup (struct usb_serial *serial)
for (i = 0; i < serial->num_ports; ++i) {
edge_port = kmalloc (sizeof(struct edgeport_port), GFP_KERNEL);
if (edge_port == NULL) {
err(__FUNCTION__" - Out of memory");
err("%s - Out of memory", __FUNCTION__);
return -ENOMEM;
}
memset (edge_port, 0, sizeof(struct edgeport_port));
......@@ -2598,7 +2598,7 @@ static void edge_shutdown (struct usb_serial *serial)
{
int i;
dbg (__FUNCTION__);
dbg ("%s", __FUNCTION__);
for (i=0; i < serial->num_ports; ++i) {
kfree (serial->port[i].private);
......
......@@ -130,13 +130,13 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp)
return -ENODEV;
}
dbg(__FUNCTION__ " - port %d", port->number);
dbg("%s - port %d", __FUNCTION__, port->number);
bytes_in = 0;
bytes_out = 0;
priv = (struct ipaq_private *)kmalloc(sizeof(struct ipaq_private), GFP_KERNEL);
if (priv == NULL) {
err(__FUNCTION__ " - Out of memory");
err("%s - Out of memory", __FUNCTION__);
return -ENOMEM;
}
port->private = (void *)priv;
......@@ -198,7 +198,7 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp)
ipaq_read_bulk_callback, port);
result = usb_submit_urb(port->read_urb, GFP_KERNEL);
if (result) {
err(__FUNCTION__ " - failed submitting read urb, error %d", result);
err("%s - failed submitting read urb, error %d", __FUNCTION__, result);
goto error;
}
......@@ -218,12 +218,12 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp)
return 0;
}
}
err(__FUNCTION__ " - failed doing control urb, error %d", result);
err("%s - failed doing control urb, error %d", __FUNCTION__, result);
goto error;
enomem:
result = -ENOMEM;
err(__FUNCTION__ " - Out of memory");
err("%s - Out of memory", __FUNCTION__);
error:
ipaq_destroy_lists(port);
kfree(priv);
......@@ -240,7 +240,7 @@ static void ipaq_close(struct usb_serial_port *port, struct file *filp)
return;
}
dbg(__FUNCTION__ " - port %d", port->number);
dbg("%s - port %d", __FUNCTION__, port->number);
serial = get_usb_serial(port, __FUNCTION__);
if (!serial)
......@@ -271,15 +271,15 @@ static void ipaq_read_bulk_callback(struct urb *urb)
if (port_paranoia_check(port, __FUNCTION__))
return;
dbg(__FUNCTION__ " - port %d", port->number);
dbg("%s - port %d", __FUNCTION__, port->number);
if (!serial) {
dbg(__FUNCTION__ " - bad serial pointer, exiting");
dbg("%s - bad serial pointer, exiting", __FUNCTION__);
return;
}
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;
}
......@@ -306,7 +306,7 @@ static void ipaq_read_bulk_callback(struct urb *urb)
ipaq_read_bulk_callback, port);
result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
if (result)
err(__FUNCTION__ " - failed resubmitting read urb, error %d", result);
err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result);
return;
}
......@@ -317,7 +317,7 @@ static int ipaq_write(struct usb_serial_port *port, int from_user, const unsigne
int bytes_sent = 0;
int transfer_size;
dbg(__FUNCTION__ " - port %d", port->number);
dbg("%s - port %d", __FUNCTION__, port->number);
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
unsigned long flags;
if (priv->free_len <= 0) {
dbg(__FUNCTION__ " - we're stuffed");
dbg("%s - we're stuffed", __FUNCTION__);
return -EAGAIN;
}
......@@ -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);
if (pkt == NULL) {
dbg(__FUNCTION__ " - we're stuffed");
dbg("%s - we're stuffed", __FUNCTION__);
return -EAGAIN;
}
......@@ -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);
result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
if (result) {
err(__FUNCTION__ " - failed submitting write urb, error %d", result);
err("%s - failed submitting write urb, error %d", __FUNCTION__, result);
}
} else {
spin_unlock_irqrestore(&write_list_lock, flags);
......@@ -398,7 +398,7 @@ static void ipaq_write_gather(struct usb_serial_port *port)
if (urb->status == -EINPROGRESS) {
/* Should never happen */
err(__FUNCTION__ " - flushing while urb is active !");
err("%s - flushing while urb is active !", __FUNCTION__);
return;
}
room = URBDATA_SIZE;
......@@ -439,10 +439,10 @@ static void ipaq_write_bulk_callback(struct urb *urb)
return;
}
dbg(__FUNCTION__ " - port %d", port->number);
dbg("%s - port %d", __FUNCTION__, port->number);
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);
......@@ -451,7 +451,7 @@ static void ipaq_write_bulk_callback(struct urb *urb)
spin_unlock_irqrestore(&write_list_lock, flags);
result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
if (result) {
err(__FUNCTION__ " - failed submitting write urb, error %d", result);
err("%s - failed submitting write urb, error %d", __FUNCTION__, result);
}
} else {
priv->active = 0;
......@@ -467,7 +467,7 @@ static int ipaq_write_room(struct usb_serial_port *port)
{
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;
}
......@@ -475,7 +475,7 @@ static int ipaq_chars_in_buffer(struct usb_serial_port *port)
{
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;
}
......@@ -503,14 +503,14 @@ static void ipaq_destroy_lists(struct usb_serial_port *port)
static int ipaq_startup(struct usb_serial *serial)
{
dbg(__FUNCTION__);
dbg("%s", __FUNCTION__);
usb_set_configuration(serial->dev, 1);
return 0;
}
static void ipaq_shutdown(struct usb_serial *serial)
{
dbg (__FUNCTION__);
dbg("%s", __FUNCTION__);
}
static int __init ipaq_init(void)
......
......@@ -261,7 +261,7 @@ static int ir_startup (struct usb_serial *serial)
case 0x20: ir_add_bof = 2; break;
case 0x40: ir_add_bof = 1; break;
case 0x80: ir_add_bof = 0; break;
default:
default:;
}
kfree (irda_desc);
......
......@@ -402,7 +402,7 @@ static void usa26_indat_callback(struct urb *urb)
port = (struct usb_serial_port *) urb->context;
tty = port->tty;
if (urb->actual_length) {
/* 0x80 bit is error flag */
/* 0x80 bit is error flag */
if ((data[0] & 0x80) == 0) {
/* no error on any byte */
for (i = 1; i < urb->actual_length ; ++i) {
......@@ -787,7 +787,7 @@ static void usa49_indat_callback(struct urb *urb)
port = (struct usb_serial_port *) urb->context;
tty = port->tty;
if (urb->actual_length) {
/* 0x80 bit is error flag */
/* 0x80 bit is error flag */
if ((data[0] & 0x80) == 0) {
/* no error on any byte */
for (i = 1; i < urb->actual_length ; ++i) {
......@@ -1104,25 +1104,25 @@ static struct callbacks {
/* msg_usa26 callbacks */
.instat_callback = usa26_instat_callback,
.glocont_callback = usa26_glocont_callback,
.indat_callback = usa26_indat_callback,
.indat_callback = usa26_indat_callback,
.outdat_callback = usa2x_outdat_callback,
.inack_callback = usa26_inack_callback,
.inack_callback = usa26_inack_callback,
.outcont_callback = usa26_outcont_callback,
}, {
/* msg_usa28 callbacks */
.instat_callback = usa28_instat_callback,
.glocont_callback = usa28_glocont_callback,
.indat_callback = usa28_indat_callback,
.indat_callback = usa28_indat_callback,
.outdat_callback = usa2x_outdat_callback,
.inack_callback = usa28_inack_callback,
.inack_callback = usa28_inack_callback,
.outcont_callback = usa28_outcont_callback,
}, {
/* msg_usa49 callbacks */
.instat_callback = usa49_instat_callback,
.glocont_callback = usa49_glocont_callback,
.indat_callback = usa49_indat_callback,
.indat_callback = usa49_indat_callback,
.outdat_callback = usa2x_outdat_callback,
.inack_callback = usa49_inack_callback,
.inack_callback = usa49_inack_callback,
.outcont_callback = usa49_outcont_callback,
}
};
......@@ -1363,8 +1363,6 @@ static int keyspan_usa28_calc_baud(u32 baud_rate, u32 baudclk, u8 *rate_hi,
return (KEYSPAN_BAUD_RATE_OK);
}
static int keyspan_usa26_send_setup(struct usb_serial *serial,
struct usb_serial_port *port,
int reset_port)
......
......@@ -521,6 +521,7 @@ static struct usb_serial_device_type keyspan_2port_device = {
unthrottle: keyspan_rx_unthrottle,
ioctl: keyspan_ioctl,
set_termios: keyspan_set_termios,
break_ctl: keyspan_break_ctl,
attach: keyspan_startup,
shutdown: keyspan_shutdown,
};
......
......@@ -679,11 +679,11 @@ static int keyspan_pda_open (struct usb_serial_port *port, struct file *filp)
1,
2*HZ);
if (rc < 0) {
dbg(__FUNCTION__" - roomquery failed");
dbg("%s - roomquery failed", __FUNCTION__);
goto error;
}
if (rc == 0) {
dbg(__FUNCTION__" - roomquery returned 0 bytes");
dbg("%s - roomquery returned 0 bytes", __FUNCTION__);
rc = -EIO;
goto error;
}
......@@ -702,7 +702,7 @@ static int keyspan_pda_open (struct usb_serial_port *port, struct file *filp)
port->interrupt_in_urb->dev = serial->dev;
rc = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
if (rc) {
dbg(__FUNCTION__" - usb_submit_urb(read int) failed");
dbg("%s - usb_submit_urb(read int) failed", __FUNCTION__);
goto error;
}
......@@ -746,7 +746,7 @@ static int keyspan_pda_fake_startup (struct usb_serial *serial)
record = &xircom_pgs_firmware[0];
#endif
if (record == NULL) {
err(__FUNCTION__": unknown vendor, aborting.");
err("%s: unknown vendor, aborting.", __FUNCTION__);
return -ENODEV;
}
......@@ -797,7 +797,7 @@ static int keyspan_pda_startup (struct usb_serial *serial)
static void keyspan_pda_shutdown (struct usb_serial *serial)
{
dbg (__FUNCTION__);
dbg("%s", __FUNCTION__);
kfree(serial->port[0].private);
}
......
This diff is collapsed.
......@@ -317,7 +317,7 @@ static void mct_u232_shutdown (struct usb_serial *serial)
{
int i;
dbg (__FUNCTION__);
dbg("%s", __FUNCTION__);
/* stop reads and writes on all ports */
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)
struct mct_u232_private *priv = (struct mct_u232_private *)port->private;
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
* 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)
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) {
/* shutdown our urbs */
......@@ -411,10 +411,10 @@ static int mct_u232_write (struct usb_serial_port *port, int from_user,
struct usb_serial *serial = port->serial;
int result, bytes_sent, size;
dbg(__FUNCTION__ " - port %d", port->number);
dbg("%s - port %d", __FUNCTION__, port->number);
if (count == 0) {
dbg(__FUNCTION__ " - write request of 0 bytes");
dbg("%s - write request of 0 bytes", __FUNCTION__);
return (0);
}
......@@ -424,7 +424,7 @@ static int mct_u232_write (struct usb_serial_port *port, int from_user,
/* another write is still pending? */
if (port->write_urb->status == -EINPROGRESS) {
dbg (__FUNCTION__ " - already writing");
dbg("%s - already writing", __FUNCTION__);
return (0);
}
......@@ -456,8 +456,7 @@ static int mct_u232_write (struct usb_serial_port *port, int from_user,
/* send the data out the bulk port */
result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
if (result) {
err(__FUNCTION__
" - failed submitting write urb, error %d", result);
err("%s - failed submitting write urb, error %d", __FUNCTION__, result);
return result;
}
......@@ -480,15 +479,15 @@ static void mct_u232_write_bulk_callback (struct urb *urb)
struct usb_serial *serial = port->serial;
struct tty_struct *tty = port->tty;
dbg(__FUNCTION__ " - port %d", port->number);
dbg("%s - port %d", __FUNCTION__, port->number);
if (!serial) {
dbg(__FUNCTION__ " - bad serial pointer, exiting");
dbg("%s - bad serial pointer, exiting", __FUNCTION__);
return;
}
if (urb->status) {
dbg(__FUNCTION__ " - nonzero write bulk status received: %d",
dbg("%s - nonzero write bulk status received: %d", __FUNCTION__,
urb->status);
return;
}
......@@ -518,16 +517,16 @@ static void mct_u232_read_int_callback (struct urb *urb)
struct tty_struct *tty;
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. */
if (urb->status) {
dbg(__FUNCTION__ " - nonzero read bulk status received: %d",
dbg("%s - nonzero read bulk status received: %d", __FUNCTION__,
urb->status);
return;
}
if (!serial) {
dbg(__FUNCTION__ " - bad serial pointer, exiting");
dbg("%s - bad serial pointer, exiting", __FUNCTION__);
return;
}
......@@ -604,7 +603,7 @@ static void mct_u232_set_termios (struct usb_serial_port *port,
if( (cflag & CBAUD) != (old_cflag & CBAUD) ) {
/* reassert DTR and (maybe) RTS on transition from B0 */
if( (old_cflag & CBAUD) == B0 ) {
dbg(__FUNCTION__ ": baud was B0");
dbg("%s: baud was B0", __FUNCTION__);
priv->control_state |= TIOCM_DTR;
/* don't set RTS if using hardware flow control */
if (!(old_cflag & CRTSCTS)) {
......@@ -640,7 +639,7 @@ static void mct_u232_set_termios (struct usb_serial_port *port,
mct_u232_set_baud_rate(serial, 9600); break;
}
if ((cflag & CBAUD) == B0 ) {
dbg(__FUNCTION__ ": baud is B0");
dbg("%s: baud is B0", __FUNCTION__);
/* Drop RTS and DTR */
priv->control_state &= ~(TIOCM_DTR | TIOCM_RTS);
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 )
struct mct_u232_private *priv = (struct mct_u232_private *)port->private;
unsigned char lcr = priv->last_lcr;
dbg (__FUNCTION__ "state=%d", break_state);
dbg("%sstate=%d", __FUNCTION__, break_state);
if (break_state)
lcr |= MCT_U232_SET_BREAK;
......@@ -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;
int mask;
dbg (__FUNCTION__ "cmd=0x%x", cmd);
dbg("%scmd=0x%x", __FUNCTION__, cmd);
/* Based on code from acm.c and others */
switch (cmd) {
......@@ -772,7 +771,7 @@ static int mct_u232_ioctl (struct usb_serial_port *port, struct file * file,
return 0;
default:
dbg(__FUNCTION__ ": arg not supported - 0x%04x",cmd);
dbg("%s: arg not supported - 0x%04x", __FUNCTION__,cmd);
return(-ENOIOCTLCMD);
break;
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -22,3 +22,6 @@
#define ITEGNO_VENDOR_ID 0x0eba
#define ITEGNO_PRODUCT_ID 0x1080
#define MA620_VENDOR_ID 0x0df7
#define MA620_PRODUCT_ID 0x0620
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -1036,6 +1036,14 @@ struct urb *usb_buffer_map (struct urb *urb);
void usb_buffer_dmasync (struct urb *urb);
void usb_buffer_unmap (struct urb *urb);
struct scatterlist;
int usb_buffer_map_sg (struct usb_device *dev, unsigned pipe,
struct scatterlist *sg, int nents);
void usb_buffer_dmasync_sg (struct usb_device *dev, unsigned pipe,
struct scatterlist *sg, int n_hw_ents);
void usb_buffer_unmap_sg (struct usb_device *dev, unsigned pipe,
struct scatterlist *sg, int n_hw_ents);
/*-------------------------------------------------------------------*
* SYNCHRONOUS CALL SUPPORT *
*-------------------------------------------------------------------*/
......
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