diff options
Diffstat (limited to 'drivers/staging/unisys/visorchannel/visorchannel_funcs.c')
-rw-r--r-- | drivers/staging/unisys/visorchannel/visorchannel_funcs.c | 72 |
1 files changed, 37 insertions, 35 deletions
diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c index 1ce25c237d39..6c48ba13951f 100644 --- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c +++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c @@ -28,7 +28,7 @@ #define MYDRVNAME "visorchannel" -struct VISORCHANNEL_Tag { +struct visorchannel { struct memregion *memregion; /* from visor_memregion_create() */ struct channel_header chan_hdr; uuid_le guid; @@ -46,18 +46,18 @@ struct VISORCHANNEL_Tag { } safe_uis_queue; }; -/* Creates the VISORCHANNEL abstraction for a data area in memory, but does - * NOT modify this data area. +/* Creates the struct visorchannel abstraction for a data area in memory, + * but does NOT modify this data area. */ -static VISORCHANNEL * +static struct visorchannel * visorchannel_create_guts(HOSTADDRESS physaddr, ulong channel_bytes, - VISORCHANNEL *parent, ulong off, uuid_le guid, + struct visorchannel *parent, ulong off, uuid_le guid, BOOL needs_lock) { - VISORCHANNEL *p = NULL; + struct visorchannel *p = NULL; void *rc = NULL; - p = kmalloc(sizeof(VISORCHANNEL), GFP_KERNEL|__GFP_NORETRY); + p = kmalloc(sizeof(*p), GFP_KERNEL|__GFP_NORETRY); if (p == NULL) { ERRDRV("allocation failed: (status=0)\n"); rc = NULL; @@ -114,7 +114,7 @@ cleanup: return rc; } -VISORCHANNEL * +struct visorchannel * visorchannel_create(HOSTADDRESS physaddr, ulong channel_bytes, uuid_le guid) { return visorchannel_create_guts(physaddr, channel_bytes, NULL, 0, guid, @@ -122,7 +122,7 @@ visorchannel_create(HOSTADDRESS physaddr, ulong channel_bytes, uuid_le guid) } EXPORT_SYMBOL_GPL(visorchannel_create); -VISORCHANNEL * +struct visorchannel * visorchannel_create_with_lock(HOSTADDRESS physaddr, ulong channel_bytes, uuid_le guid) { @@ -131,18 +131,19 @@ visorchannel_create_with_lock(HOSTADDRESS physaddr, ulong channel_bytes, } EXPORT_SYMBOL_GPL(visorchannel_create_with_lock); -VISORCHANNEL * +struct visorchannel * visorchannel_create_overlapped(ulong channel_bytes, - VISORCHANNEL *parent, ulong off, uuid_le guid) + struct visorchannel *parent, ulong off, + uuid_le guid) { return visorchannel_create_guts(0, channel_bytes, parent, off, guid, FALSE); } EXPORT_SYMBOL_GPL(visorchannel_create_overlapped); -VISORCHANNEL * +struct visorchannel * visorchannel_create_overlapped_with_lock(ulong channel_bytes, - VISORCHANNEL *parent, ulong off, + struct visorchannel *parent, ulong off, uuid_le guid) { return visorchannel_create_guts(0, channel_bytes, parent, off, guid, @@ -151,7 +152,7 @@ visorchannel_create_overlapped_with_lock(ulong channel_bytes, EXPORT_SYMBOL_GPL(visorchannel_create_overlapped_with_lock); void -visorchannel_destroy(VISORCHANNEL *channel) +visorchannel_destroy(struct visorchannel *channel) { if (channel == NULL) return; @@ -164,14 +165,14 @@ visorchannel_destroy(VISORCHANNEL *channel) EXPORT_SYMBOL_GPL(visorchannel_destroy); HOSTADDRESS -visorchannel_get_physaddr(VISORCHANNEL *channel) +visorchannel_get_physaddr(struct visorchannel *channel) { return visor_memregion_get_physaddr(channel->memregion); } EXPORT_SYMBOL_GPL(visorchannel_get_physaddr); ulong -visorchannel_get_nbytes(VISORCHANNEL *channel) +visorchannel_get_nbytes(struct visorchannel *channel) { return channel->size; } @@ -186,42 +187,42 @@ visorchannel_uuid_id(uuid_le *guid, char *s) EXPORT_SYMBOL_GPL(visorchannel_uuid_id); char * -visorchannel_id(VISORCHANNEL *channel, char *s) +visorchannel_id(struct visorchannel *channel, char *s) { return visorchannel_uuid_id(&channel->guid, s); } EXPORT_SYMBOL_GPL(visorchannel_id); char * -visorchannel_zoneid(VISORCHANNEL *channel, char *s) +visorchannel_zoneid(struct visorchannel *channel, char *s) { return visorchannel_uuid_id(&channel->chan_hdr.zone_uuid, s); } EXPORT_SYMBOL_GPL(visorchannel_zoneid); HOSTADDRESS -visorchannel_get_clientpartition(VISORCHANNEL *channel) +visorchannel_get_clientpartition(struct visorchannel *channel) { return channel->chan_hdr.partition_handle; } EXPORT_SYMBOL_GPL(visorchannel_get_clientpartition); uuid_le -visorchannel_get_uuid(VISORCHANNEL *channel) +visorchannel_get_uuid(struct visorchannel *channel) { return channel->guid; } EXPORT_SYMBOL_GPL(visorchannel_get_uuid); struct memregion * -visorchannel_get_memregion(VISORCHANNEL *channel) +visorchannel_get_memregion(struct visorchannel *channel) { return channel->memregion; } EXPORT_SYMBOL_GPL(visorchannel_get_memregion); int -visorchannel_read(VISORCHANNEL *channel, ulong offset, +visorchannel_read(struct visorchannel *channel, ulong offset, void *local, ulong nbytes) { int rc = visor_memregion_read(channel->memregion, offset, @@ -236,7 +237,7 @@ visorchannel_read(VISORCHANNEL *channel, ulong offset, EXPORT_SYMBOL_GPL(visorchannel_read); int -visorchannel_write(VISORCHANNEL *channel, ulong offset, +visorchannel_write(struct visorchannel *channel, ulong offset, void *local, ulong nbytes) { if (offset == 0 && nbytes >= sizeof(struct channel_header)) @@ -247,7 +248,8 @@ visorchannel_write(VISORCHANNEL *channel, ulong offset, EXPORT_SYMBOL_GPL(visorchannel_write); int -visorchannel_clear(VISORCHANNEL *channel, ulong offset, u8 ch, ulong nbytes) +visorchannel_clear(struct visorchannel *channel, ulong offset, u8 ch, + ulong nbytes) { int rc = -1; int bufsize = 65536; @@ -286,7 +288,7 @@ cleanup: EXPORT_SYMBOL_GPL(visorchannel_clear); void __iomem * -visorchannel_get_header(VISORCHANNEL *channel) +visorchannel_get_header(struct visorchannel *channel) { return (void __iomem *)&channel->chan_hdr; } @@ -317,7 +319,7 @@ EXPORT_SYMBOL_GPL(visorchannel_get_header); sizeof((sig_hdr)->FIELD)) >= 0) static BOOL -sig_read_header(VISORCHANNEL *channel, u32 queue, +sig_read_header(struct visorchannel *channel, u32 queue, struct signal_queue_header *sig_hdr) { BOOL rc = FALSE; @@ -345,7 +347,7 @@ cleanup: } static BOOL -sig_do_data(VISORCHANNEL *channel, u32 queue, +sig_do_data(struct visorchannel *channel, u32 queue, struct signal_queue_header *sig_hdr, u32 slot, void *data, BOOL is_write) { @@ -374,14 +376,14 @@ cleanup: } static inline BOOL -sig_read_data(VISORCHANNEL *channel, u32 queue, +sig_read_data(struct visorchannel *channel, u32 queue, struct signal_queue_header *sig_hdr, u32 slot, void *data) { return sig_do_data(channel, queue, sig_hdr, slot, data, FALSE); } static inline BOOL -sig_write_data(VISORCHANNEL *channel, u32 queue, +sig_write_data(struct visorchannel *channel, u32 queue, struct signal_queue_header *sig_hdr, u32 slot, void *data) { return sig_do_data(channel, queue, sig_hdr, slot, data, TRUE); @@ -410,7 +412,7 @@ safe_sig_queue_validate(struct signal_queue_header *psafe_sqh, } /* end safe_sig_queue_validate */ BOOL -visorchannel_signalremove(VISORCHANNEL *channel, u32 queue, void *msg) +visorchannel_signalremove(struct visorchannel *channel, u32 queue, void *msg) { BOOL rc = FALSE; struct signal_queue_header sig_hdr; @@ -457,7 +459,7 @@ cleanup: EXPORT_SYMBOL_GPL(visorchannel_signalremove); BOOL -visorchannel_signalinsert(VISORCHANNEL *channel, u32 queue, void *msg) +visorchannel_signalinsert(struct visorchannel *channel, u32 queue, void *msg) { BOOL rc = FALSE; struct signal_queue_header sig_hdr; @@ -512,7 +514,7 @@ cleanup: EXPORT_SYMBOL_GPL(visorchannel_signalinsert); int -visorchannel_signalqueue_slots_avail(VISORCHANNEL *channel, u32 queue) +visorchannel_signalqueue_slots_avail(struct visorchannel *channel, u32 queue) { struct signal_queue_header sig_hdr; u32 slots_avail, slots_used; @@ -531,7 +533,7 @@ visorchannel_signalqueue_slots_avail(VISORCHANNEL *channel, u32 queue) EXPORT_SYMBOL_GPL(visorchannel_signalqueue_slots_avail); int -visorchannel_signalqueue_max_slots(VISORCHANNEL *channel, u32 queue) +visorchannel_signalqueue_max_slots(struct visorchannel *channel, u32 queue) { struct signal_queue_header sig_hdr; @@ -566,7 +568,7 @@ sigqueue_debug(struct signal_queue_header *q, int which, struct seq_file *seq) } void -visorchannel_debug(VISORCHANNEL *channel, int num_queues, +visorchannel_debug(struct visorchannel *channel, int num_queues, struct seq_file *seq, u32 off) { HOSTADDRESS addr = 0; @@ -648,7 +650,7 @@ visorchannel_debug(VISORCHANNEL *channel, int num_queues, EXPORT_SYMBOL_GPL(visorchannel_debug); void -visorchannel_dump_section(VISORCHANNEL *chan, char *s, +visorchannel_dump_section(struct visorchannel *chan, char *s, int off, int len, struct seq_file *seq) { char *buf, *tbuf, *fmtbuf; |