git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
drivers
/
ieee1394
/
ieee1394_core.c
diff --git
a/drivers/ieee1394/ieee1394_core.c
b/drivers/ieee1394/ieee1394_core.c
index
be6854e
..
9a48ca2
100644
(file)
--- a/
drivers/ieee1394/ieee1394_core.c
+++ b/
drivers/ieee1394/ieee1394_core.c
@@
-20,7
+20,6
@@
*
*/
*
*/
-#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/string.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/string.h>
@@
-33,9
+32,9
@@
#include <linux/kdev_t.h>
#include <linux/skbuff.h>
#include <linux/suspend.h>
#include <linux/kdev_t.h>
#include <linux/skbuff.h>
#include <linux/suspend.h>
+#include <linux/kthread.h>
#include <asm/byteorder.h>
#include <asm/byteorder.h>
-#include <asm/semaphore.h>
#include "ieee1394_types.h"
#include "ieee1394.h"
#include "ieee1394_types.h"
#include "ieee1394.h"
@@
-86,7
+85,7
@@
static void dump_packet(const char *text, quadlet_t *data, int size, int speed)
printk("\n");
}
#else
printk("\n");
}
#else
-#define dump_packet(a,b,c,d)
+#define dump_packet(a,b,c,d)
do {} while (0)
#endif
static void abort_requests(struct hpsb_host *host);
#endif
static void abort_requests(struct hpsb_host *host);
@@
-285,9
+284,9
@@
static int check_selfids(struct hpsb_host *host)
static void build_speed_map(struct hpsb_host *host, int nodecount)
{
static void build_speed_map(struct hpsb_host *host, int nodecount)
{
- u8 speedcap[nodecount];
u8 cldcnt[nodecount];
u8 *map = host->speed_map;
u8 cldcnt[nodecount];
u8 *map = host->speed_map;
+ u8 *speedcap = host->speed;
struct selfid *sid;
struct ext_selfid *esid;
int i, j, n;
struct selfid *sid;
struct ext_selfid *esid;
int i, j, n;
@@
-354,6
+353,13
@@
static void build_speed_map(struct hpsb_host *host, int nodecount)
}
}
}
}
}
}
+
+#if SELFID_SPEED_UNKNOWN != IEEE1394_SPEED_MAX
+ /* assume maximum speed for 1394b PHYs, nodemgr will correct it */
+ for (n = 0; n < nodecount; n++)
+ if (speedcap[n] == SELFID_SPEED_UNKNOWN)
+ speedcap[n] = IEEE1394_SPEED_MAX;
+#endif
}
}
@@
-554,11
+560,10
@@
int hpsb_send_packet(struct hpsb_packet *packet)
return 0;
}
return 0;
}
- if (packet->type == hpsb_async && packet->node_id != ALL_NODES) {
+ if (packet->type == hpsb_async &&
+ NODEID_TO_NODE(packet->node_id) != ALL_NODES)
packet->speed_code =
packet->speed_code =
- host->speed_map[NODEID_TO_NODE(host->node_id) * 64
- + NODEID_TO_NODE(packet->node_id)];
- }
+ host->speed[NODEID_TO_NODE(packet->node_id)];
dump_packet("send packet", packet->header, packet->header_size, packet->speed_code);
dump_packet("send packet", packet->header, packet->header_size, packet->speed_code);
@@
-997,11
+1002,8
@@
void abort_timedouts(unsigned long __opaque)
* packets that have a "complete" function are sent here. This way, the
* completion is run out of kernel context, and doesn't block the rest of
* the stack. */
* packets that have a "complete" function are sent here. This way, the
* completion is run out of kernel context, and doesn't block the rest of
* the stack. */
-static int khpsbpkt_pid = -1, khpsbpkt_kill;
-static DECLARE_COMPLETION(khpsbpkt_complete);
+static struct task_struct *khpsbpkt_thread;
static struct sk_buff_head hpsbpkt_queue;
static struct sk_buff_head hpsbpkt_queue;
-static DECLARE_MUTEX_LOCKED(khpsbpkt_sig);
-
static void queue_packet_complete(struct hpsb_packet *packet)
{
static void queue_packet_complete(struct hpsb_packet *packet)
{
@@
-1011,9
+1013,7
@@
static void queue_packet_complete(struct hpsb_packet *packet)
}
if (packet->complete_routine != NULL) {
skb_queue_tail(&hpsbpkt_queue, packet->skb);
}
if (packet->complete_routine != NULL) {
skb_queue_tail(&hpsbpkt_queue, packet->skb);
-
- /* Signal the kernel thread to handle this */
- up(&khpsbpkt_sig);
+ wake_up_process(khpsbpkt_thread);
}
return;
}
}
return;
}
@@
-1025,19
+1025,9
@@
static int hpsbpkt_thread(void *__hi)
void (*complete_routine)(void*);
void *complete_data;
void (*complete_routine)(void*);
void *complete_data;
- daemonize("khpsbpkt");
-
current->flags |= PF_NOFREEZE;
current->flags |= PF_NOFREEZE;
- while (1) {
- if (down_interruptible(&khpsbpkt_sig)) {
- printk("khpsbpkt: received unexpected signal?!\n" );
- break;
- }
-
- if (khpsbpkt_kill)
- break;
-
+ while (!kthread_should_stop()) {
while ((skb = skb_dequeue(&hpsbpkt_queue)) != NULL) {
packet = (struct hpsb_packet *)skb->data;
while ((skb = skb_dequeue(&hpsbpkt_queue)) != NULL) {
packet = (struct hpsb_packet *)skb->data;
@@
-1048,9
+1038,13
@@
static int hpsbpkt_thread(void *__hi)
complete_routine(complete_data);
}
complete_routine(complete_data);
}
- }
- complete_and_exit(&khpsbpkt_complete, 0);
+ set_current_state(TASK_INTERRUPTIBLE);
+ if (!skb_peek(&hpsbpkt_queue))
+ schedule();
+ __set_current_state(TASK_RUNNING);
+ }
+ return 0;
}
static int __init ieee1394_init(void)
}
static int __init ieee1394_init(void)
@@
-1065,10
+1059,10
@@
static int __init ieee1394_init(void)
HPSB_ERR("Some features may not be available\n");
}
HPSB_ERR("Some features may not be available\n");
}
- khpsbpkt_
pid = kernel_thread(hpsbpkt_thread, NULL, CLONE_KERNEL
);
- if (
khpsbpkt_pid < 0
) {
+ khpsbpkt_
thread = kthread_run(hpsbpkt_thread, NULL, "khpsbpkt"
);
+ if (
IS_ERR(khpsbpkt_thread)
) {
HPSB_ERR("Failed to start hpsbpkt thread!\n");
HPSB_ERR("Failed to start hpsbpkt thread!\n");
- ret =
-ENOMEM
;
+ ret =
PTR_ERR(khpsbpkt_thread)
;
goto exit_cleanup_config_roms;
}
goto exit_cleanup_config_roms;
}
@@
-1148,10
+1142,7
@@
release_all_bus:
release_chrdev:
unregister_chrdev_region(IEEE1394_CORE_DEV, 256);
exit_release_kernel_thread:
release_chrdev:
unregister_chrdev_region(IEEE1394_CORE_DEV, 256);
exit_release_kernel_thread:
- if (khpsbpkt_pid >= 0) {
- kill_proc(khpsbpkt_pid, SIGTERM, 1);
- wait_for_completion(&khpsbpkt_complete);
- }
+ kthread_stop(khpsbpkt_thread);
exit_cleanup_config_roms:
hpsb_cleanup_config_roms();
return ret;
exit_cleanup_config_roms:
hpsb_cleanup_config_roms();
return ret;
@@
-1172,19
+1163,14
@@
static void __exit ieee1394_cleanup(void)
bus_remove_file(&ieee1394_bus_type, fw_bus_attrs[i]);
bus_unregister(&ieee1394_bus_type);
bus_remove_file(&ieee1394_bus_type, fw_bus_attrs[i]);
bus_unregister(&ieee1394_bus_type);
- if (khpsbpkt_pid >= 0) {
- khpsbpkt_kill = 1;
- mb();
- up(&khpsbpkt_sig);
- wait_for_completion(&khpsbpkt_complete);
- }
+ kthread_stop(khpsbpkt_thread);
hpsb_cleanup_config_roms();
unregister_chrdev_region(IEEE1394_CORE_DEV, 256);
}
hpsb_cleanup_config_roms();
unregister_chrdev_region(IEEE1394_CORE_DEV, 256);
}
-module_init(ieee1394_init);
+fs_initcall(ieee1394_init); /* same as ohci1394 */
module_exit(ieee1394_cleanup);
/* Exported symbols */
module_exit(ieee1394_cleanup);
/* Exported symbols */
@@
-1251,10
+1237,10
@@
EXPORT_SYMBOL(highlevel_remove_host);
/** nodemgr.c **/
EXPORT_SYMBOL(hpsb_node_fill_packet);
EXPORT_SYMBOL(hpsb_node_write);
/** nodemgr.c **/
EXPORT_SYMBOL(hpsb_node_fill_packet);
EXPORT_SYMBOL(hpsb_node_write);
-EXPORT_SYMBOL(hpsb_register_protocol);
+EXPORT_SYMBOL(
__
hpsb_register_protocol);
EXPORT_SYMBOL(hpsb_unregister_protocol);
EXPORT_SYMBOL(hpsb_unregister_protocol);
-EXPORT_SYMBOL(ieee1394_bus_type);
#ifdef CONFIG_IEEE1394_EXPORT_FULL_API
#ifdef CONFIG_IEEE1394_EXPORT_FULL_API
+EXPORT_SYMBOL(ieee1394_bus_type);
EXPORT_SYMBOL(nodemgr_for_each_host);
#endif
EXPORT_SYMBOL(nodemgr_for_each_host);
#endif