If unsure, say N.
+Sony Vaio Programmable I/O Control Device support
+CONFIG_SONYPI
+ This driver enables access to the Sony Programmable I/O Control Device
+ which can be found in many (all ?) Sony Vaio laptops.
+
+ If you have one of those laptops, read Documentation/sonypi.txt,
+ and say Y or M here.
+
+ If you want to compile the driver as a module ( = code which can be
+ inserted in and removed from the running kernel whenever you want),
+ say M here and read <file:Documentation/modules.txt>. The module will be
+ called sonypi.o.
+
Intel Random Number Generator support
CONFIG_INTEL_RNG
This driver provides kernel-side support for the Random Number
from the running kernel whenever you want). If you want to compile
it as a module, say M here and read Documentation/modules.txt.
+CONFIG_VIDEO_MEYE
+ This is the video4linux driver for the Motion Eye camera found
+ in the Vaio Picturebook laptops. Please read the material in
+ <file:Documentation/video4linux/meye.txt> for more information.
+
+ If you say Y or M here, you need to say Y or M to "Sony Programmable
+ I/O Control Device" in the character device section.
+
+ This driver is available as a module called meye.o ( = code
+ which can be inserted in and removed from the running kernel
+ whenever you want). If you want to compile it as a module, say M
+ here and read <file:Documentation/modules.txt>.
+
IBM's S/390 architecture
CONFIG_ARCH_S390
Select this option, if you want to run the Kernel on one of IBM's
version and the tested hardware. Any changes to the HiSax source code may
therefore affect the certification.
+Additional ITU approval tests have been carried out for all generic cards
+using Colognechip single chip solutions HFC-S PCI A for PCI cards as well
+as HFC-S USB based USB ISDN ta adapters.
+These tests included all layers 1-3 and as well all functional tests for
+the layer 1. Because all hardware based on these chips are complete ISDN
+solutions in one chip all cards and USB-TAs using these chips are to be
+regarded as approved for those tests. Some additional electrical tests
+of the layer 1 which are independant of the driver and related to a
+special hardware used will be regarded as approved if at least one
+solution has been tested including those electrical tests. So if cards
+or tas have been completely approved for any other os, the approval
+for those electrical tests is valid for linux, too.
+Please send any questions regarding this drivers or approval abouts to
+werner@isdn-development.de
+Additional information and the type approval documents will be found
+shortly on the Colognechip website www.colognechip.com
+
If you change the main files of the HiSax ISDN stack, the certification will
become invalid. Because in most countries it is illegal to connect
unapproved ISDN equipment to the public network, I have to guarantee that
drivers/isdn/hisax/cert.c
drivers/isdn/hisax/elsa.c
drivers/isdn/hisax/diva.c
+drivers/isdn/hisax/hfc_pci.c
Please send any changes, bugfixes and patches to me rather than implementing
them directly into the HiSax sources.
VERSION = 2
PATCHLEVEL = 4
SUBLEVEL = 8
-EXTRAVERSION =-pre1
+EXTRAVERSION =-pre2
KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
-# $Id: Makefile,v 1.48 2000/12/15 00:41:24 davem Exp $
+# $Id: Makefile,v 1.49 2001/07/27 09:42:22 davem Exp $
# sparc/Makefile
#
# Makefile for the architecture dependent flags and dependencies on the
archdep: check_asm
-check_asm:
+check_asm: include/linux/version.h
$(MAKE) -C arch/sparc/kernel check_asm
tftpboot.img:
if ((current->personality == PER_SUNOS && request == PTRACE_SUNATTACH)
|| (current->personality != PER_SUNOS && request == PTRACE_ATTACH)) {
- unsigned long flags;
-
if (ptrace_attach(child)) {
pt_error_return(regs, EPERM);
goto out_tsk;
-/* $Id: fault.c,v 1.119 2001/03/24 09:36:10 davem Exp $
+/* $Id: fault.c,v 1.120 2001/07/18 13:40:05 anton Exp $
* fault.c: Page fault handlers for the Sparc.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
extern struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS];
extern int prom_node_root;
-struct linux_romvec *romvec;
-
/* At boot time we determine these two values necessary for setting
* up the segment maps and page table entries (pte's).
*/
-# $Id: Makefile,v 1.46 2000/12/14 22:57:26 davem Exp $
+# $Id: Makefile,v 1.47 2001/07/27 09:42:22 davem Exp $
# sparc64/Makefile
#
# Makefile for the architecture dependent flags and dependencies on the
archdep: check_asm
-check_asm:
+check_asm: include/linux/version.h
$(MAKE) -C arch/sparc64/kernel check_asm
tftpboot.img:
-/* $Id: ioctl32.c,v 1.117 2001/06/02 21:39:55 davem Exp $
+/* $Id: ioctl32.c,v 1.119 2001/07/21 00:28:25 davem Exp $
* ioctl32.c: Conversion between 32bit and 64bit native ioctls.
*
* Copyright (C) 1997-2000 Jakub Jelinek (jakub@redhat.com)
#include <linux/atm_tcp.h>
#include <linux/sonet.h>
#include <linux/atm_suni.h>
+#include <linux/mtd/mtd.h>
#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci.h>
+#include <linux/usb.h>
+#include <linux/usbdevice_fs.h>
+
/* Use this to get at 32-bit user passed pointers.
See sys_sparc32.c for description about these. */
#define A(__x) ((unsigned long)(__x))
return rw_long(fd, AUTOFS_IOC_SETTIMEOUT, arg);
}
+struct usbdevfs_ctrltransfer32 {
+ __u8 requesttype;
+ __u8 request;
+ __u16 value;
+ __u16 index;
+ __u16 length;
+ __u32 timeout; /* in milliseconds */
+ __u32 data;
+};
+
+#define USBDEVFS_CONTROL32 _IOWR('U', 0, struct usbdevfs_ctrltransfer32)
+
+static int do_usbdevfs_control(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+ struct usbdevfs_ctrltransfer kctrl;
+ struct usbdevfs_ctrltransfer32 *uctrl;
+ mm_segment_t old_fs;
+ __u32 udata;
+ void *uptr, *kptr;
+ int err;
+
+ uctrl = (struct usbdevfs_ctrltransfer32 *) arg;
+
+ if (copy_from_user(&kctrl, uctrl,
+ (sizeof(struct usbdevfs_ctrltransfer) -
+ sizeof(void *))))
+ return -EFAULT;
+
+ if (get_user(udata, &uctrl->data))
+ return -EFAULT;
+ uptr = (void *) A(udata);
+
+ /* In usbdevice_fs, it limits the control buffer to a page,
+ * for simplicity so do we.
+ */
+ if (!uptr || kctrl.length > PAGE_SIZE)
+ return -EINVAL;
+
+ kptr = (void *)__get_free_page(GFP_KERNEL);
+
+ if ((kctrl.requesttype & 0x80) == 0) {
+ err = -EFAULT;
+ if (copy_from_user(kptr, uptr, kctrl.length))
+ goto out;
+ }
+
+ kctrl.data = kptr;
+
+ old_fs = get_fs();
+ set_fs(KERNEL_DS);
+ err = sys_ioctl(fd, USBDEVFS_CONTROL, (unsigned long)&kctrl);
+ set_fs(old_fs);
+
+ if (err >= 0 &&
+ ((kctrl.requesttype & 0x80) != 0)) {
+ if (copy_to_user(uptr, kptr, kctrl.length))
+ err = -EFAULT;
+ }
+
+out:
+ free_page((unsigned long) kptr);
+ return err;
+}
+
+struct usbdevfs_bulktransfer32 {
+ unsigned int ep;
+ unsigned int len;
+ unsigned int timeout; /* in milliseconds */
+ __u32 data;
+};
+
+#define USBDEVFS_BULK32 _IOWR('U', 2, struct usbdevfs_bulktransfer32)
+
+static int do_usbdevfs_bulk(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+ struct usbdevfs_bulktransfer kbulk;
+ struct usbdevfs_bulktransfer32 *ubulk;
+ mm_segment_t old_fs;
+ __u32 udata;
+ void *uptr, *kptr;
+ int err;
+
+ ubulk = (struct usbdevfs_bulktransfer32 *) arg;
+
+ if (get_user(kbulk.ep, &ubulk->ep) ||
+ get_user(kbulk.len, &ubulk->len) ||
+ get_user(kbulk.timeout, &ubulk->timeout) ||
+ get_user(udata, &ubulk->data))
+ return -EFAULT;
+
+ uptr = (void *) A(udata);
+
+ /* In usbdevice_fs, it limits the control buffer to a page,
+ * for simplicity so do we.
+ */
+ if (!uptr || kbulk.len > PAGE_SIZE)
+ return -EINVAL;
+
+ kptr = (void *) __get_free_page(GFP_KERNEL);
+
+ if ((kbulk.ep & 0x80) == 0) {
+ err = -EFAULT;
+ if (copy_from_user(kptr, uptr, kbulk.len))
+ goto out;
+ }
+
+ kbulk.data = kptr;
+
+ old_fs = get_fs();
+ set_fs(KERNEL_DS);
+ err = sys_ioctl(fd, USBDEVFS_BULK, (unsigned long) &kbulk);
+ set_fs(old_fs);
+
+ if (err >= 0 &&
+ ((kbulk.ep & 0x80) != 0)) {
+ if (copy_to_user(uptr, kptr, kbulk.len))
+ err = -EFAULT;
+ }
+
+out:
+ free_page((unsigned long) kptr);
+ return err;
+}
+
+/* This needs more work before we can enable it. Unfortunately
+ * because of the fancy asynchronous way URB status/error is written
+ * back to userspace, we'll need to fiddle with USB devio internals
+ * and/or reimplement entirely the frontend of it ourselves. -DaveM
+ *
+ * The issue is:
+ *
+ * When an URB is submitted via usbdevicefs it is put onto an
+ * asynchronous queue. When the URB completes, it may be reaped
+ * via another ioctl. During this reaping the status is written
+ * back to userspace along with the length of the transfer.
+ *
+ * We must translate into 64-bit kernel types so we pass in a kernel
+ * space copy of the usbdevfs_urb structure. This would mean that we
+ * must do something to deal with the async entry reaping. First we
+ * have to deal somehow with this transitory memory we've allocated.
+ * This is problematic since there are many call sites from which the
+ * async entries can be destroyed (and thus when we'd need to free up
+ * this kernel memory). One of which is the close() op of usbdevicefs.
+ * To handle that we'd need to make our own file_operations struct which
+ * overrides usbdevicefs's release op with our own which runs usbdevicefs's
+ * real release op then frees up the kernel memory.
+ *
+ * But how to keep track of these kernel buffers? We'd need to either
+ * keep track of them in some table _or_ know about usbdevicefs internals
+ * (ie. the exact layout of it's file private, which is actually defined
+ * in linux/usbdevice_fs.h, the layout of the async queues are private to
+ * devio.c)
+ *
+ * There is one possible other solution I considered, also involving knowledge
+ * of usbdevicefs internals:
+ *
+ * After an URB is submitted, we "fix up" the address back to the user
+ * space one. This would work if the status/length fields written back
+ * by the async URB completion lines up perfectly in the 32-bit type with
+ * the 64-bit kernel type. Unfortunately, it does not because the iso
+ * frame descriptors, at the end of the struct, can be written back.
+ *
+ * I think we'll just need to simply duplicate the devio URB engine here.
+ */
+#if 0
+struct usbdevfs_urb32 {
+ __u8 type;
+ __u8 endpoint;
+ __s32 status;
+ __u32 flags;
+ __u32 buffer;
+ __s32 buffer_length;
+ __s32 actual_length;
+ __s32 start_frame;
+ __s32 number_of_packets;
+ __s32 error_count;
+ __u32 signr;
+ __u32 usercontext; /* unused */
+ struct usbdevfs_iso_packet_desc iso_frame_desc[0];
+};
+
+#define USBDEVFS_SUBMITURB32 _IOR('U', 10, struct usbdevfs_urb32)
+
+static int get_urb32(struct usbdevfs_urb *kurb,
+ struct usbdevfs_urb32 *uurb)
+{
+ if (get_user(kurb->type, &uurb->type) ||
+ __get_user(kurb->endpoint, &uurb->endpoint) ||
+ __get_user(kurb->status, &uurb->status) ||
+ __get_user(kurb->flags, &uurb->flags) ||
+ __get_user(kurb->buffer_length, &uurb->buffer_length) ||
+ __get_user(kurb->actual_length, &uurb->actual_length) ||
+ __get_user(kurb->start_frame, &uurb->start_frame) ||
+ __get_user(kurb->number_of_packets, &uurb->number_of_packets) ||
+ __get_user(kurb->error_count, &uurb->error_count) ||
+ __get_user(kurb->signr, &uurb->signr))
+ return -EFAULT;
+
+ kurb->usercontext = 0; /* unused currently */
+
+ return 0;
+}
+
+/* Just put back the values which usbdevfs actually changes. */
+static int put_urb32(struct usbdevfs_urb *kurb,
+ struct usbdevfs_urb32 *uurb)
+{
+ if (put_user(kurb->status, &uurb->status) ||
+ __put_user(kurb->actual_length, &uurb->actual_length) ||
+ __put_user(kurb->error_count, &uurb->error_count))
+ return -EFAULT;
+
+ if (kurb->number_of_packets != 0) {
+ int i;
+
+ for (i = 0; i < kurb->number_of_packets; i++) {
+ if (__put_user(kurb->iso_frame_desc[i].actual_length,
+ &uurb->iso_frame_desc[i].actual_length) ||
+ __put_user(kurb->iso_frame_desc[i].status,
+ &uurb->iso_frame_desc[i].status))
+ return -EFAULT;
+ }
+ }
+
+ return 0;
+}
+
+static int get_urb32_isoframes(struct usbdevfs_urb *kurb,
+ struct usbdevfs_urb32 *uurb)
+{
+ unsigned int totlen;
+ int i;
+
+ if (kurb->type != USBDEVFS_URB_TYPE_ISO) {
+ kurb->number_of_packets = 0;
+ return 0;
+ }
+
+ if (kurb->number_of_packets < 1 ||
+ kurb->number_of_packets > 128)
+ return -EINVAL;
+
+ if (copy_from_user(&kurb->iso_frame_desc[0],
+ &uurb->iso_frame_desc[0],
+ sizeof(struct usbdevfs_iso_packet_desc) *
+ kurb->number_of_packets))
+ return -EFAULT;
+
+ totlen = 0;
+ for (i = 0; i < kurb->number_of_packets; i++) {
+ unsigned int this_len;
+
+ this_len = kurb->iso_frame_desc[i].length;
+ if (this_len > 1023)
+ return -EINVAL;
+
+ totlen += this_len;
+ }
+
+ if (totlen > 32768)
+ return -EINVAL;
+
+ kurb->buffer_length = totlen;
+
+ return 0;
+}
+
+static int do_usbdevfs_urb(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+ struct usbdevfs_urb *kurb;
+ struct usbdevfs_urb32 *uurb;
+ mm_segment_t old_fs;
+ __u32 udata;
+ void *uptr, *kptr;
+ unsigned int buflen;
+ int err;
+
+ uurb = (struct usbdevfs_urb32 *) arg;
+
+ err = -ENOMEM;
+ kurb = kmalloc(sizeof(struct usbdevfs_urb) +
+ (sizeof(struct usbdevfs_iso_packet_desc) * 128),
+ GFP_KERNEL);
+ if (!kurb)
+ goto out;
+
+ err = -EFAULT;
+ if (get_urb32(kurb, uurb))
+ goto out;
+
+ err = get_urb32_isoframes(kurb, uurb);
+ if (err)
+ goto out;
+
+ err = -EFAULT;
+ if (__get_user(udata, &uurb->buffer))
+ goto out;
+ uptr = (void *) A(udata);
+
+ err = -ENOMEM;
+ buflen = kurb->buffer_length;
+ kptr = kmalloc(buflen, GFP_KERNEL);
+ if (!kptr)
+ goto out;
+
+ kurb->buffer = kptr;
+
+ err = -EFAULT;
+ if (copy_from_user(kptr, uptr, buflen))
+ goto out_kptr;
+
+ old_fs = get_fs();
+ set_fs(KERNEL_DS);
+ err = sys_ioctl(fd, USBDEVFS_SUBMITURB, (unsigned long) kurb);
+ set_fs(old_fs);
+
+ if (err >= 0) {
+ /* XXX Shit, this doesn't work for async URBs :-( XXX */
+ if (put_urb32(kurb, uurb)) {
+ err = -EFAULT;
+ } else if ((kurb->endpoint & USB_DIR_IN) != 0) {
+ if (copy_to_user(uptr, kptr, buflen))
+ err = -EFAULT;
+ }
+ }
+
+out_kptr:
+ kfree(kptr);
+
+out:
+ kfree(kurb);
+ return err;
+}
+#endif
+
+#define USBDEVFS_REAPURB32 _IOW('U', 12, u32)
+#define USBDEVFS_REAPURBNDELAY32 _IOW('U', 13, u32)
+
+static int do_usbdevfs_reapurb(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+ mm_segment_t old_fs;
+ void *kptr;
+ int err;
+
+ old_fs = get_fs();
+ set_fs(KERNEL_DS);
+ err = sys_ioctl(fd,
+ (cmd == USBDEVFS_REAPURB32 ?
+ USBDEVFS_REAPURB :
+ USBDEVFS_REAPURBNDELAY),
+ (unsigned long) &kptr);
+ set_fs(old_fs);
+
+ if (err >= 0 &&
+ put_user(((u32)(long)kptr), (u32 *) A(arg)))
+ err = -EFAULT;
+
+ return err;
+}
+
+struct usbdevfs_disconnectsignal32 {
+ unsigned int signr;
+ u32 context;
+};
+
+#define USBDEVFS_DISCSIGNAL32 _IOR('U', 14, struct usbdevfs_disconnectsignal32)
+
+static int do_usbdevfs_discsignal(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+ struct usbdevfs_disconnectsignal kdis;
+ struct usbdevfs_disconnectsignal32 *udis;
+ mm_segment_t old_fs;
+ u32 uctx;
+ int err;
+
+ udis = (struct usbdevfs_disconnectsignal32 *) arg;
+
+ if (get_user(kdis.signr, &udis->signr) ||
+ __get_user(uctx, &udis->context))
+ return -EFAULT;
+
+ kdis.context = (void *) (long)uctx;
+
+ old_fs = get_fs();
+ set_fs(KERNEL_DS);
+ err = sys_ioctl(fd, USBDEVFS_DISCSIGNAL, (unsigned long) &kdis);
+ set_fs(old_fs);
+
+ return err;
+}
+
+struct mtd_oob_buf32 {
+ u32 start;
+ u32 length;
+ u32 ptr; /* unsigned char* */
+};
+
+#define MEMWRITEOOB32 _IOWR('M',3,struct mtd_oob_buf32)
+#define MEMREADOOB32 _IOWR('M',4,struct mtd_oob_buf32)
+
+static inline int
+mtd_rw_oob(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+ mm_segment_t old_fs = get_fs();
+ struct mtd_oob_buf32 *uarg = (struct mtd_oob_buf32 *)arg;
+ struct mtd_oob_buf karg;
+ u32 tmp;
+ char *ptr;
+ int ret;
+
+ if (get_user(karg.start, &uarg->start) ||
+ get_user(karg.length, &uarg->length) ||
+ get_user(tmp, &uarg->ptr))
+ return -EFAULT;
+
+ ptr = (char *)A(tmp);
+ if (0 >= karg.length)
+ return -EINVAL;
+
+ karg.ptr = kmalloc(karg.length, GFP_KERNEL);
+ if (NULL == karg.ptr)
+ return -ENOMEM;
+
+ if (copy_from_user(karg.ptr, ptr, karg.length)) {
+ kfree(karg.ptr);
+ return -EFAULT;
+ }
+
+ set_fs(KERNEL_DS);
+ if (MEMREADOOB32 == cmd)
+ ret = sys_ioctl(fd, MEMREADOOB, (unsigned long)&karg);
+ else if (MEMWRITEOOB32 == cmd)
+ ret = sys_ioctl(fd, MEMWRITEOOB, (unsigned long)&karg);
+ else
+ ret = -EINVAL;
+ set_fs(old_fs);
+
+ if (0 == ret && cmd == MEMREADOOB32) {
+ ret = copy_to_user(ptr, karg.ptr, karg.length);
+ ret |= put_user(karg.start, &uarg->start);
+ ret |= put_user(karg.length, &uarg->length);
+ }
+
+ kfree(karg.ptr);
+ return ((0 == ret) ? 0 : -EFAULT);
+}
+
struct ioctl_trans {
unsigned int cmd;
unsigned int handler;
COMPATIBLE_IOCTL(PCIIOC_MMAP_IS_IO)
COMPATIBLE_IOCTL(PCIIOC_MMAP_IS_MEM)
COMPATIBLE_IOCTL(PCIIOC_WRITE_COMBINE)
+/* USB */
+COMPATIBLE_IOCTL(USBDEVFS_RESETEP)
+COMPATIBLE_IOCTL(USBDEVFS_SETINTERFACE)
+COMPATIBLE_IOCTL(USBDEVFS_SETCONFIGURATION)
+COMPATIBLE_IOCTL(USBDEVFS_GETDRIVER)
+COMPATIBLE_IOCTL(USBDEVFS_DISCARDURB)
+COMPATIBLE_IOCTL(USBDEVFS_CLAIMINTERFACE)
+COMPATIBLE_IOCTL(USBDEVFS_RELEASEINTERFACE)
+COMPATIBLE_IOCTL(USBDEVFS_CONNECTINFO)
+COMPATIBLE_IOCTL(USBDEVFS_HUB_PORTINFO)
+COMPATIBLE_IOCTL(USBDEVFS_RESET)
+COMPATIBLE_IOCTL(USBDEVFS_CLEAR_HALT)
+/* MTD */
+COMPATIBLE_IOCTL(MEMGETINFO)
+COMPATIBLE_IOCTL(MEMERASE)
+COMPATIBLE_IOCTL(MEMLOCK)
+COMPATIBLE_IOCTL(MEMUNLOCK)
+COMPATIBLE_IOCTL(MEMGETREGIONCOUNT)
+COMPATIBLE_IOCTL(MEMGETREGIONINFO)
/* And these ioctls need translation */
+HANDLE_IOCTL(MEMREADOOB32, mtd_rw_oob)
+HANDLE_IOCTL(MEMWRITEOOB32, mtd_rw_oob)
HANDLE_IOCTL(SIOCGIFNAME, dev_ifname32)
HANDLE_IOCTL(SIOCGIFCONF, dev_ifconf)
HANDLE_IOCTL(SIOCGIFFLAGS, dev_ifsioc)
HANDLE_IOCTL(RTC32_EPOCH_READ, do_rtc_ioctl)
HANDLE_IOCTL(RTC32_EPOCH_SET, do_rtc_ioctl)
#endif
+HANDLE_IOCTL(USBDEVFS_CONTROL32, do_usbdevfs_control)
+HANDLE_IOCTL(USBDEVFS_BULK32, do_usbdevfs_bulk)
+/*HANDLE_IOCTL(USBDEVFS_SUBMITURB32, do_usbdevfs_urb)*/
+HANDLE_IOCTL(USBDEVFS_REAPURB32, do_usbdevfs_reapurb)
+HANDLE_IOCTL(USBDEVFS_REAPURBNDELAY32, do_usbdevfs_reapurb)
+HANDLE_IOCTL(USBDEVFS_DISCSIGNAL32, do_usbdevfs_discsignal)
IOCTL_TABLE_END
unsigned int ioctl32_hash_table[1024];
if ((current->personality == PER_SUNOS && request == PTRACE_SUNATTACH)
|| (current->personality != PER_SUNOS && request == PTRACE_ATTACH)) {
- unsigned long flags;
-
if (ptrace_attach(child)) {
pt_error_return(regs, EPERM);
goto out_tsk;
#include <linux/spinlock.h>
#include <linux/timer.h>
#include <linux/pci.h>
+#include <linux/completion.h>
#include <asm/io.h>
#include <asm/segment.h>
#include <asm/uaccess.h>
static void DAC960_ExecuteCommand(DAC960_Command_T *Command)
{
DAC960_Controller_T *Controller = Command->Controller;
- DECLARE_MUTEX_LOCKED(Semaphore);
+ DECLARE_COMPLETION(Wait);
unsigned long ProcessorFlags;
- Command->Semaphore = &Semaphore;
+ Command->Waiting = &Wait;
DAC960_AcquireControllerLock(Controller, &ProcessorFlags);
DAC960_QueueCommand(Command);
DAC960_ReleaseControllerLock(Controller, &ProcessorFlags);
if (in_interrupt()) return;
- down(&Semaphore);
+ wait_for_completion(&Wait);
}
*Controller)
{
DAC960_V1_DCDB_T DCDBs[DAC960_V1_MaxChannels], *DCDB;
- Semaphore_T Semaphores[DAC960_V1_MaxChannels], *Semaphore;
+ Completion_T Wait[DAC960_V1_MaxChannels], *wait;
unsigned long ProcessorFlags;
int Channel, TargetID;
for (TargetID = 0; TargetID < Controller->Targets; TargetID++)
DAC960_SCSI_Inquiry_T *InquiryStandardData =
&Controller->V1.InquiryStandardData[Channel][TargetID];
InquiryStandardData->PeripheralDeviceType = 0x1F;
- Semaphore = &Semaphores[Channel];
- init_MUTEX_LOCKED(Semaphore);
+ wait = &Wait[Channel];
+ init_completion(wait);
DCDB = &DCDBs[Channel];
DAC960_V1_ClearCommand(Command);
Command->CommandType = DAC960_ImmediateCommand;
- Command->Semaphore = Semaphore;
+ Command->Waiting = wait;
Command->V1.CommandMailbox.Type3.CommandOpcode = DAC960_V1_DCDB;
Command->V1.CommandMailbox.Type3.BusAddress = Virtual_to_Bus32(DCDB);
DCDB->Channel = Channel;
DAC960_SCSI_Inquiry_UnitSerialNumber_T *InquiryUnitSerialNumber =
&Controller->V1.InquiryUnitSerialNumber[Channel][TargetID];
InquiryUnitSerialNumber->PeripheralDeviceType = 0x1F;
- Semaphore = &Semaphores[Channel];
- down(Semaphore);
+ wait = &Wait[Channel];
+ wait_for_completion(wait);
if (Command->V1.CommandStatus != DAC960_V1_NormalCompletion)
continue;
- Command->Semaphore = Semaphore;
+ Command->Waiting = wait;
DCDB = &DCDBs[Channel];
DCDB->TransferLength = sizeof(DAC960_SCSI_Inquiry_UnitSerialNumber_T);
DCDB->BusAddress = Virtual_to_Bus32(InquiryUnitSerialNumber);
DAC960_AcquireControllerLock(Controller, &ProcessorFlags);
DAC960_QueueCommand(Command);
DAC960_ReleaseControllerLock(Controller, &ProcessorFlags);
- down(Semaphore);
+ wait_for_completion(wait);
}
}
return true;
if (Request->cmd == READ)
Command->CommandType = DAC960_ReadCommand;
else Command->CommandType = DAC960_WriteCommand;
- Command->Semaphore = Request->sem;
+ Command->Waiting = Request->waiting;
Command->LogicalDriveNumber = DAC960_LogicalDriveNumber(Request->rq_dev);
Command->BlockNumber =
Request->sector
/*
Wake up requestor for swap file paging requests.
*/
- if (Command->Semaphore != NULL)
+ if (Command->Waiting)
{
- up(Command->Semaphore);
- Command->Semaphore = NULL;
+ complete(Command->Waiting);
+ Command->Waiting = NULL;
}
add_blkdev_randomness(DAC960_MAJOR + Controller->ControllerNumber);
}
DAC960_ProcessCompletedBuffer(BufferHeader, false);
BufferHeader = NextBufferHeader;
}
- /*
- Wake up requestor for swap file paging requests.
- */
- if (Command->Semaphore != NULL)
+ if (Command->Waiting)
{
- up(Command->Semaphore);
- Command->Semaphore = NULL;
+ complete(Command->Waiting);
+ Command->Waiting = NULL;
}
}
}
}
if (CommandType == DAC960_ImmediateCommand)
{
- up(Command->Semaphore);
- Command->Semaphore = NULL;
+ complete(Command->Waiting);
+ Command->Waiting = NULL;
return;
}
if (CommandType == DAC960_QueuedCommand)
DAC960_ProcessCompletedBuffer(BufferHeader, true);
BufferHeader = NextBufferHeader;
}
- /*
- Wake up requestor for swap file paging requests.
- */
- if (Command->Semaphore != NULL)
+ if (Command->Waiting)
{
- up(Command->Semaphore);
- Command->Semaphore = NULL;
+ complete(Command->Waiting);
+ Command->Waiting = NULL;
}
add_blkdev_randomness(DAC960_MAJOR + Controller->ControllerNumber);
}
DAC960_ProcessCompletedBuffer(BufferHeader, false);
BufferHeader = NextBufferHeader;
}
- /*
- Wake up requestor for swap file paging requests.
- */
- if (Command->Semaphore != NULL)
+ if (Command->Waiting)
{
- up(Command->Semaphore);
- Command->Semaphore = NULL;
+ complete(Command->Waiting);
+ Command->Waiting = NULL;
}
}
}
}
if (CommandType == DAC960_ImmediateCommand)
{
- up(Command->Semaphore);
- Command->Semaphore = NULL;
+ complete(Command->Waiting);
+ Command->Waiting = NULL;
return;
}
if (CommandType == DAC960_QueuedCommand)
typedef struct pt_regs Registers_T;
typedef struct request IO_Request_T;
typedef request_queue_t RequestQueue_T;
-typedef struct semaphore Semaphore_T;
+typedef struct completion Completion_T;
typedef struct super_block SuperBlock_T;
typedef struct timer_list Timer_T;
typedef wait_queue_head_t WaitQueue_T;
DAC960_CommandType_T CommandType;
struct DAC960_Controller *Controller;
struct DAC960_Command *Next;
- Semaphore_T *Semaphore;
+ Completion_T *Waiting;
unsigned int LogicalDriveNumber;
unsigned int BlockNumber;
unsigned int BlockCount;
if (len > PAGE_SIZE)
len = PAGE_SIZE;
len = vread(kbuf, (char *)p, len);
- if (len && copy_to_user(buf, kbuf, len)) {
+ if (!len)
+ break;
+ if (copy_to_user(buf, kbuf, len)) {
free_page((unsigned long)kbuf);
return -EFAULT;
}
obj-$(CONFIG_HISAX_SEDLBAUER_CS) += sedlbauer_cs.o
obj-$(CONFIG_HISAX_ELSA_CS) += elsa_cs.o
-MD5FILES := isac.c isdnl1.c isdnl2.c isdnl3.c \
- tei.c callc.c cert.c l3dss1.c l3_1tr6.c \
- elsa.c diva.c sedlbauer.c
CERT := $(shell md5sum -c md5sums.asc >> /dev/null;echo $$?)
CFLAGS_cert.o := -DCERTIFICATION=$(CERT)
-/* $Id: cert.c,v 2.3.6.1 2001/02/16 16:43:25 kai Exp $
+/* $Id: cert.c,v 2.3.6.2 2001/07/27 09:08:27 kai Exp $
*
* Author Karsten Keil (keil@isdn4linux.de)
*
printk(KERN_INFO "HiSax: Approved with ELSA Microlink PCI cards\n");
printk(KERN_INFO "HiSax: Approved with Eicon Technology Diva 2.01 PCI cards\n");
printk(KERN_INFO "HiSax: Approved with Sedlbauer Speedfax + cards\n");
+ printk(KERN_INFO "HiSax: Approved with HFC-S PCI A based cards\n");
}
return(0);
#endif
-/* $Id: hfc_pci.c,v 1.34.6.6 2001/06/09 15:14:17 kai Exp $
+/* $Id: hfc_pci.c,v 1.34.6.7 2001/07/27 09:08:27 kai Exp $
* hfc_pci.c low level driver for CCD´s hfc-pci based cards
*
* Author Werner Cornelius (werner@isdn4linux.de)
* based on existing driver for CCD hfc ISA cards
+ * type approval valid for HFC-S PCI A based card
*
- * Copyright 1999 by Werner Cornelius (werner@isdn4linux.de)
+ * Copyright 1999 by Werner Cornelius (werner@isdn-development.de)
* Copyright 1999 by Karsten Keil (keil@isdn4linux.de)
*
* This program is free software; you can redistribute it and/or modify
extern const char *CardType[];
-static const char *hfcpci_revision = "$Revision: 1.34.6.6 $";
+static const char *hfcpci_revision = "$Revision: 1.34.6.7 $";
/* table entry in the PCI devices list */
typedef struct {
l1_msg(cs, HW_POWERUP | CONFIRM, NULL);
break;
case (HW_ENABLE | REQUEST):
- Write_hfc(cs, HFCPCI_STATES, HFCPCI_ACTIVATE | HFCPCI_DO_ACTION);
+ Write_hfc(cs, HFCPCI_STATES, HFCPCI_DO_ACTION);
break;
case (HW_DEACTIVATE | REQUEST):
cs->hw.hfcpci.mst_m &= ~HFCPCI_MASTER;
------BEGIN PGP SIGNED MESSAGE-----
-
# This are valid md5sums for certificated HiSax driver.
# The certification is valid only if the md5sums of all files match.
# The certification is valid only for ELSA Microlink PCI,
-# Eicon Technology Diva 2.01 PCI and Sedlbauer SpeedFax+
-# cards in the moment.
+# Eicon Technology Diva 2.01 PCI, Sedlbauer SpeedFax+,
+# HFC-S PCI A based cards and HFC-S USB based isdn tas
+# in the moment.
# Read ../../../Documentation/isdn/HiSax.cert for more informations.
#
6f9433a8b696076562562d090e3c420f isac.c
7076deb94a363945c21ea27aca4a720a isdnl3.c
51c603829b6cc4f8421f744ad657ceff tei.c
669050ab5079f02887ed0239d86e5474 callc.c
-e592db58630c1f1029cc064110108156 cert.c
+ecacd146b8f8881ef9349935dab3df4a cert.c
fadeb3b85bb23bc1ac48470c0848d6fa l3dss1.c
cf7dec9fac6283716904d26b99188476 l3_1tr6.c
-65d9e5471bc129624f858ebcf0743525 elsa.c
+2f75c8765e1be13d114d5f4433cf364b elsa.c
b4cf8a4dceed9ea6dcba65a85b4eecc7 diva.c
-99e67bea8f6945fa0d4e0aded5bf0fa0 sedlbauer.c
+dee3f8f40c6fe78a4b57729804b7e6cd sedlbauer.c
+0d79fe6dfc5bfaa4826970c41a6d273d hfc_pci.c
# end of md5sums
-
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/string.h>
#include <linux/timer.h>
#include <linux/ioport.h>
-/* $Id: isdn_net.c,v 1.140.6.6 2001/06/11 22:08:37 kai Exp $
+/* $Id: isdn_net.c,v 1.140.6.7 2001/07/27 11:15:53 kai Exp $
* Linux ISDN subsystem, network interfaces and related functions (linklevel).
*
static void isdn_net_ciscohdlck_connected(isdn_net_local *lp);
static void isdn_net_ciscohdlck_disconnected(isdn_net_local *lp);
-char *isdn_net_revision = "$Revision: 1.140.6.6 $";
+char *isdn_net_revision = "$Revision: 1.140.6.7 $";
/*
* Code for raw-networking over ISDN
{
ushort max_hlhdr_len = 0;
isdn_net_local *lp = (isdn_net_local *) ndev->priv;
- int drvidx,
- i;
+ int drvidx, i;
- if (ndev == NULL) {
- printk(KERN_WARNING "isdn_net_init: dev = NULL!\n");
- return -ENODEV;
- }
- if (ndev->priv == NULL) {
- printk(KERN_WARNING "isdn_net_init: dev->priv = NULL!\n");
- return -ENODEV;
- }
ether_setup(ndev);
lp->org_hhc = ndev->hard_header_cache;
lp->org_hcu = ndev->header_cache_update;
-/* $Id: isdn_ppp.c,v 1.85.6.5 2001/05/26 15:19:56 kai Exp $
+/* $Id: isdn_ppp.c,v 1.85.6.6 2001/07/27 09:08:27 kai Exp $
*
* Linux ISDN subsystem, functions for synchronous PPP (linklevel).
*
static int isdn_ppp_bundle(struct ippp_struct *, int unit);
#endif /* CONFIG_ISDN_MPP */
-char *isdn_ppp_revision = "$Revision: 1.85.6.5 $";
+char *isdn_ppp_revision = "$Revision: 1.85.6.6 $";
static struct ippp_struct *ippp_table[ISDN_MAX_CHANNELS];
sdev = lp->slave;
while (sdev) {
isdn_net_local *mlp = (isdn_net_local *) sdev->priv;
- if ((mlp->flags & ISDN_NET_CONNECTED))
+
+ if (mlp->slave) { /* find last connected link in chain */
+ isdn_net_local *nlp = (isdn_net_local *) mlp->slave->priv;
+
+ if (!(nlp->flags & ISDN_NET_CONNECTED))
+ break;
+ } else if (mlp->flags & ISDN_NET_CONNECTED)
break;
+
sdev = mlp->slave;
}
if (!sdev)
-/* $Id: isdn_tty.c,v 1.94.6.3 2001/07/03 14:48:25 kai Exp $
+/* $Id: isdn_tty.c,v 1.94.6.4 2001/07/27 11:15:53 kai Exp $
* Linux ISDN subsystem, tty functions and AT-command emulator (linklevel).
*
static int si2bit[8] =
{4, 1, 4, 4, 4, 4, 4, 4};
-char *isdn_tty_revision = "$Revision: 1.94.6.3 $";
+char *isdn_tty_revision = "$Revision: 1.94.6.4 $";
/* isdn_tty_try_read() is called from within isdn_tty_rcv_skb()
if (isdn_tty_paranoia_check(info, tty->device, "isdn_tty_write"))
return 0;
- if (!tty)
- return 0;
if (from_user)
down(&info->write_sem);
/* See isdn_tty_senddown() */
/* return a page table pointing to N pages of locked memory */
static void *ptable_alloc(int npages, u32 *pt_addr) {
- int i = 0;
+ int i;
void *vmem;
- u32 ptable[npages+1];
- signed long size;
+ u32 *ptable;
unsigned long adr;
- size = (npages + 1) * PAGE_SIZE;
- vmem = rvmalloc(size);
+ vmem = rvmalloc((npages + 1) * PAGE_SIZE);
if (!vmem)
return NULL;
- memset(ptable, 0, sizeof(ptable));
adr = (unsigned long)vmem;
- while (size > 0) {
- ptable[i++] = virt_to_bus(__va(kvirt_to_pa(adr)));
+ ptable = (u32 *)(vmem + npages * PAGE_SIZE);
+ for (i = 0; i < npages; i++) {
+ ptable[i] = (u32) kvirt_to_bus(adr);
adr += PAGE_SIZE;
- size -= PAGE_SIZE;
}
- memcpy(vmem + npages * PAGE_SIZE, ptable, PAGE_SIZE);
- *pt_addr = ptable[npages];
-
+ *pt_addr = (u32) kvirt_to_bus(adr);
return vmem;
}
#define _MEYE_PRIV_H_
#define MEYE_DRIVER_MAJORVERSION 1
-#define MEYE_DRIVER_MINORVERSION 0
+#define MEYE_DRIVER_MINORVERSION 1
/****************************************************************************/
/* Motion JPEG chip registers */
-/* $Id: sunhme.c,v 1.120 2001/06/14 17:37:23 jgarzik Exp $
+/* $Id: sunhme.c,v 1.121 2001/07/27 10:22:57 davem Exp $
* sunhme.c: Sparc HME/BigMac 10/100baseT half/full duplex auto switching,
* auto carrier detecting ethernet driver. Also known as the
* "Happy Meal Ethernet" found on SunSwift SBUS cards.
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/ethtool.h>
+#include <linux/mii.h>
#include <asm/system.h>
#include <asm/bitops.h>
#include <asm/io.h>
*/
static int try_next_permutation(struct happy_meal *hp, unsigned long tregs)
{
- hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, DP83840_BMCR);
+ hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR);
/* Downgrade from full to half duplex. Only possible
* via ethtool.
*/
if (hp->sw_bmcr & BMCR_FULLDPLX) {
hp->sw_bmcr &= ~(BMCR_FULLDPLX);
- happy_meal_tcvr_write(hp, tregs, DP83840_BMCR, hp->sw_bmcr);
+ happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr);
return 0;
}
/* Downgrade from 100 to 10. */
if (hp->sw_bmcr & BMCR_SPEED100) {
hp->sw_bmcr &= ~(BMCR_SPEED100);
- happy_meal_tcvr_write(hp, tregs, DP83840_BMCR, hp->sw_bmcr);
+ happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr);
return 0;
}
else
printk("internal ");
printk("transceiver at ");
- hp->sw_lpa = happy_meal_tcvr_read(hp, tregs, DP83840_LPA);
+ hp->sw_lpa = happy_meal_tcvr_read(hp, tregs, MII_LPA);
if (hp->sw_lpa & (LPA_100HALF | LPA_100FULL)) {
if (hp->sw_lpa & LPA_100FULL)
printk("100Mb/s, Full Duplex.\n");
else
printk("internal ");
printk("transceiver at ");
- hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, DP83840_BMCR);
+ hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR);
if (hp->sw_bmcr & BMCR_SPEED100)
printk("100Mb/s, ");
else
* proper duplex setting.
*/
if (hp->timer_state == arbwait) {
- hp->sw_lpa = happy_meal_tcvr_read(hp, tregs, DP83840_LPA);
+ hp->sw_lpa = happy_meal_tcvr_read(hp, tregs, MII_LPA);
if (!(hp->sw_lpa & (LPA_10HALF | LPA_10FULL | LPA_100HALF | LPA_100FULL)))
goto no_response;
if (hp->sw_lpa & LPA_100FULL)
full = 0;
} else {
/* Forcing a link mode. */
- hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, DP83840_BMCR);
+ hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR);
if (hp->sw_bmcr & BMCR_FULLDPLX)
full = 1;
else
if (hp->timer_ticks >= 10) {
/* Enter force mode. */
do_force_mode:
- hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, DP83840_BMCR);
+ hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR);
printk(KERN_NOTICE "%s: Auto-Negotiation unsuccessful, trying force link mode\n",
hp->dev->name);
hp->sw_bmcr = BMCR_SPEED100;
- happy_meal_tcvr_write(hp, tregs, DP83840_BMCR, hp->sw_bmcr);
+ happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr);
if (!is_lucent_phy(hp)) {
/* OK, seems we need do disable the transceiver for the first
restart_timer = 1;
} else {
/* Anything interesting happen? */
- hp->sw_bmsr = happy_meal_tcvr_read(hp, tregs, DP83840_BMSR);
+ hp->sw_bmsr = happy_meal_tcvr_read(hp, tregs, MII_BMSR);
if (hp->sw_bmsr & BMSR_ANEGCOMPLETE) {
int ret;
* forever until some sort of error is signalled, reporting
* a message to the user at 10 second intervals.
*/
- hp->sw_bmsr = happy_meal_tcvr_read(hp, tregs, DP83840_BMSR);
+ hp->sw_bmsr = happy_meal_tcvr_read(hp, tregs, MII_BMSR);
if (hp->sw_bmsr & BMSR_LSTATUS) {
/* Wheee, it's up, display the link mode in use and put
* the timer to sleep.
* permutations, but then again this is essentially
* error recovery code for the most part.
*/
- hp->sw_bmsr = happy_meal_tcvr_read(hp, tregs, DP83840_BMSR);
+ hp->sw_bmsr = happy_meal_tcvr_read(hp, tregs, MII_BMSR);
hp->sw_csconfig = happy_meal_tcvr_read(hp, tregs, DP83840_CSCONFIG);
if (hp->timer_ticks == 1) {
if (!is_lucent_phy(hp)) {
hp->tcvr_type = internal;
hp->paddr = TCV_PADDR_ITX;
ASD(("ISOLATE,"));
- happy_meal_tcvr_write(hp, tregs, DP83840_BMCR,
+ happy_meal_tcvr_write(hp, tregs, MII_BMCR,
(BMCR_LOOPBACK|BMCR_PDOWN|BMCR_ISOLATE));
- result = happy_meal_tcvr_read(hp, tregs, DP83840_BMCR);
+ result = happy_meal_tcvr_read(hp, tregs, MII_BMCR);
if (result == TCVR_FAILURE) {
ASD(("phyread_fail>\n"));
return -1;
ASD(("internal<PSELECT,"));
hme_write32(hp, tregs + TCVR_CFG, (tconfig | TCV_CFG_PSELECT));
ASD(("ISOLATE,"));
- happy_meal_tcvr_write(hp, tregs, DP83840_BMCR,
+ happy_meal_tcvr_write(hp, tregs, MII_BMCR,
(BMCR_LOOPBACK|BMCR_PDOWN|BMCR_ISOLATE));
- result = happy_meal_tcvr_read(hp, tregs, DP83840_BMCR);
+ result = happy_meal_tcvr_read(hp, tregs, MII_BMCR);
if (result == TCVR_FAILURE) {
ASD(("phyread_fail>\n"));
return -1;
}
ASD(("BMCR_RESET "));
- happy_meal_tcvr_write(hp, tregs, DP83840_BMCR, BMCR_RESET);
+ happy_meal_tcvr_write(hp, tregs, MII_BMCR, BMCR_RESET);
while (--tries) {
- result = happy_meal_tcvr_read(hp, tregs, DP83840_BMCR);
+ result = happy_meal_tcvr_read(hp, tregs, MII_BMCR);
if (result == TCVR_FAILURE)
return -1;
hp->sw_bmcr = result;
ASD(("RESET_OK\n"));
/* Get fresh copies of the PHY registers. */
- hp->sw_bmsr = happy_meal_tcvr_read(hp, tregs, DP83840_BMSR);
- hp->sw_physid1 = happy_meal_tcvr_read(hp, tregs, DP83840_PHYSID1);
- hp->sw_physid2 = happy_meal_tcvr_read(hp, tregs, DP83840_PHYSID2);
- hp->sw_advertise = happy_meal_tcvr_read(hp, tregs, DP83840_ADVERTISE);
+ hp->sw_bmsr = happy_meal_tcvr_read(hp, tregs, MII_BMSR);
+ hp->sw_physid1 = happy_meal_tcvr_read(hp, tregs, MII_PHYSID1);
+ hp->sw_physid2 = happy_meal_tcvr_read(hp, tregs, MII_PHYSID2);
+ hp->sw_advertise = happy_meal_tcvr_read(hp, tregs, MII_ADVERTISE);
ASD(("UNISOLATE"));
hp->sw_bmcr &= ~(BMCR_ISOLATE);
- happy_meal_tcvr_write(hp, tregs, DP83840_BMCR, hp->sw_bmcr);
+ happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr);
tries = TCVR_UNISOLATE_TRIES;
while (--tries) {
- result = happy_meal_tcvr_read(hp, tregs, DP83840_BMCR);
+ result = happy_meal_tcvr_read(hp, tregs, MII_BMCR);
if (result == TCVR_FAILURE)
return -1;
if (!(result & BMCR_ISOLATE))
int timeout;
/* Read all of the registers we are interested in now. */
- hp->sw_bmsr = happy_meal_tcvr_read(hp, tregs, DP83840_BMSR);
- hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, DP83840_BMCR);
- hp->sw_physid1 = happy_meal_tcvr_read(hp, tregs, DP83840_PHYSID1);
- hp->sw_physid2 = happy_meal_tcvr_read(hp, tregs, DP83840_PHYSID2);
+ hp->sw_bmsr = happy_meal_tcvr_read(hp, tregs, MII_BMSR);
+ hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR);
+ hp->sw_physid1 = happy_meal_tcvr_read(hp, tregs, MII_PHYSID1);
+ hp->sw_physid2 = happy_meal_tcvr_read(hp, tregs, MII_PHYSID2);
/* XXX Check BMSR_ANEGCAPABLE, should not be necessary though. */
- hp->sw_advertise = happy_meal_tcvr_read(hp, tregs, DP83840_ADVERTISE);
+ hp->sw_advertise = happy_meal_tcvr_read(hp, tregs, MII_ADVERTISE);
if (ep == NULL || ep->autoneg == AUTONEG_ENABLE) {
/* Advertise everything we can support. */
if (hp->sw_bmsr & BMSR_10HALF)
hp->sw_advertise |= (ADVERTISE_100FULL);
else
hp->sw_advertise &= ~(ADVERTISE_100FULL);
- happy_meal_tcvr_write(hp, tregs, DP83840_ADVERTISE, hp->sw_advertise);
+ happy_meal_tcvr_write(hp, tregs, MII_ADVERTISE, hp->sw_advertise);
/* XXX Currently no Happy Meal cards I know off support 100BaseT4,
* XXX and this is because the DP83840 does not support it, changes
/* Enable Auto-Negotiation, this is usually on already... */
hp->sw_bmcr |= BMCR_ANENABLE;
- happy_meal_tcvr_write(hp, tregs, DP83840_BMCR, hp->sw_bmcr);
+ happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr);
/* Restart it to make sure it is going. */
hp->sw_bmcr |= BMCR_ANRESTART;
- happy_meal_tcvr_write(hp, tregs, DP83840_BMCR, hp->sw_bmcr);
+ happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr);
/* BMCR_ANRESTART self clears when the process has begun. */
timeout = 64; /* More than enough. */
while (--timeout) {
- hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, DP83840_BMCR);
+ hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR);
if (!(hp->sw_bmcr & BMCR_ANRESTART))
break; /* got it. */
udelay(10);
if (ep->duplex == DUPLEX_FULL)
hp->sw_bmcr |= BMCR_FULLDPLX;
}
- happy_meal_tcvr_write(hp, tregs, DP83840_BMCR, hp->sw_bmcr);
+ happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr);
if (!is_lucent_phy(hp)) {
/* OK, seems we need do disable the transceiver for the first
return;
/* Latch PHY registers as of now. */
- hp->sw_bmsr = happy_meal_tcvr_read(hp, tregs, DP83840_BMSR);
- hp->sw_advertise = happy_meal_tcvr_read(hp, tregs, DP83840_ADVERTISE);
+ hp->sw_bmsr = happy_meal_tcvr_read(hp, tregs, MII_BMSR);
+ hp->sw_advertise = happy_meal_tcvr_read(hp, tregs, MII_ADVERTISE);
/* Advertise everything we can support. */
if (hp->sw_bmsr & BMSR_10HALF)
hp->sw_advertise &= ~(ADVERTISE_100FULL);
/* Update the PHY advertisement register. */
- happy_meal_tcvr_write(hp, tregs, DP83840_ADVERTISE, hp->sw_advertise);
+ happy_meal_tcvr_write(hp, tregs, MII_ADVERTISE, hp->sw_advertise);
}
/* Once status is latched (by happy_meal_interrupt) it is cleared by
unsigned long tregs = hp->tcvregs;
printk(KERN_INFO "%s: Link status change.\n", hp->dev->name);
- hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, DP83840_BMCR);
- hp->sw_lpa = happy_meal_tcvr_read(hp, tregs, DP83840_LPA);
+ hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR);
+ hp->sw_lpa = happy_meal_tcvr_read(hp, tregs, MII_LPA);
/* Use the fastest transmission protocol possible. */
if (hp->sw_lpa & LPA_100FULL) {
} else {
printk(KERN_INFO "%s: Using 10Mbps at half duplex.", hp->dev->name);
}
- happy_meal_tcvr_write(hp, tregs, DP83840_BMCR, hp->sw_bmcr);
+ happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr);
/* Finally stop polling and shut up the MIF. */
happy_meal_poll_stop(hp, tregs);
ecmd.phy_address = 0; /* XXX fixed PHYAD */
/* Record PHY settings. */
- hp->sw_bmcr = happy_meal_tcvr_read(hp, hp->tcvregs, DP83840_BMCR);
- hp->sw_lpa = happy_meal_tcvr_read(hp, hp->tcvregs, DP83840_LPA);
+ hp->sw_bmcr = happy_meal_tcvr_read(hp, hp->tcvregs, MII_BMCR);
+ hp->sw_lpa = happy_meal_tcvr_read(hp, hp->tcvregs, MII_LPA);
if (hp->sw_bmcr & BMCR_ANENABLE) {
ecmd.autoneg = AUTONEG_ENABLE;
ecmd.speed =
-/* $Id: cgfourteenfb.c,v 1.9 2001/02/13 01:17:14 davem Exp $
+/* $Id: cgfourteenfb.c,v 1.10 2001/07/27 09:44:00 davem Exp $
* cgfourteenfb.c: CGfourteen frame buffer driver
*
* Copyright (C) 1996,1998 Jakub Jelinek (jj@ultra.linux.cz)
tmp |= CG14_CCR_ENABLE;
sbus_writeb(tmp, &cur->ccr);
+ } else {
+ u8 tmp = sbus_readb(&cur->ccr);
+
+ tmp &= ~CG14_CCR_ENABLE;
+ sbus_writeb(tmp, &cur->ccr);
}
sbus_writew(((c->cpos.fbx - c->chot.fbx) & 0xfff), &cur->cursx);
sbus_writew(((c->cpos.fby - c->chot.fby) & 0xfff), &cur->cursy);
#endif
}
+#define MSDOS_LABEL_MAGIC1 0x55
+#define MSDOS_LABEL_MAGIC2 0xAA
+
+static inline int
+msdos_magic_present(unsigned char *p) {
+ return (p[0] == MSDOS_LABEL_MAGIC1 && p[1] == MSDOS_LABEL_MAGIC2);
+}
+
/*
* Create devices for each logical partition in an extended partition.
* The logical partitions form a linked list, with each entry being
if (!(bh = bread(dev,0,get_ptable_blocksize(dev))))
return;
- if ((*(__u16 *) (bh->b_data+510)) != cpu_to_le16(MSDOS_LABEL_MAGIC))
+ if (!msdos_magic_present(bh->b_data + 510))
goto done;
- p = (struct partition *) (0x1BE + bh->b_data);
+ p = (struct partition *) (bh->b_data + 0x1be);
this_size = hd->part[MINOR(dev)].nr_sects;
/* The first sector of a Minix partition can have either
* a secondary MBR describing its subpartitions, or
* the normal boot sector. */
- if ((*(__u16 *) (bh->b_data + 510)) != cpu_to_le16(MSDOS_LABEL_MAGIC) &&
+ if (msdos_magic_present (bh->b_data + 510) &&
SYS_IND(p) == MINIX_PARTITION) { /* subpartition table present */
printk(" %s: <minix:", partition_name(hd, minor, buf));
check_table:
#endif /* CONFIG_BLK_DEV_IDE */
/* Use bforget(), because we may have changed the disk geometry */
- if (*(unsigned short *) (0x1fe + data) != cpu_to_le16(MSDOS_LABEL_MAGIC)) {
+ if (!msdos_magic_present(data + 510)) {
bforget(bh);
return 0;
}
- p = (struct partition *) (0x1be + data);
+ p = (struct partition *) (data + 0x1be);
#ifdef CONFIG_BLK_DEV_IDE
if (!tested_for_xlate++) { /* Do this only once per disk */
/*
* Check for old-style Disk Manager partition table
*/
- if (*(unsigned short *) (data+0xfc) == cpu_to_le16(MSDOS_LABEL_MAGIC)) {
+ if (msdos_magic_present(data + 0xfc)) {
p = (struct partition *) (0x1be + data);
for (i = 4 ; i < 16 ; i++, current_minor++) {
p--;
*/
struct info {
long ___orig_eip;
- long ___ret_from_system_call;
long ___ebx;
long ___ecx;
long ___edx;
#define local_bh_enable() \
do { \
unsigned int *ptr = &local_bh_count(smp_processor_id()); \
+ unsigned long flags; \
\
+ __save_flags(flags); \
+ if (!(flags & (1 << 9))) \
+ BUG(); \
barrier(); \
if (!--*ptr) \
__asm__ __volatile__ ( \
-/* $Id: bitops.h,v 1.63 2001/07/17 16:17:33 anton Exp $
+/* $Id: bitops.h,v 1.64 2001/07/18 13:48:23 anton Exp $
* bitops.h: Bit string operations on the Sparc.
*
* Copyright 1995 David S. Miller (davem@caip.rutgers.edu)
{
register unsigned long mask asm("g2");
register unsigned long *ADDR asm("g1");
+
ADDR = ((unsigned long *) addr) + (nr >> 5);
mask = 1 << (nr & 31);
+
__asm__ __volatile__("
mov %%o7, %%g4
call ___set_bit
add %%o7, 8, %%o7
" : "=&r" (mask)
: "0" (mask), "r" (ADDR)
- : "g3", "g4", "g5", "g7", "cc");
+ : "g3", "g4", "g5", "g7", "memory", "cc");
return mask != 0;
}
static __inline__ void set_bit(unsigned long nr, volatile void *addr)
{
- (void) test_and_set_bit(nr, addr);
+ register unsigned long mask asm("g2");
+ register unsigned long *ADDR asm("g1");
+
+ ADDR = ((unsigned long *) addr) + (nr >> 5);
+ mask = 1 << (nr & 31);
+
+ __asm__ __volatile__("
+ mov %%o7, %%g4
+ call ___set_bit
+ add %%o7, 8, %%o7
+" : "=&r" (mask)
+ : "0" (mask), "r" (ADDR)
+ : "g3", "g4", "g5", "g7", "cc");
}
static __inline__ int test_and_clear_bit(unsigned long nr, volatile void *addr)
ADDR = ((unsigned long *) addr) + (nr >> 5);
mask = 1 << (nr & 31);
+
__asm__ __volatile__("
mov %%o7, %%g4
call ___clear_bit
add %%o7, 8, %%o7
" : "=&r" (mask)
: "0" (mask), "r" (ADDR)
- : "g3", "g4", "g5", "g7", "cc");
+ : "g3", "g4", "g5", "g7", "memory", "cc");
return mask != 0;
}
static __inline__ void clear_bit(unsigned long nr, volatile void *addr)
{
- (void) test_and_clear_bit(nr, addr);
+ register unsigned long mask asm("g2");
+ register unsigned long *ADDR asm("g1");
+
+ ADDR = ((unsigned long *) addr) + (nr >> 5);
+ mask = 1 << (nr & 31);
+
+ __asm__ __volatile__("
+ mov %%o7, %%g4
+ call ___clear_bit
+ add %%o7, 8, %%o7
+" : "=&r" (mask)
+ : "0" (mask), "r" (ADDR)
+ : "g3", "g4", "g5", "g7", "cc");
}
static __inline__ int test_and_change_bit(unsigned long nr, volatile void *addr)
ADDR = ((unsigned long *) addr) + (nr >> 5);
mask = 1 << (nr & 31);
+
__asm__ __volatile__("
mov %%o7, %%g4
call ___change_bit
add %%o7, 8, %%o7
" : "=&r" (mask)
: "0" (mask), "r" (ADDR)
- : "g3", "g4", "g5", "g7", "cc");
+ : "g3", "g4", "g5", "g7", "memory", "cc");
return mask != 0;
}
static __inline__ void change_bit(unsigned long nr, volatile void *addr)
{
- (void) test_and_change_bit(nr, addr);
+ register unsigned long mask asm("g2");
+ register unsigned long *ADDR asm("g1");
+
+ ADDR = ((unsigned long *) addr) + (nr >> 5);
+ mask = 1 << (nr & 31);
+
+ __asm__ __volatile__("
+ mov %%o7, %%g4
+ call ___change_bit
+ add %%o7, 8, %%o7
+" : "=&r" (mask)
+ : "0" (mask), "r" (ADDR)
+ : "g3", "g4", "g5", "g7", "cc");
}
/*
/*
* Ok, this is an expanded form so that we can use the same
- * request for paging requests when that is implemented. In
- * paging, 'bh' is NULL, and the completion is used to wait
- * for the IO to be ready.
+ * request for paging requests.
*/
struct request {
struct list_head queue;
#define PageAlignSize(size) (((size) + PAGE_SIZE -1) & PAGE_MASK)
/* read-ahead in pages.. */
-#define MAX_READAHEAD 31
+#define MAX_READAHEAD 127
#define MIN_READAHEAD 3
#define blkdev_entry_to_request(entry) list_entry((entry), struct request, queue)
enum
{
TASKLET_STATE_SCHED, /* Tasklet is scheduled for execution */
- TASKLET_STATE_RUN /* Tasklet is running */
+ TASKLET_STATE_RUN /* Tasklet is running (SMP only) */
};
struct tasklet_head
extern struct tasklet_head tasklet_vec[NR_CPUS];
extern struct tasklet_head tasklet_hi_vec[NR_CPUS];
-#define tasklet_trylock(t) (!test_and_set_bit(TASKLET_STATE_RUN, &(t)->state))
-#define tasklet_unlock(t) do { smp_mb__before_clear_bit(); clear_bit(TASKLET_STATE_RUN, &(t)->state); } while(0)
-#define tasklet_unlock_wait(t) while (test_bit(TASKLET_STATE_RUN, &(t)->state)) { barrier(); }
+#ifdef CONFIG_SMP
+static inline int tasklet_trylock(struct tasklet_struct *t)
+{
+ return !test_and_set_bit(TASKLET_STATE_RUN, &(t)->state);
+}
+
+static inline void tasklet_unlock(struct tasklet_struct *t)
+{
+ smp_mb__before_clear_bit();
+ clear_bit(TASKLET_STATE_RUN, &(t)->state);
+}
+
+static inline void tasklet_unlock_wait(struct tasklet_struct *t)
+{
+ while (test_bit(TASKLET_STATE_RUN, &(t)->state)) { barrier(); }
+}
+#else
+#define tasklet_trylock(t) 1
+#define tasklet_unlock_wait(t) do { } while (0)
+#define tasklet_unlock(t) do { } while (0)
+#endif
+
+extern void FASTCALL(__tasklet_schedule(struct tasklet_struct *t));
+
+static inline void tasklet_schedule(struct tasklet_struct *t)
+{
+ if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state))
+ __tasklet_schedule(t);
+}
+
+extern void FASTCALL(__tasklet_hi_schedule(struct tasklet_struct *t));
+
+static inline void tasklet_hi_schedule(struct tasklet_struct *t)
+{
+ if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state))
+ __tasklet_hi_schedule(t);
+}
-extern void tasklet_schedule(struct tasklet_struct *t);
-extern void tasklet_hi_schedule(struct tasklet_struct *t);
static inline void tasklet_disable_nosync(struct tasklet_struct *t)
{
atomic_inc(&t->count);
+ smp_mb__after_atomic_inc();
}
static inline void tasklet_disable(struct tasklet_struct *t)
{
tasklet_disable_nosync(t);
tasklet_unlock_wait(t);
+ smp_mb();
}
static inline void tasklet_enable(struct tasklet_struct *t)
{
- if (atomic_dec_and_test(&t->count))
- tasklet_schedule(t);
+ smp_mb__before_atomic_dec();
+ atomic_dec(&t->count);
}
static inline void tasklet_hi_enable(struct tasklet_struct *t)
{
- if (atomic_dec_and_test(&t->count))
- tasklet_hi_schedule(t);
+ smp_mb__before_atomic_dec();
+ atomic_dec(&t->count);
}
extern void tasklet_kill(struct tasklet_struct *t);
* linux/mii.h: definitions for MII-compatible transceivers
* Originally drivers/net/sunhme.h.
*
- * Copyright (C) 1996, 1999 David S. Miller (davem@redhat.com)
+ * Copyright (C) 1996, 1999, 2001 David S. Miller (davem@redhat.com)
*/
#ifndef __LINUX_MII_H__
#include <linux/types.h>
-/* Inside the Happy Meal transceiver is the physical layer, they use an
- * implementations for National Semiconductor, part number DP83840VCE.
- * You can retrieve the data sheets and programming docs for this beast
- * from http://www.national.com/
- *
- * The DP83840 is capable of both 10 and 100Mbps ethernet, in both
- * half and full duplex mode. It also supports auto negotiation.
- *
- * But.... THIS THING IS A PAIN IN THE ASS TO PROGRAM!
- * Debugging eeprom burnt code is more fun than programming this chip!
- */
+/* Generic MII registers. */
-/* First, the MII register numbers (actually DP83840 register numbers). */
#define MII_BMCR 0x00 /* Basic mode control register */
#define MII_BMSR 0x01 /* Basic mode status register */
#define MII_PHYSID1 0x02 /* PHYS ID 1 */
#define MII_NWAYTEST 0x14 /* N-way auto-neg test reg */
#define MII_RERRCOUNTER 0x15 /* Receive error counter */
#define MII_SREVISION 0x16 /* Silicon revision */
-#define MII_CSCONFIG 0x17 /* CS configuration */
+#define MII_RESV1 0x17 /* Reserved... */
#define MII_LBRERROR 0x18 /* Lpback, rx, bypass error */
#define MII_PHYADDR 0x19 /* PHY address */
-#define MII_RESERVED 0x1a /* Unused... */
+#define MII_RESV2 0x1a /* Reserved... */
#define MII_TPISTATUS 0x1b /* TPI status for 10mbps */
#define MII_NCONFIG 0x1c /* Network interface config */
#define NWAYTEST_LOOPBACK 0x0100 /* Enable loopback for N-way */
#define NWAYTEST_RESV2 0xfe00 /* Unused... */
-/* The Carrier Sense config register. */
-#define CSCONFIG_RESV1 0x0001 /* Unused... */
-#define CSCONFIG_LED4 0x0002 /* Pin for full-dplx LED4 */
-#define CSCONFIG_LED1 0x0004 /* Pin for conn-status LED1 */
-#define CSCONFIG_RESV2 0x0008 /* Unused... */
-#define CSCONFIG_TCVDISAB 0x0010 /* Turns off the transceiver */
-#define CSCONFIG_DFBYPASS 0x0020 /* Bypass disconnect function */
-#define CSCONFIG_GLFORCE 0x0040 /* Good link force for 100mbps */
-#define CSCONFIG_CLKTRISTATE 0x0080 /* Tristate 25m clock */
-#define CSCONFIG_RESV3 0x0700 /* Unused... */
-#define CSCONFIG_ENCODE 0x0800 /* 1=MLT-3, 0=binary */
-#define CSCONFIG_RENABLE 0x1000 /* Repeater mode enable */
-#define CSCONFIG_TCDISABLE 0x2000 /* Disable timeout counter */
-#define CSCONFIG_RESV4 0x4000 /* Unused... */
-#define CSCONFIG_NDISABLE 0x8000 /* Disable NRZI */
-
-
/* This structure is used in all SIOCxMIIxxx ioctl calls */
struct mii_ioctl_data {
u16 phy_id;
/* Interface address info. */
unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */
- unsigned char pad; /* make dev_addr aligned to 8 bytes */
unsigned char dev_addr[MAX_ADDR_LEN]; /* hw address */
unsigned char addr_len; /* hardware address length */
struct pci_dev *dev;
};
-static __inline__ void parport_pc_write_data(struct parport *p, unsigned char d)
+extern __inline__ void parport_pc_write_data(struct parport *p, unsigned char d)
{
#ifdef DEBUG_PARPORT
printk (KERN_DEBUG "parport_pc_write_data(%p,0x%02x)\n", p, d);
outb(d, DATA(p));
}
-static __inline__ unsigned char parport_pc_read_data(struct parport *p)
+extern __inline__ unsigned char parport_pc_read_data(struct parport *p)
{
unsigned char val = inb (DATA (p));
#ifdef DEBUG_PARPORT
}
#ifdef DEBUG_PARPORT
-static __inline__ void dump_parport_state (char *str, struct parport *p)
+extern __inline__ void dump_parport_state (char *str, struct parport *p)
{
/* here's hoping that reading these ports won't side-effect anything underneath */
unsigned char ecr = inb (ECONTROL (p));
return ctr;
}
-static __inline__ void parport_pc_data_reverse (struct parport *p)
+extern __inline__ void parport_pc_data_reverse (struct parport *p)
{
__parport_pc_frob_control (p, 0x20, 0x20);
}
-static __inline__ void parport_pc_data_forward (struct parport *p)
+extern __inline__ void parport_pc_data_forward (struct parport *p)
{
__parport_pc_frob_control (p, 0x20, 0x00);
}
-static __inline__ void parport_pc_write_control (struct parport *p,
+extern __inline__ void parport_pc_write_control (struct parport *p,
unsigned char d)
{
const unsigned char wm = (PARPORT_CONTROL_STROBE |
__parport_pc_frob_control (p, wm, d & wm);
}
-static __inline__ unsigned char parport_pc_read_control(struct parport *p)
+extern __inline__ unsigned char parport_pc_read_control(struct parport *p)
{
const unsigned char rm = (PARPORT_CONTROL_STROBE |
PARPORT_CONTROL_AUTOFD |
return priv->ctr & rm; /* Use soft copy */
}
-static __inline__ unsigned char parport_pc_frob_control (struct parport *p,
+extern __inline__ unsigned char parport_pc_frob_control (struct parport *p,
unsigned char mask,
unsigned char val)
{
return __parport_pc_frob_control (p, mask, val);
}
-static __inline__ unsigned char parport_pc_read_status(struct parport *p)
+extern __inline__ unsigned char parport_pc_read_status(struct parport *p)
{
return inb(STATUS(p));
}
-static __inline__ void parport_pc_disable_irq(struct parport *p)
+extern __inline__ void parport_pc_disable_irq(struct parport *p)
{
__parport_pc_frob_control (p, 0x10, 0x00);
}
-static __inline__ void parport_pc_enable_irq(struct parport *p)
+extern __inline__ void parport_pc_enable_irq(struct parport *p)
{
__parport_pc_frob_control (p, 0x10, 0x10);
}
EXPORT_SYMBOL(do_softirq);
EXPORT_SYMBOL(raise_softirq);
EXPORT_SYMBOL(cpu_raise_softirq);
-EXPORT_SYMBOL(tasklet_schedule);
-EXPORT_SYMBOL(tasklet_hi_schedule);
+EXPORT_SYMBOL(__tasklet_schedule);
+EXPORT_SYMBOL(__tasklet_hi_schedule);
/* init task, for moving kthread roots - ought to export a function ?? */
/* Tasklets */
struct tasklet_head tasklet_vec[NR_CPUS] __cacheline_aligned;
+struct tasklet_head tasklet_hi_vec[NR_CPUS] __cacheline_aligned;
-void tasklet_schedule(struct tasklet_struct *t)
+void __tasklet_schedule(struct tasklet_struct *t)
{
+ int cpu = smp_processor_id();
unsigned long flags;
- int cpu;
- cpu = smp_processor_id();
local_irq_save(flags);
- /*
- * If nobody is running it then add it to this CPU's
- * tasklet queue.
- */
- if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) {
- t->next = tasklet_vec[cpu].list;
- tasklet_vec[cpu].list = t;
- cpu_raise_softirq(cpu, TASKLET_SOFTIRQ);
- tasklet_unlock(t);
- }
+ t->next = tasklet_vec[cpu].list;
+ tasklet_vec[cpu].list = t;
+ cpu_raise_softirq(cpu, TASKLET_SOFTIRQ);
local_irq_restore(flags);
}
-void tasklet_hi_schedule(struct tasklet_struct *t)
+void __tasklet_hi_schedule(struct tasklet_struct *t)
{
+ int cpu = smp_processor_id();
unsigned long flags;
- int cpu;
- cpu = smp_processor_id();
local_irq_save(flags);
-
- if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) {
- t->next = tasklet_hi_vec[cpu].list;
- tasklet_hi_vec[cpu].list = t;
- cpu_raise_softirq(cpu, HI_SOFTIRQ);
- tasklet_unlock(t);
- }
+ t->next = tasklet_hi_vec[cpu].list;
+ tasklet_hi_vec[cpu].list = t;
+ cpu_raise_softirq(cpu, HI_SOFTIRQ);
local_irq_restore(flags);
}
list = list->next;
- if (!tasklet_trylock(t))
- BUG();
- if (!atomic_read(&t->count)) {
- if (!test_and_clear_bit(TASKLET_STATE_SCHED, &t->state))
- BUG();
- t->func(t->data);
+ if (tasklet_trylock(t)) {
+ if (!atomic_read(&t->count)) {
+ if (!test_and_clear_bit(TASKLET_STATE_SCHED, &t->state))
+ BUG();
+ t->func(t->data);
+ tasklet_unlock(t);
+ continue;
+ }
tasklet_unlock(t);
- continue;
}
- tasklet_unlock(t);
local_irq_disable();
t->next = tasklet_vec[cpu].list;
tasklet_vec[cpu].list = t;
- cpu_raise_softirq(cpu, TASKLET_SOFTIRQ);
local_irq_enable();
+ __cpu_raise_softirq(cpu, TASKLET_SOFTIRQ);
}
}
-
-
-struct tasklet_head tasklet_hi_vec[NR_CPUS] __cacheline_aligned;
-
static void tasklet_hi_action(struct softirq_action *a)
{
int cpu = smp_processor_id();
list = list->next;
- if (!tasklet_trylock(t))
- BUG();
- if (!atomic_read(&t->count)) {
- if (!test_and_clear_bit(TASKLET_STATE_SCHED, &t->state))
- BUG();
- t->func(t->data);
+ if (tasklet_trylock(t)) {
+ if (!atomic_read(&t->count)) {
+ if (!test_and_clear_bit(TASKLET_STATE_SCHED, &t->state))
+ BUG();
+ t->func(t->data);
+ tasklet_unlock(t);
+ continue;
+ }
tasklet_unlock(t);
- continue;
}
- tasklet_unlock(t);
local_irq_disable();
t->next = tasklet_hi_vec[cpu].list;
tasklet_hi_vec[cpu].list = t;
- cpu_raise_softirq(cpu, HI_SOFTIRQ);
local_irq_enable();
+ __cpu_raise_softirq(cpu, HI_SOFTIRQ);
}
}
}
offset += size;
- mask = -1;
for (i = 0; ; i++) {
unsigned long bitmap_size;
zone->free_area[i].map = NULL;
break;
}
- mask += mask;
- size = (size + ~mask) & mask;
- bitmap_size = size >> (i+1);
- bitmap_size = (bitmap_size + 7) >> 3;
- bitmap_size = LONG_ALIGN(bitmap_size);
+
+ /*
+ * Page buddy system uses "index >> (i+1)",
+ * where "index" is at most "size-1".
+ *
+ * The extra "+3" is to round down to byte
+ * size (8 bits per byte assumption). Thus
+ * we get "(size-1) >> (i+4)" as the last byte
+ * we can access.
+ *
+ * The "+1" is because we want to round the
+ * byte allocation up rather than down. So
+ * we should have had a "+7" before we shifted
+ * down by three. Also, we have to add one as
+ * we actually _use_ the last bit (it's [0,n]
+ * inclusive, not [0,n[).
+ *
+ * So we actually had +7+1 before we shift
+ * down by 3. But (n+8) >> 3 == (n >> 3) + 1
+ * (modulo overflows, which we do not have).
+ *
+ * Finally, we LONG_ALIGN because all bitmap
+ * operations are on longs.
+ */
+ bitmap_size = (size-1) >> (i+4);
+ bitmap_size = LONG_ALIGN(bitmap_size+1);
zone->free_area[i].map =
(unsigned long *) alloc_bootmem_node(pgdat, bitmap_size);
}
enqueue:
dev_hold(skb->dev);
__skb_queue_tail(&queue->input_pkt_queue,skb);
+ local_irq_restore(flags);
/* Runs from irqs or BH's, no need to wake BH */
__cpu_raise_softirq(this_cpu, NET_RX_SOFTIRQ);
- local_irq_restore(flags);
#ifndef OFFLINE_SAMPLE
get_sample_stats(this_cpu);
#endif
local_irq_disable();
netdev_rx_stat[this_cpu].time_squeeze++;
+ local_irq_enable();
/* This already runs in BH context, no need to wake up BH's */
__cpu_raise_softirq(this_cpu, NET_RX_SOFTIRQ);
- local_irq_enable();
NET_PROFILE_LEAVE(softnet_process);
return;
* handler for protocols to use and generic option handler.
*
*
- * Version: $Id: sock.c,v 1.111 2001/06/26 23:29:17 davem Exp $
+ * Version: $Id: sock.c,v 1.112 2001/07/27 09:54:48 davem Exp $
*
* Authors: Ross Biro, <bir7@leland.Stanford.Edu>
* Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
#include <linux/filter.h>
#endif
-#define min(a,b) ((a)<(b)?(a):(b))
-
/* Run time adjustable parameters. */
__u32 sysctl_wmem_max = SK_WMEM_MAX;
__u32 sysctl_rmem_max = SK_RMEM_MAX;
val = sysctl_wmem_max;
sk->userlocks |= SOCK_SNDBUF_LOCK;
- sk->sndbuf = max(val*2,SOCK_MIN_SNDBUF);
+ if ((val * 2) < SOCK_MIN_SNDBUF)
+ sk->sndbuf = SOCK_MIN_SNDBUF;
+ else
+ sk->sndbuf = (val * 2);
/*
* Wake up sending tasks if we
sk->userlocks |= SOCK_RCVBUF_LOCK;
/* FIXME: is this lower bound the right one? */
- sk->rcvbuf = max(val*2,SOCK_MIN_RCVBUF);
+ if ((val * 2) < SOCK_MIN_RCVBUF)
+ sk->rcvbuf = SOCK_MIN_RCVBUF;
+ else
+ sk->rcvbuf = (val * 2);
break;
case SO_KEEPALIVE:
break;
case SO_PEERCRED:
- lv=sizeof(sk->peercred);
- len=min(len, lv);
- if(copy_to_user((void*)optval, &sk->peercred, len))
+ if (len > sizeof(sk->peercred))
+ len = sizeof(sk->peercred);
+ if (copy_to_user(optval, &sk->peercred, len))
return -EFAULT;
goto lenout;
default:
return(-ENOPROTOOPT);
}
- len=min(len,lv);
- if(copy_to_user(optval,&v,len))
+ if (len > lv)
+ len = lv;
+ if (copy_to_user(optval, &v, len))
return -EFAULT;
lenout:
- if(put_user(len, optlen))
+ if (put_user(len, optlen))
return -EFAULT;
return 0;
}
* the older version didn't come out right using gcc 2.5.8, the newer one
* seems to fall out with gcc 2.6.2.
*
- * Version: $Id: igmp.c,v 1.45 2001/02/23 06:32:11 davem Exp $
+ * Version: $Id: igmp.c,v 1.46 2001/07/27 09:27:29 davem Exp $
*
* Authors:
* Alan Cox <Alan.Cox@linux.org>
#define IGMP_Unsolicited_Report_Count 2
-#define IGMP_Initial_Report_Delay (1*HZ)
+#define IGMP_Initial_Report_Delay (1)
/* IGMP_Initial_Report_Delay is not from IGMP specs!
* IGMP specs require to report membership immediately after
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Version: $Id: af_unix.c,v 1.117 2001/07/01 06:59:10 davem Exp $
+ * Version: $Id: af_unix.c,v 1.118 2001/07/18 07:52:37 davem Exp $
*
* Fixes:
* Linus Torvalds : Assorted bug cures.