summaryrefslogtreecommitdiffstats
path: root/drivers/isdn/hardware/eicon/istream.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-20 21:04:47 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-20 21:04:47 -0700
commit3b59bf081622b6446db77ad06c93fe23677bc533 (patch)
tree3f4bb5a27c90cc86994a1f6d3c53fbf9208003cb /drivers/isdn/hardware/eicon/istream.c
parente45836fafe157df137a837093037f741ad8f4c90 (diff)
parentbbdb32cb5b73597386913d052165423b9d736145 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking merge from David Miller: "1) Move ixgbe driver over to purely page based buffering on receive. From Alexander Duyck. 2) Add receive packet steering support to e1000e, from Bruce Allan. 3) Convert TCP MD5 support over to RCU, from Eric Dumazet. 4) Reduce cpu usage in handling out-of-order TCP packets on modern systems, also from Eric Dumazet. 5) Support the IP{,V6}_UNICAST_IF socket options, making the wine folks happy, from Erich Hoover. 6) Support VLAN trunking from guests in hyperv driver, from Haiyang Zhang. 7) Support byte-queue-limtis in r8169, from Igor Maravic. 8) Outline code intended for IP_RECVTOS in IP_PKTOPTIONS existed but was never properly implemented, Jiri Benc fixed that. 9) 64-bit statistics support in r8169 and 8139too, from Junchang Wang. 10) Support kernel side dump filtering by ctmark in netfilter ctnetlink, from Pablo Neira Ayuso. 11) Support byte-queue-limits in gianfar driver, from Paul Gortmaker. 12) Add new peek socket options to assist with socket migration, from Pavel Emelyanov. 13) Add sch_plug packet scheduler whose queue is controlled by userland daemons using explicit freeze and release commands. From Shriram Rajagopalan. 14) Fix FCOE checksum offload handling on transmit, from Yi Zou." * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1846 commits) Fix pppol2tp getsockname() Remove printk from rds_sendmsg ipv6: fix incorrent ipv6 ipsec packet fragment cpsw: Hook up default ndo_change_mtu. net: qmi_wwan: fix build error due to cdc-wdm dependecy netdev: driver: ethernet: Add TI CPSW driver netdev: driver: ethernet: add cpsw address lookup engine support phy: add am79c874 PHY support mlx4_core: fix race on comm channel bonding: send igmp report for its master fs_enet: Add MPC5125 FEC support and PHY interface selection net: bpf_jit: fix BPF_S_LDX_B_MSH compilation net: update the usage of CHECKSUM_UNNECESSARY fcoe: use CHECKSUM_UNNECESSARY instead of CHECKSUM_PARTIAL on tx net: do not do gso for CHECKSUM_UNNECESSARY in netif_needs_gso ixgbe: Fix issues with SR-IOV loopback when flow control is disabled net/hyperv: Fix the code handling tx busy ixgbe: fix namespace issues when FCoE/DCB is not enabled rtlwifi: Remove unused ETH_ADDR_LEN defines igbvf: Use ETH_ALEN ... Fix up fairly trivial conflicts in drivers/isdn/gigaset/interface.c and drivers/net/usb/{Kconfig,qmi_wwan.c} as per David.
Diffstat (limited to 'drivers/isdn/hardware/eicon/istream.c')
-rw-r--r--drivers/isdn/hardware/eicon/istream.c352
1 files changed, 176 insertions, 176 deletions
diff --git a/drivers/isdn/hardware/eicon/istream.c b/drivers/isdn/hardware/eicon/istream.c
index 7bd5baa547b..045bda5c839 100644
--- a/drivers/isdn/hardware/eicon/istream.c
+++ b/drivers/isdn/hardware/eicon/istream.c
@@ -1,26 +1,26 @@
/*
*
- Copyright (c) Eicon Networks, 2002.
+ Copyright (c) Eicon Networks, 2002.
*
- This source file is supplied for the use with
- Eicon Networks range of DIVA Server Adapters.
+ This source file is supplied for the use with
+ Eicon Networks range of DIVA Server Adapters.
*
- Eicon File Revision : 2.1
+ Eicon File Revision : 2.1
*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
*
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
*
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#include "platform.h"
@@ -31,196 +31,196 @@
#include "divasync.h"
#include "di.h"
#if !defined USE_EXTENDED_DEBUGS
- #include "dimaint.h"
+#include "dimaint.h"
#else
- #define dprintf
+#define dprintf
#endif
#include "dfifo.h"
-int diva_istream_write (void* context,
- int Id,
- void* data,
- int length,
- int final,
- byte usr1,
- byte usr2);
-int diva_istream_read (void* context,
- int Id,
- void* data,
- int max_length,
- int* final,
- byte* usr1,
- byte* usr2);
+int diva_istream_write(void *context,
+ int Id,
+ void *data,
+ int length,
+ int final,
+ byte usr1,
+ byte usr2);
+int diva_istream_read(void *context,
+ int Id,
+ void *data,
+ int max_length,
+ int *final,
+ byte *usr1,
+ byte *usr2);
/* -------------------------------------------------------------------
- Does provide iStream interface to the client
+ Does provide iStream interface to the client
------------------------------------------------------------------- */
-void diva_xdi_provide_istream_info (ADAPTER* a,
- diva_xdi_stream_interface_t* pi) {
- pi->provided_service = 0;
+void diva_xdi_provide_istream_info(ADAPTER *a,
+ diva_xdi_stream_interface_t *pi) {
+ pi->provided_service = 0;
}
/* ------------------------------------------------------------------
- Does write the data from caller's buffer to the card's
- stream interface.
- If synchronous service was requested, then function
- does return amount of data written to stream.
- 'final' does indicate that piece of data to be written is
- final part of frame (necessary only by structured datatransfer)
- return 0 if zero lengh packet was written
- return -1 if stream is full
- ------------------------------------------------------------------ */
-int diva_istream_write (void* context,
- int Id,
- void* data,
- int length,
- int final,
- byte usr1,
- byte usr2) {
- ADAPTER* a = (ADAPTER*)context;
- int written = 0, to_write = -1;
- char tmp[4];
- byte* data_ptr = (byte*)data;
- for (;;) {
- a->ram_in_dw (a,
+ Does write the data from caller's buffer to the card's
+ stream interface.
+ If synchronous service was requested, then function
+ does return amount of data written to stream.
+ 'final' does indicate that piece of data to be written is
+ final part of frame (necessary only by structured datatransfer)
+ return 0 if zero lengh packet was written
+ return -1 if stream is full
+ ------------------------------------------------------------------ */
+int diva_istream_write(void *context,
+ int Id,
+ void *data,
+ int length,
+ int final,
+ byte usr1,
+ byte usr2) {
+ ADAPTER *a = (ADAPTER *)context;
+ int written = 0, to_write = -1;
+ char tmp[4];
+ byte *data_ptr = (byte *)data;
+ for (;;) {
+ a->ram_in_dw(a,
#ifdef PLATFORM_GT_32BIT
- ULongToPtr(a->tx_stream[Id] + a->tx_pos[Id]),
+ ULongToPtr(a->tx_stream[Id] + a->tx_pos[Id]),
#else
- (void*)(a->tx_stream[Id] + a->tx_pos[Id]),
+ (void *)(a->tx_stream[Id] + a->tx_pos[Id]),
#endif
- (dword*)&tmp[0],
- 1);
- if (tmp[0] & DIVA_DFIFO_READY) { /* No free blocks more */
- if (to_write < 0)
- return (-1); /* was not able to write */
- break; /* only part of message was written */
- }
- to_write = min(length, DIVA_DFIFO_DATA_SZ);
- if (to_write) {
- a->ram_out_buffer (a,
+ (dword *)&tmp[0],
+ 1);
+ if (tmp[0] & DIVA_DFIFO_READY) { /* No free blocks more */
+ if (to_write < 0)
+ return (-1); /* was not able to write */
+ break; /* only part of message was written */
+ }
+ to_write = min(length, DIVA_DFIFO_DATA_SZ);
+ if (to_write) {
+ a->ram_out_buffer(a,
#ifdef PLATFORM_GT_32BIT
- ULongToPtr(a->tx_stream[Id] + a->tx_pos[Id]+4),
+ ULongToPtr(a->tx_stream[Id] + a->tx_pos[Id] + 4),
#else
- (void*)(a->tx_stream[Id] + a->tx_pos[Id] + 4),
+ (void *)(a->tx_stream[Id] + a->tx_pos[Id] + 4),
#endif
- data_ptr,
- (word)to_write);
- length -= to_write;
- written += to_write;
- data_ptr += to_write;
- }
- tmp[1] = (char)to_write;
- tmp[0] = (tmp[0] & DIVA_DFIFO_WRAP) |
- DIVA_DFIFO_READY |
- ((!length && final) ? DIVA_DFIFO_LAST : 0);
- if (tmp[0] & DIVA_DFIFO_LAST) {
- tmp[2] = usr1;
- tmp[3] = usr2;
- }
- a->ram_out_dw (a,
+ data_ptr,
+ (word)to_write);
+ length -= to_write;
+ written += to_write;
+ data_ptr += to_write;
+ }
+ tmp[1] = (char)to_write;
+ tmp[0] = (tmp[0] & DIVA_DFIFO_WRAP) |
+ DIVA_DFIFO_READY |
+ ((!length && final) ? DIVA_DFIFO_LAST : 0);
+ if (tmp[0] & DIVA_DFIFO_LAST) {
+ tmp[2] = usr1;
+ tmp[3] = usr2;
+ }
+ a->ram_out_dw(a,
#ifdef PLATFORM_GT_32BIT
- ULongToPtr(a->tx_stream[Id] + a->tx_pos[Id]),
+ ULongToPtr(a->tx_stream[Id] + a->tx_pos[Id]),
#else
- (void*)(a->tx_stream[Id] + a->tx_pos[Id]),
+ (void *)(a->tx_stream[Id] + a->tx_pos[Id]),
#endif
- (dword*)&tmp[0],
- 1);
- if (tmp[0] & DIVA_DFIFO_WRAP) {
- a->tx_pos[Id] = 0;
- } else {
- a->tx_pos[Id] += DIVA_DFIFO_STEP;
- }
- if (!length) {
- break;
- }
- }
- return (written);
+ (dword *)&tmp[0],
+ 1);
+ if (tmp[0] & DIVA_DFIFO_WRAP) {
+ a->tx_pos[Id] = 0;
+ } else {
+ a->tx_pos[Id] += DIVA_DFIFO_STEP;
+ }
+ if (!length) {
+ break;
+ }
+ }
+ return (written);
}
/* -------------------------------------------------------------------
- In case of SYNCRONOUS service:
- Does write data from stream in caller's buffer.
- Does return amount of data written to buffer
- Final flag is set on return if last part of structured frame
- was received
- return 0 if zero packet was received
- return -1 if stream is empty
- return -2 if read buffer does not profide sufficient space
- to accommodate entire segment
- max_length should be at least 68 bytes
- ------------------------------------------------------------------- */
-int diva_istream_read (void* context,
- int Id,
- void* data,
- int max_length,
- int* final,
- byte* usr1,
- byte* usr2) {
- ADAPTER* a = (ADAPTER*)context;
- int read = 0, to_read = -1;
- char tmp[4];
- byte* data_ptr = (byte*)data;
- *final = 0;
- for (;;) {
- a->ram_in_dw (a,
+ In case of SYNCRONOUS service:
+ Does write data from stream in caller's buffer.
+ Does return amount of data written to buffer
+ Final flag is set on return if last part of structured frame
+ was received
+ return 0 if zero packet was received
+ return -1 if stream is empty
+ return -2 if read buffer does not profide sufficient space
+ to accommodate entire segment
+ max_length should be at least 68 bytes
+ ------------------------------------------------------------------- */
+int diva_istream_read(void *context,
+ int Id,
+ void *data,
+ int max_length,
+ int *final,
+ byte *usr1,
+ byte *usr2) {
+ ADAPTER *a = (ADAPTER *)context;
+ int read = 0, to_read = -1;
+ char tmp[4];
+ byte *data_ptr = (byte *)data;
+ *final = 0;
+ for (;;) {
+ a->ram_in_dw(a,
#ifdef PLATFORM_GT_32BIT
- ULongToPtr(a->rx_stream[Id] + a->rx_pos[Id]),
+ ULongToPtr(a->rx_stream[Id] + a->rx_pos[Id]),
#else
- (void*)(a->rx_stream[Id] + a->rx_pos[Id]),
+ (void *)(a->rx_stream[Id] + a->rx_pos[Id]),
#endif
- (dword*)&tmp[0],
- 1);
- if (tmp[1] > max_length) {
- if (to_read < 0)
- return (-2); /* was not able to read */
- break;
- }
- if (!(tmp[0] & DIVA_DFIFO_READY)) {
- if (to_read < 0)
- return (-1); /* was not able to read */
- break;
- }
- to_read = min(max_length, (int)tmp[1]);
- if (to_read) {
- a->ram_in_buffer(a,
+ (dword *)&tmp[0],
+ 1);
+ if (tmp[1] > max_length) {
+ if (to_read < 0)
+ return (-2); /* was not able to read */
+ break;
+ }
+ if (!(tmp[0] & DIVA_DFIFO_READY)) {
+ if (to_read < 0)
+ return (-1); /* was not able to read */
+ break;
+ }
+ to_read = min(max_length, (int)tmp[1]);
+ if (to_read) {
+ a->ram_in_buffer(a,
#ifdef PLATFORM_GT_32BIT
- ULongToPtr(a->rx_stream[Id] + a->rx_pos[Id] + 4),
+ ULongToPtr(a->rx_stream[Id] + a->rx_pos[Id] + 4),
#else
- (void*)(a->rx_stream[Id] + a->rx_pos[Id] + 4),
+ (void *)(a->rx_stream[Id] + a->rx_pos[Id] + 4),
#endif
- data_ptr,
- (word)to_read);
- max_length -= to_read;
- read += to_read;
- data_ptr += to_read;
- }
- if (tmp[0] & DIVA_DFIFO_LAST) {
- *final = 1;
- }
- tmp[0] &= DIVA_DFIFO_WRAP;
- a->ram_out_dw(a,
+ data_ptr,
+ (word)to_read);
+ max_length -= to_read;
+ read += to_read;
+ data_ptr += to_read;
+ }
+ if (tmp[0] & DIVA_DFIFO_LAST) {
+ *final = 1;
+ }
+ tmp[0] &= DIVA_DFIFO_WRAP;
+ a->ram_out_dw(a,
#ifdef PLATFORM_GT_32BIT
- ULongToPtr(a->rx_stream[Id] + a->rx_pos[Id]),
+ ULongToPtr(a->rx_stream[Id] + a->rx_pos[Id]),
#else
- (void*)(a->rx_stream[Id] + a->rx_pos[Id]),
+ (void *)(a->rx_stream[Id] + a->rx_pos[Id]),
#endif
- (dword*)&tmp[0],
- 1);
- if (tmp[0] & DIVA_DFIFO_WRAP) {
- a->rx_pos[Id] = 0;
- } else {
- a->rx_pos[Id] += DIVA_DFIFO_STEP;
- }
- if (*final) {
- if (usr1)
- *usr1 = tmp[2];
- if (usr2)
- *usr2 = tmp[3];
- break;
- }
- }
- return (read);
+ (dword *)&tmp[0],
+ 1);
+ if (tmp[0] & DIVA_DFIFO_WRAP) {
+ a->rx_pos[Id] = 0;
+ } else {
+ a->rx_pos[Id] += DIVA_DFIFO_STEP;
+ }
+ if (*final) {
+ if (usr1)
+ *usr1 = tmp[2];
+ if (usr2)
+ *usr2 = tmp[3];
+ break;
+ }
+ }
+ return (read);
}
/* ---------------------------------------------------------------------
- Does check if one of streams had caused interrupt and does
- wake up corresponding application
+ Does check if one of streams had caused interrupt and does
+ wake up corresponding application
--------------------------------------------------------------------- */
-void pr_stream (ADAPTER * a) {
+void pr_stream(ADAPTER *a) {
}
#endif /* } */