# # This file and its contents are supplied under the terms of the # Common Development and Distribution License ("CDDL"), version 1.0. # You may only use this file in accordance with the terms of version # 1.0 of the CDDL. # # A full copy of the text of the CDDL should have accompanied this # source. A copy of the CDDL is also available via the Internet at # http://www.illumos.org/license/CDDL. # This directory contains files extracted from the Intel ixl-1.6.10 driver for FreeBSD with the following modifications/differences. The following two changes each modified the common code. 9805 i40e should read SFP data when firmware supports it 9601 Divide by zero in i40e_get_available_resources() The following diff was originally applied to add support for Studio and the 32-bit kernel: --- ixl-1.6.10/src/i40e_common.c +++ illumos-gate/usr/src/uts/common/io/i40e/core/i40e_common.c @@ -4037,8 +4037,8 @@ cmd->type = mib_type; cmd->length = CPU_TO_LE16(buff_size); - cmd->address_high = CPU_TO_LE32(I40E_HI_WORD((u64)buff)); - cmd->address_low = CPU_TO_LE32(I40E_LO_DWORD((u64)buff)); + cmd->address_high = CPU_TO_LE32(I40E_HI_WORD((uintptr_t)buff)); + cmd->address_low = CPU_TO_LE32(I40E_LO_DWORD((uintptr_t)buff)); status = i40e_asq_send_command(hw, &desc, buff, buff_size, cmd_details); return status; @@ -6585,9 +6585,9 @@ i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_set_proxy_config); desc.params.external.addr_high = - CPU_TO_LE32(I40E_HI_DWORD((u64)proxy_config)); + CPU_TO_LE32(I40E_HI_DWORD((uintptr_t)proxy_config)); desc.params.external.addr_low = - CPU_TO_LE32(I40E_LO_DWORD((u64)proxy_config)); + CPU_TO_LE32(I40E_LO_DWORD((uintptr_t)proxy_config)); status = i40e_asq_send_command(hw, &desc, proxy_config, sizeof(struct i40e_aqc_arp_proxy_data), @@ -6619,9 +6619,9 @@ i40e_aqc_opc_set_ns_proxy_table_entry); desc.params.external.addr_high = - CPU_TO_LE32(I40E_HI_DWORD((u64)ns_proxy_table_entry)); + CPU_TO_LE32(I40E_HI_DWORD((uintptr_t)ns_proxy_table_entry)); desc.params.external.addr_low = - CPU_TO_LE32(I40E_LO_DWORD((u64)ns_proxy_table_entry)); + CPU_TO_LE32(I40E_LO_DWORD((uintptr_t)ns_proxy_table_entry)); status = i40e_asq_send_command(hw, &desc, ns_proxy_table_entry, sizeof(struct i40e_aqc_ns_proxy_data), @@ -6681,8 +6681,8 @@ valid_flags |= I40E_AQC_SET_WOL_FILTER_NO_TCO_ACTION_VALID; cmd->valid_flags = CPU_TO_LE16(valid_flags); - cmd->address_high = CPU_TO_LE32(I40E_HI_DWORD((u64)filter)); - cmd->address_low = CPU_TO_LE32(I40E_LO_DWORD((u64)filter)); + cmd->address_high = CPU_TO_LE32(I40E_HI_DWORD((uintptr_t)filter)); + cmd->address_low = CPU_TO_LE32(I40E_LO_DWORD((uintptr_t)filter)); status = i40e_asq_send_command(hw, &desc, filter, buff_len, cmd_details); --- ixl-1.6.10/src/i40e_register.h +++ illumos-gate/usr/src/uts/common/io/i40e/core/i40e_register.h @@ -113,7 +113,7 @@ #define I40E_PF_ATQLEN_ATQCRIT_SHIFT 30 #define I40E_PF_ATQLEN_ATQCRIT_MASK I40E_MASK(0x1, I40E_PF_ATQLEN_ATQCRIT_SHIFT) #define I40E_PF_ATQLEN_ATQENABLE_SHIFT 31 -#define I40E_PF_ATQLEN_ATQENABLE_MASK I40E_MASK(0x1, I40E_PF_ATQLEN_ATQENABLE_SHIFT) +#define I40E_PF_ATQLEN_ATQENABLE_MASK I40E_MASK(0x1UL, I40E_PF_ATQLEN_ATQENABLE_SHIFT) #define I40E_PF_ATQT 0x00080400 /* Reset: EMPR */ #define I40E_PF_ATQT_ATQT_SHIFT 0 #define I40E_PF_ATQT_ATQT_MASK I40E_MASK(0x3FF, I40E_PF_ATQT_ATQT_SHIFT) --- ixl-1.6.10/src/i40e_type.h +++ illumos-gate/usr/src/uts/common/io/i40e/core/i40e_type.h @@ -49,7 +49,7 @@ #ifndef I40E_MASK /* I40E_MASK is a macro used on 32 bit registers */ -#define I40E_MASK(mask, shift) (mask << shift) +#define I40E_MASK(mask, shift) (((uint32_t)(mask)) << ((uint32_t)(shift))) #endif #define I40E_MAX_PF 16