dev.h (8860B)
1 /* 2 * DO NOT EDIT THIS FILE! 3 * This file is auto-generated. 4 * Edits to this file will be lost when it is regenerated. 5 * 6 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 7 * 8 * Copyright 2007-2020 Broadcom Inc. All rights reserved. 9 */ 10 11 #ifndef BCMI_LTSW_DEV_H 12 #define BCMI_LTSW_DEV_H 13 14 #include <bcm/types.h> 15 16 #include <sal/sal_types.h> 17 18 /*! 19 * \brief Initialize the device information for specified unit. 20 * 21 * \param [in] unit Unit Number. 22 * 23 * \retval SHR_E_NONE No errors. 24 * \retval !SHR_E_NONE Failure. 25 */ 26 extern int 27 bcmi_ltsw_dev_init(int unit); 28 29 /*! 30 * \brief Initialize the device information for specified unit. 31 * 32 * \param [in] unit Unit Number. 33 * 34 * \retval SHR_E_NONE No errors. 35 * \retval !SHR_E_NONE Failure. 36 */ 37 extern int 38 bcmi_ltsw_dev_info_init(int unit); 39 40 /*! 41 * \brief Get the BCMDRD unit ID associated with a given BCM unit ID. 42 * 43 * \param [in] unit Unit Number. 44 * 45 * \return BCMDRD unit ID. 46 */ 47 extern int 48 bcmi_ltsw_dev_dunit(int unit); 49 50 /*! 51 * \brief Get the BCM unit ID associated with a given BCMDRD unit ID. 52 * 53 * \param [in] dunit BCM unit ID. 54 * 55 * \return BCMDRD unit ID. 56 */ 57 extern int 58 bcmi_ltsw_dev_unit(int dunit); 59 60 /*! 61 * \brief Check if a device has been created. 62 * 63 * \param [in] unit Unit Number. 64 * 65 * \return true if device exists, otherwise false. 66 */ 67 extern int 68 bcmi_ltsw_dev_exists(int unit); 69 70 /*! 71 * \brief Get the PCI vendor ID. 72 * 73 * \param [in] unit Unit Number. 74 * 75 * \return Broadcom device vendor ID. 76 */ 77 extern int 78 bcmi_ltsw_dev_vendor_id(int unit); 79 80 /*! 81 * \brief Get the PCI device ID. 82 * 83 * \param [in] unit Unit Number. 84 * 85 * \return Broadcom device ID. 86 */ 87 extern int 88 bcmi_ltsw_dev_device_id(int unit); 89 90 /*! 91 * \brief Get the PCI revision ID. 92 * 93 * \param [in] unit Unit Number. 94 * 95 * \return Broadcom device revison ID. 96 */ 97 extern int 98 bcmi_ltsw_dev_revision_id(int unit); 99 100 /*! 101 * \brief Get the error handling of user callback. 102 * 103 * \param [in] unit Unit Number. 104 * 105 * \retval 0 Continue processing on the error of user callback. 106 * \retval !0 Abort processing on the error of user callback. 107 */ 108 extern int 109 bcmi_ltsw_dev_cb_err_abort(int unit); 110 111 /*! 112 * \brief Get the number of logical port. 113 * 114 * \param [in] unit Unit Number. 115 * 116 * \return Number of logical port. 117 */ 118 extern int 119 bcmi_ltsw_dev_logic_port_num(int unit); 120 121 /*! 122 * \brief Get the maximum logical port. 123 * 124 * \param [in] unit Unit Number. 125 * 126 * \return Maximum logical port. 127 */ 128 extern int 129 bcmi_ltsw_dev_logic_port_max(int unit); 130 131 /*! 132 * \brief Get the number of physical port. 133 * 134 * \param [in] unit Unit Number. 135 * 136 * \return Number of physical port. 137 */ 138 extern int 139 bcmi_ltsw_dev_phys_port_num(int unit); 140 141 /*! 142 * \brief Get the maximum physical port. 143 * 144 * \param [in] unit Unit Number. 145 * 146 * \return Maximum physical port. 147 */ 148 extern int 149 bcmi_ltsw_dev_phys_port_max(int unit); 150 151 /*! 152 * \brief Get the number of pipes. 153 * 154 * \param [in] unit Unit Number. 155 * 156 * \return number of pipes. 157 */ 158 extern int 159 bcmi_ltsw_dev_max_pipe_num(int unit); 160 161 /*! 162 * \brief Get the maximum pipe. 163 * 164 * \param [in] unit Unit Number. 165 * 166 * \return maximum pipe. 167 */ 168 extern int 169 bcmi_ltsw_dev_pipe_max(int unit); 170 171 /*! 172 * \brief Get bitmap of pipes. 173 * 174 * \param [in] unit Unit Number. 175 * \param [out] pipe_bmp Bitmap of pipes. 176 * 177 * \retval SHR_E_NONE No errors. 178 * \retval !SHR_E_NONE Failure. 179 */ 180 extern int 181 bcmi_ltsw_dev_pipe_bmp( 182 int unit, 183 uint32_t *pipe_bmp); 184 185 /*! 186 * \brief Get the number of pp pipes. 187 * 188 * \param [in] unit Unit Number. 189 * 190 * \return Number of pp pipes. 191 */ 192 extern int 193 bcmi_ltsw_dev_max_pp_pipe_num(int unit); 194 195 /*! 196 * \brief Get the number of packet buffers. 197 * 198 * \param [in] unit Unit Number. 199 * 200 * \return Number of packet buffers. 201 */ 202 extern int 203 bcmi_ltsw_dev_max_packet_buffer_num(int unit); 204 205 /*! 206 * \brief Get the maximum pp pipe. 207 * 208 * \param [in] unit Unit Number. 209 * 210 * \return maximum pp pipe. 211 */ 212 extern int 213 bcmi_ltsw_dev_pp_pipe_max(int unit); 214 215 /*! 216 * \brief Get bitmap of pp pipes. 217 * 218 * \param [in] unit Unit Number. 219 * \param [out] pipe_bmp Bitmap of pp pipes. 220 * 221 * \retval SHR_E_NONE No errors. 222 * \retval !SHR_E_NONE Failure. 223 */ 224 extern int 225 bcmi_ltsw_dev_pp_pipe_bmp( 226 int unit, 227 uint32_t *pipe_bmp); 228 229 /*! 230 * \brief Get the maximum modid. 231 * 232 * \param [in] unit Unit Number. 233 * 234 * \return Maximum modid. 235 */ 236 extern int 237 bcmi_ltsw_dev_max_modid(int unit); 238 239 /*! 240 * \brief Get the modport max first. 241 * 242 * \param [in] unit Unit Number. 243 * 244 * \return modport max first. 245 */ 246 extern int 247 bcmi_ltsw_dev_modport_max_first(int unit); 248 249 /*! 250 * \brief Get the modport max. 251 * 252 * \param [in] unit Unit Number. 253 * 254 * \return modport max. 255 */ 256 extern int 257 bcmi_ltsw_dev_modport_max(int unit); 258 259 /*! 260 * \brief Get the modid count. 261 * 262 * \param [in] unit Unit Number. 263 * 264 * \return Modid count. 265 */ 266 extern int 267 bcmi_ltsw_dev_modid_count(int unit); 268 269 /*! 270 * \brief Get the maximum addressable port number. 271 * 272 * \param [in] unit Unit Number. 273 * 274 * \return Maximum addressable port. 275 */ 276 extern int 277 bcmi_ltsw_dev_max_port_addr(int unit); 278 279 /*! 280 * \brief Get pipeline index of a given logical port for this unit. 281 * 282 * \param [in] unit Unit Number. 283 * \param [in] port Logical port number. 284 * 285 * \return Pipeline index, or -1 on error. 286 */ 287 extern int 288 bcmi_ltsw_dev_logic_port_pipe( 289 int unit, 290 int port); 291 292 /*! 293 * \brief Get pipeline index of a given physical port for this unit. 294 * 295 * \param [in] unit Unit Number. 296 * \param [in] port Physical port number. 297 * 298 * \return Pipeline index, or -1 on error. 299 */ 300 extern int 301 bcmi_ltsw_dev_phys_port_pipe( 302 int unit, 303 int port); 304 305 /*! 306 * \brief Get PP pipe index of a given logical port for this unit. 307 * 308 * \param [in] unit Unit Number. 309 * \param [in] port Logical port number. 310 * 311 * \return PP pipe index, or -1 on error. 312 */ 313 extern int 314 bcmi_ltsw_dev_logic_port_pp_pipe( 315 int unit, 316 int port); 317 318 /*! 319 * \brief Get port index inside its PP pipe, for a given logical port for this unit. 320 * 321 * \param [in] unit Unit Number. 322 * \param [in] port Logical port number. 323 * 324 * \return Port index inside its PP pipe, or -1 on error. 325 */ 326 extern int 327 bcmi_ltsw_dev_logic_port_pp_pipe_port( 328 int unit, 329 int port); 330 331 /*! 332 * \brief Get logical port, from given PP pipe and port index inside its PP pipe. 333 * 334 * \param [in] unit Unit Number. 335 * \param [in] pipe PP pipe index. 336 * \param [in] pp_port Port index inside its PP pipe. 337 * 338 * \return Logical port number, or -1 on error. 339 */ 340 extern int 341 bcmi_ltsw_dev_pp_pipe_port_logic_port( 342 int unit, 343 int pipe, 344 int pp_port); 345 346 /*! 347 * \brief Get bitmap of physical ports. 348 * 349 * \param [in] unit Unit Number. 350 * \param [out] pbmp Bitmap of physical ports. 351 * 352 * \retval SHR_E_NONE No errors. 353 * \retval !SHR_E_NONE Failure. 354 */ 355 extern int 356 bcmi_ltsw_dev_phys_pbmp( 357 int unit, 358 bcm_pbmp_t *pbmp); 359 360 /*! 361 * \brief Get bit map of physical ports associated with a given pipeline. 362 * 363 * \param [in] unit Unit Number. 364 * \param [in] pipe Switch pipeline index. 365 * \param [out] pbmp Bitmap of physical ports associated with the specified pipeline. 366 * 367 * \retval SHR_E_NONE No errors. 368 * \retval !SHR_E_NONE Failure. 369 */ 370 extern int 371 bcmi_ltsw_dev_pipe_phys_pbmp( 372 int unit, 373 int pipe, 374 bcm_pbmp_t *pbmp); 375 376 /*! 377 * \brief Get bit map of logical ports. 378 * 379 * \param [in] unit Unit Number. 380 * \param [out] pbmp Bitmap of logical ports. 381 * 382 * \retval SHR_E_NONE No errors. 383 * \retval !SHR_E_NONE Failure. 384 */ 385 extern int 386 bcmi_ltsw_dev_logic_pbmp( 387 int unit, 388 bcm_pbmp_t *pbmp); 389 390 /*! 391 * \brief Get bit map of logical ports associated with a given pipeline. 392 * 393 * \param [in] unit Unit Number. 394 * \param [in] pipe Switch pipeline index. 395 * \param [out] pbmp Bitmap of logical ports associated with the specified pipeline. 396 * 397 * \retval SHR_E_NONE No errors. 398 * \retval !SHR_E_NONE Failure. 399 */ 400 extern int 401 bcmi_ltsw_dev_pipe_logic_pbmp( 402 int unit, 403 int pipe, 404 bcm_pbmp_t *pbmp); 405 406 /*! 407 * \brief Get bit map of logical ports associated with a given PP pipe. 408 * 409 * \param [in] unit Unit Number. 410 * \param [in] pipe PP pipe index. 411 * \param [out] pbmp Bitmap of logical ports associated with the specified PP pipe. 412 * 413 * \retval SHR_E_NONE No errors. 414 * \retval !SHR_E_NONE Failure. 415 */ 416 extern int 417 bcmi_ltsw_dev_pp_pipe_logic_pbmp( 418 int unit, 419 int pipe, 420 bcm_pbmp_t *pbmp); 421 422 /*! 423 * \brief Get the maximum port number inside mod. 424 * 425 * \param [in] unit Unit Number. 426 * 427 * \return Maximum port number inside mod. 428 */ 429 extern int 430 bcmi_ltsw_dev_max_modport(int unit); 431 432 /*! 433 * \brief Get the cmic port id for this unit. 434 * 435 * \param [in] unit Unit Number. 436 * 437 * \return CMIC port. 438 */ 439 extern int 440 bcmi_ltsw_dev_cmic_port(int unit); 441 442 /*! 443 * \brief Get the core clock frequency. 444 * 445 * \param [in] unit Unit Number. 446 * 447 * \return Core clock frequency. 448 */ 449 extern int 450 bcmi_ltsw_dev_core_clk_freq(int unit); 451 452 #endif /* BCMI_LTSW_DEV_H */