staging: unisys: fix CamelCase in struct signal_queue_header

Fix CamelCase names:
VersionId => version
Type => chtype
Size => size
oSignalBase => sig_base_offset
FeatureFlags => features
NumSignalsSent => num_sent
NumOverflows => num_overflows
SignalSize => signal_size
MaxSignalSlots => max_slots
MaxSignals => max_signals
Head => head
NumSignalsReceived => num_received
Tail => tail
Reserved1 => reserved1
Reserved2 => reserved2
ClientQueue => client_queue
NumInterruptsReceived => num_irq_received
NumEmptyCnt => num_empty
ErrorFlags => errorflags
Filler => filler

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Benjamin Romer 2014-10-23 14:30:04 -04:00 committed by Greg Kroah-Hartman
parent e0fed862c8
commit 153cf71072
5 changed files with 113 additions and 113 deletions

View file

@ -56,30 +56,30 @@ visor_signal_insert(struct channel_header __iomem *pChannel, u32 Queue,
+ Queue; + Queue;
/* capture current head and tail */ /* capture current head and tail */
head = readl(&pqhdr->Head); head = readl(&pqhdr->head);
tail = readl(&pqhdr->Tail); tail = readl(&pqhdr->tail);
/* queue is full if (head + 1) % n equals tail */ /* queue is full if (head + 1) % n equals tail */
if (((head + 1) % readl(&pqhdr->MaxSignalSlots)) == tail) { if (((head + 1) % readl(&pqhdr->max_slots)) == tail) {
nof = readq(&pqhdr->NumOverflows) + 1; nof = readq(&pqhdr->num_overflows) + 1;
writeq(nof, &pqhdr->NumOverflows); writeq(nof, &pqhdr->num_overflows);
return 0; return 0;
} }
/* increment the head index */ /* increment the head index */
head = (head + 1) % readl(&pqhdr->MaxSignalSlots); head = (head + 1) % readl(&pqhdr->max_slots);
/* copy signal to the head location from the area pointed to /* copy signal to the head location from the area pointed to
* by pSignal * by pSignal
*/ */
psignal = (char __iomem *)pqhdr + readq(&pqhdr->oSignalBase) + psignal = (char __iomem *)pqhdr + readq(&pqhdr->sig_base_offset) +
(head * readl(&pqhdr->SignalSize)); (head * readl(&pqhdr->signal_size));
memcpy_toio(psignal, pSignal, readl(&pqhdr->SignalSize)); memcpy_toio(psignal, pSignal, readl(&pqhdr->signal_size));
mb(); /* channel synch */ mb(); /* channel synch */
writel(head, &pqhdr->Head); writel(head, &pqhdr->head);
writeq(readq(&pqhdr->NumSignalsSent) + 1, &pqhdr->NumSignalsSent); writeq(readq(&pqhdr->num_sent) + 1, &pqhdr->num_sent);
return 1; return 1;
} }
EXPORT_SYMBOL_GPL(visor_signal_insert); EXPORT_SYMBOL_GPL(visor_signal_insert);
@ -113,28 +113,28 @@ visor_signal_remove(struct channel_header __iomem *pChannel, u32 Queue,
readq(&pChannel->ch_space_offset)) + Queue; readq(&pChannel->ch_space_offset)) + Queue;
/* capture current head and tail */ /* capture current head and tail */
head = readl(&pqhdr->Head); head = readl(&pqhdr->head);
tail = readl(&pqhdr->Tail); tail = readl(&pqhdr->tail);
/* queue is empty if the head index equals the tail index */ /* queue is empty if the head index equals the tail index */
if (head == tail) { if (head == tail) {
writeq(readq(&pqhdr->NumEmptyCnt) + 1, &pqhdr->NumEmptyCnt); writeq(readq(&pqhdr->num_empty) + 1, &pqhdr->num_empty);
return 0; return 0;
} }
/* advance past the 'empty' front slot */ /* advance past the 'empty' front slot */
tail = (tail + 1) % readl(&pqhdr->MaxSignalSlots); tail = (tail + 1) % readl(&pqhdr->max_slots);
/* copy signal from tail location to the area pointed to by pSignal */ /* copy signal from tail location to the area pointed to by pSignal */
psource = (char __iomem *) pqhdr + readq(&pqhdr->oSignalBase) + psource = (char __iomem *) pqhdr + readq(&pqhdr->sig_base_offset) +
(tail * readl(&pqhdr->SignalSize)); (tail * readl(&pqhdr->signal_size));
memcpy_fromio(pSignal, psource, readl(&pqhdr->SignalSize)); memcpy_fromio(pSignal, psource, readl(&pqhdr->signal_size));
mb(); /* channel synch */ mb(); /* channel synch */
writel(tail, &pqhdr->Tail); writel(tail, &pqhdr->tail);
writeq(readq(&pqhdr->NumSignalsReceived) + 1, writeq(readq(&pqhdr->num_received) + 1,
&pqhdr->NumSignalsReceived); &pqhdr->num_received);
return 1; return 1;
} }
EXPORT_SYMBOL_GPL(visor_signal_remove); EXPORT_SYMBOL_GPL(visor_signal_remove);
@ -168,8 +168,8 @@ SignalRemoveAll(struct channel_header *pChannel, u32 Queue, void *pSignal)
pChannel->ch_space_offset) + Queue; pChannel->ch_space_offset) + Queue;
/* capture current head and tail */ /* capture current head and tail */
head = pqhdr->Head; head = pqhdr->head;
tail = pqhdr->Tail; tail = pqhdr->tail;
/* queue is empty if the head index equals the tail index */ /* queue is empty if the head index equals the tail index */
if (head == tail) if (head == tail)
@ -177,22 +177,22 @@ SignalRemoveAll(struct channel_header *pChannel, u32 Queue, void *pSignal)
while (head != tail) { while (head != tail) {
/* advance past the 'empty' front slot */ /* advance past the 'empty' front slot */
tail = (tail + 1) % pqhdr->MaxSignalSlots; tail = (tail + 1) % pqhdr->max_slots;
/* copy signal from tail location to the area pointed /* copy signal from tail location to the area pointed
* to by pSignal * to by pSignal
*/ */
psource = psource =
(char *) pqhdr + pqhdr->oSignalBase + (char *) pqhdr + pqhdr->sig_base_offset +
(tail * pqhdr->SignalSize); (tail * pqhdr->signal_size);
memcpy((char *) pSignal + (pqhdr->SignalSize * signalCount), memcpy((char *) pSignal + (pqhdr->signal_size * signalCount),
psource, pqhdr->SignalSize); psource, pqhdr->signal_size);
mb(); /* channel synch */ mb(); /* channel synch */
pqhdr->Tail = tail; pqhdr->tail = tail;
signalCount++; signalCount++;
pqhdr->NumSignalsReceived++; pqhdr->num_received++;
} }
return signalCount; return signalCount;
@ -215,7 +215,7 @@ visor_signalqueue_empty(struct channel_header __iomem *pChannel, u32 Queue)
struct signal_queue_header __iomem *pqhdr = struct signal_queue_header __iomem *pqhdr =
(struct 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);
} }
EXPORT_SYMBOL_GPL(visor_signalqueue_empty); EXPORT_SYMBOL_GPL(visor_signalqueue_empty);

View file

@ -234,37 +234,37 @@ struct channel_header {
/* Subheader for the Signal Type variation of the Common Channel */ /* Subheader for the Signal Type variation of the Common Channel */
struct signal_queue_header { struct signal_queue_header {
/* 1st cache line */ /* 1st cache line */
u32 VersionId; /* SIGNAL_QUEUE_HEADER Version ID */ u32 version; /* SIGNAL_QUEUE_HEADER Version ID */
u32 Type; /* Queue type: storage, network */ u32 chtype; /* Queue type: storage, network */
u64 Size; /* Total size of this queue in bytes */ u64 size; /* Total size of this queue in bytes */
u64 oSignalBase; /* Offset to signal queue area */ u64 sig_base_offset; /* Offset to signal queue area */
u64 FeatureFlags; /* Flags to modify behavior */ u64 features; /* Flags to modify behavior */
u64 NumSignalsSent; /* Total # of signals placed in this queue */ u64 num_sent; /* Total # of signals placed in this queue */
u64 NumOverflows; /* Total # of inserts failed due to u64 num_overflows; /* Total # of inserts failed due to
* full queue */ * full queue */
u32 SignalSize; /* Total size of a signal for this queue */ u32 signal_size; /* Total size of a signal for this queue */
u32 MaxSignalSlots; /* Max # of slots in queue, 1 slot is u32 max_slots; /* Max # of slots in queue, 1 slot is
* always empty */ * always empty */
u32 MaxSignals; /* Max # of signals in queue u32 max_signals; /* Max # of signals in queue
* (MaxSignalSlots-1) */ * (MaxSignalSlots-1) */
u32 Head; /* Queue head signal # */ u32 head; /* Queue head signal # */
/* 2nd cache line */ /* 2nd cache line */
u64 NumSignalsReceived; /* Total # of signals removed from this queue */ u64 num_received; /* Total # of signals removed from this queue */
u32 Tail; /* Queue tail signal # (on separate u32 tail; /* Queue tail signal # (on separate
* cache line) */ * cache line) */
u32 Reserved1; /* Reserved field */ u32 reserved1; /* Reserved field */
u64 Reserved2; /* Resrved field */ u64 reserved2; /* Reserved field */
u64 ClientQueue; u64 client_queue;
u64 NumInterruptsReceived; /* Total # of Interrupts received. This u64 num_irq_received; /* Total # of Interrupts received. This
* is incremented by the ISR in the * is incremented by the ISR in the
* guest windows driver */ * guest windows driver */
u64 NumEmptyCnt; /* Number of times that visor_signal_remove u64 num_empty; /* Number of times that visor_signal_remove
* is called and returned Empty * is called and returned Empty
* Status. */ * Status. */
u32 ErrorFlags; /* Error bits set during SignalReinit u32 errorflags; /* Error bits set during SignalReinit
* 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 */
}; };
#pragma pack(pop) #pragma pack(pop)

View file

@ -750,21 +750,21 @@ typedef struct _ULTRA_IO_CHANNEL_PROTOCOL {
#define QSIZEFROMBYTES(bytes) (QSLOTSFROMBYTES(bytes)*SIZEOF_CMDRSP) #define QSIZEFROMBYTES(bytes) (QSLOTSFROMBYTES(bytes)*SIZEOF_CMDRSP)
#define SignalQInit(x) \ #define SignalQInit(x) \
do { \ do { \
x->cmdQ.Size = QSIZEFROMBYTES(x->ChannelHeader.size); \ x->cmdQ.size = QSIZEFROMBYTES(x->ChannelHeader.size); \
x->cmdQ.oSignalBase = SIZEOF_PROTOCOL - \ x->cmdQ.sig_base_offset = SIZEOF_PROTOCOL - \
offsetof(ULTRA_IO_CHANNEL_PROTOCOL, cmdQ); \ offsetof(ULTRA_IO_CHANNEL_PROTOCOL, cmdQ); \
x->cmdQ.SignalSize = SIZEOF_CMDRSP; \ x->cmdQ.signal_size = SIZEOF_CMDRSP; \
x->cmdQ.MaxSignalSlots = \ x->cmdQ.max_slots = \
QSLOTSFROMBYTES(x->ChannelHeader.size); \ QSLOTSFROMBYTES(x->ChannelHeader.size); \
x->cmdQ.MaxSignals = x->cmdQ.MaxSignalSlots - 1; \ x->cmdQ.max_signals = x->cmdQ.max_slots - 1; \
x->rspQ.Size = QSIZEFROMBYTES(x->ChannelHeader.size); \ x->rspQ.size = QSIZEFROMBYTES(x->ChannelHeader.size); \
x->rspQ.oSignalBase = \ x->rspQ.sig_base_offset = \
(SIZEOF_PROTOCOL + x->cmdQ.Size) - \ (SIZEOF_PROTOCOL + x->cmdQ.size) - \
offsetof(ULTRA_IO_CHANNEL_PROTOCOL, rspQ); \ offsetof(ULTRA_IO_CHANNEL_PROTOCOL, rspQ); \
x->rspQ.SignalSize = SIZEOF_CMDRSP; \ x->rspQ.signal_size = SIZEOF_CMDRSP; \
x->rspQ.MaxSignalSlots = \ x->rspQ.max_slots = \
QSLOTSFROMBYTES(x->ChannelHeader.size); \ QSLOTSFROMBYTES(x->ChannelHeader.size); \
x->rspQ.MaxSignals = x->rspQ.MaxSignalSlots - 1; \ x->rspQ.max_signals = x->rspQ.max_slots - 1; \
x->ChannelHeader.ch_space_offset = \ x->ChannelHeader.ch_space_offset = \
offsetof(ULTRA_IO_CHANNEL_PROTOCOL, cmdQ); \ offsetof(ULTRA_IO_CHANNEL_PROTOCOL, cmdQ); \
} while (0) } while (0)
@ -814,12 +814,12 @@ static inline int ULTRA_VHBA_init_channel(ULTRA_IO_CHANNEL_PROTOCOL *x,
INIT_CLIENTSTRING(x, ULTRA_IO_CHANNEL_PROTOCOL, clientStr, INIT_CLIENTSTRING(x, ULTRA_IO_CHANNEL_PROTOCOL, clientStr,
clientStrLen); clientStrLen);
SignalQInit(x); SignalQInit(x);
if ((x->cmdQ.MaxSignalSlots > MAX_NUMSIGNALS) || if ((x->cmdQ.max_slots > MAX_NUMSIGNALS) ||
(x->rspQ.MaxSignalSlots > MAX_NUMSIGNALS)) { (x->rspQ.max_slots > MAX_NUMSIGNALS)) {
return 0; return 0;
} }
if ((x->cmdQ.MaxSignalSlots < MIN_NUMSIGNALS) || if ((x->cmdQ.max_slots < MIN_NUMSIGNALS) ||
(x->rspQ.MaxSignalSlots < MIN_NUMSIGNALS)) { (x->rspQ.max_slots < MIN_NUMSIGNALS)) {
return 0; return 0;
} }
return 1; return 1;
@ -852,12 +852,12 @@ static inline int ULTRA_VNIC_init_channel(ULTRA_IO_CHANNEL_PROTOCOL *x,
INIT_CLIENTSTRING(x, ULTRA_IO_CHANNEL_PROTOCOL, clientStr, INIT_CLIENTSTRING(x, ULTRA_IO_CHANNEL_PROTOCOL, clientStr,
clientStrLen); clientStrLen);
SignalQInit(x); SignalQInit(x);
if ((x->cmdQ.MaxSignalSlots > MAX_NUMSIGNALS) || if ((x->cmdQ.max_slots > MAX_NUMSIGNALS) ||
(x->rspQ.MaxSignalSlots > MAX_NUMSIGNALS)) { (x->rspQ.max_slots > MAX_NUMSIGNALS)) {
return 0; return 0;
} }
if ((x->cmdQ.MaxSignalSlots < MIN_NUMSIGNALS) || if ((x->cmdQ.max_slots < MIN_NUMSIGNALS) ||
(x->rspQ.MaxSignalSlots < MIN_NUMSIGNALS)) { (x->rspQ.max_slots < MIN_NUMSIGNALS)) {
return 0; return 0;
} }
return 1; return 1;

View file

@ -445,8 +445,8 @@ virthba_ISR(int irq, void *dev_id)
pqhdr = (struct 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->num_irq_received) + 1,
&pqhdr->NumInterruptsReceived); &pqhdr->num_irq_received);
atomic_set(&virthbainfo->interrupt_rcvd, 1); atomic_set(&virthbainfo->interrupt_rcvd, 1);
wake_up_interruptible(&virthbainfo->rsp_queue); wake_up_interruptible(&virthbainfo->rsp_queue);
return IRQ_HANDLED; return IRQ_HANDLED;
@ -589,7 +589,7 @@ virthba_probe(struct virtpci_dev *virtpcidev, const struct pci_device_id *id)
pqhdr = (struct 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->features;
if (!uisthread_start(&virthbainfo->chinfo.threadinfo, if (!uisthread_start(&virthbainfo->chinfo.threadinfo,
process_incoming_rsps, process_incoming_rsps,

View file

@ -302,8 +302,8 @@ EXPORT_SYMBOL_GPL(visorchannel_get_header);
* channel header * channel header
*/ */
#define SIG_DATA_OFFSET(chan_hdr, q, sig_hdr, slot) \ #define SIG_DATA_OFFSET(chan_hdr, q, sig_hdr, slot) \
(SIG_QUEUE_OFFSET(chan_hdr, q) + (sig_hdr)->oSignalBase + \ (SIG_QUEUE_OFFSET(chan_hdr, q) + (sig_hdr)->sig_base_offset + \
((slot) * (sig_hdr)->SignalSize)) ((slot) * (sig_hdr)->signal_size))
/** Write the contents of a specific field within a SIGNAL_QUEUE_HEADER back /** Write the contents of a specific field within a SIGNAL_QUEUE_HEADER back
* into host memory * into host memory
@ -353,13 +353,13 @@ sig_do_data(VISORCHANNEL *channel, u32 queue,
if (is_write) { if (is_write) {
if (visor_memregion_write(channel->memregion, if (visor_memregion_write(channel->memregion,
signal_data_offset, signal_data_offset,
data, sig_hdr->SignalSize) < 0) { data, sig_hdr->signal_size) < 0) {
ERRDRV("visor_memregion_write of signal data failed: (status=%d)\n", rc); ERRDRV("visor_memregion_write of signal data failed: (status=%d)\n", rc);
goto Away; goto Away;
} }
} else { } else {
if (visor_memregion_read(channel->memregion, signal_data_offset, if (visor_memregion_read(channel->memregion, signal_data_offset,
data, sig_hdr->SignalSize) < 0) { data, sig_hdr->signal_size) < 0) {
ERRDRV("visor_memregion_read of signal data failed: (status=%d)\n", rc); ERRDRV("visor_memregion_read of signal data failed: (status=%d)\n", rc);
goto Away; goto Away;
} }
@ -388,18 +388,18 @@ safe_sig_queue_validate(struct signal_queue_header *psafe_sqh,
struct signal_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->max_slots)
|| (*ptail >= psafe_sqh->MaxSignalSlots)) { || (*ptail >= psafe_sqh->max_slots)) {
/* Choose 0 or max, maybe based on current tail value */ /* Choose 0 or max, maybe based on current tail value */
*phead = 0; *phead = 0;
*ptail = 0; *ptail = 0;
/* Sync with client as necessary */ /* Sync with client as necessary */
punsafe_sqh->Head = *phead; punsafe_sqh->head = *phead;
punsafe_sqh->Tail = *ptail; punsafe_sqh->tail = *ptail;
ERRDRV("safe_sig_queue_validate: head = 0x%x, tail = 0x%x, MaxSlots = 0x%x", ERRDRV("safe_sig_queue_validate: head = 0x%x, tail = 0x%x, MaxSlots = 0x%x",
*phead, *ptail, psafe_sqh->MaxSignalSlots); *phead, *ptail, psafe_sqh->max_slots);
return 0; return 0;
} }
return 1; return 1;
@ -418,27 +418,27 @@ visorchannel_signalremove(VISORCHANNEL *channel, u32 queue, void *msg)
rc = FALSE; rc = FALSE;
goto Away; goto Away;
} }
if (sig_hdr.Head == sig_hdr.Tail) { if (sig_hdr.head == sig_hdr.tail) {
rc = FALSE; /* no signals to remove */ rc = FALSE; /* no signals to remove */
goto Away; goto Away;
} }
sig_hdr.Tail = (sig_hdr.Tail + 1) % sig_hdr.MaxSignalSlots; sig_hdr.tail = (sig_hdr.tail + 1) % sig_hdr.max_slots;
if (!sig_read_data(channel, queue, &sig_hdr, sig_hdr.Tail, msg)) { if (!sig_read_data(channel, queue, &sig_hdr, sig_hdr.tail, msg)) {
ERRDRV("sig_read_data failed: (status=%d)\n", rc); ERRDRV("sig_read_data failed: (status=%d)\n", rc);
goto Away; goto Away;
} }
sig_hdr.NumSignalsReceived++; sig_hdr.num_received++;
/* For each data field in SIGNAL_QUEUE_HEADER that was modified, /* For each data field in SIGNAL_QUEUE_HEADER that was modified,
* update host memory. * update host memory.
*/ */
mb(); /* required for channel synch */ mb(); /* required for channel synch */
if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, Tail)) { if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, tail)) {
ERRDRV("visor_memregion_write of Tail failed: (status=%d)\n", ERRDRV("visor_memregion_write of Tail failed: (status=%d)\n",
rc); rc);
goto Away; goto Away;
} }
if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, NumSignalsReceived)) { if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, num_received)) {
ERRDRV("visor_memregion_write of NumSignalsReceived failed: (status=%d)\n", rc); ERRDRV("visor_memregion_write of NumSignalsReceived failed: (status=%d)\n", rc);
goto Away; goto Away;
} }
@ -465,10 +465,10 @@ visorchannel_signalinsert(VISORCHANNEL *channel, u32 queue, void *msg)
goto Away; goto Away;
} }
sig_hdr.Head = ((sig_hdr.Head + 1) % sig_hdr.MaxSignalSlots); sig_hdr.head = ((sig_hdr.head + 1) % sig_hdr.max_slots);
if (sig_hdr.Head == sig_hdr.Tail) { if (sig_hdr.head == sig_hdr.tail) {
sig_hdr.NumOverflows++; sig_hdr.num_overflows++;
if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, NumOverflows)) { if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, num_overflows)) {
ERRDRV("visor_memregion_write of NumOverflows failed: (status=%d)\n", rc); ERRDRV("visor_memregion_write of NumOverflows failed: (status=%d)\n", rc);
goto Away; goto Away;
} }
@ -476,22 +476,22 @@ visorchannel_signalinsert(VISORCHANNEL *channel, u32 queue, void *msg)
goto Away; goto Away;
} }
if (!sig_write_data(channel, queue, &sig_hdr, sig_hdr.Head, msg)) { if (!sig_write_data(channel, queue, &sig_hdr, sig_hdr.head, msg)) {
ERRDRV("sig_write_data failed: (status=%d)\n", rc); ERRDRV("sig_write_data failed: (status=%d)\n", rc);
goto Away; goto Away;
} }
sig_hdr.NumSignalsSent++; sig_hdr.num_sent++;
/* For each data field in SIGNAL_QUEUE_HEADER that was modified, /* For each data field in SIGNAL_QUEUE_HEADER that was modified,
* update host memory. * update host memory.
*/ */
mb(); /* required for channel synch */ mb(); /* required for channel synch */
if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, Head)) { if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, head)) {
ERRDRV("visor_memregion_write of Head failed: (status=%d)\n", ERRDRV("visor_memregion_write of Head failed: (status=%d)\n",
rc); rc);
goto Away; goto Away;
} }
if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, NumSignalsSent)) { if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, num_sent)) {
ERRDRV("visor_memregion_write of NumSignalsSent failed: (status=%d)\n", rc); ERRDRV("visor_memregion_write of NumSignalsSent failed: (status=%d)\n", rc);
goto Away; goto Away;
} }
@ -514,12 +514,12 @@ visorchannel_signalqueue_slots_avail(VISORCHANNEL *channel, u32 queue)
if (!sig_read_header(channel, queue, &sig_hdr)) if (!sig_read_header(channel, queue, &sig_hdr))
return 0; return 0;
head = sig_hdr.Head; head = sig_hdr.head;
tail = sig_hdr.Tail; tail = sig_hdr.tail;
if (head < tail) if (head < tail)
head = head + sig_hdr.MaxSignalSlots; head = head + sig_hdr.max_slots;
slots_used = (head - tail); slots_used = (head - tail);
slots_avail = sig_hdr.MaxSignals - slots_used; slots_avail = sig_hdr.max_signals - slots_used;
return (int) slots_avail; return (int) slots_avail;
} }
EXPORT_SYMBOL_GPL(visorchannel_signalqueue_slots_avail); EXPORT_SYMBOL_GPL(visorchannel_signalqueue_slots_avail);
@ -531,7 +531,7 @@ visorchannel_signalqueue_max_slots(VISORCHANNEL *channel, u32 queue)
if (!sig_read_header(channel, queue, &sig_hdr)) if (!sig_read_header(channel, queue, &sig_hdr))
return 0; return 0;
return (int) sig_hdr.MaxSignals; return (int) sig_hdr.max_signals;
} }
EXPORT_SYMBOL_GPL(visorchannel_signalqueue_max_slots); EXPORT_SYMBOL_GPL(visorchannel_signalqueue_max_slots);
@ -539,24 +539,24 @@ static void
sigqueue_debug(struct 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->version);
seq_printf(seq, " Type = %lu\n", (ulong) q->Type); seq_printf(seq, " Type = %lu\n", (ulong)q->chtype);
seq_printf(seq, " oSignalBase = %llu\n", seq_printf(seq, " oSignalBase = %llu\n",
(long long) q->oSignalBase); (long long)q->sig_base_offset);
seq_printf(seq, " SignalSize = %lu\n", (ulong) q->SignalSize); seq_printf(seq, " SignalSize = %lu\n", (ulong)q->signal_size);
seq_printf(seq, " MaxSignalSlots = %lu\n", seq_printf(seq, " MaxSignalSlots = %lu\n",
(ulong) q->MaxSignalSlots); (ulong)q->max_slots);
seq_printf(seq, " MaxSignals = %lu\n", (ulong) q->MaxSignals); seq_printf(seq, " MaxSignals = %lu\n", (ulong)q->max_signals);
seq_printf(seq, " FeatureFlags = %-16.16Lx\n", seq_printf(seq, " FeatureFlags = %-16.16Lx\n",
(long long) q->FeatureFlags); (long long)q->features);
seq_printf(seq, " NumSignalsSent = %llu\n", seq_printf(seq, " NumSignalsSent = %llu\n",
(long long) q->NumSignalsSent); (long long)q->num_sent);
seq_printf(seq, " NumSignalsReceived = %llu\n", seq_printf(seq, " NumSignalsReceived = %llu\n",
(long long) q->NumSignalsReceived); (long long)q->num_received);
seq_printf(seq, " NumOverflows = %llu\n", seq_printf(seq, " NumOverflows = %llu\n",
(long long) q->NumOverflows); (long long)q->num_overflows);
seq_printf(seq, " Head = %lu\n", (ulong) q->Head); seq_printf(seq, " Head = %lu\n", (ulong)q->head);
seq_printf(seq, " Tail = %lu\n", (ulong) q->Tail); seq_printf(seq, " Tail = %lu\n", (ulong)q->tail);
} }
void void