Commit 916e723b authored by Andy Grover's avatar Andy Grover

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

into groveronline.com:/root/bk/linux-acpi
parents 81442037 eb40c469
...@@ -140,7 +140,7 @@ understand what the function is all about, you should adhere to the ...@@ -140,7 +140,7 @@ understand what the function is all about, you should adhere to the
maximum limits all the more closely. Use helper functions with maximum limits all the more closely. Use helper functions with
descriptive names (you can ask the compiler to in-line them if you think descriptive names (you can ask the compiler to in-line them if you think
it's performance-critical, and it will probably do a better job of it it's performance-critical, and it will probably do a better job of it
that you would have done). than you would have done).
Another measure of the function is the number of local variables. They Another measure of the function is the number of local variables. They
shouldn't exceed 5-10, or you're doing something wrong. Re-think the shouldn't exceed 5-10, or you're doing something wrong. Re-think the
...@@ -200,7 +200,7 @@ automagically when you edit source files under /usr/src/linux. ...@@ -200,7 +200,7 @@ automagically when you edit source files under /usr/src/linux.
But even if you fail in getting emacs to do sane formatting, not But even if you fail in getting emacs to do sane formatting, not
everything is lost: use "indent". everything is lost: use "indent".
Now, again, GNU indent has the same brain dead settings that GNU emacs Now, again, GNU indent has the same brain-dead settings that GNU emacs
has, which is why you need to give it a few command line options. has, which is why you need to give it a few command line options.
However, that's not too bad, because even the makers of GNU indent However, that's not too bad, because even the makers of GNU indent
recognize the authority of K&R (the GNU people aren't evil, they are recognize the authority of K&R (the GNU people aren't evil, they are
...@@ -232,7 +232,7 @@ fi ...@@ -232,7 +232,7 @@ fi
Generally, CONFIG_EXPERIMENTAL should surround all options not considered Generally, CONFIG_EXPERIMENTAL should surround all options not considered
stable. All options that are known to trash data (experimental write- stable. All options that are known to trash data (experimental write-
support for file-systems, for instance) should be denoted (DANGEROUS), other support for file-systems, for instance) should be denoted (DANGEROUS), other
Experimental options should be denoted (EXPERIMENTAL). experimental options should be denoted (EXPERIMENTAL).
Chapter 8: Data structures Chapter 8: Data structures
...@@ -258,7 +258,7 @@ when there are users of different "classes". The subclass count counts ...@@ -258,7 +258,7 @@ when there are users of different "classes". The subclass count counts
the number of subclass users, and decrements the global count just once the number of subclass users, and decrements the global count just once
when the subclass count goes to zero. when the subclass count goes to zero.
Examples of this kind of "multi-reference-counting" can be found in Examples of this kind of "multi-level-reference-counting" can be found in
memory management ("struct mm_struct": mm_users and mm_count), and in memory management ("struct mm_struct": mm_users and mm_count), and in
filesystem code ("struct super_block": s_count and s_active). filesystem code ("struct super_block": s_count and s_active).
......
...@@ -973,7 +973,7 @@ M: scott.feldman@intel.com ...@@ -973,7 +973,7 @@ M: scott.feldman@intel.com
S: Supported S: Supported
INTERMEZZO FILE SYSTEM INTERMEZZO FILE SYSTEM
P: Chen Yang P: Cluster File Systems
M: intermezzo-devel@lists.sf.net M: intermezzo-devel@lists.sf.net
W: http://www.inter-mezzo.org/ W: http://www.inter-mezzo.org/
L: intermezzo-discuss@lists.sourceforge.net L: intermezzo-discuss@lists.sourceforge.net
......
VERSION = 2 VERSION = 2
PATCHLEVEL = 5 PATCHLEVEL = 6
SUBLEVEL = 75 SUBLEVEL = 0
EXTRAVERSION = EXTRAVERSION = -test1
# *DOCUMENTATION* # *DOCUMENTATION*
# To see a list of typical targets execute "make help" # To see a list of typical targets execute "make help"
......
...@@ -269,17 +269,6 @@ config ISA ...@@ -269,17 +269,6 @@ config ISA
(MCA) or VESA. ISA is an older system, now being displaced by PCI; (MCA) or VESA. ISA is an older system, now being displaced by PCI;
newer boards don't support it. If you have ISA, say Y, otherwise N. newer boards don't support it. If you have ISA, say Y, otherwise N.
config SBUS
bool
config MCA
bool
help
MicroChannel Architecture is found in some IBM PS/2 machines and
laptops. It is a bus system similar to PCI or ISA. See
<file:Documentation/mca.txt> (and especially the web page given
there) before attempting to build an MCA bus kernel.
config PCI config PCI
bool bool
depends on !ALPHA_JENSEN depends on !ALPHA_JENSEN
......
...@@ -443,6 +443,7 @@ sys_call_table: ...@@ -443,6 +443,7 @@ sys_call_table:
.quad sys_clock_getres .quad sys_clock_getres
.quad sys_clock_nanosleep .quad sys_clock_nanosleep
.quad sys_semtimedop .quad sys_semtimedop
.quad sys_tgkill
.size sys_call_table, . - sys_call_table .size sys_call_table, . - sys_call_table
.type sys_call_table, @object .type sys_call_table, @object
......
...@@ -682,6 +682,21 @@ __initcall(balanced_irq_init); ...@@ -682,6 +682,21 @@ __initcall(balanced_irq_init);
#else /* !SMP */ #else /* !SMP */
static inline void move_irq(int irq) { } static inline void move_irq(int irq) { }
void send_IPI_self(int vector)
{
unsigned int cfg;
/*
* Wait for idle.
*/
apic_wait_icr_idle();
cfg = APIC_DM_FIXED | APIC_DEST_SELF | vector | APIC_DEST_LOGICAL;
/*
* Send the IPI. The write to APIC_ICR fires this off.
*/
apic_write_around(APIC_ICR, cfg);
}
#endif /* defined(CONFIG_SMP) */ #endif /* defined(CONFIG_SMP) */
......
...@@ -357,25 +357,23 @@ int register_busmouse(struct busmouse *ops) ...@@ -357,25 +357,23 @@ int register_busmouse(struct busmouse *ops)
{ {
unsigned int msedev = MINOR_TO_MOUSE(ops->minor); unsigned int msedev = MINOR_TO_MOUSE(ops->minor);
struct busmouse_data *mse; struct busmouse_data *mse;
int ret; int ret = -EINVAL;
if (msedev >= NR_MICE) { if (msedev >= NR_MICE) {
printk(KERN_ERR "busmouse: trying to allocate mouse on minor %d\n", printk(KERN_ERR "busmouse: trying to allocate mouse on minor %d\n",
ops->minor); ops->minor);
return -EINVAL; goto out;
} }
ret = -ENOMEM;
mse = kmalloc(sizeof(*mse), GFP_KERNEL); mse = kmalloc(sizeof(*mse), GFP_KERNEL);
if (!mse) if (!mse)
return -ENOMEM; goto out;
down(&mouse_sem); down(&mouse_sem);
ret = -EBUSY;
if (busmouse_data[msedev]) if (busmouse_data[msedev])
{ goto freemem;
up(&mouse_sem);
kfree(mse);
return -EBUSY;
}
memset(mse, 0, sizeof(*mse)); memset(mse, 0, sizeof(*mse));
...@@ -386,14 +384,22 @@ int register_busmouse(struct busmouse *ops) ...@@ -386,14 +384,22 @@ int register_busmouse(struct busmouse *ops)
mse->lock = (spinlock_t)SPIN_LOCK_UNLOCKED; mse->lock = (spinlock_t)SPIN_LOCK_UNLOCKED;
init_waitqueue_head(&mse->wait); init_waitqueue_head(&mse->wait);
busmouse_data[msedev] = mse;
ret = misc_register(&mse->miscdev); ret = misc_register(&mse->miscdev);
if (!ret)
ret = msedev; if (ret < 0)
goto freemem;
busmouse_data[msedev] = mse;
ret = msedev;
out:
up(&mouse_sem); up(&mouse_sem);
return ret; return ret;
freemem:
kfree(mse);
goto out;
} }
/** /**
......
This diff is collapsed.
...@@ -161,7 +161,7 @@ static int debug; ...@@ -161,7 +161,7 @@ static int debug;
* then put the packet into tx_queue, and call sppp_flush_xmit() * then put the packet into tx_queue, and call sppp_flush_xmit()
* after spinlock is released. * after spinlock is released.
*/ */
static void sppp_flush_xmit() static void sppp_flush_xmit(void)
{ {
struct sk_buff *skb; struct sk_buff *skb;
while ((skb = skb_dequeue(&tx_queue)) != NULL) while ((skb = skb_dequeue(&tx_queue)) != NULL)
......
...@@ -258,7 +258,7 @@ static int mtd_modify_window(window_handle_t win, mtd_mod_win_t *req) ...@@ -258,7 +258,7 @@ static int mtd_modify_window(window_handle_t win, mtd_mod_win_t *req)
win->ctl.flags |= MAP_ATTRIB; win->ctl.flags |= MAP_ATTRIB;
win->ctl.speed = req->AccessSpeed; win->ctl.speed = req->AccessSpeed;
win->ctl.card_start = req->CardOffset; win->ctl.card_start = req->CardOffset;
win->sock->ss_entry->set_mem_map(win->sock, &win->ctl); win->sock->ops->set_mem_map(win->sock, &win->ctl);
return CS_SUCCESS; return CS_SUCCESS;
} }
...@@ -271,7 +271,7 @@ static int mtd_set_vpp(client_handle_t handle, mtd_vpp_req_t *req) ...@@ -271,7 +271,7 @@ static int mtd_set_vpp(client_handle_t handle, mtd_vpp_req_t *req)
return CS_BAD_VPP; return CS_BAD_VPP;
s = SOCKET(handle); s = SOCKET(handle);
s->socket.Vpp = req->Vpp1; s->socket.Vpp = req->Vpp1;
if (s->ss_entry->set_socket(s, &s->socket)) if (s->ops->set_socket(s, &s->socket))
return CS_BAD_VPP; return CS_BAD_VPP;
return CS_SUCCESS; return CS_SUCCESS;
} }
...@@ -286,7 +286,7 @@ static int mtd_rdy_mask(client_handle_t handle, mtd_rdy_req_t *req) ...@@ -286,7 +286,7 @@ static int mtd_rdy_mask(client_handle_t handle, mtd_rdy_req_t *req)
s->socket.csc_mask |= SS_READY; s->socket.csc_mask |= SS_READY;
else else
s->socket.csc_mask &= ~SS_READY; s->socket.csc_mask &= ~SS_READY;
if (s->ss_entry->set_socket(s, &s->socket)) if (s->ops->set_socket(s, &s->socket))
return CS_GENERAL_FAILURE; return CS_GENERAL_FAILURE;
return CS_SUCCESS; return CS_SUCCESS;
} }
......
...@@ -86,7 +86,7 @@ void release_cis_mem(struct pcmcia_socket *s) ...@@ -86,7 +86,7 @@ void release_cis_mem(struct pcmcia_socket *s)
{ {
if (s->cis_mem.sys_start != 0) { if (s->cis_mem.sys_start != 0) {
s->cis_mem.flags &= ~MAP_ACTIVE; s->cis_mem.flags &= ~MAP_ACTIVE;
s->ss_entry->set_mem_map(s, &s->cis_mem); s->ops->set_mem_map(s, &s->cis_mem);
if (!(s->features & SS_CAP_STATIC_MAP)) if (!(s->features & SS_CAP_STATIC_MAP))
release_mem_region(s->cis_mem.sys_start, s->map_size); release_mem_region(s->cis_mem.sys_start, s->map_size);
iounmap(s->cis_virt); iounmap(s->cis_virt);
...@@ -118,7 +118,7 @@ set_cis_map(struct pcmcia_socket *s, unsigned int card_offset, unsigned int flag ...@@ -118,7 +118,7 @@ set_cis_map(struct pcmcia_socket *s, unsigned int card_offset, unsigned int flag
} }
mem->card_start = card_offset; mem->card_start = card_offset;
mem->flags = flags; mem->flags = flags;
s->ss_entry->set_mem_map(s, mem); s->ops->set_mem_map(s, mem);
if (s->features & SS_CAP_STATIC_MAP) { if (s->features & SS_CAP_STATIC_MAP) {
if (s->cis_virt) if (s->cis_virt)
iounmap(s->cis_virt); iounmap(s->cis_virt);
......
...@@ -225,43 +225,6 @@ static const lookup_t service_table[] = { ...@@ -225,43 +225,6 @@ static const lookup_t service_table[] = {
}; };
#define SERVICE_COUNT (sizeof(service_table)/sizeof(lookup_t)) #define SERVICE_COUNT (sizeof(service_table)/sizeof(lookup_t))
/*======================================================================
These functions are just shorthand for the actual low-level drivers
======================================================================*/
static int get_socket_status(struct pcmcia_socket *s, int *val)
{
return s->ss_entry->get_status(s, val);
}
static int set_socket(struct pcmcia_socket *s, socket_state_t *state)
{
return s->ss_entry->set_socket(s, state);
}
static int set_io_map(struct pcmcia_socket *s, struct pccard_io_map *io)
{
return s->ss_entry->set_io_map(s, io);
}
static int set_mem_map(struct pcmcia_socket *s, struct pccard_mem_map *mem)
{
return s->ss_entry->set_mem_map(s, mem);
}
static int suspend_socket(struct pcmcia_socket *s)
{
s->socket = dead_socket;
return s->ss_entry->suspend(s);
}
static int init_socket(struct pcmcia_socket *s)
{
s->socket = dead_socket;
return s->ss_entry->init(s);
}
/*==================================================================== /*====================================================================
...@@ -338,12 +301,14 @@ static int pcmcia_add_socket(struct class_device *class_dev) ...@@ -338,12 +301,14 @@ static int pcmcia_add_socket(struct class_device *class_dev)
socket->erase_busy.next = socket->erase_busy.prev = &socket->erase_busy; socket->erase_busy.next = socket->erase_busy.prev = &socket->erase_busy;
INIT_LIST_HEAD(&socket->cis_cache); INIT_LIST_HEAD(&socket->cis_cache);
spin_lock_init(&socket->lock); spin_lock_init(&socket->lock);
init_completion(&socket->thread_done); init_completion(&socket->thread_done);
init_waitqueue_head(&socket->thread_wait); init_waitqueue_head(&socket->thread_wait);
init_MUTEX(&socket->skt_sem); init_MUTEX(&socket->skt_sem);
spin_lock_init(&socket->thread_lock); spin_lock_init(&socket->thread_lock);
init_socket(socket); socket->socket = dead_socket;
socket->ops->init(socket);
ret = kernel_thread(pccardd, socket, CLONE_KERNEL); ret = kernel_thread(pccardd, socket, CLONE_KERNEL);
if (ret < 0) if (ret < 0)
...@@ -373,7 +338,7 @@ static void pcmcia_remove_socket(struct class_device *class_dev) ...@@ -373,7 +338,7 @@ static void pcmcia_remove_socket(struct class_device *class_dev)
socket->clients = socket->clients->next; socket->clients = socket->clients->next;
kfree(client); kfree(client);
} }
socket->ss_entry = NULL; socket->ops = NULL;
} }
static void pcmcia_release_socket(struct class_device *class_dev) static void pcmcia_release_socket(struct class_device *class_dev)
...@@ -388,10 +353,10 @@ static void pcmcia_release_socket(struct class_device *class_dev) ...@@ -388,10 +353,10 @@ static void pcmcia_release_socket(struct class_device *class_dev)
*/ */
int pcmcia_register_socket(struct pcmcia_socket *socket) int pcmcia_register_socket(struct pcmcia_socket *socket)
{ {
if (!socket || !socket->ss_entry || !socket->dev.dev) if (!socket || !socket->ops || !socket->dev.dev)
return -EINVAL; return -EINVAL;
DEBUG(0, "cs: pcmcia_register_socket(0x%p)\n", socket->ss_entry); DEBUG(0, "cs: pcmcia_register_socket(0x%p)\n", socket->ops);
/* try to obtain a socket number [yes, it gets ugly if we /* try to obtain a socket number [yes, it gets ugly if we
* register more than 2^sizeof(unsigned int) pcmcia * register more than 2^sizeof(unsigned int) pcmcia
...@@ -443,7 +408,7 @@ void pcmcia_unregister_socket(struct pcmcia_socket *socket) ...@@ -443,7 +408,7 @@ void pcmcia_unregister_socket(struct pcmcia_socket *socket)
if (!socket) if (!socket)
return; return;
DEBUG(0, "cs: pcmcia_unregister_socket(0x%p)\n", socket->ss_entry); DEBUG(0, "cs: pcmcia_unregister_socket(0x%p)\n", socket->ops);
init_completion(&socket->socket_released); init_completion(&socket->socket_released);
...@@ -510,7 +475,8 @@ static void shutdown_socket(struct pcmcia_socket *s) ...@@ -510,7 +475,8 @@ static void shutdown_socket(struct pcmcia_socket *s)
/* Blank out the socket state */ /* Blank out the socket state */
s->state &= SOCKET_PRESENT|SOCKET_SETUP_PENDING; s->state &= SOCKET_PRESENT|SOCKET_SETUP_PENDING;
init_socket(s); s->socket = dead_socket;
s->ops->init(s);
s->irq.AssignedIRQ = s->irq.Config = 0; s->irq.AssignedIRQ = s->irq.Config = 0;
s->lock_count = 0; s->lock_count = 0;
destroy_cis_cache(s); destroy_cis_cache(s);
...@@ -525,7 +491,7 @@ static void shutdown_socket(struct pcmcia_socket *s) ...@@ -525,7 +491,7 @@ static void shutdown_socket(struct pcmcia_socket *s)
s->socket.Vpp = 0; s->socket.Vpp = 0;
s->socket.Vcc = 0; s->socket.Vcc = 0;
s->socket.io_irq = 0; s->socket.io_irq = 0;
set_socket(s, &s->socket); s->ops->set_socket(s, &s->socket);
/* */ /* */
#ifdef CONFIG_CARDBUS #ifdef CONFIG_CARDBUS
cb_free(s); cb_free(s);
...@@ -619,16 +585,16 @@ static int socket_reset(struct pcmcia_socket *skt) ...@@ -619,16 +585,16 @@ static int socket_reset(struct pcmcia_socket *skt)
int status, i; int status, i;
skt->socket.flags |= SS_OUTPUT_ENA | SS_RESET; skt->socket.flags |= SS_OUTPUT_ENA | SS_RESET;
set_socket(skt, &skt->socket); skt->ops->set_socket(skt, &skt->socket);
udelay((long)reset_time); udelay((long)reset_time);
skt->socket.flags &= ~SS_RESET; skt->socket.flags &= ~SS_RESET;
set_socket(skt, &skt->socket); skt->ops->set_socket(skt, &skt->socket);
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(cs_to_timeout(unreset_delay)); schedule_timeout(cs_to_timeout(unreset_delay));
for (i = 0; i < unreset_limit; i++) { for (i = 0; i < unreset_limit; i++) {
get_socket_status(skt, &status); skt->ops->get_status(skt, &status);
if (!(status & SS_DETECT)) if (!(status & SS_DETECT))
return CS_NO_CARD; return CS_NO_CARD;
...@@ -648,7 +614,7 @@ static int socket_setup(struct pcmcia_socket *skt, int initial_delay) ...@@ -648,7 +614,7 @@ static int socket_setup(struct pcmcia_socket *skt, int initial_delay)
{ {
int status, i; int status, i;
get_socket_status(skt, &status); skt->ops->get_status(skt, &status);
if (!(status & SS_DETECT)) if (!(status & SS_DETECT))
return CS_NO_CARD; return CS_NO_CARD;
...@@ -656,7 +622,7 @@ static int socket_setup(struct pcmcia_socket *skt, int initial_delay) ...@@ -656,7 +622,7 @@ static int socket_setup(struct pcmcia_socket *skt, int initial_delay)
schedule_timeout(cs_to_timeout(initial_delay)); schedule_timeout(cs_to_timeout(initial_delay));
for (i = 0; i < 100; i++) { for (i = 0; i < 100; i++) {
get_socket_status(skt, &status); skt->ops->get_status(skt, &status);
if (!(status & SS_DETECT)) if (!(status & SS_DETECT))
return CS_NO_CARD; return CS_NO_CARD;
...@@ -693,7 +659,7 @@ static int socket_setup(struct pcmcia_socket *skt, int initial_delay) ...@@ -693,7 +659,7 @@ static int socket_setup(struct pcmcia_socket *skt, int initial_delay)
} }
skt->state |= SOCKET_PRESENT; skt->state |= SOCKET_PRESENT;
skt->socket.flags = SS_DEBOUNCED; skt->socket.flags = SS_DEBOUNCED;
set_socket(skt, &skt->socket); skt->ops->set_socket(skt, &skt->socket);
/* /*
* Wait "vcc_settle" for the supply to stabilise. * Wait "vcc_settle" for the supply to stabilise.
...@@ -739,7 +705,8 @@ static int socket_suspend(struct pcmcia_socket *skt) ...@@ -739,7 +705,8 @@ static int socket_suspend(struct pcmcia_socket *skt)
return CS_IN_USE; return CS_IN_USE;
send_event(skt, CS_EVENT_PM_SUSPEND, CS_EVENT_PRI_LOW); send_event(skt, CS_EVENT_PM_SUSPEND, CS_EVENT_PRI_LOW);
suspend_socket(skt); skt->socket = dead_socket;
skt->ops->suspend(skt);
skt->state |= SOCKET_SUSPEND; skt->state |= SOCKET_SUSPEND;
return CS_SUCCESS; return CS_SUCCESS;
...@@ -757,7 +724,8 @@ static int socket_resume(struct pcmcia_socket *skt) ...@@ -757,7 +724,8 @@ static int socket_resume(struct pcmcia_socket *skt)
if (!(skt->state & SOCKET_SUSPEND)) if (!(skt->state & SOCKET_SUSPEND))
return CS_IN_USE; return CS_IN_USE;
init_socket(skt); skt->socket = dead_socket;
skt->ops->init(skt);
ret = socket_setup(skt, resume_delay); ret = socket_setup(skt, resume_delay);
if (ret == CS_SUCCESS) { if (ret == CS_SUCCESS) {
...@@ -811,7 +779,7 @@ static void socket_detect_change(struct pcmcia_socket *skt) ...@@ -811,7 +779,7 @@ static void socket_detect_change(struct pcmcia_socket *skt)
schedule_timeout(cs_to_timeout(2)); schedule_timeout(cs_to_timeout(2));
} }
get_socket_status(skt, &status); skt->ops->get_status(skt, &status);
if ((skt->state & SOCKET_PRESENT) && if ((skt->state & SOCKET_PRESENT) &&
!(status & SS_DETECT)) !(status & SS_DETECT))
socket_remove(skt); socket_remove(skt);
...@@ -1368,7 +1336,7 @@ int pcmcia_get_status(client_handle_t handle, cs_status_t *status) ...@@ -1368,7 +1336,7 @@ int pcmcia_get_status(client_handle_t handle, cs_status_t *status)
if (CHECK_HANDLE(handle)) if (CHECK_HANDLE(handle))
return CS_BAD_HANDLE; return CS_BAD_HANDLE;
s = SOCKET(handle); s = SOCKET(handle);
get_socket_status(s, &val); s->ops->get_status(s, &val);
status->CardState = status->SocketState = 0; status->CardState = status->SocketState = 0;
status->CardState |= (val & SS_DETECT) ? CS_EVENT_CARD_DETECT : 0; status->CardState |= (val & SS_DETECT) ? CS_EVENT_CARD_DETECT : 0;
status->CardState |= (val & SS_CARDBUS) ? CS_EVENT_CB_DETECT : 0; status->CardState |= (val & SS_CARDBUS) ? CS_EVENT_CB_DETECT : 0;
...@@ -1447,7 +1415,7 @@ int pcmcia_map_mem_page(window_handle_t win, memreq_t *req) ...@@ -1447,7 +1415,7 @@ int pcmcia_map_mem_page(window_handle_t win, memreq_t *req)
return CS_BAD_PAGE; return CS_BAD_PAGE;
s = win->sock; s = win->sock;
win->ctl.card_start = req->CardOffset; win->ctl.card_start = req->CardOffset;
if (set_mem_map(s, &win->ctl) != 0) if (s->ops->set_mem_map(s, &win->ctl) != 0)
return CS_BAD_OFFSET; return CS_BAD_OFFSET;
return CS_SUCCESS; return CS_SUCCESS;
} /* map_mem_page */ } /* map_mem_page */
...@@ -1480,7 +1448,7 @@ int pcmcia_modify_configuration(client_handle_t handle, ...@@ -1480,7 +1448,7 @@ int pcmcia_modify_configuration(client_handle_t handle,
c->Attributes &= ~CONF_ENABLE_IRQ; c->Attributes &= ~CONF_ENABLE_IRQ;
s->socket.io_irq = 0; s->socket.io_irq = 0;
} }
set_socket(s, &s->socket); s->ops->set_socket(s, &s->socket);
} }
if (mod->Attributes & CONF_VCC_CHANGE_VALID) if (mod->Attributes & CONF_VCC_CHANGE_VALID)
...@@ -1492,7 +1460,7 @@ int pcmcia_modify_configuration(client_handle_t handle, ...@@ -1492,7 +1460,7 @@ int pcmcia_modify_configuration(client_handle_t handle,
if (mod->Vpp1 != mod->Vpp2) if (mod->Vpp1 != mod->Vpp2)
return CS_BAD_VPP; return CS_BAD_VPP;
c->Vpp1 = c->Vpp2 = s->socket.Vpp = mod->Vpp1; c->Vpp1 = c->Vpp2 = s->socket.Vpp = mod->Vpp1;
if (set_socket(s, &s->socket)) if (s->ops->set_socket(s, &s->socket))
return CS_BAD_VPP; return CS_BAD_VPP;
} else if ((mod->Attributes & CONF_VPP1_CHANGE_VALID) || } else if ((mod->Attributes & CONF_VPP1_CHANGE_VALID) ||
(mod->Attributes & CONF_VPP2_CHANGE_VALID)) (mod->Attributes & CONF_VPP2_CHANGE_VALID))
...@@ -1522,7 +1490,7 @@ int pcmcia_modify_window(window_handle_t win, modwin_t *req) ...@@ -1522,7 +1490,7 @@ int pcmcia_modify_window(window_handle_t win, modwin_t *req)
if (req->Attributes & WIN_USE_WAIT) if (req->Attributes & WIN_USE_WAIT)
win->ctl.flags |= MAP_USE_WAIT; win->ctl.flags |= MAP_USE_WAIT;
win->ctl.speed = req->AccessSpeed; win->ctl.speed = req->AccessSpeed;
set_mem_map(win->sock, &win->ctl); win->sock->ops->set_mem_map(win->sock, &win->ctl);
return CS_SUCCESS; return CS_SUCCESS;
} /* modify_window */ } /* modify_window */
...@@ -1622,7 +1590,7 @@ int pcmcia_release_configuration(client_handle_t handle) ...@@ -1622,7 +1590,7 @@ int pcmcia_release_configuration(client_handle_t handle)
s->socket.flags = SS_OUTPUT_ENA; /* Is this correct? */ s->socket.flags = SS_OUTPUT_ENA; /* Is this correct? */
s->socket.Vpp = 0; s->socket.Vpp = 0;
s->socket.io_irq = 0; s->socket.io_irq = 0;
set_socket(s, &s->socket); s->ops->set_socket(s, &s->socket);
} }
if (c->state & CONFIG_IO_REQ) if (c->state & CONFIG_IO_REQ)
for (i = 0; i < MAX_IO_WIN; i++) { for (i = 0; i < MAX_IO_WIN; i++) {
...@@ -1632,7 +1600,7 @@ int pcmcia_release_configuration(client_handle_t handle) ...@@ -1632,7 +1600,7 @@ int pcmcia_release_configuration(client_handle_t handle)
if (s->io[i].Config != 0) if (s->io[i].Config != 0)
continue; continue;
io.map = i; io.map = i;
set_io_map(s, &io); s->ops->set_io_map(s, &io);
} }
c->state &= ~CONFIG_LOCKED; c->state &= ~CONFIG_LOCKED;
} }
...@@ -1733,7 +1701,7 @@ int pcmcia_release_window(window_handle_t win) ...@@ -1733,7 +1701,7 @@ int pcmcia_release_window(window_handle_t win)
/* Shut down memory window */ /* Shut down memory window */
win->ctl.flags &= ~MAP_ACTIVE; win->ctl.flags &= ~MAP_ACTIVE;
set_mem_map(s, &win->ctl); s->ops->set_mem_map(s, &win->ctl);
s->state &= ~SOCKET_WIN_REQ(win->index); s->state &= ~SOCKET_WIN_REQ(win->index);
/* Release system memory */ /* Release system memory */
...@@ -1780,7 +1748,7 @@ int pcmcia_request_configuration(client_handle_t handle, ...@@ -1780,7 +1748,7 @@ int pcmcia_request_configuration(client_handle_t handle,
if (req->Vpp1 != req->Vpp2) if (req->Vpp1 != req->Vpp2)
return CS_BAD_VPP; return CS_BAD_VPP;
s->socket.Vpp = req->Vpp1; s->socket.Vpp = req->Vpp1;
if (set_socket(s, &s->socket)) if (s->ops->set_socket(s, &s->socket))
return CS_BAD_VPP; return CS_BAD_VPP;
c->Vcc = req->Vcc; c->Vpp1 = c->Vpp2 = req->Vpp1; c->Vcc = req->Vcc; c->Vpp1 = c->Vpp2 = req->Vpp1;
...@@ -1798,7 +1766,7 @@ int pcmcia_request_configuration(client_handle_t handle, ...@@ -1798,7 +1766,7 @@ int pcmcia_request_configuration(client_handle_t handle,
s->socket.io_irq = s->irq.AssignedIRQ; s->socket.io_irq = s->irq.AssignedIRQ;
else else
s->socket.io_irq = 0; s->socket.io_irq = 0;
set_socket(s, &s->socket); s->ops->set_socket(s, &s->socket);
s->lock_count++; s->lock_count++;
/* Set up CIS configuration registers */ /* Set up CIS configuration registers */
...@@ -1863,7 +1831,7 @@ int pcmcia_request_configuration(client_handle_t handle, ...@@ -1863,7 +1831,7 @@ int pcmcia_request_configuration(client_handle_t handle,
} }
iomap.start = s->io[i].BasePort; iomap.start = s->io[i].BasePort;
iomap.stop = iomap.start + s->io[i].NumPorts - 1; iomap.stop = iomap.start + s->io[i].NumPorts - 1;
set_io_map(s, &iomap); s->ops->set_io_map(s, &iomap);
s->io[i].Config++; s->io[i].Config++;
} }
} }
...@@ -2084,7 +2052,7 @@ int pcmcia_request_window(client_handle_t *handle, win_req_t *req, window_handle ...@@ -2084,7 +2052,7 @@ int pcmcia_request_window(client_handle_t *handle, win_req_t *req, window_handle
win->ctl.sys_start = win->base; win->ctl.sys_start = win->base;
win->ctl.sys_stop = win->base + win->size-1; win->ctl.sys_stop = win->base + win->size-1;
win->ctl.card_start = 0; win->ctl.card_start = 0;
if (set_mem_map(s, &win->ctl) != 0) if (s->ops->set_mem_map(s, &win->ctl) != 0)
return CS_BAD_ARGS; return CS_BAD_ARGS;
s->state |= SOCKET_WIN_REQ(w); s->state |= SOCKET_WIN_REQ(w);
......
...@@ -113,7 +113,7 @@ struct cis_cache_entry { ...@@ -113,7 +113,7 @@ struct cis_cache_entry {
(((h) == NULL) || ((h)->client_magic != CLIENT_MAGIC)) (((h) == NULL) || ((h)->client_magic != CLIENT_MAGIC))
#define CHECK_SOCKET(s) \ #define CHECK_SOCKET(s) \
(((s) >= sockets) || (socket_table[s]->ss_entry == NULL)) (((s) >= sockets) || (socket_table[s]->ops == NULL))
#define SOCKET(h) (h->Socket) #define SOCKET(h) (h->Socket)
#define CONFIG(h) (&SOCKET(h)->config[(h)->Function]) #define CONFIG(h) (&SOCKET(h)->config[(h)->Function])
......
This diff is collapsed.
...@@ -161,7 +161,7 @@ static int __init i82092aa_pci_probe(struct pci_dev *dev, const struct pci_devic ...@@ -161,7 +161,7 @@ static int __init i82092aa_pci_probe(struct pci_dev *dev, const struct pci_devic
for (i = 0; i<socket_count; i++) { for (i = 0; i<socket_count; i++) {
sockets[i].socket.dev.dev = &dev->dev; sockets[i].socket.dev.dev = &dev->dev;
sockets[i].socket.ss_entry = &i82092aa_operations; sockets[i].socket.ops = &i82092aa_operations;
ret = pcmcia_register_socket(&sockets[i].socket); ret = pcmcia_register_socket(&sockets[i].socket);
if (ret) { if (ret) {
goto err_out_free_sockets; goto err_out_free_sockets;
......
...@@ -1403,7 +1403,7 @@ static int __init init_i82365(void) ...@@ -1403,7 +1403,7 @@ static int __init init_i82365(void)
/* register sockets with the pcmcia core */ /* register sockets with the pcmcia core */
for (i = 0; i < sockets; i++) { for (i = 0; i < sockets; i++) {
socket[i].socket.dev.dev = &i82365_device.dev; socket[i].socket.dev.dev = &i82365_device.dev;
socket[i].socket.ss_entry = &pcic_operations; socket[i].socket.ops = &pcic_operations;
socket[i].socket.owner = THIS_MODULE; socket[i].socket.owner = THIS_MODULE;
socket[i].number = i; socket[i].number = i;
ret = pcmcia_register_socket(&socket[i].socket); ret = pcmcia_register_socket(&socket[i].socket);
......
...@@ -161,7 +161,7 @@ static int ricoh_override(struct yenta_socket *socket) ...@@ -161,7 +161,7 @@ static int ricoh_override(struct yenta_socket *socket)
rl_config(socket) |= RL5C4XX_CONFIG_PREFETCH; rl_config(socket) |= RL5C4XX_CONFIG_PREFETCH;
} }
socket->socket.ss_entry->init = ricoh_init; socket->socket.ops->init = ricoh_init;
return 0; return 0;
} }
......
...@@ -360,7 +360,7 @@ static int checksum(struct pcmcia_socket *s, struct resource *res) ...@@ -360,7 +360,7 @@ static int checksum(struct pcmcia_socket *s, struct resource *res)
map.sys_start = res->start; map.sys_start = res->start;
map.sys_stop = res->end; map.sys_stop = res->end;
map.card_start = 0; map.card_start = 0;
s->ss_entry->set_mem_map(s, &map); s->ops->set_mem_map(s, &map);
/* Don't bother checking every word... */ /* Don't bother checking every word... */
for (i = 0; i < s->map_size; i += 44) { for (i = 0; i < s->map_size; i += 44) {
...@@ -370,7 +370,7 @@ static int checksum(struct pcmcia_socket *s, struct resource *res) ...@@ -370,7 +370,7 @@ static int checksum(struct pcmcia_socket *s, struct resource *res)
} }
map.flags = 0; map.flags = 0;
s->ss_entry->set_mem_map(s, &map); s->ops->set_mem_map(s, &map);
iounmap(virt); iounmap(virt);
} }
......
...@@ -725,7 +725,7 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, in ...@@ -725,7 +725,7 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, in
struct sa1100_pcmcia_socket *skt = PCMCIA_SOCKET(i); struct sa1100_pcmcia_socket *skt = PCMCIA_SOCKET(i);
memset(skt, 0, sizeof(*skt)); memset(skt, 0, sizeof(*skt));
skt->socket.ss_entry = &sa11xx_pcmcia_operations; skt->socket.ops = &sa11xx_pcmcia_operations;
skt->socket.owner = ops->owner; skt->socket.owner = ops->owner;
skt->socket.dev.dev = dev; skt->socket.dev.dev = dev;
......
...@@ -519,7 +519,7 @@ static int __init init_tcic(void) ...@@ -519,7 +519,7 @@ static int __init init_tcic(void)
platform_device_register(&tcic_device); platform_device_register(&tcic_device);
for (i = 0; i < sockets; i++) { for (i = 0; i < sockets; i++) {
socket_table[i].socket.ss_entry = &tcic_operations; socket_table[i].socket.ops = &tcic_operations;
socket_table[i].socket.dev.dev = &tcic_device.dev; socket_table[i].socket.dev.dev = &tcic_device.dev;
ret = pcmcia_register_socket(&socket_table[i].socket); ret = pcmcia_register_socket(&socket_table[i].socket);
if (ret && i) if (ret && i)
......
...@@ -182,25 +182,30 @@ static int ti_override(struct yenta_socket *socket) ...@@ -182,25 +182,30 @@ static int ti_override(struct yenta_socket *socket)
/* /*
* If ISA interrupts don't work, then fall back to routing card * If ISA interrupts don't work, then fall back to routing card
* interrupts to the PCI interrupt of the socket. * interrupts to the PCI interrupt of the socket.
*
* Tweaking this when we are using serial PCI IRQs causes hangs
* --rmk
*/ */
if (!socket->socket.irq_mask) { if (!socket->socket.irq_mask) {
int irqmux, devctl; u8 irqmux, devctl;
printk (KERN_INFO "ti113x: Routing card interrupts to PCI\n");
devctl = config_readb(socket, TI113X_DEVICE_CONTROL); devctl = config_readb(socket, TI113X_DEVICE_CONTROL);
devctl &= ~TI113X_DCR_IMODE_MASK; if (devctl & TI113X_DCR_IMODE_MASK != TI12XX_DCR_IMODE_ALL_SERIAL) {
printk (KERN_INFO "ti113x: Routing card interrupts to PCI\n");
devctl &= ~TI113X_DCR_IMODE_MASK;
irqmux = config_readl(socket, TI122X_IRQMUX); irqmux = config_readl(socket, TI122X_IRQMUX);
irqmux = (irqmux & ~0x0f) | 0x02; /* route INTA */ irqmux = (irqmux & ~0x0f) | 0x02; /* route INTA */
irqmux = (irqmux & ~0xf0) | 0x20; /* route INTB */ irqmux = (irqmux & ~0xf0) | 0x20; /* route INTB */
config_writel(socket, TI122X_IRQMUX, irqmux); config_writel(socket, TI122X_IRQMUX, irqmux);
config_writeb(socket, TI113X_DEVICE_CONTROL, devctl); config_writeb(socket, TI113X_DEVICE_CONTROL, devctl);
}
} }
#endif #endif
socket->socket.ss_entry->init = ti_init; socket->socket.ops->init = ti_init;
return 0; return 0;
} }
...@@ -233,7 +238,7 @@ static int ti113x_override(struct yenta_socket *socket) ...@@ -233,7 +238,7 @@ static int ti113x_override(struct yenta_socket *socket)
if (socket->cb_irq) if (socket->cb_irq)
ti_cardctl(socket) |= TI113X_CCR_PCI_IRQ_ENA | TI113X_CCR_PCI_CSC | TI113X_CCR_PCI_IREQ; ti_cardctl(socket) |= TI113X_CCR_PCI_IRQ_ENA | TI113X_CCR_PCI_CSC | TI113X_CCR_PCI_IREQ;
ti_override(socket); ti_override(socket);
socket->socket.ss_entry->init = ti113x_init; socket->socket.ops->init = ti113x_init;
return 0; return 0;
} }
...@@ -262,7 +267,7 @@ static int ti1250_override(struct yenta_socket *socket) ...@@ -262,7 +267,7 @@ static int ti1250_override(struct yenta_socket *socket)
if (socket->cb_irq) if (socket->cb_irq)
ti_diag(socket) |= TI1250_DIAG_PCI_CSC | TI1250_DIAG_PCI_IREQ; ti_diag(socket) |= TI1250_DIAG_PCI_CSC | TI1250_DIAG_PCI_IREQ;
ti113x_override(socket); ti113x_override(socket);
socket->socket.ss_entry->init = ti1250_init; socket->socket.ops->init = ti1250_init;
return 0; return 0;
} }
......
...@@ -828,7 +828,7 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i ...@@ -828,7 +828,7 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i
memset(socket, 0, sizeof(*socket)); memset(socket, 0, sizeof(*socket));
/* prepare pcmcia_socket */ /* prepare pcmcia_socket */
socket->socket.ss_entry = &yenta_socket_operations; socket->socket.ops = &yenta_socket_operations;
socket->socket.dev.dev = &dev->dev; socket->socket.dev.dev = &dev->dev;
socket->socket.driver_data = socket; socket->socket.driver_data = socket;
socket->socket.owner = THIS_MODULE; socket->socket.owner = THIS_MODULE;
......
...@@ -69,7 +69,7 @@ obj-$(CONFIG_FB_SA1100) += sa1100fb.o cfbfillrect.o cfbcopyarea.o cfbi ...@@ -69,7 +69,7 @@ obj-$(CONFIG_FB_SA1100) += sa1100fb.o cfbfillrect.o cfbcopyarea.o cfbi
obj-$(CONFIG_FB_VIRTUAL) += vfb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o obj-$(CONFIG_FB_VIRTUAL) += vfb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_HIT) += hitfb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o obj-$(CONFIG_FB_HIT) += hitfb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_E1355) += epson1355fb.o obj-$(CONFIG_FB_E1355) += epson1355fb.o
obj-$(CONFIG_FB_PVR2) += pvr2fb.o obj-$(CONFIG_FB_PVR2) += pvr2fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_VOODOO1) += sstfb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o obj-$(CONFIG_FB_VOODOO1) += sstfb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_FFB) += ffb.o sbuslib.o cfbimgblt.o cfbcopyarea.o obj-$(CONFIG_FB_FFB) += ffb.o sbuslib.o cfbimgblt.o cfbcopyarea.o
......
This diff is collapsed.
...@@ -536,7 +536,8 @@ static ssize_t read_profile(struct file *file, char *buf, ...@@ -536,7 +536,8 @@ static ssize_t read_profile(struct file *file, char *buf,
buf++; p++; count--; read++; buf++; p++; count--; read++;
} }
pnt = (char *)prof_buffer + p - sizeof(unsigned int); pnt = (char *)prof_buffer + p - sizeof(unsigned int);
copy_to_user(buf,(void *)pnt,count); if (copy_to_user(buf,(void *)pnt,count))
return -EFAULT;
read += count; read += count;
*ppos += read; *ppos += read;
return read; return read;
......
...@@ -6,7 +6,9 @@ ...@@ -6,7 +6,9 @@
#ifndef _ASMALPHA_TIMEX_H #ifndef _ASMALPHA_TIMEX_H
#define _ASMALPHA_TIMEX_H #define _ASMALPHA_TIMEX_H
#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ /* With only one or two oddballs, we use the RTC as the ticker, selecting
the 32.768kHz reference clock, which nicely divides down to our HZ. */
#define CLOCK_TICK_RATE 32768
/* /*
* Standard way to access the cycle counter. * Standard way to access the cycle counter.
......
...@@ -359,7 +359,8 @@ ...@@ -359,7 +359,8 @@
#define __NR_clock_getres 421 #define __NR_clock_getres 421
#define __NR_clock_nanosleep 422 #define __NR_clock_nanosleep 422
#define __NR_semtimedop 423 #define __NR_semtimedop 423
#define NR_SYSCALLS 424 #define __NR_tgkill 424
#define NR_SYSCALLS 425
#if defined(__GNUC__) #if defined(__GNUC__)
......
...@@ -107,7 +107,7 @@ static inline void x86_do_profile(struct pt_regs * regs) ...@@ -107,7 +107,7 @@ static inline void x86_do_profile(struct pt_regs * regs)
atomic_inc((atomic_t *)&prof_buffer[eip]); atomic_inc((atomic_t *)&prof_buffer[eip]);
} }
#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_SMP) #if defined(CONFIG_X86_IO_APIC)
static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i)
{ {
if (IO_APIC_IRQ(i)) if (IO_APIC_IRQ(i))
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#define _NAMESPACE_H_ #define _NAMESPACE_H_
#ifdef __KERNEL__ #ifdef __KERNEL__
#include <linux/dcache.h> #include <linux/mount.h>
#include <linux/sched.h> #include <linux/sched.h>
struct namespace { struct namespace {
...@@ -19,9 +19,9 @@ static inline void put_namespace(struct namespace *namespace) ...@@ -19,9 +19,9 @@ static inline void put_namespace(struct namespace *namespace)
{ {
if (atomic_dec_and_test(&namespace->count)) { if (atomic_dec_and_test(&namespace->count)) {
down_write(&namespace->sem); down_write(&namespace->sem);
spin_lock(&dcache_lock); spin_lock(&vfsmount_lock);
umount_tree(namespace->root); umount_tree(namespace->root);
spin_unlock(&dcache_lock); spin_unlock(&vfsmount_lock);
up_write(&namespace->sem); up_write(&namespace->sem);
kfree(namespace); kfree(namespace);
} }
......
...@@ -456,10 +456,10 @@ struct pci_bus { ...@@ -456,10 +456,10 @@ struct pci_bus {
void *sysdata; /* hook for sys-specific extension */ void *sysdata; /* hook for sys-specific extension */
struct proc_dir_entry *procdir; /* directory entry in /proc/bus/pci */ struct proc_dir_entry *procdir; /* directory entry in /proc/bus/pci */
unsigned char number; /* bus number */ unsigned int number; /* bus number */
unsigned char primary; /* number of primary bridge */ unsigned int primary; /* number of primary bridge */
unsigned char secondary; /* number of secondary bridge */ unsigned int secondary; /* number of secondary bridge */
unsigned char subordinate; /* max number of subordinate buses */ unsigned int subordinate; /* max number of subordinate buses */
char name[48]; char name[48];
......
...@@ -170,7 +170,6 @@ struct region_t; ...@@ -170,7 +170,6 @@ struct region_t;
struct pcmcia_socket { struct pcmcia_socket {
struct module *owner; struct module *owner;
spinlock_t lock; spinlock_t lock;
struct pccard_operations * ss_entry;
socket_state_t socket; socket_state_t socket;
u_int state; u_int state;
u_short functions; u_short functions;
...@@ -207,6 +206,9 @@ struct pcmcia_socket { ...@@ -207,6 +206,9 @@ struct pcmcia_socket {
u_char pci_irq; u_char pci_irq;
struct pci_dev * cb_dev; struct pci_dev * cb_dev;
/* socket operations */
struct pccard_operations * ops;
/* state thread */ /* state thread */
struct semaphore skt_sem; /* protects socket h/w state */ struct semaphore skt_sem; /* protects socket h/w state */
......
...@@ -605,6 +605,9 @@ EXPORT_SYMBOL(next_thread); ...@@ -605,6 +605,9 @@ EXPORT_SYMBOL(next_thread);
EXPORT_SYMBOL(__per_cpu_offset); EXPORT_SYMBOL(__per_cpu_offset);
#endif #endif
EXPORT_SYMBOL(set_fs_pwd);
EXPORT_SYMBOL(set_fs_root);
/* debug */ /* debug */
EXPORT_SYMBOL(dump_stack); EXPORT_SYMBOL(dump_stack);
EXPORT_SYMBOL(ptrace_notify); EXPORT_SYMBOL(ptrace_notify);
......
...@@ -2373,7 +2373,7 @@ static void tcp_fin(struct sk_buff *skb, struct sock *sk, struct tcphdr *th) ...@@ -2373,7 +2373,7 @@ static void tcp_fin(struct sk_buff *skb, struct sock *sk, struct tcphdr *th)
tcp_schedule_ack(tp); tcp_schedule_ack(tp);
sk->sk_shutdown |= RCV_SHUTDOWN; sk->sk_shutdown |= RCV_SHUTDOWN;
sock_reset_flag(sk, SOCK_DONE); sock_set_flag(sk, SOCK_DONE);
switch (sk->sk_state) { switch (sk->sk_state) {
case TCP_SYN_RECV: case TCP_SYN_RECV:
......
...@@ -368,7 +368,8 @@ static struct inet6_dev * ipv6_add_dev(struct net_device *dev) ...@@ -368,7 +368,8 @@ static struct inet6_dev * ipv6_add_dev(struct net_device *dev)
dev, dev->name); dev, dev->name);
ndev->cnf.use_tempaddr = -1; ndev->cnf.use_tempaddr = -1;
} else { } else {
__ipv6_regen_rndid(ndev); in6_dev_hold(ndev);
ipv6_regen_rndid((unsigned long) ndev);
} }
#endif #endif
...@@ -1122,9 +1123,6 @@ static int __ipv6_regen_rndid(struct inet6_dev *idev) ...@@ -1122,9 +1123,6 @@ static int __ipv6_regen_rndid(struct inet6_dev *idev)
sg[1].offset = ((long) eui64 & ~PAGE_MASK); sg[1].offset = ((long) eui64 & ~PAGE_MASK);
sg[1].length = 8; sg[1].length = 8;
if (!del_timer(&idev->regen_timer))
in6_dev_hold(idev);
dev = idev->dev; dev = idev->dev;
if (ipv6_generate_eui64(eui64, dev)) { if (ipv6_generate_eui64(eui64, dev)) {
...@@ -1137,7 +1135,6 @@ static int __ipv6_regen_rndid(struct inet6_dev *idev) ...@@ -1137,7 +1135,6 @@ static int __ipv6_regen_rndid(struct inet6_dev *idev)
spin_lock(&md5_tfm_lock); spin_lock(&md5_tfm_lock);
if (unlikely(md5_tfm == NULL)) { if (unlikely(md5_tfm == NULL)) {
spin_unlock(&md5_tfm_lock); spin_unlock(&md5_tfm_lock);
in6_dev_put(idev);
return -1; return -1;
} }
crypto_digest_init(md5_tfm); crypto_digest_init(md5_tfm);
...@@ -1170,33 +1167,41 @@ static int __ipv6_regen_rndid(struct inet6_dev *idev) ...@@ -1170,33 +1167,41 @@ static int __ipv6_regen_rndid(struct inet6_dev *idev)
if ((idev->rndid[2]|idev->rndid[3]|idev->rndid[4]|idev->rndid[5]|idev->rndid[6]|idev->rndid[7]) == 0x00) if ((idev->rndid[2]|idev->rndid[3]|idev->rndid[4]|idev->rndid[5]|idev->rndid[6]|idev->rndid[7]) == 0x00)
goto regen; goto regen;
} }
idev->regen_timer.expires = jiffies +
idev->cnf.temp_prefered_lft * HZ -
idev->cnf.regen_max_retry * idev->cnf.dad_transmits * idev->nd_parms->retrans_time - desync_factor;
if (time_before(idev->regen_timer.expires, jiffies)) {
idev->regen_timer.expires = 0;
printk(KERN_WARNING
"__ipv6_regen_rndid(): too short regeneration interval; timer disabled for %s.\n",
idev->dev->name);
in6_dev_put(idev);
return -1;
}
add_timer(&idev->regen_timer);
return 0; return 0;
} }
static void ipv6_regen_rndid(unsigned long data) static void ipv6_regen_rndid(unsigned long data)
{ {
struct inet6_dev *idev = (struct inet6_dev *) data; struct inet6_dev *idev = (struct inet6_dev *) data;
unsigned long expires;
read_lock_bh(&addrconf_lock); read_lock_bh(&addrconf_lock);
write_lock_bh(&idev->lock); write_lock_bh(&idev->lock);
if (!idev->dead)
__ipv6_regen_rndid(idev); if (idev->dead)
goto out;
if (__ipv6_regen_rndid(idev) < 0)
goto out;
expires = jiffies +
idev->cnf.temp_prefered_lft * HZ -
idev->cnf.regen_max_retry * idev->cnf.dad_transmits * idev->nd_parms->retrans_time - desync_factor;
if (time_before(expires, jiffies)) {
printk(KERN_WARNING
"ipv6_regen_rndid(): too short regeneration interval; timer disabled for %s.\n",
idev->dev->name);
goto out;
}
if (!mod_timer(&idev->regen_timer, expires))
in6_dev_hold(idev);
out:
write_unlock_bh(&idev->lock); write_unlock_bh(&idev->lock);
read_unlock_bh(&addrconf_lock); read_unlock_bh(&addrconf_lock);
in6_dev_put(idev);
} }
static int __ipv6_try_regen_rndid(struct inet6_dev *idev, struct in6_addr *tmpaddr) { static int __ipv6_try_regen_rndid(struct inet6_dev *idev, struct in6_addr *tmpaddr) {
...@@ -1928,6 +1933,27 @@ static int addrconf_ifdown(struct net_device *dev, int how) ...@@ -1928,6 +1933,27 @@ static int addrconf_ifdown(struct net_device *dev, int how)
/* Step 3: clear address list */ /* Step 3: clear address list */
write_lock_bh(&idev->lock); write_lock_bh(&idev->lock);
#ifdef CONFIG_IPV6_PRIVACY
if (how == 1 && del_timer(&idev->regen_timer))
in6_dev_put(idev);
/* clear tempaddr list */
while ((ifa = idev->tempaddr_list) != NULL) {
idev->tempaddr_list = ifa->tmp_next;
ifa->tmp_next = NULL;
ifa->dead = 1;
write_unlock_bh(&idev->lock);
spin_lock_bh(&ifa->lock);
if (ifa->ifpub) {
in6_ifa_put(ifa->ifpub);
ifa->ifpub = NULL;
}
spin_unlock_bh(&ifa->lock);
in6_ifa_put(ifa);
write_lock_bh(&idev->lock);
}
#endif
while ((ifa = idev->addr_list) != NULL) { while ((ifa = idev->addr_list) != NULL) {
idev->addr_list = ifa->if_next; idev->addr_list = ifa->if_next;
ifa->if_next = NULL; ifa->if_next = NULL;
......
...@@ -668,7 +668,7 @@ static int wanrouter_device_stat(struct wan_device *wandev, ...@@ -668,7 +668,7 @@ static int wanrouter_device_stat(struct wan_device *wandev,
static int wanrouter_device_new_if(struct wan_device *wandev, static int wanrouter_device_new_if(struct wan_device *wandev,
wanif_conf_t *u_conf) wanif_conf_t *u_conf)
{ {
wanif_conf_t conf; wanif_conf_t *cnf;
struct net_device *dev = NULL; struct net_device *dev = NULL;
#ifdef CONFIG_WANPIPE_MULTPPP #ifdef CONFIG_WANPIPE_MULTPPP
struct ppp_device *pppdev=NULL; struct ppp_device *pppdev=NULL;
...@@ -678,38 +678,47 @@ static int wanrouter_device_new_if(struct wan_device *wandev, ...@@ -678,38 +678,47 @@ static int wanrouter_device_new_if(struct wan_device *wandev,
if ((wandev->state == WAN_UNCONFIGURED) || (wandev->new_if == NULL)) if ((wandev->state == WAN_UNCONFIGURED) || (wandev->new_if == NULL))
return -ENODEV; return -ENODEV;
if (copy_from_user(&conf, u_conf, sizeof(wanif_conf_t))) cnf = kmalloc(sizeof(wanif_conf_t), GFP_KERNEL);
return -EFAULT; if (!cnf)
return -ENOBUFS;
if (conf.magic != ROUTER_MAGIC) err = -EFAULT;
return -EINVAL; if (copy_from_user(cnf, u_conf, sizeof(wanif_conf_t)))
goto out;
err = -EINVAL;
if (cnf->magic != ROUTER_MAGIC)
goto out;
if (conf.config_id == WANCONFIG_MPPP) { if (cnf->config_id == WANCONFIG_MPPP) {
#ifdef CONFIG_WANPIPE_MULTPPP #ifdef CONFIG_WANPIPE_MULTPPP
pppdev = kmalloc(sizeof(struct ppp_device), GFP_KERNEL); pppdev = kmalloc(sizeof(struct ppp_device), GFP_KERNEL);
err = -ENOBUFS;
if (pppdev == NULL) if (pppdev == NULL)
return -ENOBUFS; goto out;
memset(pppdev, 0, sizeof(struct ppp_device)); memset(pppdev, 0, sizeof(struct ppp_device));
pppdev->dev = kmalloc(sizeof(struct net_device), GFP_KERNEL); pppdev->dev = kmalloc(sizeof(struct net_device), GFP_KERNEL);
if (pppdev->dev == NULL) { if (pppdev->dev == NULL) {
kfree(pppdev); kfree(pppdev);
return -ENOBUFS; err = -ENOBUFS;
goto out;
} }
memset(pppdev->dev, 0, sizeof(struct net_device)); memset(pppdev->dev, 0, sizeof(struct net_device));
err = wandev->new_if(wandev, err = wandev->new_if(wandev, (struct net_device *)pppdev, cnf);
(struct net_device *)pppdev, &conf);
dev = pppdev->dev; dev = pppdev->dev;
#else #else
printk(KERN_INFO "%s: Wanpipe Mulit-Port PPP support has not been compiled in!\n", printk(KERN_INFO "%s: Wanpipe Mulit-Port PPP support has not been compiled in!\n",
wandev->name); wandev->name);
return -EPROTONOSUPPORT; err = -EPROTONOSUPPORT;
goto out;
#endif #endif
} else { } else {
dev = kmalloc(sizeof(struct net_device), GFP_KERNEL); dev = kmalloc(sizeof(struct net_device), GFP_KERNEL);
err = -ENOBUFS;
if (dev == NULL) if (dev == NULL)
return -ENOBUFS; goto out;
memset(dev, 0, sizeof(struct net_device)); memset(dev, 0, sizeof(struct net_device));
err = wandev->new_if(wandev, dev, &conf); err = wandev->new_if(wandev, dev, cnf);
} }
if (!err) { if (!err) {
...@@ -748,7 +757,8 @@ static int wanrouter_device_new_if(struct wan_device *wandev, ...@@ -748,7 +757,8 @@ static int wanrouter_device_new_if(struct wan_device *wandev,
++wandev->ndev; ++wandev->ndev;
unlock_adapter_irq(&wandev->lock, &smp_flags); unlock_adapter_irq(&wandev->lock, &smp_flags);
return 0; /* done !!! */ err = 0; /* done !!! */
goto out;
} }
} }
if (wandev->del_if) if (wandev->del_if)
...@@ -761,18 +771,19 @@ static int wanrouter_device_new_if(struct wan_device *wandev, ...@@ -761,18 +771,19 @@ static int wanrouter_device_new_if(struct wan_device *wandev,
dev->priv = NULL; dev->priv = NULL;
} }
#ifdef CONFIG_WANPIPE_MULTPPP #ifdef CONFIG_WANPIPE_MULTPPP
if (conf.config_id == WANCONFIG_MPPP) if (cnf->config_id == WANCONFIG_MPPP)
kfree(pppdev); kfree(pppdev);
else else
kfree(dev); kfree(dev);
#else #else
/* Sync PPP is disabled */ /* Sync PPP is disabled */
if (conf.config_id != WANCONFIG_MPPP) if (cnf->config_id != WANCONFIG_MPPP)
kfree(dev); kfree(dev);
#endif #endif
out:
kfree(cnf);
return err; return err;
} }
......
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