Commit e0fed862 authored by Benjamin Romer's avatar Benjamin Romer Committed by Greg Kroah-Hartman

staging: unisys: remove typedef SIGNAL_QUEUE_HEADER

Get rid of the typedef for SIGNAL_QUEUE_HEADER and use struct
signal_queue_header directly instead. Fix all references to the typedef
to use the struct.
Signed-off-by: default avatarBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 08598918
...@@ -50,8 +50,8 @@ visor_signal_insert(struct channel_header __iomem *pChannel, u32 Queue, ...@@ -50,8 +50,8 @@ visor_signal_insert(struct channel_header __iomem *pChannel, u32 Queue,
void __iomem *psignal; void __iomem *psignal;
unsigned int head, tail, nof; unsigned int head, tail, nof;
SIGNAL_QUEUE_HEADER __iomem *pqhdr = struct signal_queue_header __iomem *pqhdr =
(SIGNAL_QUEUE_HEADER __iomem *) (struct signal_queue_header __iomem *)
((char __iomem *) pChannel + readq(&pChannel->ch_space_offset)) ((char __iomem *) pChannel + readq(&pChannel->ch_space_offset))
+ Queue; + Queue;
...@@ -108,8 +108,8 @@ visor_signal_remove(struct channel_header __iomem *pChannel, u32 Queue, ...@@ -108,8 +108,8 @@ visor_signal_remove(struct channel_header __iomem *pChannel, u32 Queue,
{ {
void __iomem *psource; void __iomem *psource;
unsigned int head, tail; unsigned int head, tail;
SIGNAL_QUEUE_HEADER __iomem *pqhdr = struct signal_queue_header __iomem *pqhdr =
(SIGNAL_QUEUE_HEADER __iomem *) ((char __iomem *) pChannel + (struct signal_queue_header __iomem *) ((char __iomem *) pChannel +
readq(&pChannel->ch_space_offset)) + Queue; readq(&pChannel->ch_space_offset)) + Queue;
/* capture current head and tail */ /* capture current head and tail */
...@@ -163,8 +163,8 @@ SignalRemoveAll(struct channel_header *pChannel, u32 Queue, void *pSignal) ...@@ -163,8 +163,8 @@ SignalRemoveAll(struct channel_header *pChannel, u32 Queue, void *pSignal)
{ {
void *psource; void *psource;
unsigned int head, tail, signalCount = 0; unsigned int head, tail, signalCount = 0;
pSIGNAL_QUEUE_HEADER pqhdr = struct signal_queue_header *pqhdr =
(pSIGNAL_QUEUE_HEADER) ((char *) pChannel + (struct signal_queue_header *) ((char *) pChannel +
pChannel->ch_space_offset) + Queue; pChannel->ch_space_offset) + Queue;
/* capture current head and tail */ /* capture current head and tail */
...@@ -212,8 +212,8 @@ SignalRemoveAll(struct channel_header *pChannel, u32 Queue, void *pSignal) ...@@ -212,8 +212,8 @@ SignalRemoveAll(struct channel_header *pChannel, u32 Queue, void *pSignal)
unsigned char unsigned char
visor_signalqueue_empty(struct channel_header __iomem *pChannel, u32 Queue) visor_signalqueue_empty(struct channel_header __iomem *pChannel, u32 Queue)
{ {
SIGNAL_QUEUE_HEADER __iomem *pqhdr = struct signal_queue_header __iomem *pqhdr =
(SIGNAL_QUEUE_HEADER __iomem *) ((char __iomem *) pChannel + (struct signal_queue_header __iomem *) ((char __iomem *) pChannel +
readq(&pChannel->ch_space_offset)) + Queue; readq(&pChannel->ch_space_offset)) + Queue;
return readl(&pqhdr->Head) == readl(&pqhdr->Tail); return readl(&pqhdr->Head) == readl(&pqhdr->Tail);
} }
......
...@@ -232,7 +232,7 @@ struct channel_header { ...@@ -232,7 +232,7 @@ struct channel_header {
#define ULTRA_CHANNEL_ENABLE_INTS (0x1ULL << 0) #define ULTRA_CHANNEL_ENABLE_INTS (0x1ULL << 0)
/* Subheader for the Signal Type variation of the Common Channel */ /* Subheader for the Signal Type variation of the Common Channel */
typedef struct _SIGNAL_QUEUE_HEADER { struct signal_queue_header {
/* 1st cache line */ /* 1st cache line */
u32 VersionId; /* SIGNAL_QUEUE_HEADER Version ID */ u32 VersionId; /* SIGNAL_QUEUE_HEADER Version ID */
u32 Type; /* Queue type: storage, network */ u32 Type; /* Queue type: storage, network */
...@@ -265,7 +265,7 @@ typedef struct _SIGNAL_QUEUE_HEADER { ...@@ -265,7 +265,7 @@ typedef struct _SIGNAL_QUEUE_HEADER {
* to denote trouble with client's * to denote trouble with client's
* fields */ * fields */
u8 Filler[12]; /* Pad out to 64 byte cacheline */ u8 Filler[12]; /* Pad out to 64 byte cacheline */
} SIGNAL_QUEUE_HEADER, *pSIGNAL_QUEUE_HEADER; };
#pragma pack(pop) #pragma pack(pop)
......
...@@ -542,16 +542,16 @@ typedef struct _ULTRA_CONTROLVM_CHANNEL_PROTOCOL { ...@@ -542,16 +542,16 @@ typedef struct _ULTRA_CONTROLVM_CHANNEL_PROTOCOL {
u32 SPReserved; u32 SPReserved;
u8 Reserved2[28]; /* Force signals to begin on 128-byte cache u8 Reserved2[28]; /* Force signals to begin on 128-byte cache
* line */ * line */
SIGNAL_QUEUE_HEADER RequestQueue; /* Service or guest partition struct signal_queue_header RequestQueue;/* Service or guest partition
* uses this queue to send * uses this queue to send
* requests to Control */ * requests to Control */
SIGNAL_QUEUE_HEADER ResponseQueue; /* Control uses this queue to struct signal_queue_header ResponseQueue;/* Control uses this queue to
* respond to service or guest * respond to service or guest
* partition requests */ * partition requests */
SIGNAL_QUEUE_HEADER EventQueue; /* Control uses this queue to struct signal_queue_header EventQueue; /* Control uses this queue to
* send events to service or * send events to service or
* guest partition */ * guest partition */
SIGNAL_QUEUE_HEADER EventAckQueue; /* Service or guest partition struct signal_queue_header EventAckQueue;/* Service or guest partition
* uses this queue to ack * uses this queue to ack
* Control events */ * Control events */
......
...@@ -384,7 +384,7 @@ typedef struct _DIAG_CHANNEL_PROTOCOL_HEADER { ...@@ -384,7 +384,7 @@ typedef struct _DIAG_CHANNEL_PROTOCOL_HEADER {
/* Offsets/sizes for diagnostic channel attributes... */ /* Offsets/sizes for diagnostic channel attributes... */
#define DIAG_CH_QUEUE_HEADER_OFFSET (sizeof(struct channel_header)) #define DIAG_CH_QUEUE_HEADER_OFFSET (sizeof(struct channel_header))
#define DIAG_CH_QUEUE_HEADER_SIZE (sizeof(SIGNAL_QUEUE_HEADER)) #define DIAG_CH_QUEUE_HEADER_SIZE (sizeof(struct signal_queue_header))
#define DIAG_CH_PROTOCOL_HEADER_OFFSET \ #define DIAG_CH_PROTOCOL_HEADER_OFFSET \
(DIAG_CH_QUEUE_HEADER_OFFSET + DIAG_CH_QUEUE_HEADER_SIZE) (DIAG_CH_QUEUE_HEADER_OFFSET + DIAG_CH_QUEUE_HEADER_SIZE)
#define DIAG_CH_PROTOCOL_HEADER_SIZE (sizeof(DIAG_CHANNEL_PROTOCOL_HEADER)) #define DIAG_CH_PROTOCOL_HEADER_SIZE (sizeof(DIAG_CHANNEL_PROTOCOL_HEADER))
...@@ -417,7 +417,7 @@ typedef struct _DIAG_CHANNEL_PROTOCOL_HEADER { ...@@ -417,7 +417,7 @@ typedef struct _DIAG_CHANNEL_PROTOCOL_HEADER {
*/ */
typedef struct _ULTRA_DIAG_CHANNEL_PROTOCOL { typedef struct _ULTRA_DIAG_CHANNEL_PROTOCOL {
struct channel_header CommonChannelHeader; struct channel_header CommonChannelHeader;
SIGNAL_QUEUE_HEADER QueueHeader; struct signal_queue_header QueueHeader;
DIAG_CHANNEL_PROTOCOL_HEADER DiagChannelHeader; DIAG_CHANNEL_PROTOCOL_HEADER DiagChannelHeader;
DIAG_CHANNEL_EVENT Events[(DIAG_CH_SIZE - DIAG_CH_EVENT_OFFSET) / DIAG_CHANNEL_EVENT Events[(DIAG_CH_SIZE - DIAG_CH_EVENT_OFFSET) /
sizeof(DIAG_CHANNEL_EVENT)]; sizeof(DIAG_CHANNEL_EVENT)];
......
...@@ -686,8 +686,8 @@ struct uiscmdrsp { ...@@ -686,8 +686,8 @@ struct uiscmdrsp {
* response queues as specified in cmdQ and rspQ SIGNAL_QUEUE_HEADERS. */ * response queues as specified in cmdQ and rspQ SIGNAL_QUEUE_HEADERS. */
typedef struct _ULTRA_IO_CHANNEL_PROTOCOL { typedef struct _ULTRA_IO_CHANNEL_PROTOCOL {
struct channel_header ChannelHeader; struct channel_header ChannelHeader;
SIGNAL_QUEUE_HEADER cmdQ; struct signal_queue_header cmdQ;
SIGNAL_QUEUE_HEADER rspQ; struct signal_queue_header rspQ;
union { union {
struct { struct {
struct vhba_wwnn wwnn; /* 8 bytes */ struct vhba_wwnn wwnn; /* 8 bytes */
......
...@@ -47,8 +47,8 @@ struct uisqueue_info { ...@@ -47,8 +47,8 @@ struct uisqueue_info {
u64 non_empty_wakeup_cnt; u64 non_empty_wakeup_cnt;
struct { struct {
SIGNAL_QUEUE_HEADER reserved1; /* */ struct signal_queue_header reserved1; /* */
SIGNAL_QUEUE_HEADER reserved2; /* */ struct signal_queue_header reserved2; /* */
} safe_uis_queue; } safe_uis_queue;
unsigned int (*send_int_if_needed)(struct uisqueue_info *info, unsigned int (*send_int_if_needed)(struct uisqueue_info *info,
unsigned int whichcqueue, unsigned int whichcqueue,
......
...@@ -421,7 +421,7 @@ virthba_ISR(int irq, void *dev_id) ...@@ -421,7 +421,7 @@ virthba_ISR(int irq, void *dev_id)
{ {
struct virthba_info *virthbainfo = (struct virthba_info *) dev_id; struct virthba_info *virthbainfo = (struct virthba_info *) dev_id;
struct channel_header __iomem *pChannelHeader; struct channel_header __iomem *pChannelHeader;
SIGNAL_QUEUE_HEADER __iomem *pqhdr; struct signal_queue_header __iomem *pqhdr;
u64 mask; u64 mask;
unsigned long long rc1; unsigned long long rc1;
...@@ -442,7 +442,7 @@ virthba_ISR(int irq, void *dev_id) ...@@ -442,7 +442,7 @@ virthba_ISR(int irq, void *dev_id)
virthbainfo->interrupts_notme++; virthbainfo->interrupts_notme++;
return IRQ_NONE; return IRQ_NONE;
} }
pqhdr = (SIGNAL_QUEUE_HEADER __iomem *) pqhdr = (struct signal_queue_header __iomem *)
((char __iomem *) pChannelHeader + ((char __iomem *) pChannelHeader +
readq(&pChannelHeader->ch_space_offset)) + IOCHAN_FROM_IOPART; readq(&pChannelHeader->ch_space_offset)) + IOCHAN_FROM_IOPART;
writeq(readq(&pqhdr->NumInterruptsReceived) + 1, writeq(readq(&pqhdr->NumInterruptsReceived) + 1,
...@@ -462,7 +462,7 @@ virthba_probe(struct virtpci_dev *virtpcidev, const struct pci_device_id *id) ...@@ -462,7 +462,7 @@ virthba_probe(struct virtpci_dev *virtpcidev, const struct pci_device_id *id)
int i; int i;
irq_handler_t handler = virthba_ISR; irq_handler_t handler = virthba_ISR;
struct channel_header __iomem *pChannelHeader; struct channel_header __iomem *pChannelHeader;
SIGNAL_QUEUE_HEADER __iomem *pqhdr; struct signal_queue_header __iomem *pqhdr;
u64 mask; u64 mask;
LOGVER("entering virthba_probe...\n"); LOGVER("entering virthba_probe...\n");
...@@ -586,7 +586,7 @@ virthba_probe(struct virtpci_dev *virtpcidev, const struct pci_device_id *id) ...@@ -586,7 +586,7 @@ virthba_probe(struct virtpci_dev *virtpcidev, const struct pci_device_id *id)
virthbainfo->chinfo.queueinfo, &virthbainfo->chinfo.threadinfo); virthbainfo->chinfo.queueinfo, &virthbainfo->chinfo.threadinfo);
pChannelHeader = virthbainfo->chinfo.queueinfo->chan; pChannelHeader = virthbainfo->chinfo.queueinfo->chan;
pqhdr = (SIGNAL_QUEUE_HEADER __iomem *) pqhdr = (struct signal_queue_header __iomem *)
((char __iomem *)pChannelHeader + ((char __iomem *)pChannelHeader +
readq(&pChannelHeader->ch_space_offset)) + IOCHAN_FROM_IOPART; readq(&pChannelHeader->ch_space_offset)) + IOCHAN_FROM_IOPART;
virthbainfo->flags_addr = &pqhdr->FeatureFlags; virthbainfo->flags_addr = &pqhdr->FeatureFlags;
......
...@@ -38,10 +38,10 @@ struct VISORCHANNEL_Tag { ...@@ -38,10 +38,10 @@ struct VISORCHANNEL_Tag {
spinlock_t remove_lock; spinlock_t remove_lock;
struct { struct {
SIGNAL_QUEUE_HEADER req_queue; struct signal_queue_header req_queue;
SIGNAL_QUEUE_HEADER rsp_queue; struct signal_queue_header rsp_queue;
SIGNAL_QUEUE_HEADER event_queue; struct signal_queue_header event_queue;
SIGNAL_QUEUE_HEADER ack_queue; struct signal_queue_header ack_queue;
} safe_uis_queue; } safe_uis_queue;
}; };
...@@ -295,7 +295,8 @@ EXPORT_SYMBOL_GPL(visorchannel_get_header); ...@@ -295,7 +295,8 @@ EXPORT_SYMBOL_GPL(visorchannel_get_header);
* channel header * channel header
*/ */
#define SIG_QUEUE_OFFSET(chan_hdr, q) \ #define SIG_QUEUE_OFFSET(chan_hdr, q) \
((chan_hdr)->ch_space_offset + ((q) * sizeof(SIGNAL_QUEUE_HEADER))) ((chan_hdr)->ch_space_offset + \
((q) * sizeof(struct signal_queue_header)))
/** Return offset of a specific queue entry (data) from the beginning of a /** Return offset of a specific queue entry (data) from the beginning of a
* channel header * channel header
...@@ -310,13 +311,13 @@ EXPORT_SYMBOL_GPL(visorchannel_get_header); ...@@ -310,13 +311,13 @@ EXPORT_SYMBOL_GPL(visorchannel_get_header);
#define SIG_WRITE_FIELD(channel, queue, sig_hdr, FIELD) \ #define SIG_WRITE_FIELD(channel, queue, sig_hdr, FIELD) \
(visor_memregion_write(channel->memregion, \ (visor_memregion_write(channel->memregion, \
SIG_QUEUE_OFFSET(&channel->chan_hdr, queue)+ \ SIG_QUEUE_OFFSET(&channel->chan_hdr, queue)+ \
offsetof(SIGNAL_QUEUE_HEADER, FIELD), \ offsetof(struct signal_queue_header, FIELD),\
&((sig_hdr)->FIELD), \ &((sig_hdr)->FIELD), \
sizeof((sig_hdr)->FIELD)) >= 0) sizeof((sig_hdr)->FIELD)) >= 0)
static BOOL static BOOL
sig_read_header(VISORCHANNEL *channel, u32 queue, sig_read_header(VISORCHANNEL *channel, u32 queue,
SIGNAL_QUEUE_HEADER *sig_hdr) struct signal_queue_header *sig_hdr)
{ {
BOOL rc = FALSE; BOOL rc = FALSE;
...@@ -329,7 +330,8 @@ sig_read_header(VISORCHANNEL *channel, u32 queue, ...@@ -329,7 +330,8 @@ sig_read_header(VISORCHANNEL *channel, u32 queue,
if (visor_memregion_read(channel->memregion, if (visor_memregion_read(channel->memregion,
SIG_QUEUE_OFFSET(&channel->chan_hdr, queue), SIG_QUEUE_OFFSET(&channel->chan_hdr, queue),
sig_hdr, sizeof(SIGNAL_QUEUE_HEADER)) < 0) { sig_hdr,
sizeof(struct signal_queue_header)) < 0) {
ERRDRV("queue=%d SIG_QUEUE_OFFSET=%d", ERRDRV("queue=%d SIG_QUEUE_OFFSET=%d",
queue, (int)SIG_QUEUE_OFFSET(&channel->chan_hdr, queue)); queue, (int)SIG_QUEUE_OFFSET(&channel->chan_hdr, queue));
ERRDRV("visor_memregion_read of signal queue failed: (status=%d)\n", rc); ERRDRV("visor_memregion_read of signal queue failed: (status=%d)\n", rc);
...@@ -342,7 +344,8 @@ sig_read_header(VISORCHANNEL *channel, u32 queue, ...@@ -342,7 +344,8 @@ sig_read_header(VISORCHANNEL *channel, u32 queue,
static BOOL static BOOL
sig_do_data(VISORCHANNEL *channel, u32 queue, sig_do_data(VISORCHANNEL *channel, u32 queue,
SIGNAL_QUEUE_HEADER *sig_hdr, u32 slot, void *data, BOOL is_write) struct signal_queue_header *sig_hdr, u32 slot, void *data,
BOOL is_write)
{ {
BOOL rc = FALSE; BOOL rc = FALSE;
int signal_data_offset = SIG_DATA_OFFSET(&channel->chan_hdr, queue, int signal_data_offset = SIG_DATA_OFFSET(&channel->chan_hdr, queue,
...@@ -368,21 +371,21 @@ sig_do_data(VISORCHANNEL *channel, u32 queue, ...@@ -368,21 +371,21 @@ sig_do_data(VISORCHANNEL *channel, u32 queue,
static inline BOOL static inline BOOL
sig_read_data(VISORCHANNEL *channel, u32 queue, sig_read_data(VISORCHANNEL *channel, u32 queue,
SIGNAL_QUEUE_HEADER *sig_hdr, u32 slot, void *data) struct signal_queue_header *sig_hdr, u32 slot, void *data)
{ {
return sig_do_data(channel, queue, sig_hdr, slot, data, FALSE); return sig_do_data(channel, queue, sig_hdr, slot, data, FALSE);
} }
static inline BOOL static inline BOOL
sig_write_data(VISORCHANNEL *channel, u32 queue, sig_write_data(VISORCHANNEL *channel, u32 queue,
SIGNAL_QUEUE_HEADER *sig_hdr, u32 slot, void *data) struct signal_queue_header *sig_hdr, u32 slot, void *data)
{ {
return sig_do_data(channel, queue, sig_hdr, slot, data, TRUE); return sig_do_data(channel, queue, sig_hdr, slot, data, TRUE);
} }
static inline unsigned char static inline unsigned char
safe_sig_queue_validate(pSIGNAL_QUEUE_HEADER psafe_sqh, safe_sig_queue_validate(struct signal_queue_header *psafe_sqh,
pSIGNAL_QUEUE_HEADER punsafe_sqh, struct signal_queue_header *punsafe_sqh,
u32 *phead, u32 *ptail) u32 *phead, u32 *ptail)
{ {
if ((*phead >= psafe_sqh->MaxSignalSlots) if ((*phead >= psafe_sqh->MaxSignalSlots)
...@@ -406,7 +409,7 @@ BOOL ...@@ -406,7 +409,7 @@ BOOL
visorchannel_signalremove(VISORCHANNEL *channel, u32 queue, void *msg) visorchannel_signalremove(VISORCHANNEL *channel, u32 queue, void *msg)
{ {
BOOL rc = FALSE; BOOL rc = FALSE;
SIGNAL_QUEUE_HEADER sig_hdr; struct signal_queue_header sig_hdr;
if (channel->needs_lock) if (channel->needs_lock)
spin_lock(&channel->remove_lock); spin_lock(&channel->remove_lock);
...@@ -452,7 +455,7 @@ BOOL ...@@ -452,7 +455,7 @@ BOOL
visorchannel_signalinsert(VISORCHANNEL *channel, u32 queue, void *msg) visorchannel_signalinsert(VISORCHANNEL *channel, u32 queue, void *msg)
{ {
BOOL rc = FALSE; BOOL rc = FALSE;
SIGNAL_QUEUE_HEADER sig_hdr; struct signal_queue_header sig_hdr;
if (channel->needs_lock) if (channel->needs_lock)
spin_lock(&channel->insert_lock); spin_lock(&channel->insert_lock);
...@@ -505,7 +508,7 @@ EXPORT_SYMBOL_GPL(visorchannel_signalinsert); ...@@ -505,7 +508,7 @@ EXPORT_SYMBOL_GPL(visorchannel_signalinsert);
int int
visorchannel_signalqueue_slots_avail(VISORCHANNEL *channel, u32 queue) visorchannel_signalqueue_slots_avail(VISORCHANNEL *channel, u32 queue)
{ {
SIGNAL_QUEUE_HEADER sig_hdr; struct signal_queue_header sig_hdr;
u32 slots_avail, slots_used; u32 slots_avail, slots_used;
u32 head, tail; u32 head, tail;
...@@ -524,7 +527,7 @@ EXPORT_SYMBOL_GPL(visorchannel_signalqueue_slots_avail); ...@@ -524,7 +527,7 @@ EXPORT_SYMBOL_GPL(visorchannel_signalqueue_slots_avail);
int int
visorchannel_signalqueue_max_slots(VISORCHANNEL *channel, u32 queue) visorchannel_signalqueue_max_slots(VISORCHANNEL *channel, u32 queue)
{ {
SIGNAL_QUEUE_HEADER sig_hdr; struct signal_queue_header sig_hdr;
if (!sig_read_header(channel, queue, &sig_hdr)) if (!sig_read_header(channel, queue, &sig_hdr))
return 0; return 0;
...@@ -533,7 +536,7 @@ visorchannel_signalqueue_max_slots(VISORCHANNEL *channel, u32 queue) ...@@ -533,7 +536,7 @@ visorchannel_signalqueue_max_slots(VISORCHANNEL *channel, u32 queue)
EXPORT_SYMBOL_GPL(visorchannel_signalqueue_max_slots); EXPORT_SYMBOL_GPL(visorchannel_signalqueue_max_slots);
static void static void
sigqueue_debug(SIGNAL_QUEUE_HEADER *q, int which, struct seq_file *seq) sigqueue_debug(struct signal_queue_header *q, int which, struct seq_file *seq)
{ {
seq_printf(seq, "Signal Queue #%d\n", which); seq_printf(seq, "Signal Queue #%d\n", which);
seq_printf(seq, " VersionId = %lu\n", (ulong) q->VersionId); seq_printf(seq, " VersionId = %lu\n", (ulong) q->VersionId);
...@@ -617,7 +620,7 @@ visorchannel_debug(VISORCHANNEL *channel, int nQueues, ...@@ -617,7 +620,7 @@ visorchannel_debug(VISORCHANNEL *channel, int nQueues,
; ;
else else
for (i = 0; i < nQueues; i++) { for (i = 0; i < nQueues; i++) {
SIGNAL_QUEUE_HEADER q; struct signal_queue_header q;
errcode = visorchannel_read(channel, errcode = visorchannel_read(channel,
off + phdr->ch_space_offset + off + phdr->ch_space_offset +
......
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