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
)
29 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPTMC_256T3_E1
):
30 np
= "wanPTMC-256T3 <E1>";
32 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPTMC_256T3_T1
):
33 np
= "wanPTMC-256T3 <T1>";
35 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C4T1E1
):
36 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C4T1E1_L
):
39 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C2T1E1
):
40 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C2T1E1_L
):
43 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C1T1E1
):
44 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C1T1E1_L
):
47 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C4T1E1
):
50 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C2T1E1
):
53 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C1T1E1
):
57 /*** np = "<unknown>"; ***/
66 /* given the presetting of brd_id, set the corresponding hdw_id */
69 sbeid_set_hdwbid (ci_t
*ci
)
72 * set SBE's unique hardware identification (for legacy boards might not
73 * have this register implemented)
78 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPTMC_256T3_E1
):
79 ci
->hdw_bid
= SBE_BID_256T3_E1
; /* 0x46 - SBE wanPTMC-256T3 (E1
82 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPTMC_256T3_T1
):
83 ci
->hdw_bid
= SBE_BID_256T3_T1
; /* 0x42 - SBE wanPTMC-256T3 (T1
86 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C4T1E1
):
87 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C4T1E1_L
):
89 * This Board ID is a generic identification. Use the found number
90 * of ports to further define this hardware.
94 default: /* shouldn't need a default, but have one
97 ci
->hdw_bid
= SBE_BID_PMC_C4T1E1
; /* 0xC4 - SBE wanPMC-C4T1E1 */
100 ci
->hdw_bid
= SBE_BID_PMC_C2T1E1
; /* 0xC2 - SBE wanPMC-C2T1E1 */
101 ci
->brd_id
= SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C2T1E1
);
104 ci
->hdw_bid
= SBE_BID_PMC_C1T1E1
; /* 0xC1 - SBE wanPMC-C1T1E1 */
105 ci
->brd_id
= SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C1T1E1
);
109 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C2T1E1
):
110 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C2T1E1_L
):
111 ci
->hdw_bid
= SBE_BID_PMC_C2T1E1
; /* 0xC2 - SBE wanPMC-C2T1E1 */
113 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C1T1E1
):
114 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C1T1E1_L
):
115 ci
->hdw_bid
= SBE_BID_PMC_C1T1E1
; /* 0xC1 - SBE wanPMC-C1T1E1 */
117 #ifdef SBE_PMCC4_ENABLE
119 * This case is entered as a result of the inability to obtain the
120 * <bid> from the board's EEPROM. Assume a PCI board and set
121 * <hdsbid> according to the number ofr found ports.
124 /* start by assuming 4-port for ZERO casing */
125 ci
->brd_id
= SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C4T1E1
);
126 /* drop thru to set hdw_bid and alternate PCI CxT1E1 settings */
128 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C4T1E1
):
130 * This Board ID is a generic identification. Use the number of
131 * found ports to further define this hardware.
133 switch (ci
->max_port
)
135 default: /* shouldn't need a default, but have one
138 ci
->hdw_bid
= SBE_BID_PCI_C4T1E1
; /* 0x04 - SBE wanPCI-C4T1E1 */
141 ci
->hdw_bid
= SBE_BID_PCI_C2T1E1
; /* 0x02 - SBE wanPCI-C2T1E1 */
142 ci
->brd_id
= SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C2T1E1
);
145 ci
->hdw_bid
= SBE_BID_PCI_C1T1E1
; /* 0x01 - SBE wanPCI-C1T1E1 */
146 ci
->brd_id
= SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C1T1E1
);
150 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C2T1E1
):
151 ci
->hdw_bid
= SBE_BID_PCI_C2T1E1
; /* 0x02 - SBE wanPCI-C2T1E1 */
153 case SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C1T1E1
):
154 ci
->hdw_bid
= SBE_BID_PCI_C1T1E1
; /* 0x01 - SBE wanPCI-C1T1E1 */
157 /*** bid = "<unknown>"; ***/
158 ci
->hdw_bid
= SBE_BID_PMC_C4T1E1
; /* 0x41 - SBE wanPTMC-C4T1E1 */
163 /* given the presetting of hdw_bid, set the corresponding brd_id */
166 sbeid_set_bdtype (ci_t
*ci
)
168 /* set SBE's unique PCI VENDOR/DEVID */
171 case SBE_BID_C1T3
: /* SBE wanPMC-C1T3 */
172 ci
->brd_id
= SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C1T3
);
174 case SBE_BID_C24TE1
: /* SBE wanPTMC-C24TE1 */
175 ci
->brd_id
= SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPTMC_C24TE1
);
177 case SBE_BID_256T3_E1
: /* SBE wanPTMC-256T3 E1 Version */
178 ci
->brd_id
= SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPTMC_256T3_E1
);
180 case SBE_BID_256T3_T1
: /* SBE wanPTMC-256T3 T1 Version */
181 ci
->brd_id
= SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPTMC_256T3_T1
);
183 case SBE_BID_PMC_C4T1E1
: /* 0xC4 - SBE wanPMC-C4T1E1 */
184 ci
->brd_id
= SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C4T1E1
);
186 case SBE_BID_PMC_C2T1E1
: /* 0xC2 - SBE wanPMC-C2T1E1 */
187 ci
->brd_id
= SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C2T1E1
);
189 case SBE_BID_PMC_C1T1E1
: /* 0xC1 - SBE wanPMC-C1T1E1 */
190 ci
->brd_id
= SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPMC_C1T1E1
);
192 case SBE_BID_PCI_C4T1E1
: /* 0x04 - SBE wanPCI-C4T1E1 */
193 ci
->brd_id
= SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C4T1E1
);
195 case SBE_BID_PCI_C2T1E1
: /* 0x02 - SBE wanPCI-C2T1E1 */
196 ci
->brd_id
= SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C2T1E1
);
198 case SBE_BID_PCI_C1T1E1
: /* 0x01 - SBE wanPCI-C1T1E1 */
199 ci
->brd_id
= SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C1T1E1
);
203 /*** hdw_bid = "<unknown>"; ***/
204 ci
->brd_id
= SBE_BOARD_ID (PCI_VENDOR_ID_SBE
, PCI_DEVICE_ID_WANPCI_C4T1E1
);
210 /*** End-of-File ***/