Commit 7c888716 authored by David S. Miller's avatar David S. Miller

Merge nuts.ninka.net:/home/davem/src/BK/network-2.5

into nuts.ninka.net:/home/davem/src/BK/net-2.5
parents 0c0548ba 9cfeede4
...@@ -1146,7 +1146,7 @@ CONFIG_BT_BNEP_PROTO_FILTER=y ...@@ -1146,7 +1146,7 @@ CONFIG_BT_BNEP_PROTO_FILTER=y
# #
CONFIG_BT_HCIUSB=m CONFIG_BT_HCIUSB=m
CONFIG_BT_USB_SCO=y CONFIG_BT_USB_SCO=y
CONFIG_BT_USB_ZERO_PACKET=y # CONFIG_BT_USB_ZERO_PACKET is not set
CONFIG_BT_HCIUART=m CONFIG_BT_HCIUART=m
CONFIG_BT_HCIUART_H4=y CONFIG_BT_HCIUART_H4=y
CONFIG_BT_HCIUART_BCSP=y CONFIG_BT_HCIUART_BCSP=y
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/oprofile.h> #include <linux/oprofile.h>
#include <linux/errno.h>
#include <linux/init.h> #include <linux/init.h>
extern void timer_init(struct oprofile_operations ** ops); extern void timer_init(struct oprofile_operations ** ops);
......
...@@ -52,30 +52,6 @@ static inline int dev_to_index(dev_t dev) ...@@ -52,30 +52,6 @@ static inline int dev_to_index(dev_t dev)
return major_to_index(MAJOR(dev)); return major_to_index(MAJOR(dev));
} }
/*
* __bdevname may be called from interrupts, and must be atomic
*/
const char *__bdevname(dev_t dev, char *buffer)
{
char *name = "unknown-block";
unsigned int major = MAJOR(dev);
unsigned int minor = MINOR(dev);
int index = major_to_index(major);
struct blk_major_name *n;
unsigned long flags;
spin_lock_irqsave(&major_names_lock, flags);
for (n = major_names[index]; n; n = n->next)
if (n->major == major)
break;
if (n)
name = &(n->name[0]);
snprintf(buffer, BDEVNAME_SIZE, "%s(%u,%u)", name, major, minor);
spin_unlock_irqrestore(&major_names_lock, flags);
return buffer;
}
/* get block device names in somewhat random order */ /* get block device names in somewhat random order */
int get_blkdev_list(char *p) int get_blkdev_list(char *p)
{ {
......
...@@ -70,13 +70,9 @@ static int serport_ldisc_open(struct tty_struct *tty) ...@@ -70,13 +70,9 @@ static int serport_ldisc_open(struct tty_struct *tty)
struct serport *serport; struct serport *serport;
char name[64]; char name[64];
MOD_INC_USE_COUNT; serport = kmalloc(sizeof(struct serport), GFP_KERNEL);
if (unlikely(!serport))
if (!(serport = kmalloc(sizeof(struct serport), GFP_KERNEL))) {
MOD_DEC_USE_COUNT;
return -ENOMEM; return -ENOMEM;
}
memset(serport, 0, sizeof(struct serport)); memset(serport, 0, sizeof(struct serport));
set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
...@@ -107,7 +103,6 @@ static void serport_ldisc_close(struct tty_struct *tty) ...@@ -107,7 +103,6 @@ static void serport_ldisc_close(struct tty_struct *tty)
{ {
struct serport *serport = (struct serport*) tty->disc_data; struct serport *serport = (struct serport*) tty->disc_data;
kfree(serport); kfree(serport);
MOD_DEC_USE_COUNT;
} }
/* /*
...@@ -188,6 +183,7 @@ static void serport_ldisc_write_wakeup(struct tty_struct * tty) ...@@ -188,6 +183,7 @@ static void serport_ldisc_write_wakeup(struct tty_struct * tty)
*/ */
static struct tty_ldisc serport_ldisc = { static struct tty_ldisc serport_ldisc = {
.owner = THIS_MODULE,
.name = "input", .name = "input",
.open = serport_ldisc_open, .open = serport_ldisc_open,
.close = serport_ldisc_close, .close = serport_ldisc_close,
...@@ -202,7 +198,7 @@ static struct tty_ldisc serport_ldisc = { ...@@ -202,7 +198,7 @@ static struct tty_ldisc serport_ldisc = {
* The functions for insering/removing us as a module. * The functions for insering/removing us as a module.
*/ */
int __init serport_init(void) static int __init serport_init(void)
{ {
if (tty_register_ldisc(N_MOUSE, &serport_ldisc)) { if (tty_register_ldisc(N_MOUSE, &serport_ldisc)) {
printk(KERN_ERR "serport.c: Error registering line discipline.\n"); printk(KERN_ERR "serport.c: Error registering line discipline.\n");
...@@ -212,7 +208,7 @@ int __init serport_init(void) ...@@ -212,7 +208,7 @@ int __init serport_init(void)
return 0; return 0;
} }
void __exit serport_exit(void) static void __exit serport_exit(void)
{ {
tty_register_ldisc(N_MOUSE, NULL); tty_register_ldisc(N_MOUSE, NULL);
} }
......
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/oprofile.h> #include <linux/oprofile.h>
#include <linux/profile.h>
#include <linux/init.h>
#include <asm/ptrace.h> #include <asm/ptrace.h>
static int timer_notify(struct notifier_block * self, unsigned long val, void * data) static int timer_notify(struct notifier_block * self, unsigned long val, void * data)
......
...@@ -300,7 +300,6 @@ asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd, unsigned lon ...@@ -300,7 +300,6 @@ asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd, unsigned lon
{ {
struct file * filp; struct file * filp;
int error = -EBADF; int error = -EBADF;
int (*handler)(unsigned int, unsigned int, unsigned long, struct file * filp);
struct ioctl_trans *t; struct ioctl_trans *t;
filp = fget(fd); filp = fget(fd);
...@@ -317,8 +316,10 @@ asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd, unsigned lon ...@@ -317,8 +316,10 @@ asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd, unsigned lon
while (t && t->cmd != cmd) while (t && t->cmd != cmd)
t = (struct ioctl_trans *)t->next; t = (struct ioctl_trans *)t->next;
if (t) { if (t) {
handler = t->handler; if (t->handler)
error = handler(fd, cmd, arg, filp); error = t->handler(fd, cmd, arg, filp);
else
error = sys_ioctl(fd, cmd, arg);
} else if (cmd >= SIOCDEVPRIVATE && cmd <= (SIOCDEVPRIVATE + 15)) { } else if (cmd >= SIOCDEVPRIVATE && cmd <= (SIOCDEVPRIVATE + 15)) {
error = siocdevprivate_ioctl(fd, cmd, arg); error = siocdevprivate_ioctl(fd, cmd, arg);
} else { } else {
......
...@@ -125,6 +125,29 @@ const char *bdevname(struct block_device *bdev, char *buf) ...@@ -125,6 +125,29 @@ const char *bdevname(struct block_device *bdev, char *buf)
return disk_name(bdev->bd_disk, part, buf); return disk_name(bdev->bd_disk, part, buf);
} }
/*
* NOTE: this cannot be called from interrupt context.
*
* But in interrupt context you should really have a struct
* block_device anyway and use bdevname() above.
*/
const char *__bdevname(dev_t dev, char *buffer)
{
struct gendisk *disk;
int part;
disk = get_gendisk(dev, &part);
if (disk) {
buffer = disk_name(disk, part, buffer);
put_disk(disk);
} else {
snprintf(buffer, BDEVNAME_SIZE, "unknown-block(%u,%u)",
MAJOR(dev), MINOR(dev));
}
return buffer;
}
static struct parsed_partitions * static struct parsed_partitions *
check_partition(struct gendisk *hd, struct block_device *bdev) check_partition(struct gendisk *hd, struct block_device *bdev)
{ {
......
#ifndef _BLK_H /* this file is obsolete, please use <linux/blkdev.h> instead */
#define _BLK_H
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/elevator.h>
#include <linux/config.h>
#include <linux/spinlock.h>
#include <linux/compiler.h>
extern void set_device_ro(struct block_device *bdev, int flag);
extern void set_disk_ro(struct gendisk *disk, int flag);
extern void add_disk_randomness(struct gendisk *disk);
extern void rand_initialize_disk(struct gendisk *disk);
/*
* end_request() and friends. Must be called with the request queue spinlock
* acquired. All functions called within end_request() _must_be_ atomic.
*
* Several drivers define their own end_request and call
* end_that_request_first() and end_that_request_last()
* for parts of the original function. This prevents
* code duplication in drivers.
*/
extern int end_that_request_first(struct request *, int, int);
extern int end_that_request_chunk(struct request *, int, int);
extern void end_that_request_last(struct request *);
extern void end_request(struct request *req, int uptodate);
struct request *elv_next_request(request_queue_t *q);
static inline void blkdev_dequeue_request(struct request *req)
{
BUG_ON(list_empty(&req->queuelist));
list_del_init(&req->queuelist);
if (req->q)
elv_remove_request(req->q, req);
}
#endif /* _BLK_H */
...@@ -348,6 +348,30 @@ static inline request_queue_t *bdev_get_queue(struct block_device *bdev) ...@@ -348,6 +348,30 @@ static inline request_queue_t *bdev_get_queue(struct block_device *bdev)
return bdev->bd_disk->queue; return bdev->bd_disk->queue;
} }
/*
* end_request() and friends. Must be called with the request queue spinlock
* acquired. All functions called within end_request() _must_be_ atomic.
*
* Several drivers define their own end_request and call
* end_that_request_first() and end_that_request_last()
* for parts of the original function. This prevents
* code duplication in drivers.
*/
extern int end_that_request_first(struct request *, int, int);
extern int end_that_request_chunk(struct request *, int, int);
extern void end_that_request_last(struct request *);
extern void end_request(struct request *req, int uptodate);
static inline void blkdev_dequeue_request(struct request *req)
{
BUG_ON(list_empty(&req->queuelist));
list_del_init(&req->queuelist);
if (req->q)
elv_remove_request(req->q, req);
}
/* /*
* get ready for proper ref counting * get ready for proper ref counting
*/ */
......
...@@ -54,6 +54,7 @@ extern void elv_merge_requests(request_queue_t *, struct request *, ...@@ -54,6 +54,7 @@ extern void elv_merge_requests(request_queue_t *, struct request *,
extern void elv_merged_request(request_queue_t *, struct request *); extern void elv_merged_request(request_queue_t *, struct request *);
extern void elv_remove_request(request_queue_t *, struct request *); extern void elv_remove_request(request_queue_t *, struct request *);
extern int elv_queue_empty(request_queue_t *); extern int elv_queue_empty(request_queue_t *);
extern struct request *elv_next_request(struct request_queue *q);
extern struct request *elv_former_request(request_queue_t *, struct request *); extern struct request *elv_former_request(request_queue_t *, struct request *);
extern struct request *elv_latter_request(request_queue_t *, struct request *); extern struct request *elv_latter_request(request_queue_t *, struct request *);
extern int elv_register_queue(struct gendisk *); extern int elv_register_queue(struct gendisk *);
......
...@@ -190,6 +190,14 @@ extern void add_disk(struct gendisk *disk); ...@@ -190,6 +190,14 @@ extern void add_disk(struct gendisk *disk);
extern void del_gendisk(struct gendisk *gp); extern void del_gendisk(struct gendisk *gp);
extern void unlink_gendisk(struct gendisk *gp); extern void unlink_gendisk(struct gendisk *gp);
extern struct gendisk *get_gendisk(dev_t dev, int *part); extern struct gendisk *get_gendisk(dev_t dev, int *part);
extern void set_device_ro(struct block_device *bdev, int flag);
extern void set_disk_ro(struct gendisk *disk, int flag);
/* drivers/char/random.c */
extern void add_disk_randomness(struct gendisk *disk);
extern void rand_initialize_disk(struct gendisk *disk);
static inline sector_t get_start_sect(struct block_device *bdev) static inline sector_t get_start_sect(struct block_device *bdev)
{ {
return bdev->bd_offset; return bdev->bd_offset;
......
...@@ -21,6 +21,22 @@ struct pci_device_id { ...@@ -21,6 +21,22 @@ struct pci_device_id {
kernel_ulong_t driver_data; /* Data private to the driver */ kernel_ulong_t driver_data; /* Data private to the driver */
}; };
#define IEEE1394_MATCH_VENDOR_ID 0x0001
#define IEEE1394_MATCH_MODEL_ID 0x0002
#define IEEE1394_MATCH_SPECIFIER_ID 0x0004
#define IEEE1394_MATCH_VERSION 0x0008
struct ieee1394_device_id {
__u32 match_flags;
__u32 vendor_id;
__u32 model_id;
__u32 specifier_id;
__u32 version;
kernel_ulong_t driver_data;
};
/* /*
* Device table entry for "new style" table-driven USB drivers. * Device table entry for "new style" table-driven USB drivers.
* User mode code can read these tables to choose which modules to load. * User mode code can read these tables to choose which modules to load.
......
...@@ -952,7 +952,6 @@ rpciod(void *ptr) ...@@ -952,7 +952,6 @@ rpciod(void *ptr)
wait_queue_head_t *assassin = (wait_queue_head_t*) ptr; wait_queue_head_t *assassin = (wait_queue_head_t*) ptr;
int rounds = 0; int rounds = 0;
MOD_INC_USE_COUNT;
lock_kernel(); lock_kernel();
/* /*
* Let our maker know we're running ... * Let our maker know we're running ...
...@@ -995,7 +994,6 @@ rpciod(void *ptr) ...@@ -995,7 +994,6 @@ rpciod(void *ptr)
dprintk("RPC: rpciod exiting\n"); dprintk("RPC: rpciod exiting\n");
unlock_kernel(); unlock_kernel();
MOD_DEC_USE_COUNT;
return 0; return 0;
} }
...@@ -1027,7 +1025,6 @@ rpciod_up(void) ...@@ -1027,7 +1025,6 @@ rpciod_up(void)
{ {
int error = 0; int error = 0;
MOD_INC_USE_COUNT;
down(&rpciod_sema); down(&rpciod_sema);
dprintk("rpciod_up: pid %d, users %d\n", rpciod_pid, rpciod_users); dprintk("rpciod_up: pid %d, users %d\n", rpciod_pid, rpciod_users);
rpciod_users++; rpciod_users++;
...@@ -1051,7 +1048,6 @@ rpciod_up(void) ...@@ -1051,7 +1048,6 @@ rpciod_up(void)
error = 0; error = 0;
out: out:
up(&rpciod_sema); up(&rpciod_sema);
MOD_DEC_USE_COUNT;
return error; return error;
} }
...@@ -1060,7 +1056,6 @@ rpciod_down(void) ...@@ -1060,7 +1056,6 @@ rpciod_down(void)
{ {
unsigned long flags; unsigned long flags;
MOD_INC_USE_COUNT;
down(&rpciod_sema); down(&rpciod_sema);
dprintk("rpciod_down pid %d sema %d\n", rpciod_pid, rpciod_users); dprintk("rpciod_down pid %d sema %d\n", rpciod_pid, rpciod_users);
if (rpciod_users) { if (rpciod_users) {
...@@ -1097,7 +1092,6 @@ rpciod_down(void) ...@@ -1097,7 +1092,6 @@ rpciod_down(void)
spin_unlock_irqrestore(&current->sighand->siglock, flags); spin_unlock_irqrestore(&current->sighand->siglock, flags);
out: out:
up(&rpciod_sema); up(&rpciod_sema);
MOD_DEC_USE_COUNT;
} }
#ifdef RPC_DEBUG #ifdef RPC_DEBUG
......
...@@ -81,6 +81,29 @@ static int do_usb_entry(const char *filename, ...@@ -81,6 +81,29 @@ static int do_usb_entry(const char *filename,
return 1; return 1;
} }
/* Looks like: ieee1394:venNmoNspNverN */
static int do_ieee1394_entry(const char *filename,
struct ieee1394_device_id *id, char *alias)
{
id->match_flags = TO_NATIVE(id->match_flags);
id->vendor_id = TO_NATIVE(id->vendor_id);
id->model_id = TO_NATIVE(id->model_id);
id->specifier_id = TO_NATIVE(id->specifier_id);
id->version = TO_NATIVE(id->version);
strcpy(alias, "ieee1394:");
ADD(alias, "ven", id->match_flags & IEEE1394_MATCH_VENDOR_ID,
id->vendor_id);
ADD(alias, "mo", id->match_flags & IEEE1394_MATCH_MODEL_ID,
id->model_id);
ADD(alias, "sp", id->match_flags & IEEE1394_MATCH_SPECIFIER_ID,
id->specifier_id);
ADD(alias, "ver", id->match_flags & IEEE1394_MATCH_VERSION,
id->version);
return 1;
}
/* Looks like: pci:vNdNsvNsdNbcNscNiN. */ /* Looks like: pci:vNdNsvNsdNbcNscNiN. */
static int do_pci_entry(const char *filename, static int do_pci_entry(const char *filename,
struct pci_device_id *id, char *alias) struct pci_device_id *id, char *alias)
...@@ -184,6 +207,9 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, ...@@ -184,6 +207,9 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
else if (sym_is(symname, "__mod_usb_device_table")) else if (sym_is(symname, "__mod_usb_device_table"))
do_table(symval, sym->st_size, sizeof(struct usb_device_id), do_table(symval, sym->st_size, sizeof(struct usb_device_id),
do_usb_entry, mod); do_usb_entry, mod);
else if (sym_is(symname, "__mod_ieee1394_device_table"))
do_table(symval, sym->st_size, sizeof(struct ieee1394_device_id),
do_ieee1394_entry, mod);
} }
/* Now add out buffered information to the generated C source */ /* Now add out buffered information to the generated C source */
......
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