summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@home.transmeta.com>2002-09-18 09:21:07 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2002-09-18 09:21:07 -0700
commitaf9429086db125c1f63d8dc659fc5e758b5e3827 (patch)
tree25a5b0fbd1e0c277819b3e8db473e68ec101766f /include
parent1b44cb9121fa6e95eff381093c4a60823ea6a9af (diff)
parentb3e20e41ed7ba22d11dce0a148cebfeba6cef092 (diff)
Merge http://linux-acpi.bkbits.net/linux-acpi
into home.transmeta.com:/home/torvalds/v2.5/linux
Diffstat (limited to 'include')
-rw-r--r--include/linux/nbd.h2
-rw-r--r--include/linux/netdevice.h4
-rw-r--r--include/net/irda/af_irda.h4
-rw-r--r--include/net/irda/ircomm_tty.h12
-rw-r--r--include/net/irda/irlmp.h15
-rw-r--r--include/net/irda/irqueue.h35
-rw-r--r--include/net/irda/irtty.h3
-rw-r--r--include/net/irda/smc-ircc.h4
-rw-r--r--include/net/irda/w83977af_ir.h5
9 files changed, 49 insertions, 35 deletions
diff --git a/include/linux/nbd.h b/include/linux/nbd.h
index e2c507ba6b08..d2e9309f1a76 100644
--- a/include/linux/nbd.h
+++ b/include/linux/nbd.h
@@ -59,7 +59,7 @@ nbd_end_request(struct request *req)
blk_finished_io(nsect);
req->bio = bio->bi_next;
bio->bi_next = NULL;
- bio_endio(bio, uptodate);
+ bio_endio(bio, nsect << 9, uptodate ? 0 : -EIO);
}
blk_put_request(req);
spin_unlock_irqrestore(q->queue_lock, flags);
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 6ed74303fbda..c73a00744bc8 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -691,6 +691,8 @@ enum {
NETIF_MSG_TX_DONE = 0x0400,
NETIF_MSG_RX_STATUS = 0x0800,
NETIF_MSG_PKTDATA = 0x1000,
+ NETIF_MSG_HW = 0x2000,
+ NETIF_MSG_WOL = 0x4000,
};
#define netif_msg_drv(p) ((p)->msg_enable & NETIF_MSG_DRV)
@@ -706,6 +708,8 @@ enum {
#define netif_msg_tx_done(p) ((p)->msg_enable & NETIF_MSG_TX_DONE)
#define netif_msg_rx_status(p) ((p)->msg_enable & NETIF_MSG_RX_STATUS)
#define netif_msg_pktdata(p) ((p)->msg_enable & NETIF_MSG_PKTDATA)
+#define netif_msg_hw(p) ((p)->msg_enable & NETIF_MSG_HW)
+#define netif_msg_wol(p) ((p)->msg_enable & NETIF_MSG_WOL)
/* Schedule rx intr now? */
diff --git a/include/net/irda/af_irda.h b/include/net/irda/af_irda.h
index 947a4d653c4a..d4f10293701b 100644
--- a/include/net/irda/af_irda.h
+++ b/include/net/irda/af_irda.h
@@ -55,8 +55,8 @@ struct irda_sock {
__u16 mask; /* Hint bits mask */
__u16 hints; /* Hint bits */
- __u32 ckey; /* IrLMP client handle */
- __u32 skey; /* IrLMP service handle */
+ void *ckey; /* IrLMP client handle */
+ void *skey; /* IrLMP service handle */
struct ias_object *ias_obj; /* Our service name + lsap in IAS */
struct iriap_cb *iriap; /* Used to query remote IAS */
diff --git a/include/net/irda/ircomm_tty.h b/include/net/irda/ircomm_tty.h
index a7cb72ad60ee..e5985f9ea68a 100644
--- a/include/net/irda/ircomm_tty.h
+++ b/include/net/irda/ircomm_tty.h
@@ -86,8 +86,8 @@ struct ircomm_tty_cb {
struct iriap_cb *iriap; /* Instance used for querying remote IAS */
struct ias_object* obj;
- int skey;
- int ckey;
+ void *skey;
+ void *ckey;
struct termios normal_termios;
struct termios callout_termios;
@@ -104,6 +104,14 @@ struct ircomm_tty_cb {
long pgrp; /* pgrp of opening process */
int open_count;
int blocked_open; /* # of blocked opens */
+
+ /* Protect concurent access to :
+ * o self->open_count
+ * o self->ctrl_skb
+ * o self->tx_skb
+ * Maybe other things may gain to be protected as well...
+ * Jean II */
+ spinlock_t spinlock;
};
void ircomm_tty_start(struct tty_struct *tty);
diff --git a/include/net/irda/irlmp.h b/include/net/irda/irlmp.h
index 8fcc154e42dd..e7a2fb3938fe 100644
--- a/include/net/irda/irlmp.h
+++ b/include/net/irda/irlmp.h
@@ -183,7 +183,6 @@ struct irlmp_cb {
hashbin_t *services;
hashbin_t *cachelog; /* Current discovery log */
- spinlock_t log_lock; /* discovery log spinlock */
int running;
@@ -197,12 +196,12 @@ struct lsap_cb *irlmp_open_lsap(__u8 slsap, notify_t *notify, __u8 pid);
void irlmp_close_lsap( struct lsap_cb *self);
__u16 irlmp_service_to_hint(int service);
-__u32 irlmp_register_service(__u16 hints);
-int irlmp_unregister_service(__u32 handle);
-__u32 irlmp_register_client(__u16 hint_mask, DISCOVERY_CALLBACK1 disco_clb,
+void *irlmp_register_service(__u16 hints);
+int irlmp_unregister_service(void *handle);
+void *irlmp_register_client(__u16 hint_mask, DISCOVERY_CALLBACK1 disco_clb,
DISCOVERY_CALLBACK1 expir_clb, void *priv);
-int irlmp_unregister_client(__u32 handle);
-int irlmp_update_client(__u32 handle, __u16 hint_mask,
+int irlmp_unregister_client(void *handle);
+int irlmp_update_client(void *handle, __u16 hint_mask,
DISCOVERY_CALLBACK1 disco_clb,
DISCOVERY_CALLBACK1 expir_clb, void *priv);
@@ -221,7 +220,7 @@ void irlmp_disconnect_indication(struct lsap_cb *self, LM_REASON reason,
struct sk_buff *userdata);
int irlmp_disconnect_request(struct lsap_cb *, struct sk_buff *userdata);
-void irlmp_discovery_confirm(hashbin_t *discovery_log, DISCOVERY_MODE);
+void irlmp_discovery_confirm(hashbin_t *discovery_log, DISCOVERY_MODE mode);
void irlmp_discovery_request(int nslots);
struct irda_device_info *irlmp_get_discoveries(int *pn, __u16 mask, int nslots);
void irlmp_do_expiry(void);
@@ -258,8 +257,6 @@ extern int sysctl_discovery;
extern int sysctl_lap_keepalive_time; /* in ms, default is LM_IDLE_TIMEOUT */
extern struct irlmp_cb *irlmp;
-static inline hashbin_t *irlmp_get_cachelog(void) { return irlmp->cachelog; }
-
/* Check if LAP queue is full.
* Used by IrTTP for low control, see comments in irlap.h - Jean II */
static inline int irlmp_lap_tx_queue_full(struct lsap_cb *self)
diff --git a/include/net/irda/irqueue.h b/include/net/irda/irqueue.h
index 6394397ac887..066b5377fc8f 100644
--- a/include/net/irda/irqueue.h
+++ b/include/net/irda/irqueue.h
@@ -36,12 +36,12 @@
#define NAME_SIZE 32
/*
- * Hash types
+ * Hash types (some flags can be xored)
+ * See comments in irqueue.c for which one to use...
*/
-#define HB_NOLOCK 0
-#define HB_GLOBAL 1
-#define HB_LOCAL 2
-#define HB_SORTED 4
+#define HB_NOLOCK 0 /* No concurent access prevention */
+#define HB_LOCK 1 /* Prevent concurent write with global lock */
+#define HB_SORTED 4 /* Not yet supported */
/*
* Hash defines
@@ -57,17 +57,12 @@
typedef void (*FREE_FUNC)(void *arg);
-/*
- * Hashbin
- */
-#define GET_HASHBIN(x) ( x & HASHBIN_MASK )
-
struct irda_queue {
struct irda_queue *q_next;
struct irda_queue *q_prev;
char q_name[NAME_SIZE];
- __u32 q_hash;
+ long q_hash; /* Must be able to cast a (void *) */
};
typedef struct irda_queue irda_queue_t;
@@ -75,8 +70,9 @@ typedef struct hashbin_t {
__u32 magic;
int hb_type;
int hb_size;
- spinlock_t hb_mutex[HASHBIN_SIZE] IRDA_ALIGN;
- irda_queue_t *hb_queue[HASHBIN_SIZE] IRDA_ALIGN;
+ spinlock_t hb_spinlock; /* HB_LOCK - Can be used by the user */
+
+ irda_queue_t* hb_queue[HASHBIN_SIZE] IRDA_ALIGN;
irda_queue_t* hb_current;
} hashbin_t;
@@ -84,19 +80,18 @@ typedef struct hashbin_t {
hashbin_t *hashbin_new(int type);
int hashbin_delete(hashbin_t* hashbin, FREE_FUNC func);
int hashbin_clear(hashbin_t* hashbin, FREE_FUNC free_func);
-void hashbin_insert(hashbin_t* hashbin, irda_queue_t* entry, __u32 hashv,
+void hashbin_insert(hashbin_t* hashbin, irda_queue_t* entry, long hashv,
char* name);
-void* hashbin_find(hashbin_t* hashbin, __u32 hashv, char* name);
-void* hashbin_remove(hashbin_t* hashbin, __u32 hashv, char* name);
+void* hashbin_remove(hashbin_t* hashbin, long hashv, char* name);
void* hashbin_remove_first(hashbin_t *hashbin);
void* hashbin_remove_this( hashbin_t* hashbin, irda_queue_t* entry);
+void* hashbin_find(hashbin_t* hashbin, long hashv, char* name);
+void* hashbin_lock_find(hashbin_t* hashbin, long hashv, char* name);
+void* hashbin_find_next(hashbin_t* hashbin, long hashv, char* name,
+ void ** pnext);
irda_queue_t *hashbin_get_first(hashbin_t *hashbin);
irda_queue_t *hashbin_get_next(hashbin_t *hashbin);
-void enqueue_last(irda_queue_t **queue, irda_queue_t* element);
-void enqueue_first(irda_queue_t **queue, irda_queue_t* element);
-irda_queue_t *dequeue_first(irda_queue_t **queue);
-
#define HASHBIN_GET_SIZE(hashbin) hashbin->hb_size
#endif
diff --git a/include/net/irda/irtty.h b/include/net/irda/irtty.h
index c6c54e1ad2c0..1fd6a1ec6cf2 100644
--- a/include/net/irda/irtty.h
+++ b/include/net/irda/irtty.h
@@ -62,6 +62,9 @@ struct irtty_cb {
struct qos_info qos; /* QoS capabilities for this device */
dongle_t *dongle; /* Dongle driver */
+
+ spinlock_t lock; /* For serializing operations */
+
__u32 new_speed;
__u32 flags; /* Interface flags */
diff --git a/include/net/irda/smc-ircc.h b/include/net/irda/smc-ircc.h
index f4af39082e86..456aa6026530 100644
--- a/include/net/irda/smc-ircc.h
+++ b/include/net/irda/smc-ircc.h
@@ -165,7 +165,9 @@ struct ircc_cb {
struct irport_cb *irport;
- spinlock_t lock; /* For serializing operations */
+ /* Locking : half of our operations are done with irport, so we
+ * use the irport spinlock to make sure *everything* is properly
+ * synchronised - Jean II */
__u32 new_speed;
__u32 flags; /* Interface flags */
diff --git a/include/net/irda/w83977af_ir.h b/include/net/irda/w83977af_ir.h
index 795f24fb96e9..2609588885c2 100644
--- a/include/net/irda/w83977af_ir.h
+++ b/include/net/irda/w83977af_ir.h
@@ -179,6 +179,11 @@ struct w83977af_ir {
chipio_t io; /* IrDA controller information */
iobuff_t tx_buff; /* Transmit buffer */
iobuff_t rx_buff; /* Receive buffer */
+
+ /* Note : currently locking is *very* incomplete, but this
+ * will get you started. Check in nsc-ircc.c for a proper
+ * locking strategy. - Jean II */
+ spinlock_t lock; /* For serializing operations */
__u32 flags; /* Interface flags */
__u32 new_speed;