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"
23 sbeid_get_bdname(ci_t
*ci
)
28 case SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPTMC_256T3_E1
):
29 np
= "wanPTMC-256T3 <E1>";
31 case SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPTMC_256T3_T1
):
32 np
= "wanPTMC-256T3 <T1>";
34 case SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C4T1E1
):
35 case SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C4T1E1_L
):
38 case SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C2T1E1
):
39 case SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C2T1E1_L
):
42 case SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C1T1E1
):
43 case SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C1T1E1_L
):
46 case SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C4T1E1
):
49 case SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C2T1E1
):
52 case SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C1T1E1
):
56 /*** np = "<unknown>"; ***/
65 /* given the presetting of brd_id, set the corresponding hdw_id */
68 sbeid_set_hdwbid(ci_t
*ci
)
71 * set SBE's unique hardware identification (for legacy boards might not
72 * have this register implemented)
76 case SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPTMC_256T3_E1
):
77 ci
->hdw_bid
= SBE_BID_256T3_E1
; /* 0x46 - SBE wanPTMC-256T3 (E1
80 case SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPTMC_256T3_T1
):
81 ci
->hdw_bid
= SBE_BID_256T3_T1
; /* 0x42 - SBE wanPTMC-256T3 (T1
84 case SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C4T1E1
):
85 case SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C4T1E1_L
):
87 * This Board ID is a generic identification. Use the found number
88 * of ports to further define this hardware.
90 switch (ci
->max_port
) {
91 default: /* shouldn't need a default, but have one
94 ci
->hdw_bid
= SBE_BID_PMC_C4T1E1
; /* 0xC4 - SBE wanPMC-C4T1E1 */
97 ci
->hdw_bid
= SBE_BID_PMC_C2T1E1
; /* 0xC2 - SBE wanPMC-C2T1E1 */
98 ci
->brd_id
= SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C2T1E1
);
101 ci
->hdw_bid
= SBE_BID_PMC_C1T1E1
; /* 0xC1 - SBE wanPMC-C1T1E1 */
102 ci
->brd_id
= SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C1T1E1
);
106 case SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C2T1E1
):
107 case SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C2T1E1_L
):
108 ci
->hdw_bid
= SBE_BID_PMC_C2T1E1
; /* 0xC2 - SBE wanPMC-C2T1E1 */
110 case SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C1T1E1
):
111 case SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C1T1E1_L
):
112 ci
->hdw_bid
= SBE_BID_PMC_C1T1E1
; /* 0xC1 - SBE wanPMC-C1T1E1 */
114 #ifdef SBE_PMCC4_ENABLE
116 * This case is entered as a result of the inability to obtain the
117 * <bid> from the board's EEPROM. Assume a PCI board and set
118 * <hdsbid> according to the number ofr found ports.
121 /* start by assuming 4-port for ZERO casing */
122 ci
->brd_id
= SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C4T1E1
);
123 /* drop thru to set hdw_bid and alternate PCI CxT1E1 settings */
125 case SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C4T1E1
):
127 * This Board ID is a generic identification. Use the number of
128 * found ports to further define this hardware.
130 switch (ci
->max_port
) {
131 default: /* shouldn't need a default, but have one
134 ci
->hdw_bid
= SBE_BID_PCI_C4T1E1
; /* 0x04 - SBE wanPCI-C4T1E1 */
137 ci
->hdw_bid
= SBE_BID_PCI_C2T1E1
; /* 0x02 - SBE wanPCI-C2T1E1 */
138 ci
->brd_id
= SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C2T1E1
);
141 ci
->hdw_bid
= SBE_BID_PCI_C1T1E1
; /* 0x01 - SBE wanPCI-C1T1E1 */
142 ci
->brd_id
= SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C1T1E1
);
146 case SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C2T1E1
):
147 ci
->hdw_bid
= SBE_BID_PCI_C2T1E1
; /* 0x02 - SBE wanPCI-C2T1E1 */
149 case SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C1T1E1
):
150 ci
->hdw_bid
= SBE_BID_PCI_C1T1E1
; /* 0x01 - SBE wanPCI-C1T1E1 */
153 /*** bid = "<unknown>"; ***/
154 ci
->hdw_bid
= SBE_BID_PMC_C4T1E1
; /* 0x41 - SBE wanPTMC-C4T1E1 */
159 /* given the presetting of hdw_bid, set the corresponding brd_id */
162 sbeid_set_bdtype(ci_t
*ci
)
164 /* set SBE's unique PCI VENDOR/DEVID */
165 switch (ci
->hdw_bid
) {
166 case SBE_BID_C1T3
: /* SBE wanPMC-C1T3 */
167 ci
->brd_id
= SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C1T3
);
169 case SBE_BID_C24TE1
: /* SBE wanPTMC-C24TE1 */
170 ci
->brd_id
= SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPTMC_C24TE1
);
172 case SBE_BID_256T3_E1
: /* SBE wanPTMC-256T3 E1 Version */
173 ci
->brd_id
= SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPTMC_256T3_E1
);
175 case SBE_BID_256T3_T1
: /* SBE wanPTMC-256T3 T1 Version */
176 ci
->brd_id
= SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPTMC_256T3_T1
);
178 case SBE_BID_PMC_C4T1E1
: /* 0xC4 - SBE wanPMC-C4T1E1 */
179 ci
->brd_id
= SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C4T1E1
);
181 case SBE_BID_PMC_C2T1E1
: /* 0xC2 - SBE wanPMC-C2T1E1 */
182 ci
->brd_id
= SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C2T1E1
);
184 case SBE_BID_PMC_C1T1E1
: /* 0xC1 - SBE wanPMC-C1T1E1 */
185 ci
->brd_id
= SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C1T1E1
);
187 case SBE_BID_PCI_C4T1E1
: /* 0x04 - SBE wanPCI-C4T1E1 */
188 ci
->brd_id
= SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C4T1E1
);
190 case SBE_BID_PCI_C2T1E1
: /* 0x02 - SBE wanPCI-C2T1E1 */
191 ci
->brd_id
= SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C2T1E1
);
193 case SBE_BID_PCI_C1T1E1
: /* 0x01 - SBE wanPCI-C1T1E1 */
194 ci
->brd_id
= SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C1T1E1
);
198 /*** hdw_bid = "<unknown>"; ***/
199 ci
->brd_id
= SBE_BOARD_ID(PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C4T1E1
);
205 /*** End-of-File ***/