ef10_mcdi.c (291436) | ef10_mcdi.c (291585) |
---|---|
1/*- 2 * Copyright (c) 2012-2015 Solarflare Communications Inc. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright notice, --- 15 unchanged lines hidden (view full) --- 24 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * 26 * The views and conclusions contained in the software and documentation are 27 * those of the authors and should not be interpreted as representing official 28 * policies, either expressed or implied, of the FreeBSD Project. 29 */ 30 31#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2012-2015 Solarflare Communications Inc. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright notice, --- 15 unchanged lines hidden (view full) --- 24 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * 26 * The views and conclusions contained in the software and documentation are 27 * those of the authors and should not be interpreted as representing official 28 * policies, either expressed or implied, of the FreeBSD Project. 29 */ 30 31#include <sys/cdefs.h> |
32__FBSDID("$FreeBSD: head/sys/dev/sfxge/common/hunt_mcdi.c 291436 2015-11-29 05:42:49Z arybchik $"); | 32__FBSDID("$FreeBSD: head/sys/dev/sfxge/common/hunt_mcdi.c 291585 2015-12-01 15:26:46Z arybchik $"); |
33 34#include "efsys.h" 35#include "efx.h" 36#include "efx_impl.h" 37 38 39#if EFSYS_OPT_HUNTINGTON 40 --- 389 unchanged lines hidden (view full) --- 430hunt_mcdi_fw_update_supported( 431 __in efx_nic_t *enp, 432 __out boolean_t *supportedp) 433{ 434 efx_nic_cfg_t *encp = &(enp->en_nic_cfg); 435 436 EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON); 437 | 33 34#include "efsys.h" 35#include "efx.h" 36#include "efx_impl.h" 37 38 39#if EFSYS_OPT_HUNTINGTON 40 --- 389 unchanged lines hidden (view full) --- 430hunt_mcdi_fw_update_supported( 431 __in efx_nic_t *enp, 432 __out boolean_t *supportedp) 433{ 434 efx_nic_cfg_t *encp = &(enp->en_nic_cfg); 435 436 EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON); 437 |
438 /* use privilege mask state at MCDI attach */ | 438 /* 439 * Use privilege mask state at MCDI attach. 440 * Admin privilege must be used prior to introduction of 441 * specific flag. 442 */ |
439 *supportedp = (encp->enc_privilege_mask & 440 MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN) 441 == MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN; 442 443 return (0); 444} 445 446 __checkReturn efx_rc_t 447hunt_mcdi_macaddr_change_supported( 448 __in efx_nic_t *enp, 449 __out boolean_t *supportedp) 450{ 451 efx_nic_cfg_t *encp = &(enp->en_nic_cfg); | 443 *supportedp = (encp->enc_privilege_mask & 444 MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN) 445 == MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN; 446 447 return (0); 448} 449 450 __checkReturn efx_rc_t 451hunt_mcdi_macaddr_change_supported( 452 __in efx_nic_t *enp, 453 __out boolean_t *supportedp) 454{ 455 efx_nic_cfg_t *encp = &(enp->en_nic_cfg); |
456 uint32_t privilege_mask = encp->enc_privilege_mask; |
|
452 453 EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON); 454 | 457 458 EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON); 459 |
455 /* use privilege mask state at MCDI attach */ 456 *supportedp = (encp->enc_privilege_mask & 457 MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING) 458 == MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING; | 460 /* 461 * Use privilege mask state at MCDI attach. 462 * Admin privilege must be used prior to introduction of 463 * specific flag (at v4.6). 464 */ 465 *supportedp = 466 ((privilege_mask & MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING) == 467 MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING) || 468 ((privilege_mask & MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN) == 469 MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN); |
459 460 return (0); 461} 462 463#endif /* EFSYS_OPT_MCDI */ 464 465#endif /* EFSYS_OPT_HUNTINGTON */ | 470 471 return (0); 472} 473 474#endif /* EFSYS_OPT_MCDI */ 475 476#endif /* EFSYS_OPT_HUNTINGTON */ |