Lines Matching refs:dev

88  * dev - software handle to the device
93 oce_mbox_init(struct oce_dev *dev)
99 ASSERT(dev != NULL);
101 mbx = (struct oce_bmbx *)DBUF_VA(dev->bmbx);
114 ret = oce_mbox_dispatch(dev, 0);
117 oce_log(dev, CE_NOTE, MOD_CONFIG,
127 * dev - software handle to the device
132 oce_mbox_wait(struct oce_dev *dev, uint32_t tmo_sec)
149 mbox_db.dw0 = OCE_DB_READ32(dev, PD_MPU_MBOX_DB);
150 if (oce_fm_check_acc_handle(dev, dev->db_handle) != DDI_FM_OK) {
151 ddi_fm_service_impact(dev->dip, DDI_SERVICE_DEGRADED);
152 oce_fm_ereport(dev, DDI_FM_DEVICE_INVAL_STATE);
167 * dev - software handle to the device
172 oce_mbox_dispatch(struct oce_dev *dev, uint32_t tmo_sec)
179 (void) DBUF_SYNC(dev->bmbx, DDI_DMA_SYNC_FORDEV);
182 pa = (uint32_t)(DBUF_PA(dev->bmbx) >> 34);
189 ret = oce_mbox_wait(dev, tmo_sec);
195 OCE_DB_WRITE32(dev, PD_MPU_MBOX_DB, mbox_db.dw0);
197 if (oce_fm_check_acc_handle(dev, dev->db_handle) != DDI_FM_OK) {
198 ddi_fm_service_impact(dev->dip, DDI_SERVICE_DEGRADED);
202 ret = oce_mbox_wait(dev, tmo_sec);
204 oce_log(dev, CE_NOTE, MOD_CONFIG,
207 ddi_fm_service_impact(dev->dip, DDI_SERVICE_DEGRADED);
208 oce_fm_ereport(dev, DDI_FM_DEVICE_INVAL_STATE);
213 pa = (uint32_t)(DBUF_PA(dev->bmbx) >> 4) & 0x3fffffff;
219 OCE_DB_WRITE32(dev, PD_MPU_MBOX_DB, mbox_db.dw0);
220 if (oce_fm_check_acc_handle(dev, dev->db_handle) != DDI_FM_OK) {
221 ddi_fm_service_impact(dev->dip, DDI_SERVICE_DEGRADED);
225 ret = oce_mbox_wait(dev, tmo_sec);
227 (void) ddi_dma_sync(DBUF_DHDL(dev->bmbx), 0, 0,
229 if (oce_fm_check_dma_handle(dev, DBUF_DHDL(dev->bmbx)) != DDI_FM_OK) {
230 ddi_fm_service_impact(dev->dip, DDI_SERVICE_DEGRADED);
239 * dev - software handle to the device
246 oce_mbox_post(struct oce_dev *dev, struct oce_mbx *mbx,
255 mutex_enter(&dev->bmbx_lock);
257 mb = (struct oce_bmbx *)DBUF_VA(dev->bmbx);
268 ret = oce_mbox_dispatch(dev, tmo);
270 mutex_exit(&dev->bmbx_lock);
276 (void) ddi_dma_sync(DBUF_DHDL(dev->bmbx), 0, 0,
278 ret = oce_fm_check_dma_handle(dev, DBUF_DHDL(dev->bmbx));
280 ddi_fm_service_impact(dev->dip, DDI_SERVICE_DEGRADED);
281 mutex_exit(&dev->bmbx_lock);
294 oce_log(dev, CE_WARN, MOD_CONFIG,
298 mutex_exit(&dev->bmbx_lock);
317 mutex_exit(&dev->bmbx_lock);
324 * dev - software handle to the device
329 oce_get_fw_version(struct oce_dev *dev)
351 ret = oce_mbox_post(dev, &mbx, NULL);
356 bcopy(fwcmd->params.rsp.fw_ver_str, dev->fw_version, 32);
358 oce_log(dev, CE_NOTE, MOD_CONFIG, "%s %s",
369 * dev - software handle to the device
375 oce_reset_fun(struct oce_dev *dev)
381 mb = (struct oce_bmbx *)DBUF_VA(dev->bmbx);
397 return (oce_mbox_dispatch(dev, 0));
403 * dev - software handle to the device
414 oce_read_mac_addr(struct oce_dev *dev, uint32_t if_id, uint8_t perm,
444 ret = oce_mbox_post(dev, &mbx, NULL);
450 oce_log(dev, CE_NOTE, MOD_CONFIG,
453 oce_log(dev, CE_NOTE, MOD_CONFIG,
474 * dev - software handle to the device
485 oce_if_create(struct oce_dev *dev, uint32_t cap_flags, uint32_t en_flags,
523 ret = oce_mbox_post(dev, &mbx, NULL);
532 oce_log(dev, CE_NOTE, MOD_CONFIG,
537 dev->pmac_id = LE_32(fwcmd->params.rsp.pmac_id);
538 oce_log(dev, CE_NOTE, MOD_CONFIG,
539 "PMAC_ID = 0x%x", dev->pmac_id);
547 * dev - software handle to the device
553 oce_if_del(struct oce_dev *dev, uint32_t if_id)
577 ret = oce_mbox_post(dev, &mbx, NULL);
584 * dev - software handle to the device
590 oce_get_link_status(struct oce_dev *dev, struct link_status *link)
612 ret = oce_mbox_post(dev, &mbx, NULL);
629 * dev - software handle to the device
635 oce_set_rx_filter(struct oce_dev *dev,
660 ret = oce_mbox_post(dev, &mbx, NULL);
668 * dev - software handle to the device
676 oce_set_multicast_table(struct oce_dev *dev, uint32_t if_id,
709 ret = oce_mbox_post(dev, &mbx, NULL);
717 * dev - software handle to the device
722 oce_get_fw_config(struct oce_dev *dev)
743 ret = oce_mbox_post(dev, &mbx, NULL);
752 dev->config_number = fwcmd->params.rsp.config_number;
753 dev->asic_revision = fwcmd->params.rsp.asic_revision;
754 dev->port_id = fwcmd->params.rsp.port_id;
755 dev->function_mode = fwcmd->params.rsp.function_mode;
759 dev->max_tx_rings = fwcmd->params.rsp.ulp[0].wq_count;
760 dev->max_rx_rings = fwcmd->params.rsp.ulp[0].rq_count;
762 dev->max_tx_rings = fwcmd->params.rsp.ulp[1].wq_count;
763 dev->max_rx_rings = fwcmd->params.rsp.ulp[1].rq_count;
765 dev->function_caps = fwcmd->params.rsp.function_caps;
772 * dev - software handle to the device
777 oce_get_hw_stats(struct oce_dev *dev)
780 struct mbx_get_nic_stats *fwcmd = dev->hw_stats;
793 mbx.payload.u0.u1.sgl[0].pa_lo = ADDR_LO(DBUF_PA(dev->stats_dbuf));
794 mbx.payload.u0.u1.sgl[0].pa_hi = ADDR_HI(DBUF_PA(dev->stats_dbuf));
804 (void) DBUF_SYNC(dev->stats_dbuf, DDI_DMA_SYNC_FORDEV);
807 ret = oce_mbox_post(dev, &mbx, NULL);
809 (void) DBUF_SYNC(dev->stats_dbuf, DDI_DMA_SYNC_FORKERNEL);
816 DW_SWAP(u32ptr(dev->hw_stats), sizeof (struct mbx_get_nic_stats));
823 * dev - software handle to the device
829 oce_num_intr_vectors_set(struct oce_dev *dev, uint32_t num_vectors)
854 ret = oce_mbox_post(dev, &mbx, NULL);
862 * dev - software handle to the device
868 oce_set_flow_control(struct oce_dev *dev, uint32_t flow_control)
896 ret = oce_mbox_post(dev, &mbx, NULL);
904 * dev - software handle to the device
911 oce_get_flow_control(struct oce_dev *dev, uint32_t *flow_control)
917 DEV_LOCK(dev);
918 if (dev->suspended) {
919 DEV_UNLOCK(dev);
922 DEV_UNLOCK(dev);
940 ret = oce_mbox_post(dev, &mbx, NULL);
962 * dev - software handle to the device
968 oce_set_promiscuous(struct oce_dev *dev, boolean_t enable)
978 if (dev->port_id == 0) {
997 ret = oce_mbox_post(dev, &mbx, NULL);
1005 * dev - software handle to the device
1011 oce_add_mac(struct oce_dev *dev, uint32_t if_id,
1036 ret = oce_mbox_post(dev, &mbx, NULL);
1049 * dev - software handle to the device
1055 oce_del_mac(struct oce_dev *dev, uint32_t if_id, uint32_t *pmac_id)
1079 ret = oce_mbox_post(dev, &mbx, NULL);
1088 * dev - software handle to the device
1097 oce_config_vlan(struct oce_dev *dev, uint32_t if_id,
1132 ret = oce_mbox_post(dev, &mbx, NULL);
1141 * dev - software handle to the device
1149 oce_config_link(struct oce_dev *dev, boolean_t enable)
1173 ret = oce_mbox_post(dev, &mbx, NULL);
1179 oce_config_rss(struct oce_dev *dev, uint16_t if_id, char *hkey, char *itbl,
1218 ret = oce_mbox_post(dev, &mbx, NULL);
1226 * dev - software handle to the device
1233 oce_issue_mbox(struct oce_dev *dev, queue_t *wq, mblk_t *mp,
1262 oce_log(dev, CE_NOTE, MOD_CONFIG, "Mailbox: "
1274 if (dev->cookie != 0 && dev->cookie != hdr.u0.req.rsvd0)
1277 if (dev->cookie == 0)
1278 dev->cookie = hdr.u0.req.rsvd0;
1284 oce_log(dev, CE_NOTE, MOD_CONFIG, "Mailbox params:"
1296 ret = ddi_dma_alloc_handle(dev->dip,
1300 oce_log(dev, CE_NOTE, MOD_CONFIG, "%s",
1313 oce_log(dev, CE_NOTE, MOD_CONFIG, "%s",
1330 oce_log(dev, CE_NOTE, MOD_CONFIG,
1365 ret = oce_mbox_post(dev, &mbx, NULL);
1371 oce_log(dev, CE_WARN, MOD_CONFIG,
1384 if (oce_fm_check_dma_handle(dev, dma_handle) !=
1386 ddi_fm_service_impact(dev->dip,
1401 dev->cookie = 0;
1414 if (oce_fm_check_dma_handle(dev, dma_handle) != DDI_FM_OK) {
1415 ddi_fm_service_impact(dev->dip, DDI_SERVICE_DEGRADED);
1443 dev->cookie = 0;