Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
b22267d3
Commit
b22267d3
authored
Jul 01, 2008
by
Krzysztof Hałasa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WAN: Convert PC300 driver to use normal u8/u16/u32 types
Signed-off-by:
Krzysztof Hałasa
<
khc@pm.waw.pl
>
parent
c36936ce
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
150 additions
and
154 deletions
+150
-154
drivers/net/wan/pc300.h
drivers/net/wan/pc300.h
+90
-94
drivers/net/wan/pc300_drv.c
drivers/net/wan/pc300_drv.c
+60
-60
No files found.
drivers/net/wan/pc300.h
View file @
b22267d3
...
...
@@ -103,10 +103,6 @@
#include "hd64572.h"
#include "pc300-falc-lh.h"
typedef
__u32
uclong
;
/* 32 bits, unsigned */
typedef
__u16
ucshort
;
/* 16 bits, unsigned */
typedef
__u8
ucchar
;
/* 8 bits, unsigned */
#define PC300_PROTO_MLPPP 1
#define PC300_MAXCHAN 2
/* Number of channels per card */
...
...
@@ -147,9 +143,9 @@ typedef __u8 ucchar; /* 8 bits, unsigned */
* Memory access functions/macros *
* (required to support Alpha systems) *
***************************************/
#define cpc_writeb(port,val) {writeb((u
cchar
)(val),(port)); mb();}
#define cpc_writeb(port,val) {writeb((u
8
)(val),(port)); mb();}
#define cpc_writew(port,val) {writew((ushort)(val),(port)); mb();}
#define cpc_writel(port,val) {writel((u
clong
)(val),(port)); mb();}
#define cpc_writel(port,val) {writel((u
32
)(val),(port)); mb();}
#define cpc_readb(port) readb(port)
#define cpc_readw(port) readw(port)
...
...
@@ -163,15 +159,15 @@ typedef __u8 ucchar; /* 8 bits, unsigned */
* (memory mapped).
*/
struct
RUNTIME_9050
{
u
clong
loc_addr_range
[
4
];
/* 00-0Ch : Local Address Ranges */
u
clong
loc_rom_range
;
/* 10h : Local ROM Range */
u
clong
loc_addr_base
[
4
];
/* 14-20h : Local Address Base Addrs */
u
clong
loc_rom_base
;
/* 24h : Local ROM Base */
u
clong
loc_bus_descr
[
4
];
/* 28-34h : Local Bus Descriptors */
u
clong
rom_bus_descr
;
/* 38h : ROM Bus Descriptor */
u
clong
cs_base
[
4
];
/* 3C-48h : Chip Select Base Addrs */
u
clong
intr_ctrl_stat
;
/* 4Ch : Interrupt Control/Status */
u
clong
init_ctrl
;
/* 50h : EEPROM ctrl, Init Ctrl, etc */
u
32
loc_addr_range
[
4
];
/* 00-0Ch : Local Address Ranges */
u
32
loc_rom_range
;
/* 10h : Local ROM Range */
u
32
loc_addr_base
[
4
];
/* 14-20h : Local Address Base Addrs */
u
32
loc_rom_base
;
/* 24h : Local ROM Base */
u
32
loc_bus_descr
[
4
];
/* 28-34h : Local Bus Descriptors */
u
32
rom_bus_descr
;
/* 38h : ROM Bus Descriptor */
u
32
cs_base
[
4
];
/* 3C-48h : Chip Select Base Addrs */
u
32
intr_ctrl_stat
;
/* 4Ch : Interrupt Control/Status */
u
32
init_ctrl
;
/* 50h : EEPROM ctrl, Init Ctrl, etc */
};
#define PLX_9050_LINT1_ENABLE 0x01
...
...
@@ -215,66 +211,66 @@ struct RUNTIME_9050 {
#define PC300_FALC_MAXLOOP 0x0000ffff
/* for falc_issue_cmd() */
typedef
struct
falc
{
u
cchar
sync
;
/* If true FALC is synchronized */
u
cchar
active
;
/* if TRUE then already active */
u
cchar
loop_active
;
/* if TRUE a line loopback UP was received */
u
cchar
loop_gen
;
/* if TRUE a line loopback UP was issued */
u
8
sync
;
/* If true FALC is synchronized */
u
8
active
;
/* if TRUE then already active */
u
8
loop_active
;
/* if TRUE a line loopback UP was received */
u
8
loop_gen
;
/* if TRUE a line loopback UP was issued */
u
cchar
num_channels
;
u
cchar
offset
;
/* 1 for T1, 0 for E1 */
u
cchar
full_bandwidth
;
u
8
num_channels
;
u
8
offset
;
/* 1 for T1, 0 for E1 */
u
8
full_bandwidth
;
u
cchar
xmb_cause
;
u
cchar
multiframe_mode
;
u
8
xmb_cause
;
u
8
multiframe_mode
;
/* Statistics */
u
cshort
pden
;
/* Pulse Density violation count */
u
cshort
los
;
/* Loss of Signal count */
u
cshort
losr
;
/* Loss of Signal recovery count */
u
cshort
lfa
;
/* Loss of frame alignment count */
u
cshort
farec
;
/* Frame Alignment Recovery count */
u
cshort
lmfa
;
/* Loss of multiframe alignment count */
u
cshort
ais
;
/* Remote Alarm indication Signal count */
u
cshort
sec
;
/* One-second timer */
u
cshort
es
;
/* Errored second */
u
cshort
rai
;
/* remote alarm received */
u
cshort
bec
;
u
cshort
fec
;
u
cshort
cvc
;
u
cshort
cec
;
u
cshort
ebc
;
u
16
pden
;
/* Pulse Density violation count */
u
16
los
;
/* Loss of Signal count */
u
16
losr
;
/* Loss of Signal recovery count */
u
16
lfa
;
/* Loss of frame alignment count */
u
16
farec
;
/* Frame Alignment Recovery count */
u
16
lmfa
;
/* Loss of multiframe alignment count */
u
16
ais
;
/* Remote Alarm indication Signal count */
u
16
sec
;
/* One-second timer */
u
16
es
;
/* Errored second */
u
16
rai
;
/* remote alarm received */
u
16
bec
;
u
16
fec
;
u
16
cvc
;
u
16
cec
;
u
16
ebc
;
/* Status */
u
cchar
red_alarm
;
u
cchar
blue_alarm
;
u
cchar
loss_fa
;
u
cchar
yellow_alarm
;
u
cchar
loss_mfa
;
u
cchar
prbs
;
u
8
red_alarm
;
u
8
blue_alarm
;
u
8
loss_fa
;
u
8
yellow_alarm
;
u
8
loss_mfa
;
u
8
prbs
;
}
falc_t
;
typedef
struct
falc_status
{
u
cchar
sync
;
/* If true FALC is synchronized */
u
cchar
red_alarm
;
u
cchar
blue_alarm
;
u
cchar
loss_fa
;
u
cchar
yellow_alarm
;
u
cchar
loss_mfa
;
u
cchar
prbs
;
u
8
sync
;
/* If true FALC is synchronized */
u
8
red_alarm
;
u
8
blue_alarm
;
u
8
loss_fa
;
u
8
yellow_alarm
;
u
8
loss_mfa
;
u
8
prbs
;
}
falc_status_t
;
typedef
struct
rsv_x21_status
{
u
cchar
dcd
;
u
cchar
dsr
;
u
cchar
cts
;
u
cchar
rts
;
u
cchar
dtr
;
u
8
dcd
;
u
8
dsr
;
u
8
cts
;
u
8
rts
;
u
8
dtr
;
}
rsv_x21_status_t
;
typedef
struct
pc300stats
{
int
hw_type
;
u
clong
line_on
;
u
clong
line_off
;
u
32
line_on
;
u
32
line_off
;
struct
net_device_stats
gen_stats
;
falc_t
te_stats
;
}
pc300stats_t
;
...
...
@@ -292,14 +288,14 @@ typedef struct pc300loopback {
typedef
struct
pc300patterntst
{
char
patrntst_on
;
/* 0 - off; 1 - on; 2 - read num_errors */
u
cshort
num_errors
;
u
16
num_errors
;
}
pc300patterntst_t
;
typedef
struct
pc300dev
{
struct
pc300ch
*
chan
;
u
cchar
trace_on
;
u
clong
line_on
;
/* DCD(X.21, RSV) / sync(TE) change counters */
u
clong
line_off
;
u
8
trace_on
;
u
32
line_on
;
/* DCD(X.21, RSV) / sync(TE) change counters */
u
32
line_off
;
char
name
[
16
];
struct
net_device
*
dev
;
#ifdef CONFIG_PC300_MLPPP
...
...
@@ -312,42 +308,42 @@ typedef struct pc300hw {
int
bus
;
/* Bus (PCI, PMC, etc.) */
int
nchan
;
/* number of channels */
int
irq
;
/* interrupt request level */
u
clong
clock
;
/* Board clock */
u
cchar
cpld_id
;
/* CPLD ID (TE only) */
u
cshort
cpld_reg1
;
/* CPLD reg 1 (TE only) */
u
cshort
cpld_reg2
;
/* CPLD reg 2 (TE only) */
u
cshort
gpioc_reg
;
/* PLX GPIOC reg */
u
cshort
intctl_reg
;
/* PLX Int Ctrl/Status reg */
u
clong
iophys
;
/* PLX registers I/O base */
u
clong
iosize
;
/* PLX registers I/O size */
u
clong
plxphys
;
/* PLX registers MMIO base (physical) */
u
32
clock
;
/* Board clock */
u
8
cpld_id
;
/* CPLD ID (TE only) */
u
16
cpld_reg1
;
/* CPLD reg 1 (TE only) */
u
16
cpld_reg2
;
/* CPLD reg 2 (TE only) */
u
16
gpioc_reg
;
/* PLX GPIOC reg */
u
16
intctl_reg
;
/* PLX Int Ctrl/Status reg */
u
32
iophys
;
/* PLX registers I/O base */
u
32
iosize
;
/* PLX registers I/O size */
u
32
plxphys
;
/* PLX registers MMIO base (physical) */
void
__iomem
*
plxbase
;
/* PLX registers MMIO base (virtual) */
u
clong
plxsize
;
/* PLX registers MMIO size */
u
clong
scaphys
;
/* SCA registers MMIO base (physical) */
u
32
plxsize
;
/* PLX registers MMIO size */
u
32
scaphys
;
/* SCA registers MMIO base (physical) */
void
__iomem
*
scabase
;
/* SCA registers MMIO base (virtual) */
u
clong
scasize
;
/* SCA registers MMIO size */
u
clong
ramphys
;
/* On-board RAM MMIO base (physical) */
u
32
scasize
;
/* SCA registers MMIO size */
u
32
ramphys
;
/* On-board RAM MMIO base (physical) */
void
__iomem
*
rambase
;
/* On-board RAM MMIO base (virtual) */
u
clong
alloc_ramsize
;
/* RAM MMIO size allocated by the PCI bridge */
u
clong
ramsize
;
/* On-board RAM MMIO size */
u
clong
falcphys
;
/* FALC registers MMIO base (physical) */
u
32
alloc_ramsize
;
/* RAM MMIO size allocated by the PCI bridge */
u
32
ramsize
;
/* On-board RAM MMIO size */
u
32
falcphys
;
/* FALC registers MMIO base (physical) */
void
__iomem
*
falcbase
;
/* FALC registers MMIO base (virtual) */
u
clong
falcsize
;
/* FALC registers MMIO size */
u
32
falcsize
;
/* FALC registers MMIO size */
}
pc300hw_t
;
typedef
struct
pc300chconf
{
sync_serial_settings
phys_settings
;
/* Clock type/rate (in bps),
sync_serial_settings
phys_settings
;
/* Clock type/rate (in bps),
loopback mode */
raw_hdlc_proto
proto_settings
;
/* Encoding, parity (CRC) */
u
clong
media
;
/* HW media (RS232, V.35, etc.) */
u
clong
proto
;
/* Protocol (PPP, X.25, etc.) */
u
32
media
;
/* HW media (RS232, V.35, etc.) */
u
32
proto
;
/* Protocol (PPP, X.25, etc.) */
/* TE-specific parameters */
u
cchar
lcode
;
/* Line Code (AMI, B8ZS, etc.) */
u
cchar
fr_mode
;
/* Frame Mode (ESF, D4, etc.) */
u
cchar
lbo
;
/* Line Build Out */
u
cchar
rx_sens
;
/* Rx Sensitivity (long- or short-haul) */
u
clong
tslot_bitmap
;
/* bit[i]=1 => timeslot _i_ is active */
u
8
lcode
;
/* Line Code (AMI, B8ZS, etc.) */
u
8
fr_mode
;
/* Frame Mode (ESF, D4, etc.) */
u
8
lbo
;
/* Line Build Out */
u
8
rx_sens
;
/* Rx Sensitivity (long- or short-haul) */
u
32
tslot_bitmap
;
/* bit[i]=1 => timeslot _i_ is active */
}
pc300chconf_t
;
typedef
struct
pc300ch
{
...
...
@@ -355,12 +351,12 @@ typedef struct pc300ch {
int
channel
;
pc300dev_t
d
;
pc300chconf_t
conf
;
u
cchar
tx_first_bd
;
/* First TX DMA block descr. w/ data */
u
cchar
tx_next_bd
;
/* Next free TX DMA block descriptor */
u
cchar
rx_first_bd
;
/* First free RX DMA block descriptor */
u
cchar
rx_last_bd
;
/* Last free RX DMA block descriptor */
u
cchar
nfree_tx_bd
;
/* Number of free TX DMA block descriptors */
falc_t
falc
;
/* FALC structure (TE only) */
u
8
tx_first_bd
;
/* First TX DMA block descr. w/ data */
u
8
tx_next_bd
;
/* Next free TX DMA block descriptor */
u
8
rx_first_bd
;
/* First free RX DMA block descriptor */
u
8
rx_last_bd
;
/* Last free RX DMA block descriptor */
u
8
nfree_tx_bd
;
/* Number of free TX DMA block descriptors */
falc_t
falc
;
/* FALC structure (TE only) */
}
pc300ch_t
;
typedef
struct
pc300
{
...
...
drivers/net/wan/pc300_drv.c
View file @
b22267d3
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment