1 /* Copyright (C) 2005 SBE, Inc.
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
14 #include <linux/types.h>
15 #include "pmcc4_sysdep.h"
16 #include "sbecom_inline_linux.h"
18 #include "pmcc4_private.h"
22 #ifdef SBE_INCLUDE_SYMBOLS
30 sbeid_get_bdname (ci_t
*ci
)
36 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPTMC_256T3_E1
):
37 np
= "wanPTMC-256T3 <E1>";
39 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPTMC_256T3_T1
):
40 np
= "wanPTMC-256T3 <T1>";
42 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C4T1E1
):
43 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C4T1E1_L
):
46 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C2T1E1
):
47 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C2T1E1_L
):
50 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C1T1E1
):
51 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C1T1E1_L
):
54 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C4T1E1
):
57 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C2T1E1
):
60 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C1T1E1
):
64 /*** np = "<unknown>"; ***/
73 /* given the presetting of brd_id, set the corresponding hdw_id */
76 sbeid_set_hdwbid (ci_t
*ci
)
79 * set SBE's unique hardware identification (for legacy boards might not
80 * have this register implemented)
85 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPTMC_256T3_E1
):
86 ci
->hdw_bid
= SBE_BID_256T3_E1
; /* 0x46 - SBE wanPTMC-256T3 (E1
89 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPTMC_256T3_T1
):
90 ci
->hdw_bid
= SBE_BID_256T3_T1
; /* 0x42 - SBE wanPTMC-256T3 (T1
93 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C4T1E1
):
94 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C4T1E1_L
):
96 * This Board ID is a generic identification. Use the found number
97 * of ports to further define this hardware.
101 default: /* shouldn't need a default, but have one
104 ci
->hdw_bid
= SBE_BID_PMC_C4T1E1
; /* 0xC4 - SBE wanPMC-C4T1E1 */
107 ci
->hdw_bid
= SBE_BID_PMC_C2T1E1
; /* 0xC2 - SBE wanPMC-C2T1E1 */
108 ci
->brd_id
= SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C2T1E1
);
111 ci
->hdw_bid
= SBE_BID_PMC_C1T1E1
; /* 0xC1 - SBE wanPMC-C1T1E1 */
112 ci
->brd_id
= SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C1T1E1
);
116 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C2T1E1
):
117 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C2T1E1_L
):
118 ci
->hdw_bid
= SBE_BID_PMC_C2T1E1
; /* 0xC2 - SBE wanPMC-C2T1E1 */
120 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C1T1E1
):
121 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C1T1E1_L
):
122 ci
->hdw_bid
= SBE_BID_PMC_C1T1E1
; /* 0xC1 - SBE wanPMC-C1T1E1 */
124 #ifdef SBE_PMCC4_ENABLE
126 * This case is entered as a result of the inability to obtain the
127 * <bid> from the board's EEPROM. Assume a PCI board and set
128 * <hdsbid> according to the number ofr found ports.
131 /* start by assuming 4-port for ZERO casing */
132 ci
->brd_id
= SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C4T1E1
);
133 /* drop thru to set hdw_bid and alternate PCI CxT1E1 settings */
135 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C4T1E1
):
137 * This Board ID is a generic identification. Use the number of
138 * found ports to further define this hardware.
140 switch (ci
->max_port
)
142 default: /* shouldn't need a default, but have one
145 ci
->hdw_bid
= SBE_BID_PCI_C4T1E1
; /* 0x04 - SBE wanPCI-C4T1E1 */
148 ci
->hdw_bid
= SBE_BID_PCI_C2T1E1
; /* 0x02 - SBE wanPCI-C2T1E1 */
149 ci
->brd_id
= SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C2T1E1
);
152 ci
->hdw_bid
= SBE_BID_PCI_C1T1E1
; /* 0x01 - SBE wanPCI-C1T1E1 */
153 ci
->brd_id
= SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C1T1E1
);
157 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C2T1E1
):
158 ci
->hdw_bid
= SBE_BID_PCI_C2T1E1
; /* 0x02 - SBE wanPCI-C2T1E1 */
160 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C1T1E1
):
161 ci
->hdw_bid
= SBE_BID_PCI_C1T1E1
; /* 0x01 - SBE wanPCI-C1T1E1 */
164 /*** bid = "<unknown>"; ***/
165 ci
->hdw_bid
= SBE_BID_PMC_C4T1E1
; /* 0x41 - SBE wanPTMC-C4T1E1 */
170 /* given the presetting of hdw_bid, set the corresponding brd_id */
173 sbeid_set_bdtype (ci_t
*ci
)
175 /* set SBE's unique PCI VENDOR/DEVID */
178 case SBE_BID_C1T3
: /* SBE wanPMC-C1T3 */
179 ci
->brd_id
= SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C1T3
);
181 case SBE_BID_C24TE1
: /* SBE wanPTMC-C24TE1 */
182 ci
->brd_id
= SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPTMC_C24TE1
);
184 case SBE_BID_256T3_E1
: /* SBE wanPTMC-256T3 E1 Version */
185 ci
->brd_id
= SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPTMC_256T3_E1
);
187 case SBE_BID_256T3_T1
: /* SBE wanPTMC-256T3 T1 Version */
188 ci
->brd_id
= SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPTMC_256T3_T1
);
190 case SBE_BID_PMC_C4T1E1
: /* 0xC4 - SBE wanPMC-C4T1E1 */
191 ci
->brd_id
= SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C4T1E1
);
193 case SBE_BID_PMC_C2T1E1
: /* 0xC2 - SBE wanPMC-C2T1E1 */
194 ci
->brd_id
= SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C2T1E1
);
196 case SBE_BID_PMC_C1T1E1
: /* 0xC1 - SBE wanPMC-C1T1E1 */
197 ci
->brd_id
= SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C1T1E1
);
199 case SBE_BID_PCI_C4T1E1
: /* 0x04 - SBE wanPCI-C4T1E1 */
200 ci
->brd_id
= SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C4T1E1
);
202 case SBE_BID_PCI_C2T1E1
: /* 0x02 - SBE wanPCI-C2T1E1 */
203 ci
->brd_id
= SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C2T1E1
);
205 case SBE_BID_PCI_C1T1E1
: /* 0x01 - SBE wanPCI-C1T1E1 */
206 ci
->brd_id
= SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C1T1E1
);
210 /*** hdw_bid = "<unknown>"; ***/
211 ci
->brd_id
= SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C4T1E1
);
217 /*** End-of-File ***/