Skip to content

Commit

Permalink
[PATCH] hysdn: remove custom types
Browse files Browse the repository at this point in the history
hysdn defines its own types: ulong, uint, uchar and word.

Problem is, the module_param macros rely upon some of those identifiers having
special meanings too.  The net effect is that module_param() and friends
cannot be used in ISDN because of this namespace clash.

So remove the hysdn-private defines and open-code them all.

Cc: Karsten Keil <kkeil@suse.de>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Mar 25, 2006
1 parent 5b7b18c commit c721bcc
Show file tree
Hide file tree
Showing 12 changed files with 127 additions and 126 deletions.
31 changes: 16 additions & 15 deletions drivers/isdn/hysdn/boardergo.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ ergo_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{
hysdn_card *card = dev_id; /* parameter from irq */
tErgDpram *dpr;
ulong flags;
uchar volatile b;
unsigned long flags;
unsigned char volatile b;

if (!card)
return IRQ_NONE; /* error -> spurious interrupt */
Expand Down Expand Up @@ -77,7 +77,7 @@ ergo_irq_bh(hysdn_card * card)
{
tErgDpram *dpr;
int again;
ulong flags;
unsigned long flags;

if (card->state != CARD_STATE_RUN)
return; /* invalid call */
Expand Down Expand Up @@ -131,8 +131,8 @@ ergo_irq_bh(hysdn_card * card)
static void
ergo_stopcard(hysdn_card * card)
{
ulong flags;
uchar val;
unsigned long flags;
unsigned char val;

hysdn_net_release(card); /* first release the net device if existing */
#ifdef CONFIG_HYSDN_CAPI
Expand All @@ -157,7 +157,7 @@ ergo_stopcard(hysdn_card * card)
static void
ergo_set_errlog_state(hysdn_card * card, int on)
{
ulong flags;
unsigned long flags;

if (card->state != CARD_STATE_RUN) {
card->err_log_state = ERRLOG_STATE_OFF; /* must be off */
Expand Down Expand Up @@ -217,9 +217,10 @@ ergo_testram(hysdn_card * card)
/* Negative return values are interpreted as errors. */
/*****************************************************************************/
static int
ergo_writebootimg(struct HYSDN_CARD *card, uchar * buf, ulong offs)
ergo_writebootimg(struct HYSDN_CARD *card, unsigned char *buf,
unsigned long offs)
{
uchar *dst;
unsigned char *dst;
tErgDpram *dpram;
int cnt = (BOOT_IMG_SIZE >> 2); /* number of words to move and swap (byte order!) */

Expand Down Expand Up @@ -264,14 +265,14 @@ ergo_writebootimg(struct HYSDN_CARD *card, uchar * buf, ulong offs)
/* case of errors a negative error value is returned. */
/********************************************************************************/
static int
ergo_writebootseq(struct HYSDN_CARD *card, uchar * buf, int len)
ergo_writebootseq(struct HYSDN_CARD *card, unsigned char *buf, int len)
{
tDpramBootSpooler *sp = (tDpramBootSpooler *) card->dpram;
uchar *dst;
uchar buflen;
unsigned char *dst;
unsigned char buflen;
int nr_write;
uchar tmp_rdptr;
uchar wr_mirror;
unsigned char tmp_rdptr;
unsigned char wr_mirror;
int i;

if (card->debug_flags & LOG_POF_CARD)
Expand Down Expand Up @@ -330,7 +331,7 @@ ergo_waitpofready(struct HYSDN_CARD *card)
{
tErgDpram *dpr = card->dpram; /* pointer to DPRAM structure */
int timecnt = 10000 / 50; /* timeout is 10 secs max. */
ulong flags;
unsigned long flags;
int msg_size;
int i;

Expand All @@ -345,7 +346,7 @@ ergo_waitpofready(struct HYSDN_CARD *card)
if ((dpr->ToPcChannel != CHAN_SYSTEM) ||
(dpr->ToPcSize < MIN_RDY_MSG_SIZE) ||
(dpr->ToPcSize > MAX_RDY_MSG_SIZE) ||
((*(ulong *) dpr->ToPcBuf) != RDY_MAGIC))
((*(unsigned long *) dpr->ToPcBuf) != RDY_MAGIC))
break; /* an error occurred */

/* Check for additional data delivered during SysReady */
Expand Down
46 changes: 23 additions & 23 deletions drivers/isdn/hysdn/boardergo.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,36 +23,36 @@

/* following DPRAM layout copied from OS2-driver boarderg.h */
typedef struct ErgDpram_tag {
/*0000 */ uchar ToHyBuf[ERG_TO_HY_BUF_SIZE];
/*0E00 */ uchar ToPcBuf[ERG_TO_PC_BUF_SIZE];
/*0000 */ unsigned char ToHyBuf[ERG_TO_HY_BUF_SIZE];
/*0E00 */ unsigned char ToPcBuf[ERG_TO_PC_BUF_SIZE];

/*1C00 */ uchar bSoftUart[SIZE_RSV_SOFT_UART];
/*1C00 */ unsigned char bSoftUart[SIZE_RSV_SOFT_UART];
/* size 0x1B0 */

/*1DB0 *//* tErrLogEntry */ uchar volatile ErrLogMsg[64];
/*1DB0 *//* tErrLogEntry */ unsigned char volatile ErrLogMsg[64];
/* size 64 bytes */
/*1DB0 ulong ulErrType; */
/*1DB4 ulong ulErrSubtype; */
/*1DB8 ulong ucTextSize; */
/*1DB9 ulong ucText[ERRLOG_TEXT_SIZE]; *//* ASCIIZ of len ucTextSize-1 */
/*1DB0 unsigned long ulErrType; */
/*1DB4 unsigned long ulErrSubtype; */
/*1DB8 unsigned long ucTextSize; */
/*1DB9 unsigned long ucText[ERRLOG_TEXT_SIZE]; *//* ASCIIZ of len ucTextSize-1 */
/*1DF0 */

/*1DF0 */ word volatile ToHyChannel;
/*1DF2 */ word volatile ToHySize;
/*1DF4 */ uchar volatile ToHyFlag;
/*1DF0 */ unsigned short volatile ToHyChannel;
/*1DF2 */ unsigned short volatile ToHySize;
/*1DF4 */ unsigned char volatile ToHyFlag;
/* !=0: msg for Hy waiting */
/*1DF5 */ uchar volatile ToPcFlag;
/*1DF5 */ unsigned char volatile ToPcFlag;
/* !=0: msg for PC waiting */
/*1DF6 */ word volatile ToPcChannel;
/*1DF8 */ word volatile ToPcSize;
/*1DFA */ uchar bRes1DBA[0x1E00 - 0x1DFA];
/*1DF6 */ unsigned short volatile ToPcChannel;
/*1DF8 */ unsigned short volatile ToPcSize;
/*1DFA */ unsigned char bRes1DBA[0x1E00 - 0x1DFA];
/* 6 bytes */

/*1E00 */ uchar bRestOfEntryTbl[0x1F00 - 0x1E00];
/*1F00 */ ulong TrapTable[62];
/*1FF8 */ uchar bRes1FF8[0x1FFB - 0x1FF8];
/*1E00 */ unsigned char bRestOfEntryTbl[0x1F00 - 0x1E00];
/*1F00 */ unsigned long TrapTable[62];
/*1FF8 */ unsigned char bRes1FF8[0x1FFB - 0x1FF8];
/* low part of reset vetor */
/*1FFB */ uchar ToPcIntMetro;
/*1FFB */ unsigned char ToPcIntMetro;
/* notes:
* - metro has 32-bit boot ram - accessing
* ToPcInt and ToHyInt would be the same;
Expand All @@ -65,16 +65,16 @@ typedef struct ErgDpram_tag {
* so E1 side should NOT change this byte
* when writing!
*/
/*1FFC */ uchar volatile ToHyNoDpramErrLog;
/*1FFC */ unsigned char volatile ToHyNoDpramErrLog;
/* note: ToHyNoDpramErrLog is used to inform
* boot loader, not to use DPRAM based
* ErrLog; when DOS driver is rewritten
* this becomes obsolete
*/
/*1FFD */ uchar bRes1FFD;
/*1FFE */ uchar ToPcInt;
/*1FFD */ unsigned char bRes1FFD;
/*1FFE */ unsigned char ToPcInt;
/* E1_intclear; on CHAMP2: E1_intset */
/*1FFF */ uchar ToHyInt;
/*1FFF */ unsigned char ToHyInt;
/* E1_intset; on CHAMP2: E1_intclear */
} tErgDpram;

Expand Down
2 changes: 1 addition & 1 deletion drivers/isdn/hysdn/hycapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ New nccis are created if necessary.
*******************************************************************/

void
hycapi_rx_capipkt(hysdn_card * card, uchar * buf, word len)
hycapi_rx_capipkt(hysdn_card * card, unsigned char *buf, unsigned short len)
{
struct sk_buff *skb;
hycapictrl_info *cinfo = card->hyctrlinfo;
Expand Down
28 changes: 14 additions & 14 deletions drivers/isdn/hysdn/hysdn_boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@
/* needed during boot and so allocated dynamically. */
/************************************************************/
struct boot_data {
word Cryptor; /* for use with Decrypt function */
word Nrecs; /* records remaining in file */
uchar pof_state; /* actual state of read handler */
uchar is_crypted; /* card data is crypted */
unsigned short Cryptor; /* for use with Decrypt function */
unsigned short Nrecs; /* records remaining in file */
unsigned char pof_state;/* actual state of read handler */
unsigned char is_crypted;/* card data is crypted */
int BufSize; /* actual number of bytes bufferd */
int last_error; /* last occurred error */
word pof_recid; /* actual pof recid */
ulong pof_reclen; /* total length of pof record data */
ulong pof_recoffset; /* actual offset inside pof record */
unsigned short pof_recid;/* actual pof recid */
unsigned long pof_reclen;/* total length of pof record data */
unsigned long pof_recoffset;/* actual offset inside pof record */
union {
uchar BootBuf[BOOT_BUF_SIZE]; /* buffer as byte count */
unsigned char BootBuf[BOOT_BUF_SIZE];/* buffer as byte count */
tPofRecHdr PofRecHdr; /* header for actual record/chunk */
tPofFileHdr PofFileHdr; /* header from POF file */
tPofTimeStamp PofTime; /* time information */
Expand Down Expand Up @@ -69,11 +69,11 @@ StartDecryption(struct boot_data *boot)
static void
DecryptBuf(struct boot_data *boot, int cnt)
{
uchar *bufp = boot->buf.BootBuf;
unsigned char *bufp = boot->buf.BootBuf;

while (cnt--) {
boot->Cryptor = (boot->Cryptor >> 1) ^ ((boot->Cryptor & 1U) ? CRYPT_FEEDTERM : 0);
*bufp++ ^= (uchar) boot->Cryptor;
*bufp++ ^= (unsigned char)boot->Cryptor;
}
} /* DecryptBuf */

Expand All @@ -86,7 +86,7 @@ pof_handle_data(hysdn_card * card, int datlen)
{
struct boot_data *boot = card->boot; /* pointer to boot specific data */
long l;
uchar *imgp;
unsigned char *imgp;
int img_len;

/* handle the different record types */
Expand Down Expand Up @@ -197,7 +197,7 @@ pof_write_buffer(hysdn_card * card, int datlen)
break;
}
/* Setup the new state and vars */
boot->Nrecs = (word) (boot->buf.PofFileHdr.N_PofRecs); /* limited to 65535 */
boot->Nrecs = (unsigned short)(boot->buf.PofFileHdr.N_PofRecs); /* limited to 65535 */
boot->pof_state = POF_READ_TAG_HEAD; /* now start with single tags */
boot->last_error = sizeof(tPofRecHdr); /* new length */
break;
Expand Down Expand Up @@ -268,7 +268,7 @@ pof_write_buffer(hysdn_card * card, int datlen)
/* occurred. Additionally the pointer to the buffer data area is set on success */
/*******************************************************************************/
int
pof_write_open(hysdn_card * card, uchar ** bufp)
pof_write_open(hysdn_card * card, unsigned char **bufp)
{
struct boot_data *boot; /* pointer to boot specific data */

Expand Down Expand Up @@ -335,7 +335,7 @@ pof_write_close(hysdn_card * card)
/* when POF has been booted. A return value of 0 is used if no error occurred. */
/*********************************************************************************/
int
EvalSysrTokData(hysdn_card * card, uchar * cp, int len)
EvalSysrTokData(hysdn_card *card, unsigned char *cp, int len)
{
u_char *p;
u_char crc;
Expand Down
71 changes: 34 additions & 37 deletions drivers/isdn/hysdn/hysdn_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@
#include <linux/workqueue.h>
#include <linux/skbuff.h>

/****************************/
/* storage type definitions */
/****************************/
#define uchar unsigned char
#define uint unsigned int
#define ulong unsigned long
#define word unsigned short

#include "ince1pc.h"

#ifdef CONFIG_HYSDN_CAPI
Expand Down Expand Up @@ -147,18 +139,18 @@ typedef struct HYSDN_CARD {

/* general variables for the cards */
int myid; /* own driver card id */
uchar bus; /* pci bus the card is connected to */
uchar devfn; /* slot+function bit encoded */
word subsysid; /* PCI subsystem id */
uchar brdtype; /* type of card */
uint bchans; /* number of available B-channels */
uint faxchans; /* number of available fax-channels */
uchar mac_addr[6]; /* MAC Address read from card */
uint irq; /* interrupt number */
uint iobase; /* IO-port base address */
ulong plxbase; /* PLX memory base */
ulong membase; /* DPRAM memory base */
ulong memend; /* DPRAM memory end */
unsigned char bus; /* pci bus the card is connected to */
unsigned char devfn; /* slot+function bit encoded */
unsigned short subsysid;/* PCI subsystem id */
unsigned char brdtype; /* type of card */
unsigned int bchans; /* number of available B-channels */
unsigned int faxchans; /* number of available fax-channels */
unsigned char mac_addr[6];/* MAC Address read from card */
unsigned int irq; /* interrupt number */
unsigned int iobase; /* IO-port base address */
unsigned long plxbase; /* PLX memory base */
unsigned long membase; /* DPRAM memory base */
unsigned long memend; /* DPRAM memory end */
void *dpram; /* mapped dpram */
int state; /* actual state of card -> CARD_STATE_** */
struct HYSDN_CARD *next; /* pointer to next card */
Expand All @@ -168,26 +160,26 @@ typedef struct HYSDN_CARD {
void *procconf; /* pointer to procconf filesystem specific data */

/* debugging and logging */
uchar err_log_state; /* actual error log state of the card */
ulong debug_flags; /* tells what should be debugged and where */
unsigned char err_log_state;/* actual error log state of the card */
unsigned long debug_flags;/* tells what should be debugged and where */
void (*set_errlog_state) (struct HYSDN_CARD *, int);

/* interrupt handler + interrupt synchronisation */
struct work_struct irq_queue; /* interrupt task queue */
uchar volatile irq_enabled; /* interrupt enabled if != 0 */
uchar volatile hw_lock; /* hardware is currently locked -> no access */
unsigned char volatile irq_enabled;/* interrupt enabled if != 0 */
unsigned char volatile hw_lock;/* hardware is currently locked -> no access */

/* boot process */
void *boot; /* pointer to boot private data */
int (*writebootimg) (struct HYSDN_CARD *, uchar *, ulong);
int (*writebootseq) (struct HYSDN_CARD *, uchar *, int);
int (*writebootimg) (struct HYSDN_CARD *, unsigned char *, unsigned long);
int (*writebootseq) (struct HYSDN_CARD *, unsigned char *, int);
int (*waitpofready) (struct HYSDN_CARD *);
int (*testram) (struct HYSDN_CARD *);

/* scheduler for data transfer (only async parts) */
uchar async_data[256]; /* async data to be sent (normally for config) */
word volatile async_len; /* length of data to sent */
word volatile async_channel; /* channel number for async transfer */
unsigned char async_data[256];/* async data to be sent (normally for config) */
unsigned short volatile async_len;/* length of data to sent */
unsigned short volatile async_channel;/* channel number for async transfer */
int volatile async_busy; /* flag != 0 sending in progress */
int volatile net_tx_busy; /* a network packet tx is in progress */

Expand Down Expand Up @@ -251,15 +243,18 @@ extern int ergo_inithardware(hysdn_card * card); /* get hardware -> module init

/* hysdn_boot.c */
extern int pof_write_close(hysdn_card *); /* close proc file after writing pof */
extern int pof_write_open(hysdn_card *, uchar **); /* open proc file for writing pof */
extern int pof_write_open(hysdn_card *, unsigned char **); /* open proc file for writing pof */
extern int pof_write_buffer(hysdn_card *, int); /* write boot data to card */
extern int EvalSysrTokData(hysdn_card *, uchar *, int); /* Check Sysready Token Data */
extern int EvalSysrTokData(hysdn_card *, unsigned char *, int); /* Check Sysready Token Data */

/* hysdn_sched.c */
extern int hysdn_sched_tx(hysdn_card *, uchar *, word volatile *, word volatile *,
word);
extern int hysdn_sched_rx(hysdn_card *, uchar *, word, word);
extern int hysdn_tx_cfgline(hysdn_card *, uchar *, word); /* send one cfg line */
extern int hysdn_sched_tx(hysdn_card *, unsigned char *,
unsigned short volatile *, unsigned short volatile *,
unsigned short);
extern int hysdn_sched_rx(hysdn_card *, unsigned char *, unsigned short,
unsigned short);
extern int hysdn_tx_cfgline(hysdn_card *, unsigned char *,
unsigned short); /* send one cfg line */

/* hysdn_net.c */
extern unsigned int hynet_enable;
Expand All @@ -269,14 +264,16 @@ extern int hysdn_net_release(hysdn_card *); /* delete the device */
extern char *hysdn_net_getname(hysdn_card *); /* get name of net interface */
extern void hysdn_tx_netack(hysdn_card *); /* acknowledge a packet tx */
extern struct sk_buff *hysdn_tx_netget(hysdn_card *); /* get next network packet */
extern void hysdn_rx_netpkt(hysdn_card *, uchar *, word); /* rxed packet from network */
extern void hysdn_rx_netpkt(hysdn_card *, unsigned char *,
unsigned short); /* rxed packet from network */

#ifdef CONFIG_HYSDN_CAPI
extern unsigned int hycapi_enable;
extern int hycapi_capi_create(hysdn_card *); /* create a new capi device */
extern int hycapi_capi_release(hysdn_card *); /* delete the device */
extern int hycapi_capi_stop(hysdn_card *card); /* suspend */
extern void hycapi_rx_capipkt(hysdn_card * card, uchar * buf, word len);
extern void hycapi_rx_capipkt(hysdn_card * card, unsigned char * buf,
unsigned short len);
extern void hycapi_tx_capiack(hysdn_card * card);
extern struct sk_buff *hycapi_tx_capiget(hysdn_card *card);
extern int hycapi_init(void);
Expand Down
4 changes: 2 additions & 2 deletions drivers/isdn/hysdn/hysdn_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ hysdn_card *card_root = NULL; /* pointer to first card */
/* the last entry contains all 0 */
/**********************************************/
static struct {
word subid; /* PCI sub id */
uchar cardtyp; /* card type assigned */
unsigned short subid; /* PCI sub id */
unsigned char cardtyp; /* card type assigned */
} pci_subid_map[] = {

{
Expand Down
Loading

0 comments on commit c721bcc

Please sign in to comment.