Lines Matching defs:cdev

119 static int qlnx_nic_setup(struct ecore_dev *cdev,
121 static int qlnx_nic_start(struct ecore_dev *cdev);
125 static void qlnx_set_id(struct ecore_dev *cdev, char name[NAME_SIZE],
465 for (i = 0; i < ha->cdev.num_hwfns; i++) {
466 if (&ha->cdev.hwfns[i] == p_hwfn) {
495 for (i = 0; i < ha->cdev.num_hwfns; i++) {
496 struct ecore_hwfn *p_hwfn = &ha->cdev.hwfns[i];
523 for (i = 0; i < ha->cdev.num_hwfns; i++) {
857 num_sp_msix = ha->cdev.num_hwfns;
862 ecore_vf_get_num_rxqs(&ha->cdev.hwfns[0], &max_rxq);
863 ecore_vf_get_num_rxqs(&ha->cdev.hwfns[0], &max_txq);
927 for (i = 0; i < ha->cdev.num_hwfns; i++) {
928 struct ecore_hwfn *p_hwfn = &ha->cdev.hwfns[i];
986 for (i = 0; i < ha->cdev.num_hwfns; i++) {
1043 struct ecore_hwfn *p_hwfn = &ha->cdev.hwfns[0];
1197 ha->cdev.ha = ha;
1198 ecore_init_struct(&ha->cdev);
1211 ecore_init_dp(&ha->cdev, ha->dp_module, ha->dp_level, ha->pci_dev);
1213 ha->cdev.regview = ha->pci_reg;
1218 ha->cdev.b_is_vf = true;
1221 ha->cdev.doorbells = ha->pci_dbells;
1222 ha->cdev.db_phys_addr = ha->dbells_phys_addr;
1223 ha->cdev.db_size = ha->dbells_size;
1228 ha->cdev.doorbells = ha->pci_dbells;
1229 ha->cdev.db_phys_addr = ha->dbells_phys_addr;
1230 ha->cdev.db_size = ha->dbells_size;
1251 ecore_hw_prepare(&ha->cdev, &params);
1253 qlnx_set_id(&ha->cdev, qlnx_name_str, qlnx_ver_str);
1255 QL_DPRINT1(ha, "ha = %p cdev = %p p_hwfn = %p\n",
1256 ha, &ha->cdev, &ha->cdev.hwfns[0]);
1291 ecore_hw_remove(&ha->cdev);
1326 for (i = 0; i < ha->cdev.num_hwfns; i++) {
1376 for (i = 0; i < ha->cdev.num_hwfns; i++) {
1423 p_hwfn = &ha->cdev.hwfns[(i % ha->cdev.num_hwfns)];
1458 p_hwfn = &ha->cdev.hwfns[(i % ha->cdev.num_hwfns)];
2449 struct ecore_dev *cdev;
2452 cdev = &ha->cdev;
2465 rc = ecore_filter_mcast_cmd(cdev, mcast, ECORE_SPQ_MODE_CB, NULL);
2763 struct ecore_hwfn *p_hwfn = &ha->cdev.hwfns[0];
3784 p_hwfn = &ha->cdev.hwfns[0];
4523 struct ecore_dev *cdev = &ha->cdev;
4535 p_hwfn = &ha->cdev.hwfns[(fp->rss_id % cdev->num_hwfns)];
5307 struct ecore_dev *cdev;
5313 cdev = p_hwfn->p_dev;
5316 bus_write_4(((qlnx_host_t *)cdev)->pci_dbells, offset, value);
5337 struct ecore_dev *cdev;
5339 cdev = ((struct ecore_hwfn *)p_hwfn)->p_dev;
5340 offset = (bus_size_t)((uint8_t *)reg_addr - (uint8_t *)(cdev->regview));
5342 data32 = bus_read_4(((qlnx_host_t *)cdev)->pci_reg, offset);
5351 struct ecore_dev *cdev;
5353 cdev = ((struct ecore_hwfn *)p_hwfn)->p_dev;
5354 offset = (bus_size_t)((uint8_t *)reg_addr - (uint8_t *)(cdev->regview));
5356 bus_write_4(((qlnx_host_t *)cdev)->pci_reg, offset, value);
5365 struct ecore_dev *cdev;
5367 cdev = ((struct ecore_hwfn *)p_hwfn)->p_dev;
5368 offset = (bus_size_t)((uint8_t *)reg_addr - (uint8_t *)(cdev->regview));
5370 bus_write_8(((qlnx_host_t *)cdev)->pci_reg, offset, value);
5589 qlnx_nic_setup(struct ecore_dev *cdev, struct ecore_pf_params *func_params)
5593 for (i = 0; i < cdev->num_hwfns; i++) {
5594 struct ecore_hwfn *p_hwfn = &cdev->hwfns[i];
5598 if (qlnx_vf_device((qlnx_host_t *)cdev) != 0) {
5604 rc = ecore_resc_alloc(cdev);
5608 ecore_resc_setup(cdev);
5616 qlnx_nic_start(struct ecore_dev *cdev)
5625 params.int_mode = cdev->int_mode;
5629 rc = ecore_hw_init(cdev, &params);
5631 ecore_resc_free(cdev);
5641 struct ecore_dev *cdev;
5670 cdev = &ha->cdev;
5672 rc = qlnx_nic_setup(cdev, &pf_params);
5676 cdev->int_mode = ECORE_INT_MODE_MSIX;
5677 cdev->int_coalescing_mode = ECORE_COAL_MODE_ENABLE;
5680 cdev->rx_coalesce_usecs = 255;
5681 cdev->tx_coalesce_usecs = 255;
5684 rc = qlnx_nic_start(cdev);
5686 ha->rx_coalesce_usecs = cdev->rx_coalesce_usecs;
5687 ha->tx_coalesce_usecs = cdev->tx_coalesce_usecs;
5701 struct ecore_dev *cdev;
5705 cdev = &ha->cdev;
5707 ecore_hw_stop(cdev);
5709 for (i = 0; i < ha->cdev.num_hwfns; i++) {
5722 ecore_resc_free(cdev);
5728 qlnx_set_id(struct ecore_dev *cdev, char name[NAME_SIZE],
5733 memcpy(cdev->name, name, NAME_SIZE);
5735 for_each_hwfn(cdev, i) {
5736 snprintf(cdev->hwfns[i].name, NAME_SIZE, "%s-%d", name, i);
5739 cdev->drv_type = DRV_ID_DRV_TYPE_FREEBSD;
5745 qlnx_get_protocol_stats(void *cdev, int proto_type, void *proto_stats)
5752 ha = cdev;
5758 ecore_get_vport_stats((struct ecore_dev *)cdev, &eth_stats);
5779 p_hwfn = &ha->cdev.hwfns[0];
5799 p_hwfn = &ha->cdev.hwfns[0];
5886 struct ecore_dev *cdev;
5888 cdev = &ha->cdev;
5891 OSAL_DMA_FREE_COHERENT(cdev, ((void *)sb_info->sb_virt),
5898 qlnx_sb_init(struct ecore_dev *cdev, struct ecore_sb_info *sb_info,
5905 hwfn_index = sb_id % cdev->num_hwfns;
5906 p_hwfn = &cdev->hwfns[hwfn_index];
5907 rel_sb_id = sb_id / cdev->num_hwfns;
5909 QL_DPRINT2(((qlnx_host_t *)cdev),
5929 struct ecore_dev *cdev;
5931 cdev = &ha->cdev;
5934 sb_virt = OSAL_DMA_ALLOC_COHERENT(cdev, (&sb_phys), size);
5941 rc = qlnx_sb_init(cdev, sb_info, sb_virt, sb_phys, sb_id);
5943 OSAL_DMA_FREE_COHERENT(cdev, sb_virt, sb_phys, size);
5974 struct ecore_dev *cdev;
5977 cdev = &ha->cdev;
5992 ecore_chain_free(cdev, &rxq->rx_bd_ring);
5999 ecore_chain_free(cdev, &rxq->rx_comp_ring);
6140 struct ecore_dev *cdev;
6142 cdev = &ha->cdev;
6154 rc = ecore_chain_alloc(cdev,
6166 rc = ecore_chain_alloc(cdev,
6227 struct ecore_dev *cdev;
6229 cdev = &ha->cdev;
6236 ecore_chain_free(cdev, &txq->tx_pbl);
6249 struct ecore_dev *cdev;
6251 cdev = &ha->cdev;
6257 ret = ecore_chain_alloc(cdev,
6407 qlnx_start_vport(struct ecore_dev *cdev,
6419 ha = (qlnx_host_t *)cdev;
6436 for_each_hwfn(cdev, i) {
6437 struct ecore_hwfn *p_hwfn = &cdev->hwfns[i];
6459 qlnx_update_vport(struct ecore_dev *cdev,
6466 qlnx_host_t *ha = (qlnx_host_t *)cdev;
6495 for_each_hwfn(cdev, i) {
6496 p_hwfn = &cdev->hwfns[i];
6498 if ((cdev->num_hwfns > 1) &&
6504 fp_index = ((cdev->num_hwfns * j) + i) %
6629 struct ecore_dev *cdev = &ha->cdev;
6652 rc = qlnx_start_vport(cdev, vport_id, if_getmtu(ifp), drop_ttl0_flg,
6669 p_hwfn = &cdev->hwfns[(fp->rss_id % cdev->num_hwfns)];
6714 qparams.queue_id = txq->index / cdev->num_hwfns ;
6806 rc = qlnx_update_vport(cdev, &vport_update_params);
6848 struct ecore_dev *cdev;
6852 cdev = &ha->cdev;
6871 rc = qlnx_update_vport(cdev, &vport_update_params);
6892 struct ecore_hwfn *p_hwfn = &cdev->hwfns[(i % cdev->num_hwfns)];
6921 for_each_hwfn(cdev, i) {
6922 struct ecore_hwfn *p_hwfn = &cdev->hwfns[i];
6941 struct ecore_dev *cdev;
6944 cdev = &ha->cdev;
6954 rc = ecore_filter_ucast_cmd(cdev, &ucast, ECORE_SPQ_MODE_CB, NULL);
6963 struct ecore_dev *cdev;
6972 cdev = &ha->cdev;
6974 rc = ecore_filter_ucast_cmd(cdev, &ucast, ECORE_SPQ_MODE_CB, NULL);
6983 struct ecore_dev *cdev;
6986 cdev = &ha->cdev;
7003 rc = ecore_filter_mcast_cmd(cdev, mcast, ECORE_SPQ_MODE_CB, NULL);
7036 struct ecore_dev *cdev;
7038 cdev = &ha->cdev;
7049 rc = ecore_filter_accept_cmd(cdev, 0, accept, false, false,
7101 struct ecore_dev *cdev;
7108 cdev = &ha->cdev;
7110 for_each_hwfn(cdev, i) {
7111 hwfn = &cdev->hwfns[i];
7205 ecore_get_vport_stats(&ha->cdev, &ha->hw_stats);
7271 qlnx_link_update(&ha->cdev.hwfns[0]);
7322 struct ecore_dev *cdev;
7326 cdev = &ha->cdev;
7336 ecore_hw_stop_fastpath(cdev);
7372 p_hwfn = &ha->cdev.hwfns[hwfn_index];
7403 p_hwfn = &ha->cdev.hwfns[hwfn_index];
7429 struct ecore_dev *cdev;
7440 cdev = &ha->cdev;
7442 for_each_hwfn(cdev, i) {
7443 hwfn = &cdev->hwfns[i];
7775 struct ecore_dev *cdev;
7777 cdev = p_hwfn->p_dev;
7779 for (i = 0; i < cdev->num_hwfns; i++) {
7780 if (&cdev->hwfns[i] == p_hwfn)
7784 if (i >= cdev->num_hwfns)
7796 QL_DPRINT2(ha, "ha = %p cdev = %p p_hwfn = %p rel_vf_id = %d\n",
7828 QL_DPRINT2(ha, "ha = %p cdev = %p p_hwfn = %p \n",
7861 QL_DPRINT2(ha, "ha = %p cdev = %p p_hwfn = %p \n",
7867 QL_DPRINT2(ha, "ha = %p cdev = %p p_hwfn = %p i = %d\n",
7914 struct ecore_dev *cdev;
7917 cdev = &ha->cdev;
7919 ecore_iov_set_vfs_to_disable(cdev, true);
7921 for_each_hwfn(cdev, i) {
7922 struct ecore_hwfn *hwfn = &cdev->hwfns[i];
7950 ecore_iov_release_hw_for_vf(&cdev->hwfns[i],
7960 ecore_iov_set_vfs_to_disable(cdev, false);
7995 struct ecore_dev *cdev;
8008 cdev = &ha->cdev;
8010 max_vfs = RESC_NUM(&cdev->hwfns[0], ECORE_VPORT);
8017 (RESC_NUM(&cdev->hwfns[0], ECORE_VPORT) - 1));
8030 for_each_hwfn(cdev, j) {
8031 struct ecore_hwfn *hwfn = &cdev->hwfns[j];
8063 qlnx_inform_vf_link_state(&cdev->hwfns[0], ha);
8135 p_hwfn = &ha->cdev.hwfns[0];
8273 for (i = 0; i < ha->cdev.num_hwfns; i++) {
8274 struct ecore_hwfn *p_hwfn = &ha->cdev.hwfns[i];
8302 for (i = 0; i < ha->cdev.num_hwfns; i++) {