Lines Matching refs:dev

86  * dev - software handle to the device
91 oce_mbox_init(struct oce_dev *dev)
97 ASSERT(dev != NULL);
99 mbx = (struct oce_bmbx *)DBUF_VA(dev->bmbx);
112 ret = oce_mbox_dispatch(dev, 0);
115 oce_log(dev, CE_NOTE, MOD_CONFIG,
125 * dev - software handle to the device
130 oce_mbox_wait(struct oce_dev *dev, uint32_t tmo_sec)
150 mbox_db.dw0 = OCE_DB_READ32(dev, PD_MPU_MBOX_DB);
151 if (oce_fm_check_acc_handle(dev, dev->db_handle) != DDI_FM_OK) {
152 ddi_fm_service_impact(dev->dip, DDI_SERVICE_DEGRADED);
153 oce_fm_ereport(dev, DDI_FM_DEVICE_INVAL_STATE);
168 * dev - software handle to the device
173 oce_mbox_dispatch(struct oce_dev *dev, uint32_t tmo_sec)
180 (void) DBUF_SYNC(dev->bmbx, DDI_DMA_SYNC_FORDEV);
183 pa = (uint32_t)(DBUF_PA(dev->bmbx) >> 34);
190 ret = oce_mbox_wait(dev, tmo_sec);
196 OCE_DB_WRITE32(dev, PD_MPU_MBOX_DB, mbox_db.dw0);
198 if (oce_fm_check_acc_handle(dev, dev->db_handle) != DDI_FM_OK) {
199 ddi_fm_service_impact(dev->dip, DDI_SERVICE_DEGRADED);
203 ret = oce_mbox_wait(dev, tmo_sec);
205 oce_log(dev, CE_NOTE, MOD_CONFIG,
208 ddi_fm_service_impact(dev->dip, DDI_SERVICE_DEGRADED);
209 oce_fm_ereport(dev, DDI_FM_DEVICE_INVAL_STATE);
214 pa = (uint32_t)(DBUF_PA(dev->bmbx) >> 4) & 0x3fffffff;
220 OCE_DB_WRITE32(dev, PD_MPU_MBOX_DB, mbox_db.dw0);
221 if (oce_fm_check_acc_handle(dev, dev->db_handle) != DDI_FM_OK) {
222 ddi_fm_service_impact(dev->dip, DDI_SERVICE_DEGRADED);
226 ret = oce_mbox_wait(dev, tmo_sec);
228 (void) ddi_dma_sync(DBUF_DHDL(dev->bmbx), 0, 0,
230 if (oce_fm_check_dma_handle(dev, DBUF_DHDL(dev->bmbx)) != DDI_FM_OK) {
231 ddi_fm_service_impact(dev->dip, DDI_SERVICE_DEGRADED);
240 * dev - software handle to the device
247 oce_mbox_post(struct oce_dev *dev, struct oce_mbx *mbx,
256 mutex_enter(&dev->bmbx_lock);
258 mb = (struct oce_bmbx *)DBUF_VA(dev->bmbx);
269 ret = oce_mbox_dispatch(dev, tmo);
271 mutex_exit(&dev->bmbx_lock);
277 (void) ddi_dma_sync(DBUF_DHDL(dev->bmbx), 0, 0,
279 ret = oce_fm_check_dma_handle(dev, DBUF_DHDL(dev->bmbx));
281 ddi_fm_service_impact(dev->dip, DDI_SERVICE_DEGRADED);
282 mutex_exit(&dev->bmbx_lock);
298 oce_log(dev, CE_WARN, MOD_CONFIG,
302 mutex_exit(&dev->bmbx_lock);
318 mutex_exit(&dev->bmbx_lock);
325 * dev - software handle to the device
330 oce_get_fw_version(struct oce_dev *dev)
352 ret = oce_mbox_post(dev, &mbx, NULL);
357 bcopy(fwcmd->params.rsp.fw_ver_str, dev->fw_version, 32);
359 oce_log(dev, CE_NOTE, MOD_CONFIG, "%s %s",
370 * dev - software handle to the device
376 oce_reset_fun(struct oce_dev *dev)
382 mb = (struct oce_bmbx *)DBUF_VA(dev->bmbx);
398 return (oce_mbox_dispatch(dev, 0));
404 * dev - software handle to the device
415 oce_read_mac_addr(struct oce_dev *dev, uint32_t if_id, uint8_t perm,
445 ret = oce_mbox_post(dev, &mbx, NULL);
451 oce_log(dev, CE_NOTE, MOD_CONFIG,
454 oce_log(dev, CE_NOTE, MOD_CONFIG,
475 * dev - software handle to the device
486 oce_if_create(struct oce_dev *dev, uint32_t cap_flags, uint32_t en_flags,
524 ret = oce_mbox_post(dev, &mbx, NULL);
533 oce_log(dev, CE_NOTE, MOD_CONFIG,
538 dev->pmac_id = LE_32(fwcmd->params.rsp.pmac_id);
539 oce_log(dev, CE_NOTE, MOD_CONFIG,
540 "PMAC_ID = 0x%x", dev->pmac_id);
548 * dev - software handle to the device
554 oce_if_del(struct oce_dev *dev, uint32_t if_id)
578 ret = oce_mbox_post(dev, &mbx, NULL);
585 * dev - software handle to the device
591 oce_get_link_status(struct oce_dev *dev, struct link_status *link)
613 ret = oce_mbox_post(dev, &mbx, NULL);
630 * dev - software handle to the device
636 oce_set_rx_filter(struct oce_dev *dev,
661 ret = oce_mbox_post(dev, &mbx, NULL);
669 * dev - software handle to the device
677 oce_set_multicast_table(struct oce_dev *dev, uint32_t if_id,
710 ret = oce_mbox_post(dev, &mbx, NULL);
718 * dev - software handle to the device
723 oce_get_fw_config(struct oce_dev *dev)
744 ret = oce_mbox_post(dev, &mbx, NULL);
753 dev->config_number = fwcmd->params.rsp.config_number;
754 dev->asic_revision = fwcmd->params.rsp.asic_revision;
755 dev->port_id = fwcmd->params.rsp.port_id;
756 dev->function_mode = fwcmd->params.rsp.function_mode;
760 dev->max_tx_rings = fwcmd->params.rsp.ulp[0].wq_count;
761 dev->max_rx_rings = fwcmd->params.rsp.ulp[0].rq_count;
763 dev->max_tx_rings = fwcmd->params.rsp.ulp[1].wq_count;
764 dev->max_rx_rings = fwcmd->params.rsp.ulp[1].rq_count;
766 dev->function_caps = fwcmd->params.rsp.function_caps;
773 * dev - software handle to the device
778 oce_get_hw_stats(struct oce_dev *dev)
781 struct mbx_get_nic_stats *fwcmd = dev->hw_stats;
794 mbx.payload.u0.u1.sgl[0].pa_lo = ADDR_LO(DBUF_PA(dev->stats_dbuf));
795 mbx.payload.u0.u1.sgl[0].pa_hi = ADDR_HI(DBUF_PA(dev->stats_dbuf));
804 bzero(&dev->hw_stats->params, sizeof (dev->hw_stats->params));
807 (void) DBUF_SYNC(dev->stats_dbuf, DDI_DMA_SYNC_FORDEV);
810 ret = oce_mbox_post(dev, &mbx, NULL);
812 (void) DBUF_SYNC(dev->stats_dbuf, DDI_DMA_SYNC_FORKERNEL);
819 DW_SWAP(u32ptr(dev->hw_stats), sizeof (struct mbx_get_nic_stats));
826 * dev - software handle to the device
832 oce_num_intr_vectors_set(struct oce_dev *dev, uint32_t num_vectors)
857 ret = oce_mbox_post(dev, &mbx, NULL);
865 * dev - software handle to the device
871 oce_set_flow_control(struct oce_dev *dev, uint32_t flow_control)
899 ret = oce_mbox_post(dev, &mbx, NULL);
907 * dev - software handle to the device
914 oce_get_flow_control(struct oce_dev *dev, uint32_t *flow_control)
920 DEV_LOCK(dev);
921 if (dev->suspended) {
922 DEV_UNLOCK(dev);
925 DEV_UNLOCK(dev);
943 ret = oce_mbox_post(dev, &mbx, NULL);
965 * dev - software handle to the device
971 oce_set_promiscuous(struct oce_dev *dev, boolean_t enable)
981 if (dev->port_id == 0) {
1000 ret = oce_mbox_post(dev, &mbx, NULL);
1008 * dev - software handle to the device
1014 oce_add_mac(struct oce_dev *dev, uint32_t if_id,
1039 ret = oce_mbox_post(dev, &mbx, NULL);
1052 * dev - software handle to the device
1058 oce_del_mac(struct oce_dev *dev, uint32_t if_id, uint32_t *pmac_id)
1082 ret = oce_mbox_post(dev, &mbx, NULL);
1091 * dev - software handle to the device
1100 oce_config_vlan(struct oce_dev *dev, uint32_t if_id,
1135 ret = oce_mbox_post(dev, &mbx, NULL);
1144 * dev - software handle to the device
1152 oce_config_link(struct oce_dev *dev, boolean_t enable)
1176 ret = oce_mbox_post(dev, &mbx, NULL);
1182 oce_config_rss(struct oce_dev *dev, uint16_t if_id, char *hkey, char *itbl,
1221 ret = oce_mbox_post(dev, &mbx, NULL);
1229 * dev - software handle to the device
1236 oce_issue_mbox(struct oce_dev *dev, queue_t *wq, mblk_t *mp,
1265 oce_log(dev, CE_NOTE, MOD_CONFIG, "Mailbox: "
1280 if (dev->cookie != 0 && dev->cookie != hdr.u0.req.rsvd0)
1283 if (dev->cookie == 0)
1284 dev->cookie = hdr.u0.req.rsvd0;
1287 oce_log(dev, CE_NOTE, MOD_CONFIG, "Mailbox params:"
1300 ret = ddi_dma_alloc_handle(dev->dip,
1304 oce_log(dev, CE_NOTE, MOD_CONFIG, "%s",
1317 oce_log(dev, CE_NOTE, MOD_CONFIG, "%s",
1337 oce_log(dev, CE_NOTE, MOD_CONFIG,
1372 ret = oce_mbox_post(dev, &mbx, NULL);
1378 oce_log(dev, CE_WARN, MOD_CONFIG,
1391 if (oce_fm_check_dma_handle(dev, dma_handle) !=
1393 ddi_fm_service_impact(dev->dip,
1408 dev->cookie = 0;
1423 if (oce_fm_check_dma_handle(dev, dma_handle) != DDI_FM_OK) {
1424 ddi_fm_service_impact(dev->dip, DDI_SERVICE_DEGRADED);
1455 dev->cookie = 0;