}
static ssize_t
-show_async (struct device *dev, char *buf, size_t count, loff_t off)
+show_async (struct device *dev, char *buf)
{
struct pci_dev *pdev;
struct ehci_hcd *ehci;
char *next;
struct ehci_qh *qh;
- if (off != 0)
- return 0;
-
pdev = container_of (dev, struct pci_dev, dev);
ehci = container_of (pci_get_drvdata (pdev), struct ehci_hcd, hcd);
next = buf;
- size = count;
+ size = PAGE_SIZE;
/* dumps a snapshot of the async schedule.
* usually empty except for long-term bulk reads, or head.
}
spin_unlock_irqrestore (&ehci->lock, flags);
- return count - size;
+ return PAGE_SIZE - size;
}
static DEVICE_ATTR (async, S_IRUGO, show_async, NULL);
#define DBG_SCHED_LIMIT 64
static ssize_t
-show_periodic (struct device *dev, char *buf, size_t count, loff_t off)
+show_periodic (struct device *dev, char *buf)
{
struct pci_dev *pdev;
struct ehci_hcd *ehci;
char *next;
unsigned i, tag;
- if (off != 0)
- return 0;
if (!(seen = kmalloc (DBG_SCHED_LIMIT * sizeof *seen, SLAB_ATOMIC)))
return 0;
seen_count = 0;
pdev = container_of (dev, struct pci_dev, dev);
ehci = container_of (pci_get_drvdata (pdev), struct ehci_hcd, hcd);
next = buf;
- size = count;
+ size = PAGE_SIZE;
temp = snprintf (next, size, "size = %d\n", ehci->periodic_size);
size -= temp;
spin_unlock_irqrestore (&ehci->lock, flags);
kfree (seen);
- return count - size;
+ return PAGE_SIZE - size;
}
static DEVICE_ATTR (periodic, S_IRUGO, show_periodic, NULL);
#undef DBG_SCHED_LIMIT
static ssize_t
-show_registers (struct device *dev, char *buf, size_t count, loff_t off)
+show_registers (struct device *dev, char *buf)
{
struct pci_dev *pdev;
struct ehci_hcd *ehci;
static char fmt [] = "%*s\n";
static char label [] = "";
- if (off != 0)
- return 0;
-
pdev = container_of (dev, struct pci_dev, dev);
ehci = container_of (pci_get_drvdata (pdev), struct ehci_hcd, hcd);
next = buf;
- size = count;
+ size = PAGE_SIZE;
spin_lock_irqsave (&ehci->lock, flags);
spin_unlock_irqrestore (&ehci->lock, flags);
- return count - size;
+ return PAGE_SIZE - size;
}
static DEVICE_ATTR (registers, S_IRUGO, show_registers, NULL);
*/
/*-------------------------------------------------------------------------*/
-
+
#ifdef DEBUG
#define edstring(ed_type) ({ char *temp; \
}
static ssize_t
-show_async (struct device *dev, char *buf, size_t count, loff_t off)
+show_async (struct device *dev, char *buf)
{
struct ohci_hcd *ohci;
size_t temp;
unsigned long flags;
- if (off != 0)
- return 0;
-
ohci = dev_to_ohci(dev);
/* display control and bulk lists together, for simplicity */
spin_lock_irqsave (&ohci->lock, flags);
- temp = show_list (ohci, buf, count, ohci->ed_controltail);
- count = show_list (ohci, buf + temp, count - temp, ohci->ed_bulktail);
+ temp = show_list (ohci, buf, PAGE_SIZE, ohci->ed_controltail);
+ temp += show_list (ohci, buf + temp, PAGE_SIZE - temp, ohci->ed_bulktail);
spin_unlock_irqrestore (&ohci->lock, flags);
- return temp + count;
+ return temp;
}
static DEVICE_ATTR (async, S_IRUGO, show_async, NULL);
#define DBG_SCHED_LIMIT 64
static ssize_t
-show_periodic (struct device *dev, char *buf, size_t count, loff_t off)
+show_periodic (struct device *dev, char *buf)
{
struct ohci_hcd *ohci;
struct ed **seen, *ed;
char *next;
unsigned i;
- if (off != 0)
- return 0;
if (!(seen = kmalloc (DBG_SCHED_LIMIT * sizeof *seen, SLAB_ATOMIC)))
return 0;
seen_count = 0;
ohci = dev_to_ohci(dev);
next = buf;
- size = count;
+ size = PAGE_SIZE;
temp = snprintf (next, size, "size = %d\n", NUM_INTS);
size -= temp;
spin_unlock_irqrestore (&ohci->lock, flags);
kfree (seen);
- return count - size;
+ return PAGE_SIZE - size;
}
static DEVICE_ATTR (periodic, S_IRUGO, show_periodic, NULL);
+
#undef DBG_SCHED_LIMIT
static inline void create_debug_files (struct ohci_hcd *bus)