Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libethernet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HAL
libethernet
Commits
445ccef4
Commit
445ccef4
authored
3 years ago
by
Amit Kumar
Browse files
Options
Downloads
Patches
Plain Diff
easy-soc-libs: updated bcm header files
parent
39bedc9a
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
bcm/bcm.c
+2
-2
2 additions, 2 deletions
bcm/bcm.c
bcm/bcmnet.h
+465
-8
465 additions, 8 deletions
bcm/bcmnet.h
bcm/bcmswapitypes.h
+27
-64
27 additions, 64 deletions
bcm/bcmswapitypes.h
bcm/bcmtypes.h
+6
-8
6 additions, 8 deletions
bcm/bcmtypes.h
with
500 additions
and
82 deletions
bcm/bcm.c
+
2
−
2
View file @
445ccef4
...
@@ -192,7 +192,7 @@ int bcm_eth_poweron_phy(const char *name, struct eth_phy p)
...
@@ -192,7 +192,7 @@ int bcm_eth_poweron_phy(const char *name, struct eth_phy p)
struct
ethctl_data
data
;
struct
ethctl_data
data
;
memset
(
&
data
,
0
,
sizeof
(
struct
ethctl_data
));
memset
(
&
data
,
0
,
sizeof
(
struct
ethctl_data
));
data
.
op
=
ETHSET
SPOWERUP
;
data
.
op
=
ETHSET
PHYPWRON
;
if
(
eth_ioctl
(
name
,
SIOCETHSWCTLOPS
,
&
data
,
if
(
eth_ioctl
(
name
,
SIOCETHSWCTLOPS
,
&
data
,
sizeof
(
struct
ethswctl_data
))
<
0
)
sizeof
(
struct
ethswctl_data
))
<
0
)
...
@@ -206,7 +206,7 @@ int bcm_eth_poweroff_phy(const char *name, struct eth_phy p)
...
@@ -206,7 +206,7 @@ int bcm_eth_poweroff_phy(const char *name, struct eth_phy p)
struct
ethctl_data
data
;
struct
ethctl_data
data
;
memset
(
&
data
,
0
,
sizeof
(
struct
ethctl_data
));
memset
(
&
data
,
0
,
sizeof
(
struct
ethctl_data
));
data
.
op
=
ETHSET
SPOWERDOWN
;
data
.
op
=
ETHSET
PHYPWROFF
;
if
(
eth_ioctl
(
name
,
SIOCETHSWCTLOPS
,
&
data
,
if
(
eth_ioctl
(
name
,
SIOCETHSWCTLOPS
,
&
data
,
sizeof
(
struct
ethswctl_data
))
<
0
)
sizeof
(
struct
ethswctl_data
))
<
0
)
...
...
This diff is collapsed.
Click to expand it.
bcm/bcmnet.h
+
465
−
8
View file @
445ccef4
...
@@ -41,14 +41,31 @@ extern "C" {
...
@@ -41,14 +41,31 @@ extern "C" {
#endif
#endif
#include
<linux/sockios.h>
#include
<linux/sockios.h>
//#include "skb_defines.h"
#if defined(CONFIG_COMPAT)
//#include "bcmPktDma_defines.h"
#include
<linux/compat.h>
#endif
#include
"skb_defines.h"
#include
"bcmPktDma_defines.h"
#include
"bcmtypes.h"
#include
"bcmtypes.h"
#define LINKSTATE_DOWN 0
#define LINKSTATE_UP 1
#ifndef IFNAMSIZ
#ifndef IFNAMSIZ
#define IFNAMSIZ 16
#define IFNAMSIZ 16
#endif
#endif
/*---------------------------------------------------------------------*/
/* Ethernet Switch Type */
/*---------------------------------------------------------------------*/
#define ESW_TYPE_UNDEFINED 0
#define ESW_TYPE_BCM5325M 1
#define ESW_TYPE_BCM5325E 2
#define ESW_TYPE_BCM5325F 3
#define ESW_TYPE_BCM53101 4
#define ETHERNET_ROOT_DEVICE_NAME "bcmsw"
/*
/*
* Ioctl definitions.
* Ioctl definitions.
*/
*/
...
@@ -80,15 +97,33 @@ enum {
...
@@ -80,15 +97,33 @@ enum {
ETHGETNUMRXDMACHANNELS
,
ETHGETNUMRXDMACHANNELS
,
ETHSETNUMRXDMACHANNELS
,
ETHSETNUMRXDMACHANNELS
,
ETHGETSOFTWARESTATS
,
ETHGETSOFTWARESTATS
,
ETHSETSPOWERUP
,
ETHSETSPOWERDOWN
,
ETHGETMIIREG
,
ETHGETMIIREG
,
ETHSETMIIREG
,
ETHSETMIIREG
,
ETHSETLINKSTATE
,
ETHSETLINKSTATE
,
ETHGETCOREID
,
ETHGETCOREID
,
ETHINITWAN
,
ETHGETPHYEEE
,
ETHCREATEEPONVPORT
,
ETHSETPHYEEEON
,
ETHCREATEEPONAEVPORT
ETHSETPHYEEEOFF
,
ETHGETPHYEEERESOLUTION
,
ETHSETPHYWOLSLEEP
,
ETHGETPHYAPD
,
ETHSETPHYAPDON
,
ETHSETPHYAPDOFF
,
ETHGETPHYPWR
,
ETHSETPHYPWRON
,
ETHSETPHYPWROFF
,
ETHMOVESUBPORT
,
ETHPHYMAP
,
ETHGETPHYID
,
ETHG9991CARRIERON
,
ETHG9991CARRIEROFF
,
ETHCDGET
,
ETHCDSET
,
ETHCDRUN
,
ETHGETSFPINFO
,
ETHPHYMACSEC
,
ETHWIRESPEEDGET
,
ETHWIRESPEEDSET
,
};
};
struct
ethctl_data
{
struct
ethctl_data
{
...
@@ -100,11 +135,55 @@ struct ethctl_data {
...
@@ -100,11 +135,55 @@ struct ethctl_data {
int
ret_val
;
int
ret_val
;
/* value for set operations */
/* value for set operations */
int
val
;
int
val
;
int
sub_port
;
unsigned
int
phy_addr
;
unsigned
int
phy_addr
;
unsigned
int
phy_reg
;
unsigned
int
phy_reg
;
/* flags to indicate to ioctl functions */
/* flags to indicate to ioctl functions */
unsigned
int
flags
;
unsigned
int
flags
;
char
ifname
[
IFNAMSIZ
];
union
{
char
ifname
[
IFNAMSIZ
];
#define ETHCTL_FLAG_MPMAC_SET (1<<0)
char
mpmac
[
6
];
};
BCM_IOC_PTR
(
char
*
,
buf
);
int
buf_size
;
int
pair_len
[
4
];
};
typedef
enum
{
SFP_TYPE_XPON
,
SFP_TYPE_ETHERNET
,
SFP_TYPE_UNKNOWN
,
SFP_TYPE_NOT_ETHERNET
,
/* Active Ethernet Port not defined in board paramters */
SFP_TYPE_NO_MODULE
,
}
sfp_type_t
;
enum
{
CD_INVALID
,
CD_OK
,
CD_OPEN
,
CD_INTRA_SHORT
,
CD_INTER_SHORT
,
CD_ENABLED
,
CD_DISABLED
,
CD_NOT_SUPPORTED
,
CD_ALL_PAIR_OK
=
0x1111
,
CD_ALL_PAIR_OPEN
=
0x2222
,
};
#define CD_CODE_PAIR_GET(v, p) (((v)>>((p)*4))&0xf)
#define CD_CODE_PAIR_SET(v, p) (((v)&0xf)<<((p)*4))
/* Flags for Cable Diagnostic */
#define INTERFACE_NEXT (1<<0)
#define CD_LINK_UP (1<<1)
/* ethctl ret_val definitions */
enum
{
ETHCTL_RET_OK
=
0
,
ETHMOVESUBPORT_RET_INVALID_EP
,
ETHMOVESUBPORT_RET_SRCDEV_UP
,
ETHMOVESUBPORT_RET_DSTDEV_UP
,
ETHMOVESUBPORT_RET_MAC2MAC
,
ETHMOVESUBPORT_RET_NOT_MOVEABLE
,
};
};
/* PHY type */
/* PHY type */
...
@@ -116,7 +195,385 @@ enum {
...
@@ -116,7 +195,385 @@ enum {
ETHCTL_FLAG_ACCESS_SERDES
=
(
1
<<
3
),
ETHCTL_FLAG_ACCESS_SERDES
=
(
1
<<
3
),
ETHCTL_FLAG_ACCESS_SERDES_POWER_MODE
=
(
1
<<
4
),
ETHCTL_FLAG_ACCESS_SERDES_POWER_MODE
=
(
1
<<
4
),
ETHCTL_FLAG_ACCESS_32BIT
=
(
1
<<
5
),
ETHCTL_FLAG_ACCESS_32BIT
=
(
1
<<
5
),
ETHCTL_FLAG_ACCESS_10GSERDES
=
(
1
<<
6
),
ETHCTL_FLAG_ACCESS_10GPCS
=
(
1
<<
7
),
ETHCTL_FLAG_ACCESS_SILENT_START
=
(
1
<<
8
),
};
#define ETHCTL_FLAG_ANY_SERDES (ETHCTL_FLAG_ACCESS_SERDES|ETHCTL_FLAG_ACCESS_10GSERDES)
enum
ethctl_error
{
ETHCTL_ERROR_POWER_SAVING_DOWN
=
-
100
,
ETHCTL_ERROR_POWER_ADMIN_DOWN
=
-
101
,
};
enum
{
SERDES_NO_POWER_SAVING
,
SERDES_BASIC_POWER_SAVING
,
SERDES_ADVANCED_POWER_SAVING
,
SERDES_FORCE_OFF
,
SERDES_POWER_MODE_MAX
};
/* Various operations through the SIOCGPONIF */
enum
{
GETFREEGEMIDMAP
=
0
,
SETGEMIDMAP
,
GETGEMIDMAP
,
CREATEGPONVPORT
,
DELETEGPONVPORT
,
DELETEALLGPONVPORTS
,
SETMCASTGEMID
,
};
struct
interface_data
{
char
ifname
[
IFNAMSIZ
];
int
switch_port_id
;
};
/* Definition for IFREQ extension structure to
support more IFREQs than kernel allocated 16 types */
struct
ifreq_ext
{
int
opcode
;
/* add union struct for different opcode's data below if needed */
union
{
struct
{
BCM_IOC_PTR
(
char
*
,
stringBuf
);
int
bufLen
;
};
};
};
};
typedef
struct
ifreq_ext
ifreq_ext_t
;
/* Definition for opcode */
enum
{
SIOCGPORTWANONLY
,
SIOCGPORTWANPREFERRED
,
SIOCGPORTLANONLY
,
};
/* The enet driver subdivides queue field (mark[4:0]) in the skb->mark into
priority and channel */
/* priority = queue[2:0] (=>mark[2:0]) */
#define SKBMARK_Q_PRIO_S (SKBMARK_Q_S)
#define SKBMARK_Q_PRIO_M (0x07 << SKBMARK_Q_PRIO_S)
#define SKBMARK_GET_Q_PRIO(MARK) \
((MARK & SKBMARK_Q_PRIO_M) >> SKBMARK_Q_PRIO_S)
#define SKBMARK_SET_Q_PRIO(MARK, Q) \
((MARK & ~SKBMARK_Q_PRIO_M) | (Q << SKBMARK_Q_PRIO_S))
/* channel = queue[4:3] (=>mark[4:3]) */
#define SKBMARK_Q_CH_S (SKBMARK_Q_S + 3)
#define SKBMARK_Q_CH_M (0x03 << SKBMARK_Q_CH_S)
#define SKBMARK_GET_Q_CHANNEL(MARK) ((MARK & SKBMARK_Q_CH_M) >> SKBMARK_Q_CH_S)
#define SKBMARK_SET_Q_CHANNEL(MARK, CH) \
((MARK & ~SKBMARK_Q_CH_M) | (CH << SKBMARK_Q_CH_S))
#define SPEED_10MBIT 10000000
#define SPEED_100MBIT 100000000
#define SPEED_200MBIT 200000000
#define SPEED_1000MBIT 1000000000
#define SPEED_2500MBIT 2500000000u
#define SPEED_5000MBIT 5000000000ull
#define SPEED_10000MBIT 10000000000ull
#define SPEED_DOWN 0
#define BCMNET_DUPLEX_HALF 0
#define BCMNET_DUPLEX_FULL 1
// Use for Auto negotiation capability
#define AN_10M_HALF 0x0001
#define AN_10M_FULL 0x0002
#define AN_100M_HALF 0x0004
#define AN_100M_FULL 0x0008
#define AN_1000M_HALF 0x0010
#define AN_1000M_FULL 0x0020
#define AN_2500 0x0040
#define AN_5000 0x0080
#define AN_10000 0x0100
#define AN_AUTONEG 0x0200
#define AN_FLOW_CONTROL 0x0400
#define AN_FLOW_CONTROL_ASYM 0x0800
#define AN_REPEATER 0x1000
#define AUTONEG_CTRL_MASK 0x01
#define AUTONEG_RESTART_MASK 0x02
typedef
struct
IoctlMibInfo
{
uint32
ulIfLastChange
;
uint64
ulIfSpeed
;
uint32
ulIfDuplex
;
}
IOCTL_MIB_INFO
,
*
PIOCTL_MIB_INFO
;
#define MIRROR_INTF_SIZE 32
#define MIRROR_DIR_IN 0
#define MIRROR_DIR_OUT 1
#define MIRROR_DISABLED 0
#define MIRROR_ENABLED 1
typedef
struct
_MirrorCfg
{
char
szMonitorInterface
[
MIRROR_INTF_SIZE
];
char
szMirrorInterface
[
MIRROR_INTF_SIZE
];
int
nDirection
;
int
nStatus
;
#if defined(DMP_X_ITU_ORG_GPON_1) && defined(CONFIG_BCM_MAX_GEM_PORTS)
/* +1 is when CONFIG_BCM_MAX_GEM_PORTS is not a multiple of 8 */
unsigned
char
nGemPortMaskArray
[(
CONFIG_BCM_MAX_GEM_PORTS
/
8
)
+
1
];
#endif
}
MirrorCfg
;
int
sfp_i2c_phy_read
(
int
reg
,
int
*
data
);
int
sfp_i2c_phy_write
(
int
reg
,
int
data
);
int
bcmeapi_init_wan
(
void
);
/* VLAN TPIDs that need to be checked
ETH_P_8021Q 0x8100
ETH_P_8021AD 0x88A8
ETH_P_QINQ1 0x9100
ETH_P_QINQ2 0x9200
*/
#define BCM_VLAN_TPID_CHECK(x) ( (x) == htons(ETH_P_8021Q) \
|| (x) == htons(ETH_P_8021AD) \
/* || (x) == htons(ETH_P_QINQ1) */
\
/* || (x) == htons(ETH_P_QINQ2) */
)
#define check_arp_lcp_pkt(pkt_p, ret_val) { \
unsigned char l3_offset = sizeof(struct ethhdr); \
struct vlan_hdr *vlanhdr = (struct vlan_hdr *)(pkt_p + l3_offset - sizeof(struct vlan_hdr)); \
ret_val = 0; \
/* Skip over all the VLAN Tags */
\
while ( BCM_VLAN_TPID_CHECK(vlanhdr->h_vlan_encapsulated_proto) ) \
{ \
vlanhdr = (struct vlan_hdr *)(pkt_p + l3_offset); \
l3_offset += sizeof(struct vlan_hdr); \
} \
if (vlanhdr->h_vlan_encapsulated_proto == htons(ETH_P_ARP)) \
{ \
ret_val = 1; \
} \
else if ( vlanhdr->h_vlan_encapsulated_proto == htons(ETH_P_PPP_DISC) ) \
{ \
ret_val = 1; \
} \
else if ( vlanhdr->h_vlan_encapsulated_proto == htons(ETH_P_PPP_SES) ) \
{ \
struct pppoe_hdr *pppoe = (struct pppoe_hdr *)(pkt_p + l3_offset); \
\
if ( ! (pppoe->tag[0].tag_type == htons(PPP_IP) || pppoe->tag[0].tag_type == htons(PPP_IPV6)) ) \
{ \
ret_val = 1; \
} \
} \
}
enum
Bcm63xxEnetStats
{
ET_TX_BYTES
=
0
,
ET_TX_PACKETS
,
ET_TX_ERRORS
,
ET_TX_CAPACITY
,
ET_RX_BYTES
,
ET_RX_PACKETS
,
ET_RX_ERRORS
,
ET_MAX
};
typedef
struct
mac_limit_arg
{
uint32
cmd
;
uint32
val
;
union
{
void
*
mac_limit
;
char
rsvd
[
8
];
};
}
mac_limit_arg_t
;
enum
mac_limit_cmd
{
MAC_LIMIT_IOCTL_GET
=
0
,
MAC_LIMIT_IOCTL_SET
,
MAC_LIMIT_IOCTL_CLR
,
MAC_LIMIT_IOCTL_EN
};
enum
mac_limit_set_op
{
MAC_LIMIT_SET_MAX
=
0
,
MAC_LIMIT_SET_MIN
,
};
/*------------------------------------------------------------------------*/
/* BCM net character device for ioctl to get/set netdev BRCM private info */
/*------------------------------------------------------------------------*/
#define BCMNET_DRV_MAJOR 377
#define BCMNET_DRV_NAME "bcmnet"
#define BCMNET_DRV_DEVICE_NAME "/dev/" BCMNET_DRV_NAME
typedef
enum
bcmnet_ioctl_cmd
{
BCMNET_IOCTL_GET_EXT_FLAGS
,
BCMNET_IOCTL_GET_LAST_CHANGE
,
BCMNET_IOCTL_CLR_STATS
,
BCMNET_IOCTL_ADD_NETDEV_PATH
,
BCMNET_IOCTL_MAC_LIMIT
,
BCMNET_IOCTL_MAX
}
bcmnet_ioctl_cmd_t
;
typedef
struct
{
unsigned
int
unused
:
25
;
unsigned
int
is_bcm_dev
:
1
;
unsigned
int
is_wlan
:
1
;
unsigned
int
is_hw_switch
:
1
;
unsigned
int
is_hw_fdb
:
1
;
unsigned
int
is_ppp
:
1
;
unsigned
int
is_vlan
:
1
;
unsigned
int
is_wan
:
1
;
}
bcmnet_extflags
;
typedef
struct
{
char
if_name
[
IFNAMSIZ
];
union
{
struct
{
bcmnet_extflags
ret_val
;
}
st_get_ext_flags
;
struct
{
unsigned
long
last_change
;
}
st_get_last_change
;
struct
{
char
next_if_name
[
IFNAMSIZ
];
}
st_add_netdev_path
;
mac_limit_arg_t
st_mac_limit
;
};
}
bcmnet_info_t
;
#if defined(CONFIG_COMPAT)
typedef
struct
mac_limit_compat_arg
{
uint32
cmd
;
uint32
val
;
union
{
compat_uptr_t
mac_limit
;
char
rsvd
[
8
];
};
}
compat_mac_limit_arg_t
;
typedef
struct
{
char
if_name
[
IFNAMSIZ
];
union
{
struct
{
bcmnet_extflags
ret_val
;
}
st_get_ext_flags
;
struct
{
unsigned
long
last_change
;
}
st_get_last_change
;
struct
{
char
next_if_name
[
IFNAMSIZ
];
}
st_add_netdev_path
;
compat_mac_limit_arg_t
st_mac_limit
;
};
}
compat_bcmnet_info_t
;
#endif
#if !defined(__KERNEL__)
#include
<fcntl.h>
#include
<sys/ioctl.h>
#include
<unistd.h>
#include
<string.h>
// return 0 if successful, -1 - error
static
inline
int
bcmnet_ioctl_get_ext_flags
(
char
const
*
if_name
,
bcmnet_extflags
*
flags
)
{
bcmnet_info_t
info
;
int
fd
,
err
;
fd
=
open
(
BCMNET_DRV_DEVICE_NAME
,
O_RDWR
);
if
(
fd
<
0
)
return
-
1
;
strncpy
(
info
.
if_name
,
if_name
,
IFNAMSIZ
);
err
=
ioctl
(
fd
,
BCMNET_IOCTL_GET_EXT_FLAGS
,
&
info
);
close
(
fd
);
if
(
err
==
-
1
)
return
err
;
*
flags
=
info
.
st_get_ext_flags
.
ret_val
;
return
0
;
}
// return 1 - dev is WAN, 0 - dev is not WAN, -1 - error
static
inline
int
bcmnet_ioctl_iswandev
(
char
const
*
if_name
)
{
bcmnet_extflags
flags
;
int
ret
;
ret
=
bcmnet_ioctl_get_ext_flags
(
if_name
,
&
flags
);
if
(
ret
<
0
)
return
-
1
;
return
flags
.
is_wan
;
}
// return 1 - dev is VLAN, 0 - dev is not VLAN, -1 - error
static
inline
int
bcmnet_ioctl_isvlandev
(
char
const
*
if_name
)
{
bcmnet_extflags
flags
;
int
ret
;
ret
=
bcmnet_ioctl_get_ext_flags
(
if_name
,
&
flags
);
if
(
ret
<
0
)
return
-
1
;
return
flags
.
is_vlan
;
}
// return last transction jiffies, 0 if there is error
static
inline
unsigned
long
bcmnet_ioctl_get_last_change
(
char
*
if_name
)
{
bcmnet_info_t
info
;
int
fd
,
err
;
fd
=
open
(
BCMNET_DRV_DEVICE_NAME
,
O_RDWR
);
if
(
fd
<
0
)
return
0
;
strncpy
(
info
.
if_name
,
if_name
,
IFNAMSIZ
);
err
=
ioctl
(
fd
,
BCMNET_IOCTL_GET_LAST_CHANGE
,
&
info
);
close
(
fd
);
if
(
err
==
-
1
)
return
0
;
return
info
.
st_get_last_change
.
last_change
;
}
static
inline
void
bcmnet_ioctl_clr_stat
(
char
*
if_name
)
{
bcmnet_info_t
info
;
int
fd
;
fd
=
open
(
BCMNET_DRV_DEVICE_NAME
,
O_RDWR
);
if
(
fd
<
0
)
return
;
strncpy
(
info
.
if_name
,
if_name
,
IFNAMSIZ
);
ioctl
(
fd
,
BCMNET_IOCTL_CLR_STATS
,
&
info
);
close
(
fd
);
}
static
inline
int
bcmnet_ioctl_add_netdev_path
(
char
const
*
dev_name
,
char
const
*
next_dev_name
)
{
bcmnet_info_t
info
;
int
fd
,
err
;
fd
=
open
(
BCMNET_DRV_DEVICE_NAME
,
O_RDWR
);
if
(
fd
<
0
)
return
-
1
;
strncpy
(
info
.
if_name
,
dev_name
,
IFNAMSIZ
);
strncpy
(
info
.
st_add_netdev_path
.
next_if_name
,
next_dev_name
,
IFNAMSIZ
);
err
=
ioctl
(
fd
,
BCMNET_IOCTL_ADD_NETDEV_PATH
,
&
info
);
close
(
fd
);
return
err
;
}
#endif //!__KERNEL__
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
This diff is collapsed.
Click to expand it.
bcm/bcmswapitypes.h
+
27
−
64
View file @
445ccef4
...
@@ -78,87 +78,59 @@ typedef int bcm_cos_queue_t;
...
@@ -78,87 +78,59 @@ typedef int bcm_cos_queue_t;
/* Various operations through the SIOCETHSWCTLOPS */
/* Various operations through the SIOCETHSWCTLOPS */
enum
{
enum
{
ETHSWDUMP
PAGE
=
0
,
ETHSWDUMP
MIB
=
0
,
ETHSW
DUMPIUDMA
,
ETHSW
PORTCREATE
,
ETHSW
IUDMASPLIT
,
ETHSW
PORTDELETE
,
ETHSW
DUMPMIB
,
ETHSW
PORTMCASTGEMSET
,
ETHSWSWITCHING
,
ETHSWSWITCHING
,
ETHSWRXSCHEDULING
,
ETHSWWRRPARAM
,
ETHSWUSEDEFTXQ
,
ETHSWDEFTXQ
,
ETHSWRXRATECFG
,
ETHSWRXRATELIMITCFG
,
/* 10 */
ETHSWRXPKTRATECFG
,
ETHSWRXPKTRATELIMITCFG
,
ETHSWCONTROL
,
ETHSWCONTROL
,
ETHSWPRIOCONTROL
,
ETHSWPRIOCONTROL
,
ETHSWPORTTAGREPLACE
,
ETHSWPORTTAGMANGLE
,
ETHSWPORTTAGMANGLEMATCHVID
,
ETHSWPORTTAGSTRIP
,
ETHSWPORTPAUSECAPABILITY
,
ETHSWPORTPAUSECAPABILITY
,
ETHSWVLAN
,
/* 20 */
ETHSWVLAN
,
ETHSWGETRXCOUNTERS
,
ETHSWRESETRXCOUNTERS
,
ETHSWPBVLAN
,
ETHSWPBVLAN
,
ETHSWCOSCONF
,
ETHSWCOSSCHED
,
/* 10 */
ETHSWCOSSCHED
,
ETHSWCOSPORTMAP
,
ETHSWCOSPORTMAP
,
ETHSWCOSRXCHMAP
,
ETHSWCOSTXCHMAP
,
ETHSWCOSTXQSEL
,
ETHSWSTATCLR
,
/* 30 */
ETHSWSTATPORTCLR
,
ETHSWSTATPORTCLR
,
ETHSWSTATSYNC
,
ETHSWSTATGET
,
ETHSWPORTRXRATE
,
ETHSWPORTRXRATE
,
ETHSWPORTTXRATE
,
ETHSWPORTTXRATE
,
ETHSWTEST1
,
ETHSWTEST1
,
ETHSWARLACCESS
,
ETHSWARLACCESS
,
ETHSWPORTDEFTAG
,
ETHSWCOSPRIORITYMETHOD
,
ETHSWCOSPRIORITYMETHOD
,
ETHSWREGACCESS
,
/* 40 */
ETHSWREGACCESS
,
ETHSWSPIACCESS
,
ETHSWPSEUDOMDIOACCESS
,
ETHSWPSEUDOMDIOACCESS
,
ETHSWINFO
,
ETHSWINFO
,
/* 20 */
ETHSWLINKSTATUS
,
ETHSWLINKSTATUS
,
ETHSWPORTTRAFFICCTRL
,
ETHSWPORTTRAFFICCTRL
,
ETHSWPORTLOOPBACK
,
ETHSWPORTLOOPBACK
,
ETHSWPHYMODE
,
ETHSWPHYMODE
,
ETHSWPKTPAD
,
ETHSWMACLMT
,
ETHSWJUMBO
,
ETHSWJUMBO
,
ETHSWCOSDSCPPRIOMAP
,
/* 50 */
ETHSWCOSDSCPPRIOMAP
,
ETHSWKERNELPOLL
,
ETHSWPHYCFG
,
ETHSWPHYCFG
,
ETHSWEPONUNITOUNICTRL
,
ETHSWDEBUG
,
ETHSWGETIFNAME
,
ETHSWGETIFNAME
,
ETHSWMULTIPORT
,
ETHSWMULTIPORT
,
/* 30 */
ETHSWUNITPORT
,
ETHSWUNITPORT
,
ETHSWDOSCTRL
,
ETHSWDOSCTRL
,
ETHSWHWSTP
,
ETHSWHWSTP
,
ETHSWSOFTSWITCHING
,
/* 60 */
ETHSWSOFTSWITCHING
,
ETHSWEMACGET
,
ETHSWEMACGET
,
ETHSWEMACCLEAR
,
ETHSWEMACCLEAR
,
ETHSWPHYAUTONEG
,
ETHSWPHYAUTONEG
,
ETHSWPORTSALDAL
,
ETHSWPORTSALDAL
,
ETHSWPORTTRANSPARENT
,
ETHSWPORTTRANSPARENT
,
ETHSWPORTVLANISOLATION
,
ETHSWPORTVLANISOLATION
,
/* 40 */
ETHSWACBCONTROL
,
ETHSWACBCONTROL
,
ETHSWPORTMTU
,
ETHSWMIRROR
,
ETHSWMIRROR
,
ETHSWPORTTRUNK
,
/* 70 */
ETHSWPORTTRUNK
,
ETHSWIFSTP
,
ETHSWCPUMETER
,
ETHSWCPUMETER
,
ETHSWPORTSHAPERCFG
,
ETHSWPORTSHAPERCFG
,
ETHSWCOSPCPPRIOMAP
,
ETHSWCOSPCPPRIOMAP
,
ETHSWCOSPIDPRIOMAP
,
ETHSWCOSPIDPRIOMAP
,
ETHSWRDPAPORTGET
,
ETHSWRDPAPORTGETFROMNAME
,
ETHSWRDPAPORTGETFROMNAME
,
ETHSWEXTPHYLINKSTATUS
,
ETHSWPHYAPD
,
/* 50 */
ETHSWPHYAPD
,
ETHSWPHYEEE
,
ETHSWPHYEEE
,
ETHSWDEEPGREENMODE
,
/* 80 */
ETHSWDEEPGREENMODE
,
ETHSWPHYAUTONEGCAPADV
,
ETHSWPHYAUTONEGCAPADV
,
ETHSWQUEMON
,
ETHSWQUEMON
,
ETHSWQUEMAP
,
ETHSWQUEMAP
,
...
@@ -166,9 +138,7 @@ enum {
...
@@ -166,9 +138,7 @@ enum {
ETHSWOAMIDXMAPPING
,
ETHSWOAMIDXMAPPING
,
ETHSWCFP
,
ETHSWCFP
,
ETHSWSWITCHFLAG
,
ETHSWSWITCHFLAG
,
ETHSWAUTOMDIX
,
ETHSWAUTOMDIX
,
/* 60 */
ETHSWIFSTP
,
ETHSWMACLMT
,
/* 90 */
};
};
typedef
struct
cfpArg_s
{
typedef
struct
cfpArg_s
{
...
@@ -348,8 +318,9 @@ enum {
...
@@ -348,8 +318,9 @@ enum {
MACLMT_MAX_TYPES
,
MACLMT_MAX_TYPES
,
};
};
#if defined(CONFIG_BCM963138) || defined(CONFIG_BCM963148) || defined(CONFIG_BCM94908) || defined(CONFIG_BCM963158) || defined(CONFIG_BCM963178) || defined(CONFIG_BCM947622) || \
#if defined(CONFIG_BCM963138) || defined(CONFIG_BCM963148) || defined(CONFIG_BCM94908) || defined(CONFIG_BCM963158) || \
defined(CHIP_63138) || defined(CHIP_63148) || defined(CHIP_4908) || defined(CHIP_63158) || defined(CHIP_63178) || defined(CHIP_47622)
defined(CONFIG_BCM963178) || defined(CONFIG_BCM947622) || defined(CONFIG_BCM963146) || defined(CONFIG_BCM96756) || \
defined(CHIP_63138) || defined(CHIP_63148) || defined(CHIP_4908) || defined(CHIP_63158) || defined(CHIP_63178) || defined(CHIP_47622) || defined(CHIP_63146) || defined(CHIP_6756)
#define BCM_COS_COUNT 8
#define BCM_COS_COUNT 8
#else
#else
#define BCM_COS_COUNT 4
#define BCM_COS_COUNT 4
...
@@ -765,8 +736,9 @@ typedef struct {
...
@@ -765,8 +736,9 @@ typedef struct {
#define SHAPER_RATE_PACKET_MODE 0x2
#define SHAPER_RATE_PACKET_MODE 0x2
#define SHAPER_BLOCKING_MODE 0x4
#define SHAPER_BLOCKING_MODE 0x4
#define SHAPER_INCLUDE_IFG 0x8
#define SHAPER_INCLUDE_IFG 0x8
#define SHAPER_OVF_FLAG 0x10
#define SHAPER_AVB_MODE 0x10
#define SHAPER_INPF_FLAG 0x20
#define SHAPER_OVF_FLAG 0x20
#define SHAPER_INPF_FLAG 0x40
/* Defines for the op_map in tag_mangle_set/get */
/* Defines for the op_map in tag_mangle_set/get */
#define BCM_PORT_REPLACE_TPID 0x8000
/* Replace TPID */
#define BCM_PORT_REPLACE_TPID 0x8000
/* Replace TPID */
...
@@ -779,14 +751,13 @@ typedef struct {
...
@@ -779,14 +751,13 @@ typedef struct {
/* For scheduling mechanism selection */
/* For scheduling mechanism selection */
#define SP_SCHEDULING 0
#define SP_SCHEDULING 0
#define WRR_SCHEDULING 1
#define WRR_SCHEDULING 1
#define FAP_SCHEDULING 2
#define BCM_COSQ_STRICT 0
#define BCM_COSQ_STRICT 0
#define BCM_COSQ_WRR 1
#define BCM_COSQ_WRR 1
#define BCM_COSQ_COMBO 2
#define BCM_COSQ_COMBO 2
#define BCM_COSQ_SP 0
#define BCM_COSQ_SP 0
#if defined(CONFIG_BCM963138) || defined(CONFIG_BCM963148) || defined(CONFIG_BCM94908) || defined(CONFIG_BCM963158) || defined(CONFIG_BCM963178) \
#if defined(CONFIG_BCM963138) || defined(CONFIG_BCM963148) || defined(CONFIG_BCM94908) || defined(CONFIG_BCM963158) || defined(CONFIG_BCM963178)
|| defined(CONFIG_BCM963146)
\
|| defined(CHIP_63138) || defined(CHIP_63148) || defined(CHIP_4908) || defined(CHIP_63158) || defined(CHIP_63178)
|| defined(CHIP_63138) || defined(CHIP_63148) || defined(CHIP_4908) || defined(CHIP_63158) || defined(CHIP_63178)
|| defined(CHIP_63146)
#define NUM_EGRESS_QUEUES 8
#define NUM_EGRESS_QUEUES 8
#else
#else
#define NUM_EGRESS_QUEUES 4
#define NUM_EGRESS_QUEUES 4
...
@@ -811,14 +782,6 @@ typedef struct {
...
@@ -811,14 +782,6 @@ typedef struct {
#define PAUSE_FLOW_CTRL_BCMSWITCH_ON 9
#define PAUSE_FLOW_CTRL_BCMSWITCH_ON 9
#define SWITCH_PORTS_ALL_PHYS 255
#define SWITCH_PORTS_ALL_PHYS 255
/* For ETHSWCOSTXQSEL */
/* Use Tx BD priority for egress queue selection */
#define USE_TX_BD_PRIORITY 0
/* Use Tx iuDMA channel for egress queue selection */
#define USE_TX_DMA_CHANNEL 1
/* Indicates neither BD nor channel is used for queue selection*/
#define NONE_OF_THE_METHODS 0xFF
#define PORT_QOS 0
#define PORT_QOS 0
#define MAC_QOS 1
#define MAC_QOS 1
#define IEEE8021P_QOS 2
#define IEEE8021P_QOS 2
...
...
This diff is collapsed.
Click to expand it.
bcm/bcmtypes.h
+
6
−
8
View file @
445ccef4
...
@@ -32,6 +32,8 @@
...
@@ -32,6 +32,8 @@
#ifndef BCMTYPES_H
#ifndef BCMTYPES_H
#define BCMTYPES_H
#define BCMTYPES_H
#ifndef __ASSEMBLER__
// These are also defined in typedefs.h in the application area, so I need to
// These are also defined in typedefs.h in the application area, so I need to
// protect against re-definition.
// protect against re-definition.
...
@@ -47,18 +49,14 @@ typedef signed int int32;
...
@@ -47,18 +49,14 @@ typedef signed int int32;
typedef
signed
long
long
int64
;
typedef
signed
long
long
int64
;
typedef
unsigned
long
BcmHandle
;
typedef
unsigned
long
BcmHandle
;
#if !defined(__cplusplus) && !defined(__KERNEL__) && !defined(_LINUX_TYPES_H) && !defined(_LINUX_IF_H)
#if !defined(__cplusplus) && !defined(__KERNEL__) && !defined(_LINUX_TYPES_H) && !defined(_LINUX_IF_H) && !defined(_ATF_)
#ifndef bool
typedef
int
bool
;
typedef
int
bool
;
#endif
#endif
#endif
#endif
#endif
typedef
unsigned
char
byte
;
typedef
unsigned
char
byte
;
// typedef unsigned long sem_t;
typedef
unsigned
long
HANDLE
,
*
PULONG
;
typedef
unsigned
long
HANDLE
,
*
PULONG
;
typedef
int
DWORD
,
*
PDWORD
;
typedef
int
DWORD
,
*
PDWORD
;
#ifndef LONG
#ifndef LONG
...
@@ -146,14 +144,12 @@ typedef enum
...
@@ -146,14 +144,12 @@ typedef enum
#define READ16(addr) (*(volatile UINT16 *)((ULONG)&addr))
#define READ16(addr) (*(volatile UINT16 *)((ULONG)&addr))
#define READ8(addr) (*(volatile UINT8 *)((ULONG)&addr))
#define READ8(addr) (*(volatile UINT8 *)((ULONG)&addr))
#define VIRT_TO_PHY(a) (((unsigned long)(a)) & 0x1fffffff)
typedef
unsigned
long
long
uint64_aligned
__attribute__
((
aligned
(
8
)));
typedef
unsigned
long
long
uint64_aligned
__attribute__
((
aligned
(
8
)));
typedef
signed
long
long
int64_aligned
__attribute__
((
aligned
(
8
)));
typedef
signed
long
long
int64_aligned
__attribute__
((
aligned
(
8
)));
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#define BCM_IOC_PTR(ptr_t, ptr) union { ptr_t ptr; uint64_aligned ptr##64; }
#define BCM_IOC_PTR(ptr_t, ptr) union { ptr_t ptr; uint64_aligned ptr##64; }
#define BCM_IOC_PTR_ZERO_EXT(ptr) ((ptr##64) = (uint64_aligned)(uint32_t)(ptr##64))
#define BCM_IOC_PTR_ZERO_EXT(ptr)
if (is_compat_task())
((ptr##64) = (uint64_aligned)(uint32_t)(ptr##64))
#else
#else
#define BCM_IOC_PTR(ptr_t, ptr) ptr_t ptr;
#define BCM_IOC_PTR(ptr_t, ptr) ptr_t ptr;
#define BCM_IOC_PTR_ZERO_EXT(ptr)
#define BCM_IOC_PTR_ZERO_EXT(ptr)
...
@@ -168,3 +164,5 @@ typedef signed long long int64_aligned __attribute__((aligned(8)));
...
@@ -168,3 +164,5 @@ typedef signed long long int64_aligned __attribute__((aligned(8)));
} ExampleIoctlMsg;
} ExampleIoctlMsg;
*/
*/
#endif
#endif
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment