3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs * CDDL HEADER START
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs * The contents of this file are subject to the terms of the
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs * Common Development and Distribution License (the "License").
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs * You may not use this file except in compliance with the License.
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs * See the License for the specific language governing permissions
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs * and limitations under the License.
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs * When distributing Covered Code, include this CDDL HEADER in each
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs * If applicable, add the following below this CDDL HEADER, with the
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs * fields enclosed by brackets "[]" replaced with your own identifying
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs * information: Portions Copyright [yyyy] [name of copyright owner]
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs * CDDL HEADER END
63b1987d5d7387bda49397c0f3f063b49651a5bcQiyan Sun - Sun Microsystems - San Diego United States * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs * Use is subject to license terms.
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_tcam_check_completion(hpi_handle_t handle, tcam_op_t op_type)
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs " TCAM RWC_STAT operation"
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs " failed to complete \n"));
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs " TCAM Match operationfailed to find match \n"));
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs " Invalid TCAM completion Request \n"));
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs return (HPI_PFC_ERROR | HPI_TCAM_ERROR | OPCODE_INVALID);
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_tcam_entry_read(hpi_handle_t handle, uint32_t location,
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs * Hydra doesn't allow to read TCAM entries. Use compare instead.
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs tctl_rv.value = hpi_pfc_tcam_check_completion(handle, TCAM_RWC_MATCH);
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs tcam_stat = hpi_pfc_tcam_check_completion(handle, TCAM_RWC_STAT);
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_tcam_asc_ram_entry_write(hpi_handle_t handle, uint32_t location,
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs " tcam ascr write: location %x data %llx ctl value %llx \n",
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs tcam_stat = hpi_pfc_tcam_check_completion(handle, TCAM_RWC_STAT);
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_set_config(hpi_handle_t handle, pfc_config_t config)
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_get_config(hpi_handle_t handle, pfc_config_t *configp)
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_set_tcam_enable(hpi_handle_t handle, boolean_t tcam)
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs * Read the register first.
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_set_l2_hash(hpi_handle_t handle, boolean_t l2_hash)
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs * Read the register first.
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_set_tcp_cksum(hpi_handle_t handle, boolean_t cksum)
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs * Read the register first.
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_set_default_dma(hpi_handle_t handle, uint32_t dma_channel_no)
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_mac_addr_enable(hpi_handle_t handle, uint32_t slot)
fe930412c257f961ae67039de3b164b83717976aqs config.bits.mac_addr_en_l = config.bits.mac_addr_en_l | bit;
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_mac_addr_disable(hpi_handle_t handle, uint32_t slot)
fe930412c257f961ae67039de3b164b83717976aqs config.bits.mac_addr_en_l = config.bits.mac_addr_en_l & ~bit;
fe930412c257f961ae67039de3b164b83717976aqs config.bits.mac_addr_en = config.bits.mac_addr_en & ~bit;
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_set_force_csum(hpi_handle_t handle, boolean_t force)
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs for (i = 0; i < HXGE_VLAN_TABLE_ENTRIES; i++) {
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_cfg_vlan_table_entry_clear(hpi_handle_t handle, vlan_id_t vlan_id)
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs * Assumes that the hardware will generate the new parity
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs REG_PIO_READ64(handle, offset, (uint64_t *)&vlan_tbl_entry.value);
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs vlan_tbl_entry.bits.member = vlan_tbl_entry.bits.member & ~bit;
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_cfg_vlan_table_entry_set(hpi_handle_t handle, vlan_id_t vlan_id)
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs * Assumes that the hardware will generate the new parity
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs REG_PIO_READ64(handle, offset, (uint64_t *)&vlan_tbl_entry.value);
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs vlan_tbl_entry.bits.member = vlan_tbl_entry.bits.member | bit;
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_cfg_vlan_control_set(hpi_handle_t handle, boolean_t parity,
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs REG_PIO_WRITE64(handle, PFC_VLAN_CTRL, vlan_control.value);
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_get_vlan_parity_log(hpi_handle_t handle, pfc_vlan_par_err_log_t *logp)
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_set_mac_address(hpi_handle_t handle, uint32_t slot, uint64_t address)
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_clear_mac_address(hpi_handle_t handle, uint32_t slot)
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_clear_multicast_hash_table(hpi_handle_t handle, uint32_t slot)
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_set_multicast_hash_table(hpi_handle_t handle, uint32_t slot,
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_set_l2_class_slot(hpi_handle_t handle, uint16_t etype, boolean_t valid,
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_set_l3_class_config(hpi_handle_t handle, tcam_class_t slot,
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_get_l3_class_config(hpi_handle_t handle, tcam_class_t slot,
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_set_tcam_control(hpi_handle_t handle, pfc_tcam_ctrl_t *tcontrolp)
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_tcam_entry_invalidate(hpi_handle_t handle, uint32_t location)
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs (void) hpi_pfc_tcam_entry_write(handle, location, &tcam_ptr);
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs for (i = 0; i < PFC_N_TCAM_ENTRIES; i++) {
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_tcam_entry_write(hpi_handle_t handle, uint32_t location,
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs " tcam write: location %x\n key: %llx %llx\n mask: %llx %llx\n",
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs tcam_stat = hpi_pfc_tcam_check_completion(handle, TCAM_RWC_STAT);
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_get_tcam_parity_log(hpi_handle_t handle, pfc_tcam_par_err_log_t *logp)
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_get_tcam_auto_init(hpi_handle_t handle, pfc_auto_init_t *autoinitp)
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_set_tcp_control_discard(hpi_handle_t handle, boolean_t discard)
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_set_tcp_control_fin(hpi_handle_t handle, boolean_t fin)
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_set_tcp_control_syn(hpi_handle_t handle, boolean_t syn)
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_set_tcp_control_rst(hpi_handle_t handle, boolean_t rst)
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_set_tcp_control_psh(hpi_handle_t handle, boolean_t push)
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_set_tcp_control_ack(hpi_handle_t handle, boolean_t ack)
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_set_hash_seed_value(hpi_handle_t handle, uint32_t seed)
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_get_interrupt_status(hpi_handle_t handle, pfc_int_status_t *statusp)
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs REG_PIO_WRITE64(handle, offset, HXGE_PFC_INT_STATUS_CLEAR);
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_set_interrupt_mask(hpi_handle_t handle, boolean_t drop,
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs boolean_t tcam_parity_error, boolean_t vlan_parity_error)
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_get_drop_log(hpi_handle_t handle, pfc_drop_log_t *logp)
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_set_drop_log_mask(hpi_handle_t handle, boolean_t vlan_drop,
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs boolean_t tcam_drop, boolean_t class_code_drop, boolean_t l2_addr_drop,
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_get_bad_csum_counter(hpi_handle_t handle, uint64_t *countp)
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_get_drop_counter(hpi_handle_t handle, uint64_t *countp)
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_get_number_mac_addrs(hpi_handle_t handle, uint32_t *n_of_addrs)
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs HXGE_REG_RD32(handle, HCR_REG + HCR_N_MAC_ADDRS, n_of_addrs);
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qshpi_pfc_mac_addr_get_i(hpi_handle_t handle, uint8_t *data, int slot)
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs * Read the MAC address out of the SPROM at the blade's
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs * specific location.
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs HXGE_REG_RD32(handle, HCR_REG + HCR_ADDR_LO + slot * step, &addr_lo);
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs HXGE_REG_RD32(handle, HCR_REG + HCR_ADDR_HI + slot * step, &addr_hi);
63b1987d5d7387bda49397c0f3f063b49651a5bcQiyan Sun - Sun Microsystems - San Diego United States data[4] = (addr_hi & 0x0000000ff);
63b1987d5d7387bda49397c0f3f063b49651a5bcQiyan Sun - Sun Microsystems - San Diego United States data[5] = (addr_hi & 0x00000ff00) >> 8;
3dec9fcdd56adf1b4a563137b4915c8f2d83b881qs for (i = 0; i < 16; i++) {