summaryrefslogtreecommitdiff
path: root/drivers/isdn/sc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn/sc')
-rw-r--r--drivers/isdn/sc/card.h2
-rw-r--r--drivers/isdn/sc/command.c132
-rw-r--r--drivers/isdn/sc/event.c24
-rw-r--r--drivers/isdn/sc/hardware.h2
-rw-r--r--drivers/isdn/sc/init.c122
-rw-r--r--drivers/isdn/sc/interrupt.c144
-rw-r--r--drivers/isdn/sc/ioctl.c220
-rw-r--r--drivers/isdn/sc/message.c126
-rw-r--r--drivers/isdn/sc/message.h18
-rw-r--r--drivers/isdn/sc/packet.c129
-rw-r--r--drivers/isdn/sc/scioc.h5
-rw-r--r--drivers/isdn/sc/shmem.c52
-rw-r--r--drivers/isdn/sc/timer.c25
13 files changed, 499 insertions, 502 deletions
diff --git a/drivers/isdn/sc/card.h b/drivers/isdn/sc/card.h
index 0120bcf88311..3da69ee43da7 100644
--- a/drivers/isdn/sc/card.h
+++ b/drivers/isdn/sc/card.h
@@ -118,7 +118,7 @@ int send_and_receive(int card, unsigned int procid, unsigned char type,
unsigned char class, unsigned char code,
unsigned char link, unsigned char data_len,
unsigned char *data, RspMessage *mesgdata, int timeout);
-void flushreadfifo (int card);
+void flushreadfifo(int card);
int sendmessage(int card, unsigned int procid, unsigned int type,
unsigned int class, unsigned int code, unsigned int link,
unsigned int data_len, unsigned int *data);
diff --git a/drivers/isdn/sc/command.c b/drivers/isdn/sc/command.c
index 0e4969c2ef95..4a4e66152ce7 100644
--- a/drivers/isdn/sc/command.c
+++ b/drivers/isdn/sc/command.c
@@ -69,14 +69,14 @@ int get_card_from_id(int driver)
{
int i;
- for(i = 0 ; i < cinst ; i++) {
- if(sc_adapter[i]->driverId == driver)
+ for (i = 0; i < cinst; i++) {
+ if (sc_adapter[i]->driverId == driver)
return i;
}
return -ENODEV;
}
-/*
+/*
* command
*/
@@ -85,7 +85,7 @@ int command(isdn_ctrl *cmd)
int card;
card = get_card_from_id(cmd->driver);
- if(!IS_VALID_CARD(card)) {
+ if (!IS_VALID_CARD(card)) {
pr_debug("Invalid param: %d is not a valid card id\n", card);
return -ENODEV;
}
@@ -93,17 +93,17 @@ int command(isdn_ctrl *cmd)
/*
* Dispatch the command
*/
- switch(cmd->command) {
+ switch (cmd->command) {
case ISDN_CMD_IOCTL:
{
- unsigned long cmdptr;
+ unsigned long cmdptr;
scs_ioctl ioc;
memcpy(&cmdptr, cmd->parm.num, sizeof(unsigned long));
if (copy_from_user(&ioc, (scs_ioctl __user *)cmdptr,
sizeof(scs_ioctl))) {
pr_debug("%s: Failed to verify user space 0x%lx\n",
- sc_adapter[card]->devicename, cmdptr);
+ sc_adapter[card]->devicename, cmdptr);
return -EFAULT;
}
return sc_ioctl(card, &ioc);
@@ -133,76 +133,76 @@ int command(isdn_ctrl *cmd)
/*
* start the onboard firmware
*/
-int startproc(int card)
+int startproc(int card)
{
int status;
- if(!IS_VALID_CARD(card)) {
+ if (!IS_VALID_CARD(card)) {
pr_debug("Invalid param: %d is not a valid card id\n", card);
return -ENODEV;
}
/*
- * send start msg
+ * send start msg
*/
- status = sendmessage(card, CMPID,cmReqType2,
- cmReqClass0,
- cmReqStartProc,
- 0,0,NULL);
+ status = sendmessage(card, CMPID, cmReqType2,
+ cmReqClass0,
+ cmReqStartProc,
+ 0, 0, NULL);
pr_debug("%s: Sent startProc\n", sc_adapter[card]->devicename);
-
+
return status;
}
/*
- * Dials the number passed in
+ * Dials the number passed in
*/
static int dial(int card, unsigned long channel, setup_parm setup)
{
int status;
char Phone[48];
-
- if(!IS_VALID_CARD(card)) {
+
+ if (!IS_VALID_CARD(card)) {
pr_debug("Invalid param: %d is not a valid card id\n", card);
return -ENODEV;
}
- /*extract ISDN number to dial from eaz/msn string*/
- strcpy(Phone,setup.phone);
+ /*extract ISDN number to dial from eaz/msn string*/
+ strcpy(Phone, setup.phone);
/*send the connection message*/
- status = sendmessage(card, CEPID,ceReqTypePhy,
- ceReqClass1,
- ceReqPhyConnect,
- (unsigned char) channel+1,
- strlen(Phone),
- (unsigned int *) Phone);
+ status = sendmessage(card, CEPID, ceReqTypePhy,
+ ceReqClass1,
+ ceReqPhyConnect,
+ (unsigned char)channel + 1,
+ strlen(Phone),
+ (unsigned int *)Phone);
pr_debug("%s: Dialing %s on channel %lu\n",
- sc_adapter[card]->devicename, Phone, channel+1);
-
+ sc_adapter[card]->devicename, Phone, channel + 1);
+
return status;
}
/*
- * Answer an incoming call
+ * Answer an incoming call
*/
static int answer(int card, unsigned long channel)
{
- if(!IS_VALID_CARD(card)) {
+ if (!IS_VALID_CARD(card)) {
pr_debug("Invalid param: %d is not a valid card id\n", card);
return -ENODEV;
}
- if(setup_buffers(card, channel+1)) {
- hangup(card, channel+1);
+ if (setup_buffers(card, channel + 1)) {
+ hangup(card, channel + 1);
return -ENOBUFS;
}
- indicate_status(card, ISDN_STAT_BCONN,channel,NULL);
+ indicate_status(card, ISDN_STAT_BCONN, channel, NULL);
pr_debug("%s: Answered incoming call on channel %lu\n",
- sc_adapter[card]->devicename, channel+1);
+ sc_adapter[card]->devicename, channel + 1);
return 0;
}
@@ -213,19 +213,19 @@ static int hangup(int card, unsigned long channel)
{
int status;
- if(!IS_VALID_CARD(card)) {
+ if (!IS_VALID_CARD(card)) {
pr_debug("Invalid param: %d is not a valid card id\n", card);
return -ENODEV;
}
status = sendmessage(card, CEPID, ceReqTypePhy,
- ceReqClass1,
- ceReqPhyDisconnect,
- (unsigned char) channel+1,
- 0,
- NULL);
+ ceReqClass1,
+ ceReqPhyDisconnect,
+ (unsigned char)channel + 1,
+ 0,
+ NULL);
pr_debug("%s: Sent HANGUP message to channel %lu\n",
- sc_adapter[card]->devicename, channel+1);
+ sc_adapter[card]->devicename, channel + 1);
return status;
}
@@ -234,10 +234,10 @@ static int hangup(int card, unsigned long channel)
*/
static int setl2(int card, unsigned long arg)
{
- int status =0;
- int protocol,channel;
+ int status = 0;
+ int protocol, channel;
- if(!IS_VALID_CARD(card)) {
+ if (!IS_VALID_CARD(card)) {
pr_debug("Invalid param: %d is not a valid card id\n", card);
return -ENODEV;
}
@@ -249,14 +249,14 @@ static int setl2(int card, unsigned long arg)
* check that the adapter is also set to the correct protocol
*/
pr_debug("%s: Sending GetFrameFormat for channel %d\n",
- sc_adapter[card]->devicename, channel+1);
+ sc_adapter[card]->devicename, channel + 1);
status = sendmessage(card, CEPID, ceReqTypeCall,
- ceReqClass0,
- ceReqCallGetFrameFormat,
- (unsigned char)channel+1,
- 1,
- (unsigned int *) protocol);
- if(status)
+ ceReqClass0,
+ ceReqCallGetFrameFormat,
+ (unsigned char)channel + 1,
+ 1,
+ (unsigned int *)protocol);
+ if (status)
return status;
return 0;
}
@@ -268,7 +268,7 @@ static int setl3(int card, unsigned long channel)
{
int protocol = channel >> 8;
- if(!IS_VALID_CARD(card)) {
+ if (!IS_VALID_CARD(card)) {
pr_debug("Invalid param: %d is not a valid card id\n", card);
return -ENODEV;
}
@@ -279,26 +279,26 @@ static int setl3(int card, unsigned long channel)
static int acceptb(int card, unsigned long channel)
{
- if(!IS_VALID_CARD(card)) {
+ if (!IS_VALID_CARD(card)) {
pr_debug("Invalid param: %d is not a valid card id\n", card);
return -ENODEV;
}
- if(setup_buffers(card, channel+1))
+ if (setup_buffers(card, channel + 1))
{
- hangup(card, channel+1);
+ hangup(card, channel + 1);
return -ENOBUFS;
}
pr_debug("%s: B-Channel connection accepted on channel %lu\n",
- sc_adapter[card]->devicename, channel+1);
+ sc_adapter[card]->devicename, channel + 1);
indicate_status(card, ISDN_STAT_BCONN, channel, NULL);
return 0;
}
static int clreaz(int card, unsigned long arg)
{
- if(!IS_VALID_CARD(card)) {
+ if (!IS_VALID_CARD(card)) {
pr_debug("Invalid param: %d is not a valid card id\n", card);
return -ENODEV;
}
@@ -306,13 +306,13 @@ static int clreaz(int card, unsigned long arg)
strcpy(sc_adapter[card]->channel[arg].eazlist, "");
sc_adapter[card]->channel[arg].eazclear = 1;
pr_debug("%s: EAZ List cleared for channel %lu\n",
- sc_adapter[card]->devicename, arg+1);
+ sc_adapter[card]->devicename, arg + 1);
return 0;
}
static int seteaz(int card, unsigned long arg, char *num)
{
- if(!IS_VALID_CARD(card)) {
+ if (!IS_VALID_CARD(card)) {
pr_debug("Invalid param: %d is not a valid card id\n", card);
return -ENODEV;
}
@@ -320,8 +320,8 @@ static int seteaz(int card, unsigned long arg, char *num)
strcpy(sc_adapter[card]->channel[arg].eazlist, num);
sc_adapter[card]->channel[arg].eazclear = 0;
pr_debug("%s: EAZ list for channel %lu set to: %s\n",
- sc_adapter[card]->devicename, arg+1,
- sc_adapter[card]->channel[arg].eazlist);
+ sc_adapter[card]->devicename, arg + 1,
+ sc_adapter[card]->channel[arg].eazlist);
return 0;
}
@@ -329,14 +329,14 @@ int reset(int card)
{
unsigned long flags;
- if(!IS_VALID_CARD(card)) {
+ if (!IS_VALID_CARD(card)) {
pr_debug("Invalid param: %d is not a valid card id\n", card);
return -ENODEV;
}
indicate_status(card, ISDN_STAT_STOP, 0, NULL);
- if(sc_adapter[card]->EngineUp) {
+ if (sc_adapter[card]->EngineUp) {
del_timer(&sc_adapter[card]->stat_timer);
}
@@ -350,14 +350,14 @@ int reset(int card)
add_timer(&sc_adapter[card]->reset_timer);
spin_unlock_irqrestore(&sc_adapter[card]->lock, flags);
- outb(0x1,sc_adapter[card]->ioport[SFT_RESET]);
+ outb(0x1, sc_adapter[card]->ioport[SFT_RESET]);
pr_debug("%s: Adapter Reset\n", sc_adapter[card]->devicename);
return 0;
}
-void flushreadfifo (int card)
+void flushreadfifo(int card)
{
- while(inb(sc_adapter[card]->ioport[FIFO_STATUS]) & RF_HAS_DATA)
+ while (inb(sc_adapter[card]->ioport[FIFO_STATUS]) & RF_HAS_DATA)
inb(sc_adapter[card]->ioport[FIFO_READ]);
}
diff --git a/drivers/isdn/sc/event.c b/drivers/isdn/sc/event.c
index 498f4039ece2..717003a3bdf4 100644
--- a/drivers/isdn/sc/event.c
+++ b/drivers/isdn/sc/event.c
@@ -38,26 +38,26 @@ static char *events[] = { "ISDN_STAT_STAVAIL",
"ISDN_STAT_CAUSE" };
#endif
-int indicate_status(int card, int event,ulong Channel,char *Data)
+int indicate_status(int card, int event, ulong Channel, char *Data)
{
isdn_ctrl cmd;
#ifdef DEBUG
pr_debug("%s: Indicating event %s on Channel %d\n",
- sc_adapter[card]->devicename, events[event-256], Channel);
+ sc_adapter[card]->devicename, events[event - 256], Channel);
#endif
- if (Data != NULL){
+ if (Data != NULL) {
pr_debug("%s: Event data: %s\n", sc_adapter[card]->devicename,
- Data);
+ Data);
switch (event) {
- case ISDN_STAT_BSENT:
- memcpy(&cmd.parm.length, Data, sizeof(cmd.parm.length));
- break;
- case ISDN_STAT_ICALL:
- memcpy(&cmd.parm.setup, Data, sizeof(cmd.parm.setup));
- break;
- default:
- strcpy(cmd.parm.num, Data);
+ case ISDN_STAT_BSENT:
+ memcpy(&cmd.parm.length, Data, sizeof(cmd.parm.length));
+ break;
+ case ISDN_STAT_ICALL:
+ memcpy(&cmd.parm.setup, Data, sizeof(cmd.parm.setup));
+ break;
+ default:
+ strcpy(cmd.parm.num, Data);
}
}
diff --git a/drivers/isdn/sc/hardware.h b/drivers/isdn/sc/hardware.h
index 627324856ead..81fbe78701f0 100644
--- a/drivers/isdn/sc/hardware.h
+++ b/drivers/isdn/sc/hardware.h
@@ -105,6 +105,6 @@
*/
/* Determine if a channel number is valid for the adapter */
-#define IS_VALID_CHANNEL(y,x) ((x>0) && (x <= sc_adapter[y]->channels))
+#define IS_VALID_CHANNEL(y, x) ((x > 0) && (x <= sc_adapter[y]->channels))
#endif
diff --git a/drivers/isdn/sc/init.c b/drivers/isdn/sc/init.c
index 023de789f250..6b580b2c717f 100644
--- a/drivers/isdn/sc/init.c
+++ b/drivers/isdn/sc/init.c
@@ -27,9 +27,9 @@ static const char version[] = "2.0b1";
static const char *boardname[] = { "DataCommute/BRI", "DataCommute/PRI", "TeleCommute/BRI" };
/* insmod set parameters */
-static unsigned int io[] = {0,0,0,0};
-static unsigned char irq[] = {0,0,0,0};
-static unsigned long ram[] = {0,0,0,0};
+static unsigned int io[] = {0, 0, 0, 0};
+static unsigned char irq[] = {0, 0, 0, 0};
+static unsigned long ram[] = {0, 0, 0, 0};
static bool do_reset = 0;
module_param_array(io, int, NULL, 0);
@@ -62,7 +62,7 @@ static int __init sc_init(void)
#endif
pr_info("Copyright (C) 1996 SpellCaster Telecommunications Inc.\n");
- while(b++ < MAX_CARDS - 1) {
+ while (b++ < MAX_CARDS - 1) {
pr_debug("Probing for adapter #%d\n", b);
/*
* Initialize reusable variables
@@ -72,17 +72,17 @@ static int __init sc_init(void)
channels = 0;
pgport = 0;
- /*
- * See if we should probe for IO base
+ /*
+ * See if we should probe for IO base
*/
pr_debug("I/O Base for board %d is 0x%x, %s probe\n", b, io[b],
- io[b] == 0 ? "will" : "won't");
- if(io[b]) {
+ io[b] == 0 ? "will" : "won't");
+ if (io[b]) {
/*
* No, I/O Base has been provided
*/
- for (i = 0 ; i < MAX_IO_REGS - 1 ; i++) {
- if(!request_region(io[b] + i * 0x400, 1, "sc test")) {
+ for (i = 0; i < MAX_IO_REGS - 1; i++) {
+ if (!request_region(io[b] + i * 0x400, 1, "sc test")) {
pr_debug("request_region for 0x%x failed\n", io[b] + i * 0x400);
io[b] = 0;
break;
@@ -93,13 +93,13 @@ static int __init sc_init(void)
/*
* Confirm the I/O Address with a test
*/
- if(io[b] == 0) {
+ if (io[b] == 0) {
pr_debug("I/O Address invalid.\n");
continue;
}
outb(0x18, io[b] + 0x400 * EXP_PAGE0);
- if(inb(io[b] + 0x400 * EXP_PAGE0) != 0x18) {
+ if (inb(io[b] + 0x400 * EXP_PAGE0) != 0x18) {
pr_debug("I/O Base 0x%x fails test\n",
io[b] + 0x400 * EXP_PAGE0);
continue;
@@ -109,12 +109,12 @@ static int __init sc_init(void)
/*
* Yes, probe for I/O Base
*/
- if(probe_exhasted) {
+ if (probe_exhasted) {
pr_debug("All probe addresses exhasted, skipping\n");
continue;
}
pr_debug("Probing for I/O...\n");
- for (i = last_base ; i <= IOBASE_MAX ; i += IOBASE_OFFSET) {
+ for (i = last_base; i <= IOBASE_MAX; i += IOBASE_OFFSET) {
int found_io = 1;
if (i == IOBASE_MAX) {
probe_exhasted = 1; /* No more addresses to probe */
@@ -122,19 +122,19 @@ static int __init sc_init(void)
}
last_base = i + IOBASE_OFFSET;
pr_debug(" checking 0x%x...", i);
- for ( j = 0 ; j < MAX_IO_REGS - 1 ; j++) {
- if(!request_region(i + j * 0x400, 1, "sc test")) {
+ for (j = 0; j < MAX_IO_REGS - 1; j++) {
+ if (!request_region(i + j * 0x400, 1, "sc test")) {
pr_debug("Failed\n");
found_io = 0;
break;
} else
release_region(i + j * 0x400, 1);
- }
+ }
- if(found_io) {
+ if (found_io) {
io[b] = i;
outb(0x18, io[b] + 0x400 * EXP_PAGE0);
- if(inb(io[b] + 0x400 * EXP_PAGE0) != 0x18) {
+ if (inb(io[b] + 0x400 * EXP_PAGE0) != 0x18) {
pr_debug("Failed by test\n");
continue;
}
@@ -142,7 +142,7 @@ static int __init sc_init(void)
break;
}
}
- if(probe_exhasted) {
+ if (probe_exhasted) {
continue;
}
}
@@ -150,23 +150,23 @@ static int __init sc_init(void)
/*
* See if we should probe for shared RAM
*/
- if(do_reset) {
+ if (do_reset) {
pr_debug("Doing a SAFE probe reset\n");
outb(0xFF, io[b] + RESET_OFFSET);
msleep_interruptible(10000);
}
pr_debug("RAM Base for board %d is 0x%lx, %s probe\n", b,
- ram[b], ram[b] == 0 ? "will" : "won't");
+ ram[b], ram[b] == 0 ? "will" : "won't");
- if(ram[b]) {
+ if (ram[b]) {
/*
* No, the RAM base has been provided
* Just look for a signature and ID the
* board model
*/
- if(request_region(ram[b], SRAM_PAGESIZE, "sc test")) {
+ if (request_region(ram[b], SRAM_PAGESIZE, "sc test")) {
pr_debug("request_region for RAM base 0x%lx succeeded\n", ram[b]);
- model = identify_board(ram[b], io[b]);
+ model = identify_board(ram[b], io[b]);
release_region(ram[b], SRAM_PAGESIZE);
}
}
@@ -175,15 +175,15 @@ static int __init sc_init(void)
* Yes, probe for free RAM and look for
* a signature and id the board model
*/
- for (i = SRAM_MIN ; i < SRAM_MAX ; i += SRAM_PAGESIZE) {
+ for (i = SRAM_MIN; i < SRAM_MAX; i += SRAM_PAGESIZE) {
pr_debug("Checking RAM address 0x%x...\n", i);
- if(request_region(i, SRAM_PAGESIZE, "sc test")) {
+ if (request_region(i, SRAM_PAGESIZE, "sc test")) {
pr_debug(" request_region succeeded\n");
model = identify_board(i, io[b]);
release_region(i, SRAM_PAGESIZE);
if (model >= 0) {
pr_debug(" Identified a %s\n",
- boardname[model]);
+ boardname[model]);
ram[b] = i;
break;
}
@@ -196,19 +196,19 @@ static int __init sc_init(void)
/*
* See if we found free RAM and the board model
*/
- if(!ram[b] || model < 0) {
+ if (!ram[b] || model < 0) {
/*
* Nope, there was no place in RAM for the
* board, or it couldn't be identified
*/
- pr_debug("Failed to find an adapter at 0x%lx\n", ram[b]);
- continue;
+ pr_debug("Failed to find an adapter at 0x%lx\n", ram[b]);
+ continue;
}
/*
* Set the board's magic number, memory size and page register
*/
- switch(model) {
+ switch (model) {
case PRI_BOARD:
channels = 23;
magic = 0x20000;
@@ -224,7 +224,7 @@ static int __init sc_init(void)
features = BRI_FEATURES;
break;
}
- switch(ram[b] >> 12 & 0x0F) {
+ switch (ram[b] >> 12 & 0x0F) {
case 0x0:
pr_debug("RAM Page register set to EXP_PAGE0\n");
pgport = EXP_PAGE0;
@@ -250,12 +250,12 @@ static int __init sc_init(void)
continue;
}
- pr_debug("current IRQ: %d b: %d\n",irq[b],b);
+ pr_debug("current IRQ: %d b: %d\n", irq[b], b);
/*
* Make sure we got an IRQ
*/
- if(!irq[b]) {
+ if (!irq[b]) {
/*
* No interrupt could be used
*/
@@ -299,7 +299,7 @@ static int __init sc_init(void)
}
spin_lock_init(&sc_adapter[cinst]->lock);
- if(!register_isdn(interface)) {
+ if (!register_isdn(interface)) {
/*
* Oops, couldn't register for some reason
*/
@@ -344,30 +344,30 @@ static int __init sc_init(void)
kfree(interface);
kfree(sc_adapter[cinst]);
continue;
-
+
}
sc_adapter[cinst]->iobase = io[b];
- for(i = 0 ; i < MAX_IO_REGS - 1 ; i++) {
+ for (i = 0; i < MAX_IO_REGS - 1; i++) {
sc_adapter[cinst]->ioport[i] = io[b] + i * 0x400;
request_region(sc_adapter[cinst]->ioport[i], 1,
- interface->id);
+ interface->id);
pr_debug("Requesting I/O Port %#x\n",
- sc_adapter[cinst]->ioport[i]);
+ sc_adapter[cinst]->ioport[i]);
}
sc_adapter[cinst]->ioport[IRQ_SELECT] = io[b] + 0x2;
request_region(sc_adapter[cinst]->ioport[IRQ_SELECT], 1,
- interface->id);
+ interface->id);
pr_debug("Requesting I/O Port %#x\n",
- sc_adapter[cinst]->ioport[IRQ_SELECT]);
+ sc_adapter[cinst]->ioport[IRQ_SELECT]);
sc_adapter[cinst]->rambase = ram[b];
request_region(sc_adapter[cinst]->rambase, SRAM_PAGESIZE,
- interface->id);
+ interface->id);
- pr_info(" %s (%d) - %s %d channels IRQ %d, I/O Base 0x%x, RAM Base 0x%lx\n",
+ pr_info(" %s (%d) - %s %d channels IRQ %d, I/O Base 0x%x, RAM Base 0x%lx\n",
sc_adapter[cinst]->devicename,
sc_adapter[cinst]->driverId,
boardname[model], channels, irq[b], io[b], ram[b]);
-
+
/*
* reset the adapter to put things in motion
*/
@@ -376,7 +376,7 @@ static int __init sc_init(void)
cinst++;
status = 0;
}
- if (status)
+ if (status)
pr_info("Failed to find any adapters, driver unloaded\n");
return status;
}
@@ -385,7 +385,7 @@ static void __exit sc_exit(void)
{
int i, j;
- for(i = 0 ; i < cinst ; i++) {
+ for (i = 0; i < cinst; i++) {
pr_debug("Cleaning up after adapter %d\n", i);
/*
* kill the timers
@@ -417,14 +417,14 @@ static void __exit sc_exit(void)
/*
* Release the I/O Port regions
*/
- for(j = 0 ; j < MAX_IO_REGS - 1; j++) {
+ for (j = 0; j < MAX_IO_REGS - 1; j++) {
release_region(sc_adapter[i]->ioport[j], 1);
pr_debug("Releasing I/O Port %#x\n",
- sc_adapter[i]->ioport[j]);
+ sc_adapter[i]->ioport[j]);
}
release_region(sc_adapter[i]->ioport[IRQ_SELECT], 1);
pr_debug("Releasing I/O Port %#x\n",
- sc_adapter[i]->ioport[IRQ_SELECT]);
+ sc_adapter[i]->ioport[IRQ_SELECT]);
/*
* Release any memory we alloced
@@ -447,19 +447,19 @@ static int identify_board(unsigned long rambase, unsigned int iobase)
int x;
pr_debug("Attempting to identify adapter @ 0x%lx io 0x%x\n",
- rambase, iobase);
+ rambase, iobase);
/*
* Enable the base pointer
*/
outb(rambase >> 12, iobase + 0x2c00);
- switch(rambase >> 12 & 0x0F) {
+ switch (rambase >> 12 & 0x0F) {
case 0x0:
pgport = iobase + PG0_OFFSET;
pr_debug("Page Register offset is 0x%x\n", PG0_OFFSET);
break;
-
+
case 0x4:
pgport = iobase + PG1_OFFSET;
pr_debug("Page Register offset is 0x%x\n", PG1_OFFSET);
@@ -486,7 +486,7 @@ static int identify_board(unsigned long rambase, unsigned int iobase)
msleep_interruptible(1000);
sig = readl(rambase + SIG_OFFSET);
pr_debug("Looking for a signature, got 0x%lx\n", sig);
- if(sig == SIGNATURE)
+ if (sig == SIGNATURE)
return PRI_BOARD;
/*
@@ -496,7 +496,7 @@ static int identify_board(unsigned long rambase, unsigned int iobase)
msleep_interruptible(1000);
sig = readl(rambase + SIG_OFFSET);
pr_debug("Looking for a signature, got 0x%lx\n", sig);
- if(sig == SIGNATURE)
+ if (sig == SIGNATURE)
return BRI_BOARD;
return -1;
@@ -506,7 +506,7 @@ static int identify_board(unsigned long rambase, unsigned int iobase)
*/
sig = readl(rambase + SIG_OFFSET);
pr_debug("Looking for a signature, got 0x%lx\n", sig);
- if(sig != SIGNATURE)
+ if (sig != SIGNATURE)
return -1;
dpm = (DualPortMemory *) rambase;
@@ -523,11 +523,11 @@ static int identify_board(unsigned long rambase, unsigned int iobase)
* Wait for the response
*/
x = 0;
- while((inb(iobase + FIFOSTAT_OFFSET) & RF_HAS_DATA) && x < 100) {
+ while ((inb(iobase + FIFOSTAT_OFFSET) & RF_HAS_DATA) && x < 100) {
schedule_timeout_interruptible(1);
x++;
}
- if(x == 100) {
+ if (x == 100) {
pr_debug("Timeout waiting for response\n");
return -1;
}
@@ -540,11 +540,11 @@ static int identify_board(unsigned long rambase, unsigned int iobase)
hwci.st_u_sense ? "S/T" : "U", hwci.ram_size,
hwci.serial_no, hwci.part_no, hwci.rev_no);
- if(!strncmp(PRI_PARTNO, hwci.part_no, 6))
+ if (!strncmp(PRI_PARTNO, hwci.part_no, 6))
return PRI_BOARD;
- if(!strncmp(BRI_PARTNO, hwci.part_no, 6))
+ if (!strncmp(BRI_PARTNO, hwci.part_no, 6))
return BRI_BOARD;
-
+
return -1;
}
diff --git a/drivers/isdn/sc/interrupt.c b/drivers/isdn/sc/interrupt.c
index f0225bc0f267..e80cc76bc314 100644
--- a/drivers/isdn/sc/interrupt.c
+++ b/drivers/isdn/sc/interrupt.c
@@ -22,7 +22,7 @@
#include <linux/interrupt.h>
/*
- *
+ *
*/
irqreturn_t interrupt_handler(int dummy, void *card_inst)
{
@@ -31,15 +31,15 @@ irqreturn_t interrupt_handler(int dummy, void *card_inst)
int channel;
int card = (int)(unsigned long) card_inst;
- if(!IS_VALID_CARD(card)) {
+ if (!IS_VALID_CARD(card)) {
pr_debug("Invalid param: %d is not a valid card id\n", card);
return IRQ_NONE;
}
pr_debug("%s: Entered Interrupt handler\n",
- sc_adapter[card]->devicename);
-
- /*
+ sc_adapter[card]->devicename);
+
+ /*
* Pull all of the waiting messages off the response queue
*/
while (!receivemessage(card, &rcvmsg)) {
@@ -47,31 +47,31 @@ irqreturn_t interrupt_handler(int dummy, void *card_inst)
* Push the message to the adapter structure for
* send_and_receive to snoop
*/
- if(sc_adapter[card]->want_async_messages)
+ if (sc_adapter[card]->want_async_messages)
memcpy(&(sc_adapter[card]->async_msg),
- &rcvmsg, sizeof(RspMessage));
+ &rcvmsg, sizeof(RspMessage));
channel = (unsigned int) rcvmsg.phy_link_no;
-
+
/*
* Trap Invalid request messages
*/
- if(IS_CM_MESSAGE(rcvmsg, 0, 0, Invalid)) {
- pr_debug("%s: Invalid request Message, rsp_status = %d\n",
- sc_adapter[card]->devicename,
- rcvmsg.rsp_status);
- break;
+ if (IS_CM_MESSAGE(rcvmsg, 0, 0, Invalid)) {
+ pr_debug("%s: Invalid request Message, rsp_status = %d\n",
+ sc_adapter[card]->devicename,
+ rcvmsg.rsp_status);
+ break;
}
-
+
/*
* Check for a linkRead message
*/
if (IS_CE_MESSAGE(rcvmsg, Lnk, 1, Read))
{
pr_debug("%s: Received packet 0x%x bytes long at 0x%lx\n",
- sc_adapter[card]->devicename,
- rcvmsg.msg_data.response.msg_len,
- rcvmsg.msg_data.response.buff_offset);
+ sc_adapter[card]->devicename,
+ rcvmsg.msg_data.response.msg_len,
+ rcvmsg.msg_data.response.buff_offset);
rcvpkt(card, &rcvmsg);
continue;
@@ -80,49 +80,49 @@ irqreturn_t interrupt_handler(int dummy, void *card_inst)
/*
* Handle a write acknoledgement
*/
- if(IS_CE_MESSAGE(rcvmsg, Lnk, 1, Write)) {
+ if (IS_CE_MESSAGE(rcvmsg, Lnk, 1, Write)) {
pr_debug("%s: Packet Send ACK on channel %d\n",
- sc_adapter[card]->devicename,
- rcvmsg.phy_link_no);
- sc_adapter[card]->channel[rcvmsg.phy_link_no-1].free_sendbufs++;
+ sc_adapter[card]->devicename,
+ rcvmsg.phy_link_no);
+ sc_adapter[card]->channel[rcvmsg.phy_link_no - 1].free_sendbufs++;
continue;
}
/*
* Handle a connection message
*/
- if (IS_CE_MESSAGE(rcvmsg, Phy, 1, Connect))
+ if (IS_CE_MESSAGE(rcvmsg, Phy, 1, Connect))
{
unsigned int callid;
- setup_parm setup;
+ setup_parm setup;
pr_debug("%s: Connect message: line %d: status %d: cause 0x%x\n",
- sc_adapter[card]->devicename,
- rcvmsg.phy_link_no,
- rcvmsg.rsp_status,
- rcvmsg.msg_data.byte_array[2]);
-
- memcpy(&callid,rcvmsg.msg_data.byte_array,sizeof(int));
- if(callid>=0x8000 && callid<=0xFFFF)
- {
+ sc_adapter[card]->devicename,
+ rcvmsg.phy_link_no,
+ rcvmsg.rsp_status,
+ rcvmsg.msg_data.byte_array[2]);
+
+ memcpy(&callid, rcvmsg.msg_data.byte_array, sizeof(int));
+ if (callid >= 0x8000 && callid <= 0xFFFF)
+ {
pr_debug("%s: Got Dial-Out Rsp\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
indicate_status(card, ISDN_STAT_DCONN,
- (unsigned long)rcvmsg.phy_link_no-1,NULL);
-
+ (unsigned long)rcvmsg.phy_link_no - 1, NULL);
+
}
- else if(callid>=0x0000 && callid<=0x7FFF)
+ else if (callid >= 0x0000 && callid <= 0x7FFF)
{
int len;
pr_debug("%s: Got Incoming Call\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
len = strlcpy(setup.phone, &(rcvmsg.msg_data.byte_array[4]),
- sizeof(setup.phone));
+ sizeof(setup.phone));
if (len >= sizeof(setup.phone))
continue;
len = strlcpy(setup.eazmsn,
- sc_adapter[card]->channel[rcvmsg.phy_link_no - 1].dn,
- sizeof(setup.eazmsn));
+ sc_adapter[card]->channel[rcvmsg.phy_link_no - 1].dn,
+ sizeof(setup.eazmsn));
if (len >= sizeof(setup.eazmsn))
continue;
setup.si1 = 7;
@@ -130,8 +130,8 @@ irqreturn_t interrupt_handler(int dummy, void *card_inst)
setup.plan = 0;
setup.screen = 0;
- indicate_status(card, ISDN_STAT_ICALL,(unsigned long)rcvmsg.phy_link_no-1,(char *)&setup);
- indicate_status(card, ISDN_STAT_DCONN,(unsigned long)rcvmsg.phy_link_no-1,NULL);
+ indicate_status(card, ISDN_STAT_ICALL, (unsigned long)rcvmsg.phy_link_no - 1, (char *)&setup);
+ indicate_status(card, ISDN_STAT_DCONN, (unsigned long)rcvmsg.phy_link_no - 1, NULL);
}
continue;
}
@@ -139,16 +139,16 @@ irqreturn_t interrupt_handler(int dummy, void *card_inst)
/*
* Handle a disconnection message
*/
- if (IS_CE_MESSAGE(rcvmsg, Phy, 1, Disconnect))
+ if (IS_CE_MESSAGE(rcvmsg, Phy, 1, Disconnect))
{
pr_debug("%s: disconnect message: line %d: status %d: cause 0x%x\n",
- sc_adapter[card]->devicename,
- rcvmsg.phy_link_no,
- rcvmsg.rsp_status,
- rcvmsg.msg_data.byte_array[2]);
+ sc_adapter[card]->devicename,
+ rcvmsg.phy_link_no,
+ rcvmsg.rsp_status,
+ rcvmsg.msg_data.byte_array[2]);
- indicate_status(card, ISDN_STAT_BHUP,(unsigned long)rcvmsg.phy_link_no-1,NULL);
- indicate_status(card, ISDN_STAT_DHUP,(unsigned long)rcvmsg.phy_link_no-1,NULL);
+ indicate_status(card, ISDN_STAT_BHUP, (unsigned long)rcvmsg.phy_link_no - 1, NULL);
+ indicate_status(card, ISDN_STAT_DHUP, (unsigned long)rcvmsg.phy_link_no - 1, NULL);
continue;
}
@@ -158,10 +158,10 @@ irqreturn_t interrupt_handler(int dummy, void *card_inst)
*/
if (IS_CM_MESSAGE(rcvmsg, 5, 0, MiscEngineUp)) {
pr_debug("%s: Received EngineUp message\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
sc_adapter[card]->EngineUp = 1;
- sendmessage(card, CEPID,ceReqTypeCall,ceReqClass0,ceReqCallGetMyNumber,1,0,NULL);
- sendmessage(card, CEPID,ceReqTypeCall,ceReqClass0,ceReqCallGetMyNumber,2,0,NULL);
+ sendmessage(card, CEPID, ceReqTypeCall, ceReqClass0, ceReqCallGetMyNumber, 1, 0, NULL);
+ sendmessage(card, CEPID, ceReqTypeCall, ceReqClass0, ceReqCallGetMyNumber, 2, 0, NULL);
init_timer(&sc_adapter[card]->stat_timer);
sc_adapter[card]->stat_timer.function = check_phystat;
sc_adapter[card]->stat_timer.data = card;
@@ -175,25 +175,25 @@ irqreturn_t interrupt_handler(int dummy, void *card_inst)
*/
if (IS_CM_MESSAGE(rcvmsg, 2, 0, StartProc)) {
pr_debug("%s: StartProc Response Status %d\n",
- sc_adapter[card]->devicename,
- rcvmsg.rsp_status);
+ sc_adapter[card]->devicename,
+ rcvmsg.rsp_status);
continue;
}
/*
* Handle a GetMyNumber Rsp
*/
- if (IS_CE_MESSAGE(rcvmsg,Call,0,GetMyNumber)){
+ if (IS_CE_MESSAGE(rcvmsg, Call, 0, GetMyNumber)) {
strlcpy(sc_adapter[card]->channel[rcvmsg.phy_link_no - 1].dn,
rcvmsg.msg_data.byte_array,
sizeof(rcvmsg.msg_data.byte_array));
continue;
}
-
+
/*
* PhyStatus response
*/
- if(IS_CE_MESSAGE(rcvmsg, Phy, 2, Status)) {
+ if (IS_CE_MESSAGE(rcvmsg, Phy, 2, Status)) {
unsigned int b1stat, b2stat;
/*
@@ -204,30 +204,30 @@ irqreturn_t interrupt_handler(int dummy, void *card_inst)
sc_adapter[card]->nphystat = (b2stat >> 8) | b1stat; /* endian?? */
pr_debug("%s: PhyStat is 0x%2x\n",
- sc_adapter[card]->devicename,
- sc_adapter[card]->nphystat);
+ sc_adapter[card]->devicename,
+ sc_adapter[card]->nphystat);
continue;
}
- /*
+ /*
* Handle a GetFramFormat
*/
- if(IS_CE_MESSAGE(rcvmsg, Call, 0, GetFrameFormat)) {
- if(rcvmsg.msg_data.byte_array[0] != HDLC_PROTO) {
+ if (IS_CE_MESSAGE(rcvmsg, Call, 0, GetFrameFormat)) {
+ if (rcvmsg.msg_data.byte_array[0] != HDLC_PROTO) {
unsigned int proto = HDLC_PROTO;
/*
* Set board format to HDLC if it wasn't already
*/
pr_debug("%s: current frame format: 0x%x, will change to HDLC\n",
- sc_adapter[card]->devicename,
- rcvmsg.msg_data.byte_array[0]);
+ sc_adapter[card]->devicename,
+ rcvmsg.msg_data.byte_array[0]);
sendmessage(card, CEPID, ceReqTypeCall,
- ceReqClass0,
- ceReqCallSetFrameFormat,
- (unsigned char) channel +1,
- 1,&proto);
- }
+ ceReqClass0,
+ ceReqCallSetFrameFormat,
+ (unsigned char)channel + 1,
+ 1, &proto);
+ }
continue;
}
@@ -235,13 +235,13 @@ irqreturn_t interrupt_handler(int dummy, void *card_inst)
* Hmm...
*/
pr_debug("%s: Received unhandled message (%d,%d,%d) link %d\n",
- sc_adapter[card]->devicename,
- rcvmsg.type, rcvmsg.class, rcvmsg.code,
- rcvmsg.phy_link_no);
+ sc_adapter[card]->devicename,
+ rcvmsg.type, rcvmsg.class, rcvmsg.code,
+ rcvmsg.phy_link_no);
} /* while */
pr_debug("%s: Exiting Interrupt Handler\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
return IRQ_HANDLED;
}
diff --git a/drivers/isdn/sc/ioctl.c b/drivers/isdn/sc/ioctl.c
index 4cfdbe08ffd1..e63983aa1d27 100644
--- a/drivers/isdn/sc/ioctl.c
+++ b/drivers/isdn/sc/ioctl.c
@@ -30,11 +30,11 @@ int sc_ioctl(int card, scs_ioctl *data)
if (!rcvmsg)
return -ENOMEM;
- switch(data->command) {
+ switch (data->command) {
case SCIOCRESET: /* Perform a hard reset of the adapter */
{
pr_debug("%s: SCIOCRESET: ioctl received\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
sc_adapter[card]->StartOnReset = 0;
kfree(rcvmsg);
return reset(card);
@@ -50,10 +50,10 @@ int sc_ioctl(int card, scs_ioctl *data)
return -ENOMEM;
}
pr_debug("%s: SCIOLOAD: ioctl received\n",
- sc_adapter[card]->devicename);
- if(sc_adapter[card]->EngineUp) {
+ sc_adapter[card]->devicename);
+ if (sc_adapter[card]->EngineUp) {
pr_debug("%s: SCIOCLOAD: command failed, LoadProc while engine running.\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
kfree(rcvmsg);
kfree(srec);
return -1;
@@ -69,18 +69,18 @@ int sc_ioctl(int card, scs_ioctl *data)
}
status = send_and_receive(card, CMPID, cmReqType2, cmReqClass0, cmReqLoadProc,
- 0, SCIOC_SRECSIZE, srec, rcvmsg, SAR_TIMEOUT);
+ 0, SCIOC_SRECSIZE, srec, rcvmsg, SAR_TIMEOUT);
kfree(rcvmsg);
kfree(srec);
- if(status) {
- pr_debug("%s: SCIOCLOAD: command failed, status = %d\n",
- sc_adapter[card]->devicename, status);
+ if (status) {
+ pr_debug("%s: SCIOCLOAD: command failed, status = %d\n",
+ sc_adapter[card]->devicename, status);
return -1;
}
else {
pr_debug("%s: SCIOCLOAD: command successful\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
return 0;
}
}
@@ -89,10 +89,10 @@ int sc_ioctl(int card, scs_ioctl *data)
{
kfree(rcvmsg);
pr_debug("%s: SCIOSTART: ioctl received\n",
- sc_adapter[card]->devicename);
- if(sc_adapter[card]->EngineUp) {
+ sc_adapter[card]->devicename);
+ if (sc_adapter[card]->EngineUp) {
pr_debug("%s: SCIOCSTART: command failed, engine already running.\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
return -1;
}
@@ -104,7 +104,7 @@ int sc_ioctl(int card, scs_ioctl *data)
case SCIOCSETSWITCH:
{
pr_debug("%s: SCIOSETSWITCH: ioctl received\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
/*
* Get the switch type from user space
@@ -115,41 +115,41 @@ int sc_ioctl(int card, scs_ioctl *data)
}
pr_debug("%s: SCIOCSETSWITCH: setting switch type to %d\n",
- sc_adapter[card]->devicename,
- switchtype);
+ sc_adapter[card]->devicename,
+ switchtype);
status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, ceReqCallSetSwitchType,
- 0, sizeof(char),&switchtype, rcvmsg, SAR_TIMEOUT);
- if(!status && !(rcvmsg->rsp_status)) {
+ 0, sizeof(char), &switchtype, rcvmsg, SAR_TIMEOUT);
+ if (!status && !(rcvmsg->rsp_status)) {
pr_debug("%s: SCIOCSETSWITCH: command successful\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
kfree(rcvmsg);
return 0;
}
else {
pr_debug("%s: SCIOCSETSWITCH: command failed (status = %d)\n",
- sc_adapter[card]->devicename, status);
+ sc_adapter[card]->devicename, status);
kfree(rcvmsg);
return status;
}
}
-
+
case SCIOCGETSWITCH:
{
pr_debug("%s: SCIOGETSWITCH: ioctl received\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
/*
* Get the switch type from the board
*/
- status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0,
- ceReqCallGetSwitchType, 0, 0, NULL, rcvmsg, SAR_TIMEOUT);
+ status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0,
+ ceReqCallGetSwitchType, 0, 0, NULL, rcvmsg, SAR_TIMEOUT);
if (!status && !(rcvmsg->rsp_status)) {
pr_debug("%s: SCIOCGETSWITCH: command successful\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
}
else {
pr_debug("%s: SCIOCGETSWITCH: command failed (status = %d)\n",
- sc_adapter[card]->devicename, status);
+ sc_adapter[card]->devicename, status);
kfree(rcvmsg);
return status;
}
@@ -172,7 +172,7 @@ int sc_ioctl(int card, scs_ioctl *data)
case SCIOCGETSPID:
{
pr_debug("%s: SCIOGETSPID: ioctl received\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
spid = kzalloc(SCIOC_SPIDSIZE, GFP_KERNEL);
if (!spid) {
@@ -183,13 +183,13 @@ int sc_ioctl(int card, scs_ioctl *data)
* Get the spid from the board
*/
status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, ceReqCallGetSPID,
- data->channel, 0, NULL, rcvmsg, SAR_TIMEOUT);
+ data->channel, 0, NULL, rcvmsg, SAR_TIMEOUT);
if (!status) {
pr_debug("%s: SCIOCGETSPID: command successful\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
} else {
pr_debug("%s: SCIOCGETSPID: command failed (status = %d)\n",
- sc_adapter[card]->devicename, status);
+ sc_adapter[card]->devicename, status);
kfree(spid);
kfree(rcvmsg);
return status;
@@ -208,12 +208,12 @@ int sc_ioctl(int card, scs_ioctl *data)
kfree(spid);
kfree(rcvmsg);
return 0;
- }
+ }
case SCIOCSETSPID:
{
pr_debug("%s: DCBIOSETSPID: ioctl received\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
/*
* Get the spid from user space
@@ -224,21 +224,21 @@ int sc_ioctl(int card, scs_ioctl *data)
return PTR_ERR(spid);
}
- pr_debug("%s: SCIOCSETSPID: setting channel %d spid to %s\n",
- sc_adapter[card]->devicename, data->channel, spid);
- status = send_and_receive(card, CEPID, ceReqTypeCall,
- ceReqClass0, ceReqCallSetSPID, data->channel,
- strlen(spid), spid, rcvmsg, SAR_TIMEOUT);
- if(!status && !(rcvmsg->rsp_status)) {
- pr_debug("%s: SCIOCSETSPID: command successful\n",
- sc_adapter[card]->devicename);
+ pr_debug("%s: SCIOCSETSPID: setting channel %d spid to %s\n",
+ sc_adapter[card]->devicename, data->channel, spid);
+ status = send_and_receive(card, CEPID, ceReqTypeCall,
+ ceReqClass0, ceReqCallSetSPID, data->channel,
+ strlen(spid), spid, rcvmsg, SAR_TIMEOUT);
+ if (!status && !(rcvmsg->rsp_status)) {
+ pr_debug("%s: SCIOCSETSPID: command successful\n",
+ sc_adapter[card]->devicename);
kfree(rcvmsg);
kfree(spid);
return 0;
}
else {
pr_debug("%s: SCIOCSETSPID: command failed (status = %d)\n",
- sc_adapter[card]->devicename, status);
+ sc_adapter[card]->devicename, status);
kfree(rcvmsg);
kfree(spid);
return status;
@@ -248,20 +248,20 @@ int sc_ioctl(int card, scs_ioctl *data)
case SCIOCGETDN:
{
pr_debug("%s: SCIOGETDN: ioctl received\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
/*
* Get the dn from the board
*/
status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, ceReqCallGetMyNumber,
- data->channel, 0, NULL, rcvmsg, SAR_TIMEOUT);
+ data->channel, 0, NULL, rcvmsg, SAR_TIMEOUT);
if (!status) {
pr_debug("%s: SCIOCGETDN: command successful\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
}
else {
pr_debug("%s: SCIOCGETDN: command failed (status = %d)\n",
- sc_adapter[card]->devicename, status);
+ sc_adapter[card]->devicename, status);
kfree(rcvmsg);
return status;
}
@@ -283,12 +283,12 @@ int sc_ioctl(int card, scs_ioctl *data)
}
kfree(dn);
return 0;
- }
+ }
case SCIOCSETDN:
{
pr_debug("%s: SCIOSETDN: ioctl received\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
/*
* Get the spid from user space
@@ -299,21 +299,21 @@ int sc_ioctl(int card, scs_ioctl *data)
return PTR_ERR(dn);
}
- pr_debug("%s: SCIOCSETDN: setting channel %d dn to %s\n",
- sc_adapter[card]->devicename, data->channel, dn);
- status = send_and_receive(card, CEPID, ceReqTypeCall,
- ceReqClass0, ceReqCallSetMyNumber, data->channel,
- strlen(dn),dn,rcvmsg, SAR_TIMEOUT);
- if(!status && !(rcvmsg->rsp_status)) {
- pr_debug("%s: SCIOCSETDN: command successful\n",
- sc_adapter[card]->devicename);
+ pr_debug("%s: SCIOCSETDN: setting channel %d dn to %s\n",
+ sc_adapter[card]->devicename, data->channel, dn);
+ status = send_and_receive(card, CEPID, ceReqTypeCall,
+ ceReqClass0, ceReqCallSetMyNumber, data->channel,
+ strlen(dn), dn, rcvmsg, SAR_TIMEOUT);
+ if (!status && !(rcvmsg->rsp_status)) {
+ pr_debug("%s: SCIOCSETDN: command successful\n",
+ sc_adapter[card]->devicename);
kfree(rcvmsg);
kfree(dn);
return 0;
}
else {
pr_debug("%s: SCIOCSETDN: command failed (status = %d)\n",
- sc_adapter[card]->devicename, status);
+ sc_adapter[card]->devicename, status);
kfree(rcvmsg);
kfree(dn);
return status;
@@ -323,11 +323,11 @@ int sc_ioctl(int card, scs_ioctl *data)
case SCIOCTRACE:
pr_debug("%s: SCIOTRACE: ioctl received\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
/* sc_adapter[card]->trace = !sc_adapter[card]->trace;
pr_debug("%s: SCIOCTRACE: tracing turned %s\n",
- sc_adapter[card]->devicename,
- sc_adapter[card]->trace ? "ON" : "OFF"); */
+ sc_adapter[card]->devicename,
+ sc_adapter[card]->trace ? "ON" : "OFF"); */
break;
case SCIOCSTAT:
@@ -335,7 +335,7 @@ int sc_ioctl(int card, scs_ioctl *data)
boardInfo *bi;
pr_debug("%s: SCIOSTAT: ioctl received\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
bi = kzalloc(sizeof(boardInfo), GFP_KERNEL);
if (!bi) {
@@ -358,20 +358,20 @@ int sc_ioctl(int card, scs_ioctl *data)
case SCIOCGETSPEED:
{
pr_debug("%s: SCIOGETSPEED: ioctl received\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
/*
* Get the speed from the board
*/
- status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0,
- ceReqCallGetCallType, data->channel, 0, NULL, rcvmsg, SAR_TIMEOUT);
+ status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0,
+ ceReqCallGetCallType, data->channel, 0, NULL, rcvmsg, SAR_TIMEOUT);
if (!status && !(rcvmsg->rsp_status)) {
pr_debug("%s: SCIOCGETSPEED: command successful\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
}
else {
pr_debug("%s: SCIOCGETSPEED: command failed (status = %d)\n",
- sc_adapter[card]->devicename, status);
+ sc_adapter[card]->devicename, status);
kfree(rcvmsg);
return status;
}
@@ -392,12 +392,12 @@ int sc_ioctl(int card, scs_ioctl *data)
case SCIOCSETSPEED:
pr_debug("%s: SCIOCSETSPEED: ioctl received\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
break;
case SCIOCLOOPTST:
pr_debug("%s: SCIOCLOOPTST: ioctl received\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
break;
default:
@@ -432,32 +432,32 @@ static int GetStatus(int card, boardInfo *bi)
* Get the current PhyStats and LnkStats
*/
status = send_and_receive(card, CEPID, ceReqTypePhy, ceReqClass2,
- ceReqPhyStatus, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT);
- if(!status) {
- if(sc_adapter[card]->model < PRI_BOARD) {
+ ceReqPhyStatus, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT);
+ if (!status) {
+ if (sc_adapter[card]->model < PRI_BOARD) {
bi->l1_status = rcvmsg.msg_data.byte_array[2];
- for(i = 0 ; i < BRI_CHANNELS ; i++)
+ for (i = 0; i < BRI_CHANNELS; i++)
bi->status.bristats[i].phy_stat =
rcvmsg.msg_data.byte_array[i];
}
else {
bi->l1_status = rcvmsg.msg_data.byte_array[0];
bi->l2_status = rcvmsg.msg_data.byte_array[1];
- for(i = 0 ; i < PRI_CHANNELS ; i++)
- bi->status.pristats[i].phy_stat =
- rcvmsg.msg_data.byte_array[i+2];
+ for (i = 0; i < PRI_CHANNELS; i++)
+ bi->status.pristats[i].phy_stat =
+ rcvmsg.msg_data.byte_array[i + 2];
}
}
-
+
/*
* Get the call types for each channel
*/
- for (i = 0 ; i < sc_adapter[card]->nChannels ; i++) {
+ for (i = 0; i < sc_adapter[card]->nChannels; i++) {
status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0,
- ceReqCallGetCallType, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT);
- if(!status) {
+ ceReqCallGetCallType, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT);
+ if (!status) {
if (sc_adapter[card]->model == PRI_BOARD) {
- bi->status.pristats[i].call_type =
+ bi->status.pristats[i].call_type =
rcvmsg.msg_data.byte_array[0];
}
else {
@@ -466,7 +466,7 @@ static int GetStatus(int card, boardInfo *bi)
}
}
}
-
+
/*
* If PRI, get the call states and service states for each channel
*/
@@ -475,10 +475,10 @@ static int GetStatus(int card, boardInfo *bi)
* Get the call states
*/
status = send_and_receive(card, CEPID, ceReqTypeStat, ceReqClass2,
- ceReqPhyChCallState, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT);
- if(!status) {
- for( i = 0 ; i < PRI_CHANNELS ; i++ )
- bi->status.pristats[i].call_state =
+ ceReqPhyChCallState, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT);
+ if (!status) {
+ for (i = 0; i < PRI_CHANNELS; i++)
+ bi->status.pristats[i].call_state =
rcvmsg.msg_data.byte_array[i];
}
@@ -486,27 +486,27 @@ static int GetStatus(int card, boardInfo *bi)
* Get the service states
*/
status = send_and_receive(card, CEPID, ceReqTypeStat, ceReqClass2,
- ceReqPhyChServState, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT);
- if(!status) {
- for( i = 0 ; i < PRI_CHANNELS ; i++ )
- bi->status.pristats[i].serv_state =
+ ceReqPhyChServState, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT);
+ if (!status) {
+ for (i = 0; i < PRI_CHANNELS; i++)
+ bi->status.pristats[i].serv_state =
rcvmsg.msg_data.byte_array[i];
}
/*
* Get the link stats for the channels
*/
- for (i = 1 ; i <= PRI_CHANNELS ; i++) {
+ for (i = 1; i <= PRI_CHANNELS; i++) {
status = send_and_receive(card, CEPID, ceReqTypeLnk, ceReqClass0,
- ceReqLnkGetStats, i, 0, NULL, &rcvmsg, SAR_TIMEOUT);
+ ceReqLnkGetStats, i, 0, NULL, &rcvmsg, SAR_TIMEOUT);
if (!status) {
- bi->status.pristats[i-1].link_stats.tx_good =
+ bi->status.pristats[i - 1].link_stats.tx_good =
(unsigned long)rcvmsg.msg_data.byte_array[0];
- bi->status.pristats[i-1].link_stats.tx_bad =
+ bi->status.pristats[i - 1].link_stats.tx_bad =
(unsigned long)rcvmsg.msg_data.byte_array[4];
- bi->status.pristats[i-1].link_stats.rx_good =
+ bi->status.pristats[i - 1].link_stats.rx_good =
(unsigned long)rcvmsg.msg_data.byte_array[8];
- bi->status.pristats[i-1].link_stats.rx_bad =
+ bi->status.pristats[i - 1].link_stats.rx_bad =
(unsigned long)rcvmsg.msg_data.byte_array[12];
}
}
@@ -515,7 +515,7 @@ static int GetStatus(int card, boardInfo *bi)
* Link stats for the D channel
*/
status = send_and_receive(card, CEPID, ceReqTypeLnk, ceReqClass0,
- ceReqLnkGetStats, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT);
+ ceReqLnkGetStats, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT);
if (!status) {
bi->dch_stats.tx_good = (unsigned long)rcvmsg.msg_data.byte_array[0];
bi->dch_stats.tx_bad = (unsigned long)rcvmsg.msg_data.byte_array[4];
@@ -534,49 +534,49 @@ static int GetStatus(int card, boardInfo *bi)
* Get the link stats for the channels
*/
status = send_and_receive(card, CEPID, ceReqTypeLnk, ceReqClass0,
- ceReqLnkGetStats, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT);
+ ceReqLnkGetStats, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT);
if (!status) {
bi->dch_stats.tx_good = (unsigned long)rcvmsg.msg_data.byte_array[0];
bi->dch_stats.tx_bad = (unsigned long)rcvmsg.msg_data.byte_array[4];
bi->dch_stats.rx_good = (unsigned long)rcvmsg.msg_data.byte_array[8];
bi->dch_stats.rx_bad = (unsigned long)rcvmsg.msg_data.byte_array[12];
- bi->status.bristats[0].link_stats.tx_good =
+ bi->status.bristats[0].link_stats.tx_good =
(unsigned long)rcvmsg.msg_data.byte_array[16];
- bi->status.bristats[0].link_stats.tx_bad =
+ bi->status.bristats[0].link_stats.tx_bad =
(unsigned long)rcvmsg.msg_data.byte_array[20];
- bi->status.bristats[0].link_stats.rx_good =
+ bi->status.bristats[0].link_stats.rx_good =
(unsigned long)rcvmsg.msg_data.byte_array[24];
- bi->status.bristats[0].link_stats.rx_bad =
+ bi->status.bristats[0].link_stats.rx_bad =
(unsigned long)rcvmsg.msg_data.byte_array[28];
- bi->status.bristats[1].link_stats.tx_good =
+ bi->status.bristats[1].link_stats.tx_good =
(unsigned long)rcvmsg.msg_data.byte_array[32];
- bi->status.bristats[1].link_stats.tx_bad =
+ bi->status.bristats[1].link_stats.tx_bad =
(unsigned long)rcvmsg.msg_data.byte_array[36];
- bi->status.bristats[1].link_stats.rx_good =
+ bi->status.bristats[1].link_stats.rx_good =
(unsigned long)rcvmsg.msg_data.byte_array[40];
- bi->status.bristats[1].link_stats.rx_bad =
+ bi->status.bristats[1].link_stats.rx_bad =
(unsigned long)rcvmsg.msg_data.byte_array[44];
}
/*
* Get the SPIDs
*/
- for (i = 0 ; i < BRI_CHANNELS ; i++) {
+ for (i = 0; i < BRI_CHANNELS; i++) {
status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0,
- ceReqCallGetSPID, i+1, 0, NULL, &rcvmsg, SAR_TIMEOUT);
+ ceReqCallGetSPID, i + 1, 0, NULL, &rcvmsg, SAR_TIMEOUT);
if (!status)
strcpy(bi->status.bristats[i].spid, rcvmsg.msg_data.byte_array);
}
-
+
/*
* Get the DNs
*/
- for (i = 0 ; i < BRI_CHANNELS ; i++) {
+ for (i = 0; i < BRI_CHANNELS; i++) {
status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0,
- ceReqCallGetMyNumber, i+1, 0, NULL, &rcvmsg, SAR_TIMEOUT);
+ ceReqCallGetMyNumber, i + 1, 0, NULL, &rcvmsg, SAR_TIMEOUT);
if (!status)
strcpy(bi->status.bristats[i].dn, rcvmsg.msg_data.byte_array);
}
-
+
return 0;
}
diff --git a/drivers/isdn/sc/message.c b/drivers/isdn/sc/message.c
index 0b4c4f15abdd..9679a1902b32 100644
--- a/drivers/isdn/sc/message.c
+++ b/drivers/isdn/sc/message.c
@@ -25,7 +25,7 @@
/*
* receive a message from the board
*/
-int receivemessage(int card, RspMessage *rspmsg)
+int receivemessage(int card, RspMessage *rspmsg)
{
DualPortMemory *dpm;
unsigned long flags;
@@ -34,9 +34,9 @@ int receivemessage(int card, RspMessage *rspmsg)
pr_debug("Invalid param: %d is not a valid card id\n", card);
return -EINVAL;
}
-
+
pr_debug("%s: Entered receivemessage\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
/*
* See if there are messages waiting
@@ -47,47 +47,47 @@ int receivemessage(int card, RspMessage *rspmsg)
*/
spin_lock_irqsave(&sc_adapter[card]->lock, flags);
outb((sc_adapter[card]->shmem_magic >> 14) | 0x80,
- sc_adapter[card]->ioport[sc_adapter[card]->shmem_pgport]);
+ sc_adapter[card]->ioport[sc_adapter[card]->shmem_pgport]);
dpm = (DualPortMemory *) sc_adapter[card]->rambase;
- memcpy_fromio(rspmsg, &(dpm->rsp_queue[dpm->rsp_tail]),
- MSG_LEN);
- dpm->rsp_tail = (dpm->rsp_tail+1) % MAX_MESSAGES;
+ memcpy_fromio(rspmsg, &(dpm->rsp_queue[dpm->rsp_tail]),
+ MSG_LEN);
+ dpm->rsp_tail = (dpm->rsp_tail + 1) % MAX_MESSAGES;
inb(sc_adapter[card]->ioport[FIFO_READ]);
spin_unlock_irqrestore(&sc_adapter[card]->lock, flags);
/*
* Tell the board that the message is received
*/
pr_debug("%s: Received Message seq:%d pid:%d time:%d cmd:%d "
- "cnt:%d (type,class,code):(%d,%d,%d) "
- "link:%d stat:0x%x\n",
- sc_adapter[card]->devicename,
- rspmsg->sequence_no,
- rspmsg->process_id,
- rspmsg->time_stamp,
- rspmsg->cmd_sequence_no,
- rspmsg->msg_byte_cnt,
- rspmsg->type,
- rspmsg->class,
- rspmsg->code,
- rspmsg->phy_link_no,
- rspmsg->rsp_status);
+ "cnt:%d (type,class,code):(%d,%d,%d) "
+ "link:%d stat:0x%x\n",
+ sc_adapter[card]->devicename,
+ rspmsg->sequence_no,
+ rspmsg->process_id,
+ rspmsg->time_stamp,
+ rspmsg->cmd_sequence_no,
+ rspmsg->msg_byte_cnt,
+ rspmsg->type,
+ rspmsg->class,
+ rspmsg->code,
+ rspmsg->phy_link_no,
+ rspmsg->rsp_status);
return 0;
}
return -ENOMSG;
}
-
+
/*
* send a message to the board
*/
int sendmessage(int card,
unsigned int procid,
- unsigned int type,
- unsigned int class,
+ unsigned int type,
+ unsigned int class,
unsigned int code,
- unsigned int link,
- unsigned int data_len,
- unsigned int *data)
+ unsigned int link,
+ unsigned int data_len,
+ unsigned int *data)
{
DualPortMemory *dpm;
ReqMessage sndmsg;
@@ -102,15 +102,15 @@ int sendmessage(int card,
* Make sure we only send CEPID messages when the engine is up
* and CMPID messages when it is down
*/
- if(sc_adapter[card]->EngineUp && procid == CMPID) {
+ if (sc_adapter[card]->EngineUp && procid == CMPID) {
pr_debug("%s: Attempt to send CM message with engine up\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
return -ESRCH;
}
- if(!sc_adapter[card]->EngineUp && procid == CEPID) {
+ if (!sc_adapter[card]->EngineUp && procid == CEPID) {
pr_debug("%s: Attempt to send CE message with engine down\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
return -ESRCH;
}
@@ -142,39 +142,39 @@ int sendmessage(int card,
*/
spin_lock_irqsave(&sc_adapter[card]->lock, flags);
outb((sc_adapter[card]->shmem_magic >> 14) | 0x80,
- sc_adapter[card]->ioport[sc_adapter[card]->shmem_pgport]);
+ sc_adapter[card]->ioport[sc_adapter[card]->shmem_pgport]);
dpm = (DualPortMemory *) sc_adapter[card]->rambase; /* Fix me */
- memcpy_toio(&(dpm->req_queue[dpm->req_head]),&sndmsg,MSG_LEN);
- dpm->req_head = (dpm->req_head+1) % MAX_MESSAGES;
+ memcpy_toio(&(dpm->req_queue[dpm->req_head]), &sndmsg, MSG_LEN);
+ dpm->req_head = (dpm->req_head + 1) % MAX_MESSAGES;
outb(sndmsg.sequence_no, sc_adapter[card]->ioport[FIFO_WRITE]);
spin_unlock_irqrestore(&sc_adapter[card]->lock, flags);
-
+
pr_debug("%s: Sent Message seq:%d pid:%d time:%d "
- "cnt:%d (type,class,code):(%d,%d,%d) "
- "link:%d\n ",
- sc_adapter[card]->devicename,
- sndmsg.sequence_no,
- sndmsg.process_id,
- sndmsg.time_stamp,
- sndmsg.msg_byte_cnt,
- sndmsg.type,
- sndmsg.class,
- sndmsg.code,
- sndmsg.phy_link_no);
-
+ "cnt:%d (type,class,code):(%d,%d,%d) "
+ "link:%d\n ",
+ sc_adapter[card]->devicename,
+ sndmsg.sequence_no,
+ sndmsg.process_id,
+ sndmsg.time_stamp,
+ sndmsg.msg_byte_cnt,
+ sndmsg.type,
+ sndmsg.class,
+ sndmsg.code,
+ sndmsg.phy_link_no);
+
return 0;
}
int send_and_receive(int card,
- unsigned int procid,
- unsigned char type,
- unsigned char class,
- unsigned char code,
- unsigned char link,
- unsigned char data_len,
- unsigned char *data,
- RspMessage *mesgdata,
- int timeout)
+ unsigned int procid,
+ unsigned char type,
+ unsigned char class,
+ unsigned char code,
+ unsigned char link,
+ unsigned char data_len,
+ unsigned char *data,
+ RspMessage *mesgdata,
+ int timeout)
{
int retval;
int tries;
@@ -185,12 +185,12 @@ int send_and_receive(int card,
}
sc_adapter[card]->want_async_messages = 1;
- retval = sendmessage(card, procid, type, class, code, link,
- data_len, (unsigned int *) data);
-
+ retval = sendmessage(card, procid, type, class, code, link,
+ data_len, (unsigned int *) data);
+
if (retval) {
pr_debug("%s: SendMessage failed in SAR\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
sc_adapter[card]->want_async_messages = 0;
return -EIO;
}
@@ -199,7 +199,7 @@ int send_and_receive(int card,
/* wait for the response */
while (tries < timeout) {
schedule_timeout_interruptible(1);
-
+
pr_debug("SAR waiting..\n");
/*
@@ -214,14 +214,14 @@ int send_and_receive(int card,
* Got it!
*/
pr_debug("%s: Got ASYNC message\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
memcpy(mesgdata, &(sc_adapter[card]->async_msg),
- sizeof(RspMessage));
+ sizeof(RspMessage));
sc_adapter[card]->want_async_messages = 0;
return 0;
}
- tries++;
+ tries++;
}
pr_debug("%s: SAR message timeout\n", sc_adapter[card]->devicename);
diff --git a/drivers/isdn/sc/message.h b/drivers/isdn/sc/message.h
index 8eb15e7306b2..5e6f4a5c15f8 100644
--- a/drivers/isdn/sc/message.h
+++ b/drivers/isdn/sc/message.h
@@ -21,7 +21,7 @@
/*
* Board message macros, defines and structures
*/
-
+
#ifndef MESSAGE_H
#define MESSAGE_H
@@ -36,19 +36,19 @@
* Macro to determine if a message is a loader message
*/
#define IS_CM_MESSAGE(mesg, tx, cx, dx) \
- ((mesg.type == cmRspType##tx) \
- &&(mesg.class == cmRspClass##cx) \
- &&(mesg.code == cmRsp##dx))
+ ((mesg.type == cmRspType##tx) \
+ && (mesg.class == cmRspClass##cx) \
+ && (mesg.code == cmRsp##dx))
/*
* Macro to determine if a message is a firmware message
*/
#define IS_CE_MESSAGE(mesg, tx, cx, dx) \
- ((mesg.type == ceRspType##tx) \
- &&(mesg.class == ceRspClass##cx) \
- &&(mesg.code == ceRsp##tx##dx))
+ ((mesg.type == ceRspType##tx) \
+ && (mesg.class == ceRspClass##cx) \
+ && (mesg.code == ceRsp##tx##dx))
-/*
+/*
* Loader Request and Response Messages
*/
@@ -186,7 +186,7 @@ typedef struct {
} LLData;
-/*
+/*
* Message payload template for an HWConfig message
*/
typedef struct {
diff --git a/drivers/isdn/sc/packet.c b/drivers/isdn/sc/packet.c
index 5ff6ae868440..2446957085e0 100644
--- a/drivers/isdn/sc/packet.c
+++ b/drivers/isdn/sc/packet.c
@@ -29,27 +29,27 @@ int sndpkt(int devId, int channel, int ack, struct sk_buff *data)
card = get_card_from_id(devId);
- if(!IS_VALID_CARD(card)) {
+ if (!IS_VALID_CARD(card)) {
pr_debug("invalid param: %d is not a valid card id\n", card);
return -ENODEV;
}
pr_debug("%s: sndpkt: frst = 0x%lx nxt = %d f = %d n = %d\n",
- sc_adapter[card]->devicename,
- sc_adapter[card]->channel[channel].first_sendbuf,
- sc_adapter[card]->channel[channel].next_sendbuf,
- sc_adapter[card]->channel[channel].free_sendbufs,
- sc_adapter[card]->channel[channel].num_sendbufs);
+ sc_adapter[card]->devicename,
+ sc_adapter[card]->channel[channel].first_sendbuf,
+ sc_adapter[card]->channel[channel].next_sendbuf,
+ sc_adapter[card]->channel[channel].free_sendbufs,
+ sc_adapter[card]->channel[channel].num_sendbufs);
- if(!sc_adapter[card]->channel[channel].free_sendbufs) {
+ if (!sc_adapter[card]->channel[channel].free_sendbufs) {
pr_debug("%s: out of TX buffers\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
return -EINVAL;
}
- if(data->len > BUFFER_SIZE) {
+ if (data->len > BUFFER_SIZE) {
pr_debug("%s: data overflows buffer size (data > buffer)\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
return -EINVAL;
}
@@ -57,24 +57,24 @@ int sndpkt(int devId, int channel, int ack, struct sk_buff *data)
BUFFER_SIZE + sc_adapter[card]->channel[channel].first_sendbuf;
ReqLnkWrite.msg_len = data->len; /* sk_buff size */
pr_debug("%s: writing %d bytes to buffer offset 0x%lx\n",
- sc_adapter[card]->devicename,
- ReqLnkWrite.msg_len, ReqLnkWrite.buff_offset);
+ sc_adapter[card]->devicename,
+ ReqLnkWrite.msg_len, ReqLnkWrite.buff_offset);
memcpy_toshmem(card, (char *)ReqLnkWrite.buff_offset, data->data, ReqLnkWrite.msg_len);
/*
* sendmessage
*/
pr_debug("%s: sndpkt size=%d, buf_offset=0x%lx buf_indx=%d\n",
- sc_adapter[card]->devicename,
- ReqLnkWrite.msg_len, ReqLnkWrite.buff_offset,
- sc_adapter[card]->channel[channel].next_sendbuf);
+ sc_adapter[card]->devicename,
+ ReqLnkWrite.msg_len, ReqLnkWrite.buff_offset,
+ sc_adapter[card]->channel[channel].next_sendbuf);
status = sendmessage(card, CEPID, ceReqTypeLnk, ceReqClass1, ceReqLnkWrite,
- channel+1, sizeof(LLData), (unsigned int*)&ReqLnkWrite);
+ channel + 1, sizeof(LLData), (unsigned int *)&ReqLnkWrite);
len = data->len;
- if(status) {
+ if (status) {
pr_debug("%s: failed to send packet, status = %d\n",
- sc_adapter[card]->devicename, status);
+ sc_adapter[card]->devicename, status);
return -1;
}
else {
@@ -83,9 +83,9 @@ int sndpkt(int devId, int channel, int ack, struct sk_buff *data)
++sc_adapter[card]->channel[channel].next_sendbuf ==
sc_adapter[card]->channel[channel].num_sendbufs ? 0 :
sc_adapter[card]->channel[channel].next_sendbuf;
- pr_debug("%s: packet sent successfully\n", sc_adapter[card]->devicename);
+ pr_debug("%s: packet sent successfully\n", sc_adapter[card]->devicename);
dev_kfree_skb(data);
- indicate_status(card,ISDN_STAT_BSENT,channel, (char *)&len);
+ indicate_status(card, ISDN_STAT_BSENT, channel, (char *)&len);
}
return len;
}
@@ -95,49 +95,49 @@ void rcvpkt(int card, RspMessage *rcvmsg)
LLData newll;
struct sk_buff *skb;
- if(!IS_VALID_CARD(card)) {
+ if (!IS_VALID_CARD(card)) {
pr_debug("invalid param: %d is not a valid card id\n", card);
return;
}
- switch(rcvmsg->rsp_status){
+ switch (rcvmsg->rsp_status) {
case 0x01:
case 0x02:
case 0x70:
pr_debug("%s: error status code: 0x%x\n",
- sc_adapter[card]->devicename, rcvmsg->rsp_status);
+ sc_adapter[card]->devicename, rcvmsg->rsp_status);
return;
- case 0x00:
- if (!(skb = dev_alloc_skb(rcvmsg->msg_data.response.msg_len))) {
+ case 0x00:
+ if (!(skb = dev_alloc_skb(rcvmsg->msg_data.response.msg_len))) {
printk(KERN_WARNING "%s: rcvpkt out of memory, dropping packet\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
return;
}
skb_put(skb, rcvmsg->msg_data.response.msg_len);
pr_debug("%s: getting data from offset: 0x%lx\n",
- sc_adapter[card]->devicename,
- rcvmsg->msg_data.response.buff_offset);
+ sc_adapter[card]->devicename,
+ rcvmsg->msg_data.response.buff_offset);
memcpy_fromshmem(card,
- skb_put(skb, rcvmsg->msg_data.response.msg_len),
- (char *)rcvmsg->msg_data.response.buff_offset,
- rcvmsg->msg_data.response.msg_len);
+ skb_put(skb, rcvmsg->msg_data.response.msg_len),
+ (char *)rcvmsg->msg_data.response.buff_offset,
+ rcvmsg->msg_data.response.msg_len);
sc_adapter[card]->card->rcvcallb_skb(sc_adapter[card]->driverId,
- rcvmsg->phy_link_no-1, skb);
+ rcvmsg->phy_link_no - 1, skb);
case 0x03:
/*
- * Recycle the buffer
- */
+ * Recycle the buffer
+ */
pr_debug("%s: buffer size : %d\n",
- sc_adapter[card]->devicename, BUFFER_SIZE);
+ sc_adapter[card]->devicename, BUFFER_SIZE);
/* memset_shmem(card, rcvmsg->msg_data.response.buff_offset, 0, BUFFER_SIZE); */
newll.buff_offset = rcvmsg->msg_data.response.buff_offset;
newll.msg_len = BUFFER_SIZE;
pr_debug("%s: recycled buffer at offset 0x%lx size %d\n",
- sc_adapter[card]->devicename,
- newll.buff_offset, newll.msg_len);
+ sc_adapter[card]->devicename,
+ newll.buff_offset, newll.msg_len);
sendmessage(card, CEPID, ceReqTypeLnk, ceReqClass1, ceReqLnkRead,
- rcvmsg->phy_link_no, sizeof(LLData), (unsigned int *)&newll);
+ rcvmsg->phy_link_no, sizeof(LLData), (unsigned int *)&newll);
}
}
@@ -148,7 +148,7 @@ int setup_buffers(int card, int c)
unsigned int buffer_size;
LLData RcvBuffOffset;
- if(!IS_VALID_CARD(card)) {
+ if (!IS_VALID_CARD(card)) {
pr_debug("invalid param: %d is not a valid card id\n", card);
return -ENODEV;
}
@@ -157,49 +157,48 @@ int setup_buffers(int card, int c)
* Calculate the buffer offsets (send/recv/send/recv)
*/
pr_debug("%s: setting up channel buffer space in shared RAM\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
buffer_size = BUFFER_SIZE;
nBuffers = ((sc_adapter[card]->ramsize - BUFFER_BASE) / buffer_size) / 2;
nBuffers = nBuffers > BUFFERS_MAX ? BUFFERS_MAX : nBuffers;
pr_debug("%s: calculating buffer space: %d buffers, %d big\n",
- sc_adapter[card]->devicename,
- nBuffers, buffer_size);
- if(nBuffers < 2) {
+ sc_adapter[card]->devicename,
+ nBuffers, buffer_size);
+ if (nBuffers < 2) {
pr_debug("%s: not enough buffer space\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
return -1;
}
cBase = (nBuffers * buffer_size) * (c - 1);
pr_debug("%s: channel buffer offset from shared RAM: 0x%x\n",
- sc_adapter[card]->devicename, cBase);
- sc_adapter[card]->channel[c-1].first_sendbuf = BUFFER_BASE + cBase;
- sc_adapter[card]->channel[c-1].num_sendbufs = nBuffers / 2;
- sc_adapter[card]->channel[c-1].free_sendbufs = nBuffers / 2;
- sc_adapter[card]->channel[c-1].next_sendbuf = 0;
+ sc_adapter[card]->devicename, cBase);
+ sc_adapter[card]->channel[c - 1].first_sendbuf = BUFFER_BASE + cBase;
+ sc_adapter[card]->channel[c - 1].num_sendbufs = nBuffers / 2;
+ sc_adapter[card]->channel[c - 1].free_sendbufs = nBuffers / 2;
+ sc_adapter[card]->channel[c - 1].next_sendbuf = 0;
pr_debug("%s: send buffer setup complete: first=0x%lx n=%d f=%d, nxt=%d\n",
- sc_adapter[card]->devicename,
- sc_adapter[card]->channel[c-1].first_sendbuf,
- sc_adapter[card]->channel[c-1].num_sendbufs,
- sc_adapter[card]->channel[c-1].free_sendbufs,
- sc_adapter[card]->channel[c-1].next_sendbuf);
+ sc_adapter[card]->devicename,
+ sc_adapter[card]->channel[c - 1].first_sendbuf,
+ sc_adapter[card]->channel[c - 1].num_sendbufs,
+ sc_adapter[card]->channel[c - 1].free_sendbufs,
+ sc_adapter[card]->channel[c - 1].next_sendbuf);
/*
* Prep the receive buffers
*/
pr_debug("%s: adding %d RecvBuffers:\n",
- sc_adapter[card]->devicename, nBuffers /2);
- for (i = 0 ; i < nBuffers / 2; i++) {
- RcvBuffOffset.buff_offset =
- ((sc_adapter[card]->channel[c-1].first_sendbuf +
- (nBuffers / 2) * buffer_size) + (buffer_size * i));
+ sc_adapter[card]->devicename, nBuffers / 2);
+ for (i = 0; i < nBuffers / 2; i++) {
+ RcvBuffOffset.buff_offset =
+ ((sc_adapter[card]->channel[c - 1].first_sendbuf +
+ (nBuffers / 2) * buffer_size) + (buffer_size * i));
RcvBuffOffset.msg_len = buffer_size;
pr_debug("%s: adding RcvBuffer #%d offset=0x%lx sz=%d bufsz:%d\n",
- sc_adapter[card]->devicename,
- i + 1, RcvBuffOffset.buff_offset,
- RcvBuffOffset.msg_len,buffer_size);
+ sc_adapter[card]->devicename,
+ i + 1, RcvBuffOffset.buff_offset,
+ RcvBuffOffset.msg_len, buffer_size);
sendmessage(card, CEPID, ceReqTypeLnk, ceReqClass1, ceReqLnkRead,
- c, sizeof(LLData), (unsigned int *)&RcvBuffOffset);
- }
+ c, sizeof(LLData), (unsigned int *)&RcvBuffOffset);
+ }
return 0;
}
-
diff --git a/drivers/isdn/sc/scioc.h b/drivers/isdn/sc/scioc.h
index dfb107a6de44..a50e143779e7 100644
--- a/drivers/isdn/sc/scioc.h
+++ b/drivers/isdn/sc/scioc.h
@@ -17,9 +17,9 @@
#define SCIOCGETSWITCH 0x06 /* Get switch type */
#define SCIOCSETSWITCH 0x07 /* Set switch type */
#define SCIOCGETSPID 0x08 /* Get channel SPID */
-#define SCIOCSETSPID 0x09 /* Set channel SPID */
+#define SCIOCSETSPID 0x09 /* Set channel SPID */
#define SCIOCGETDN 0x0A /* Get channel DN */
-#define SCIOCSETDN 0x0B /* Set channel DN */
+#define SCIOCSETDN 0x0B /* Set channel DN */
#define SCIOCTRACE 0x0C /* Toggle trace mode */
#define SCIOCSTAT 0x0D /* Get line status */
#define SCIOCGETSPEED 0x0E /* Set channel speed */
@@ -108,4 +108,3 @@ typedef struct {
} boardInfo;
#endif /* __ISDN_SC_SCIOC_H__ */
-
diff --git a/drivers/isdn/sc/shmem.c b/drivers/isdn/sc/shmem.c
index 7f16d75d2d89..d24506ceb6e8 100644
--- a/drivers/isdn/sc/shmem.c
+++ b/drivers/isdn/sc/shmem.c
@@ -42,22 +42,22 @@ void memcpy_toshmem(int card, void *dest, const void *src, size_t n)
* determine the page to load from the address
*/
ch = (unsigned long) dest / SRAM_PAGESIZE;
- pr_debug("%s: loaded page %d\n", sc_adapter[card]->devicename,ch);
+ pr_debug("%s: loaded page %d\n", sc_adapter[card]->devicename, ch);
/*
* Block interrupts and load the page
*/
spin_lock_irqsave(&sc_adapter[card]->lock, flags);
outb(((sc_adapter[card]->shmem_magic + ch * SRAM_PAGESIZE) >> 14) | 0x80,
- sc_adapter[card]->ioport[sc_adapter[card]->shmem_pgport]);
+ sc_adapter[card]->ioport[sc_adapter[card]->shmem_pgport]);
memcpy_toio((void __iomem *)(sc_adapter[card]->rambase + dest_rem), src, n);
spin_unlock_irqrestore(&sc_adapter[card]->lock, flags);
- pr_debug("%s: set page to %#x\n",sc_adapter[card]->devicename,
- ((sc_adapter[card]->shmem_magic + ch * SRAM_PAGESIZE)>>14)|0x80);
+ pr_debug("%s: set page to %#x\n", sc_adapter[card]->devicename,
+ ((sc_adapter[card]->shmem_magic + ch * SRAM_PAGESIZE) >> 14) | 0x80);
pr_debug("%s: copying %zu bytes from %#lx to %#lx\n",
- sc_adapter[card]->devicename, n,
- (unsigned long) src,
- sc_adapter[card]->rambase + ((unsigned long) dest %0x4000));
+ sc_adapter[card]->devicename, n,
+ (unsigned long) src,
+ sc_adapter[card]->rambase + ((unsigned long) dest % 0x4000));
}
/*
@@ -68,12 +68,12 @@ void memcpy_fromshmem(int card, void *dest, const void *src, size_t n)
unsigned long flags;
unsigned char ch;
- if(!IS_VALID_CARD(card)) {
+ if (!IS_VALID_CARD(card)) {
pr_debug("Invalid param: %d is not a valid card id\n", card);
return;
}
- if(n > SRAM_PAGESIZE) {
+ if (n > SRAM_PAGESIZE) {
return;
}
@@ -81,24 +81,24 @@ void memcpy_fromshmem(int card, void *dest, const void *src, size_t n)
* determine the page to load from the address
*/
ch = (unsigned long) src / SRAM_PAGESIZE;
- pr_debug("%s: loaded page %d\n", sc_adapter[card]->devicename,ch);
-
-
+ pr_debug("%s: loaded page %d\n", sc_adapter[card]->devicename, ch);
+
+
/*
* Block interrupts and load the page
*/
spin_lock_irqsave(&sc_adapter[card]->lock, flags);
outb(((sc_adapter[card]->shmem_magic + ch * SRAM_PAGESIZE) >> 14) | 0x80,
- sc_adapter[card]->ioport[sc_adapter[card]->shmem_pgport]);
- memcpy_fromio(dest,(void *)(sc_adapter[card]->rambase +
- ((unsigned long) src % 0x4000)), n);
+ sc_adapter[card]->ioport[sc_adapter[card]->shmem_pgport]);
+ memcpy_fromio(dest, (void *)(sc_adapter[card]->rambase +
+ ((unsigned long) src % 0x4000)), n);
spin_unlock_irqrestore(&sc_adapter[card]->lock, flags);
- pr_debug("%s: set page to %#x\n",sc_adapter[card]->devicename,
- ((sc_adapter[card]->shmem_magic + ch * SRAM_PAGESIZE)>>14)|0x80);
+ pr_debug("%s: set page to %#x\n", sc_adapter[card]->devicename,
+ ((sc_adapter[card]->shmem_magic + ch * SRAM_PAGESIZE) >> 14) | 0x80);
/* pr_debug("%s: copying %d bytes from %#x to %#x\n",
- sc_adapter[card]->devicename, n,
- sc_adapter[card]->rambase + ((unsigned long) src %0x4000), (unsigned long) dest); */
+ sc_adapter[card]->devicename, n,
+ sc_adapter[card]->rambase + ((unsigned long) src %0x4000), (unsigned long) dest); */
}
#if 0
@@ -107,12 +107,12 @@ void memset_shmem(int card, void *dest, int c, size_t n)
unsigned long flags;
unsigned char ch;
- if(!IS_VALID_CARD(card)) {
+ if (!IS_VALID_CARD(card)) {
pr_debug("Invalid param: %d is not a valid card id\n", card);
return;
}
- if(n > SRAM_PAGESIZE) {
+ if (n > SRAM_PAGESIZE) {
return;
}
@@ -120,7 +120,7 @@ void memset_shmem(int card, void *dest, int c, size_t n)
* determine the page to load from the address
*/
ch = (unsigned long) dest / SRAM_PAGESIZE;
- pr_debug("%s: loaded page %d\n",sc_adapter[card]->devicename,ch);
+ pr_debug("%s: loaded page %d\n", sc_adapter[card]->devicename, ch);
/*
* Block interrupts and load the page
@@ -128,11 +128,11 @@ void memset_shmem(int card, void *dest, int c, size_t n)
spin_lock_irqsave(&sc_adapter[card]->lock, flags);
outb(((sc_adapter[card]->shmem_magic + ch * SRAM_PAGESIZE) >> 14) | 0x80,
- sc_adapter[card]->ioport[sc_adapter[card]->shmem_pgport]);
+ sc_adapter[card]->ioport[sc_adapter[card]->shmem_pgport]);
memset_io(sc_adapter[card]->rambase +
- ((unsigned long) dest % 0x4000), c, n);
- pr_debug("%s: set page to %#x\n",sc_adapter[card]->devicename,
- ((sc_adapter[card]->shmem_magic + ch * SRAM_PAGESIZE)>>14)|0x80);
+ ((unsigned long) dest % 0x4000), c, n);
+ pr_debug("%s: set page to %#x\n", sc_adapter[card]->devicename,
+ ((sc_adapter[card]->shmem_magic + ch * SRAM_PAGESIZE) >> 14) | 0x80);
spin_unlock_irqrestore(&sc_adapter[card]->lock, flags);
}
#endif /* 0 */
diff --git a/drivers/isdn/sc/timer.c b/drivers/isdn/sc/timer.c
index 91fbe0dc28ec..6fbac2230d7e 100644
--- a/drivers/isdn/sc/timer.c
+++ b/drivers/isdn/sc/timer.c
@@ -31,7 +31,7 @@ static void setup_ports(int card)
/* And the IRQ */
outb((sc_adapter[card]->interrupt | 0x80),
- sc_adapter[card]->ioport[IRQ_SELECT]);
+ sc_adapter[card]->ioport[IRQ_SELECT]);
}
/*
@@ -50,18 +50,18 @@ void sc_check_reset(unsigned long data)
int card = (unsigned int) data;
pr_debug("%s: check_timer timer called\n",
- sc_adapter[card]->devicename);
+ sc_adapter[card]->devicename);
/* Setup the io ports */
setup_ports(card);
spin_lock_irqsave(&sc_adapter[card]->lock, flags);
outb(sc_adapter[card]->ioport[sc_adapter[card]->shmem_pgport],
- (sc_adapter[card]->shmem_magic>>14) | 0x80);
+ (sc_adapter[card]->shmem_magic >> 14) | 0x80);
sig = (unsigned long) *((unsigned long *)(sc_adapter[card]->rambase + SIG_OFFSET));
/* check the signature */
- if(sig == SIGNATURE) {
+ if (sig == SIGNATURE) {
flushreadfifo(card);
spin_unlock_irqrestore(&sc_adapter[card]->lock, flags);
/* See if we need to do a startproc */
@@ -69,8 +69,8 @@ void sc_check_reset(unsigned long data)
startproc(card);
} else {
pr_debug("%s: No signature yet, waiting another %lu jiffies.\n",
- sc_adapter[card]->devicename, CHECKRESET_TIME);
- mod_timer(&sc_adapter[card]->reset_timer, jiffies+CHECKRESET_TIME);
+ sc_adapter[card]->devicename, CHECKRESET_TIME);
+ mod_timer(&sc_adapter[card]->reset_timer, jiffies + CHECKRESET_TIME);
spin_unlock_irqrestore(&sc_adapter[card]->lock, flags);
}
}
@@ -91,19 +91,19 @@ void check_phystat(unsigned long data)
int card = (unsigned int) data;
pr_debug("%s: Checking status...\n", sc_adapter[card]->devicename);
- /*
+ /*
* check the results of the last PhyStat and change only if
* has changed drastically
*/
if (sc_adapter[card]->nphystat && !sc_adapter[card]->phystat) { /* All is well */
pr_debug("PhyStat transition to RUN\n");
- pr_info("%s: Switch contacted, transmitter enabled\n",
+ pr_info("%s: Switch contacted, transmitter enabled\n",
sc_adapter[card]->devicename);
indicate_status(card, ISDN_STAT_RUN, 0, NULL);
}
else if (!sc_adapter[card]->nphystat && sc_adapter[card]->phystat) { /* All is not well */
pr_debug("PhyStat transition to STOP\n");
- pr_info("%s: Switch connection lost, transmitter disabled\n",
+ pr_info("%s: Switch connection lost, transmitter disabled\n",
sc_adapter[card]->devicename);
indicate_status(card, ISDN_STAT_STOP, 0, NULL);
@@ -113,11 +113,10 @@ void check_phystat(unsigned long data)
/* Reinitialize the timer */
spin_lock_irqsave(&sc_adapter[card]->lock, flags);
- mod_timer(&sc_adapter[card]->stat_timer, jiffies+CHECKSTAT_TIME);
+ mod_timer(&sc_adapter[card]->stat_timer, jiffies + CHECKSTAT_TIME);
spin_unlock_irqrestore(&sc_adapter[card]->lock, flags);
/* Send a new cePhyStatus message */
- sendmessage(card, CEPID,ceReqTypePhy,ceReqClass2,
- ceReqPhyStatus,0,0,NULL);
+ sendmessage(card, CEPID, ceReqTypePhy, ceReqClass2,
+ ceReqPhyStatus, 0, 0, NULL);
}
-