solaris_compatibility.c revision 648
1N/A * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. 1N/A * This software is available to you under a choice of one of two 1N/A * licenses. You may choose to be licensed under the terms of the GNU 1N/A * General Public License (GPL) Version 2, available from the file 1N/A * COPYING in the main directory of this source tree, or the 1N/A * OpenIB.org BSD license below: 1N/A * Redistribution and use in source and binary forms, with or 1N/A * without modification, are permitted provided that the following 1N/A * conditions are met: 1N/A * - Redistributions of source code must retain the above 1N/A * copyright notice, this list of conditions and the following 1N/A * - Redistributions in binary form must reproduce the above 1N/A * copyright notice, this list of conditions and the following 1N/A * disclaimer in the documentation and/or other materials 1N/A * provided with the distribution. 1N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 1N/A * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 1N/A * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 1N/A * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 1N/A * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 1N/A * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 1N/A * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 1N/A#
endif /* HAVE_CONFIG_H */ 1N/A * OFED Solaris wrapper 1N/A * are delivered through ON. 1N/A * duplicate ABI definitions for HCAs as the HCA abi headers are not 1N/A * installed in proto. 1N/A * sol_uverbs_drv_status is the status of what libibverbs knows 1N/A * about the status of sol_uverbs driver. 1N/A * check_path() prefixs * Some temporary cache code, until things are cleaned up as part of DR * work. This will speed up the sysfs emulation. * Structure to hold the part number & PSID for an HCA card * This is a sub-set of the file : * Part Number / PSID / String ID /* For failure case, use unknown as "board-id" */ {
"unknown",
"unknown" },
{
"375-3605-01",
"SUN0160000001" },
{
"375-3382-01",
"SUN0030000001" },
{
"375-3481-01",
"SUN0040000001" },
{
"375-3418-01",
"SUN0040000001" },
{
"375-3259-01",
"SUN0010000001" },
{
"375-3259-03",
"SUN0010000001" },
{
"X1289A-Z",
"SUN0010010001" },
{
"375-3548-01",
"SUN0060000001" },
{
"375-3549-01",
"SUN0070000001" },
{
"375-3549-01",
"SUN0070130001" },
{
"375-3481-01",
"SUN0050000001" },
{
"375-3439-01",
"SUN0051000001" },
{
"375-3260-03",
"SUN0020000001" },
{
"375-3605-01",
"SUN0160000002" },
{
"375-3697-01",
"SUN0160000002" },
{
"375-3606-01",
"SUN0150000001" },
{
"375-3606-02",
"SUN0150000009" },
{
"375-3606-03",
"SUN0150000009" },
{
"375-3606-02",
"SUN0170000009" },
{
"375-3696-01",
"SUN0170000009" },
{
"375-3551-05",
"SUN0080000001" },
{
"MHEA28-XS",
"MT_0250000001" },
{
"MHEA28-XSC",
"MT_0390110001" },
{
"MHEA28-XT",
"MT_0150000001" },
{
"MHEA28-XTC",
"MT_0370110001" },
{
"MHGA28-XT",
"MT_0150000002" },
{
"MHGA28-XTC",
"MT_0370110002" },
{
"MHGA28-XTC",
"MT_0370130002" },
{
"MHGA28-XS",
"MT_0250000002" },
{
"MHGA28-XSC",
"MT_0390110002" },
{
"MHGA28-XSC",
"MT_0390130002" },
{
"MHEL-CF128",
"MT_0190000001" },
{
"MHEL-CF128-T",
"MT_00A0000001" },
{
"MTLP25208-CF128T",
"MT_00A0000001" },
{
"MHEL-CF128-TC",
"MT_00A0010001" },
{
"MHEL-CF128-TC",
"MT_0140010001" },
{
"MHEL-CF128-SC",
"MT_0190010001" },
{
"MHEA28-1TC",
"MT_02F0110001" },
{
"MHEA28-1SC",
"MT_0330110001" },
{
"MHGA28-1T",
"MT_0200000001" },
{
"MHGA28-1TC",
"MT_02F0110002" },
{
"MHGA28-1SC",
"MT_0330110002" },
{
"MHGA28-1S",
"MT_0430000001" },
{
"MHEL-CF256-T",
"MT_00B0000001" },
{
"MTLP25208-CF256T",
"MT_00B0000001" },
{
"MHEL-CF256-TC",
"MT_00B0010001" },
{
"MHEA28-2TC",
"MT_0300110001" },
{
"MHEA28-2SC",
"MT_0340110001" },
{
"MHGA28-2T",
"MT_0210000001" },
{
"MHGA28-2TC",
"MT_0300110002" },
{
"MHGA28-2SC",
"MT_0340110002" },
{
"MHEL-CF512-T",
"MT_00C0000001" },
{
"MTLP25208-CF512T",
"MT_00C0000001" },
{
"MHGA28-5T",
"MT_0220000001" },
{
"MHES14-XSC",
"MT_0410110001" },
{
"MHES14-XT",
"MT_01F0000001" },
{
"MHES14-XTC",
"MT_03F0110001" },
{
"MHES18-XS",
"MT_0260000001" },
{
"MHES18-XS",
"MT_0260010001" },
{
"MHES18-XSC",
"MT_03D0110001" },
{
"MHES18-XSC",
"MT_03D0120001" },
{
"MHES18-XSC",
"MT_03D0130001" },
{
"MHES18-XT",
"MT_0230000002" },
{
"MHES18-XT",
"MT_0230010002" },
{
"MHES18-XTC",
"MT_03B0110001" },
{
"MHES18-XTC",
"MT_03B0120001" },
{
"MHES18-XTC",
"MT_03B0140001" },
{
"MHGS18-XS",
"MT_0260000002" },
{
"MHGS18-XSC",
"MT_03D0110002" },
{
"MHGS18-XSC",
"MT_03D0120002" },
{
"MHGS18-XSC",
"MT_03D0130002" },
{
"MHGS18-XT",
"MT_0230000001" },
{
"MHGS18-XTC",
"MT_03B0110002" },
{
"MHGS18-XTC",
"MT_03B0120002" },
{
"MHGS18-XTC",
"MT_03B0140002" },
{
"MHXL-CF128",
"MT_0180000001" },
{
"MHXL-CF128-T",
"MT_0030000001" },
{
"MTLP23108-CF128T",
"MT_0030000001" },
{
"MHET2X-1SC",
"MT_0280110001" },
{
"MHET2X-1SC",
"MT_0280120001" },
{
"MHET2X-1TC",
"MT_0270110001" },
{
"MHET2X-1TC",
"MT_0270120001" },
{
"MHXL-CF256-T",
"MT_0040000001" },
{
"MHET2X-2SC",
"MT_02D0110001" },
{
"MHET2X-2SC",
"MT_02D0120001" },
{
"MHET2X-2TC",
"MT_02B0110001" },
{
"MHET2X-2TC",
"MT_02B0120001" },
{
"MHX-CE128-T",
"MT_0000000001" },
{
"MTPB23108-CE128",
"MT_0000000001" },
{
"MHX-CE256-T",
"MT_0010000001" },
{
"MTPB23108-CE256",
"MT_0010000001" },
{
"MHX-CE512-T",
"MT_0050000001" },
{
"MTPB23108-CE512",
"MT_0050000001" },
{
"MHEH28-XSC",
"MT_04C0110001" },
{
"MHEH28-XSC",
"MT_04C0130005" },
{
"MHEH28-XTC",
"MT_04A0110001" },
{
"MHEH28-XTC",
"MT_04A0130005" },
{
"MHGH28-XSC",
"MT_04C0110002" },
{
"MHGH28-XSC",
"MT_04C0120002" },
{
"MHGH28-XSC",
"MT_04C0140005" },
{
"MHGH28-XTC",
"MT_04A0110002" },
{
"MHGH28-XTC",
"MT_04A0120002" },
{
"MHGH28-XTC",
"MT_04A0140005" },
{
"MHGH29-XSC",
"MT_0A60110002" },
{
"MHGH29-XSC",
"MT_0A60120005" },
{
"MHGH29-XTC",
"MT_0A50110002" },
{
"MHGH29-XTC",
"MT_0A50120005" },
{
"MHJH29-XTC",
"MT_04E0110003" },
{
"MHJH29-XSC",
"MT_0500120005" },
{
"MHQH29-XTC",
"MT_04E0120005" },
{
"MHQH19-XTC",
"MT_0C40110009" },
{
"MHQH29-XTC",
"MT_0BB0110003" },
{
"MHQH29-XTC",
"MT_0BB0120003" },
{
"MHEH28B-XSR",
"MT_0D10110001" },
{
"MHEH28B-XTR",
"MT_0D20110001" },
{
"MHGH28B-XSR",
"MT_0D10110002" },
{
"MHGH28B-XTR",
"MT_0D20110002" },
{
"MHGH18B-XTR",
"MT_0D30110002" },
{
"MNEH28B-XSR",
"MT_0D40110004" },
{
"MNEH28B-XTR",
"MT_0D50110004" },
{
"MNEH29B-XSR",
"MT_0D40110010" },
{
"MNEH29B-XTR",
"MT_0D50110010" },
{
"MHGH29B-XSR",
"MT_0D10110008" },
{
"MHGH29B-XTR",
"MT_0D20110008" },
{
"MHJH29B-XSR",
"MT_0D10110009" },
{
"MHJH29B-XSR",
"MT_0D10120009" },
{
"MHJH29B-XTR",
"MT_0D20110009" },
{
"MHJH29B-XTR",
"MT_0D20120009" },
{
"MHGH19B-XSR",
"MT_0D60110008" },
{
"MHGH19B-XTR",
"MT_0D30110008" },
{
"MHJH19B-XTR",
"MT_0D30110009" },
{
"MHQH29B-XSR",
"MT_0D70110009" },
{
"MHQH29B-XTR",
"MT_0D80110009" },
{
"MHQH29B-XTR",
"MT_0D80120009" },
{
"MHQH29B-XTR",
"MT_0D80130009" },
{
"MHQH29B-XTR",
"MT_0E30110009" },
{
"MHRH29B-XSR",
"MT_0D70110008" },
{
"MHRH29B-XTR",
"MT_0D80110008" },
{
"MHQH19B-XTR",
"MT_0D90110009" },
{
"MHRH19B-XSR",
"MT_0E40110009" },
{
"MHRH19B-XTR",
"MT_0D90110008" },
{
"MNPH28C-XSR",
"MT_0DA0110004" },
{
"MNPH28C-XTR",
"MT_0DB0110004" },
{
"MNPH29C-XSR",
"MT_0DA0110010" },
{
"MNPH29C-XTR",
"MT_0DB0110010" },
{
"MNPH29C-XTR",
"MT_0DB0120010" },
{
"MNPH29C-XTR",
"MT_0DB0130010" },
{
"MNZH29-XSR",
"MT_0DC0110009" },
{
"MNZH29-XTR",
"MT_0DD0110009" },
{
"MNZH29-XTR",
"MT_0DD0120009" },
{
"MHQH19B-XNR",
"MT_0DF0110009" },
{
"MHQH19B-XNR",
"MT_0DF0120009" },
{
"MNQH19-XTR",
"MT_0D80110017" },
{
"MNQH19C-XTR",
"MT_0E20110017" },
{
"MHZH29B-XSR",
"MT_0E80110009" },
{
"MHZH29B-XTR",
"MT_0E90110009" },
{
"MHZH29B-XTR",
"MT_0E90110009" },
{
"MHQA19-XTR",
"MT_0EA0110009" },
{
"MHRA19-XTR",
"MT_0EB0110008" },
{
"MHQH29C-XTR",
"MT_0EF0110009" },
{
"MHQH29C-XSR",
"MT_0F00110009" },
{
"MHRH29C-XTR",
"MT_0F10110008" },
{
"MHRH29C-XSR",
"MT_0F20110008" },
{
"MHPH29D-XTR",
"MT_0F30110010" },
{
"MHPH29D-XSR",
"MT_0F40110010" },
{
"MNPA19-XTR",
"MT_0F60110010" },
{
"MNPA19-XSR",
"MT_0F70110010" },
{
"MNEH28B-XTR",
"MT_0D50110004" },
{
"MNEH29B-XSR",
"MT_0D40110010" },
{
"MNEH29B-XTR",
"MT_0D50110010" },
{
"MNPH28C-XSR",
"MT_0DA0110004" },
{
"MNPH28C-XTR",
"MT_0DB0110004" },
{
"MNPH29C-XSR",
"MT_0DA0110010" },
{
"MNPH29C-XTR",
"MT_0DB0110010" },
{
"X6275 M2 10GbE",
"X6275M2_10G" }
/* Get mlx_mdr[] array size */ (
unsigned)(
guid >>
48) &
0xffff,
(
unsigned)(
guid >>
32) &
0xffff,
(
unsigned)(
guid >>
16) &
0xffff,
(
unsigned)(
guid >> 0) &
0xffff);
(
unsigned)(
guid >>
48) &
0xffff,
(
unsigned)(
guid >>
32) &
0xffff,
(
unsigned)(
guid >>
16) &
0xffff,
(
unsigned)(
guid >> 0) &
0xffff);
/* clean up and Return */ * using the first sol_uverbs minor node that can be opened to get * all the HCA information "IB_USER_VERBS_SOLARIS_ABI_VERSION : %d\n",
"IB_USER_MAD_SOLARIS_ABI_VERSION : %d\n",
* set port_cnt to the number of total ports for all HCAs returned * find the first sol_uverbs minor node that can be opened successfully * and set sol_uverbs_mino_dev to that minor no. * All minor nodes failed to open, so set sol_uverbs_drv_status to * SOL_UVERBS_DRV_STATUS_UNLOADED to reflect that * Some sysfs emulation software * Check whether a path starts with prefix, and if it does, remove it * from the string. The prefix can also contain one %d scan argument. /* Some requests have several consecutive slashes. */ * Get the IB user verbs port info attributes for the specified device/port. * If the address of a gid pointer is passed for "gid_table", the memory * will be allocated and the ports gid table and returned as well. The caller * must free this memory on successful completion. If the address of a * pkey pointer is passed for "pkey_table", the memory will be allocated * and the ports pkey table returned as well. The caller must free this * memory on successful completion. * set high bit of port_num, and try get all gids in one go. * Quering all gids didn't work try one at a time. * Quering all gids didn't work try one at a time. * In Solaris environments, the underlying hardware driver is opened to * perform the memory mapping operations of kernel allocated memory * into the users address space. * Map the user verbs device (uverbs) to the associated * libc can't handle fd's greater than 255, in order to * ensure that these values remain available make fd > 255. * Note: not needed for LP64 * Under Linux, this is a link to the PCI device entry "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x",
"%d: PortConfigurationTraining",
/* rate = speed * width */ * This function passes the HW Part number string obtained from driver * IOCTL. The memory for "hca_hwpn" argument has to be passed by the * caller and has to be at least 64 bytes in size. "uverbs_cache_mutex %s\n",
* Find part number, set the boardid_index, * Skip index 0, as it is for failure "unknown" /* Failure case, default to "unknown" */ * Return -1 on error, or the length of the data (buf) on success. * There was a problem in initialize() * We should check all CPUS, and make sure they * are all the same or return an array of structs.