Lines Matching full:adapter
22 struct zfcp_adapter *adapter; in zfcp_ccw_adapter_by_cdev() local
26 adapter = dev_get_drvdata(&cdev->dev); in zfcp_ccw_adapter_by_cdev()
27 if (adapter) in zfcp_ccw_adapter_by_cdev()
28 kref_get(&adapter->ref); in zfcp_ccw_adapter_by_cdev()
30 return adapter; in zfcp_ccw_adapter_by_cdev()
33 void zfcp_ccw_adapter_put(struct zfcp_adapter *adapter) in zfcp_ccw_adapter_put() argument
38 kref_put(&adapter->ref, zfcp_adapter_release); in zfcp_ccw_adapter_put()
45 struct zfcp_adapter *adapter = zfcp_ccw_adapter_by_cdev(cdev); in zfcp_ccw_activate() local
47 if (!adapter) in zfcp_ccw_activate()
50 zfcp_erp_set_adapter_status(adapter, ZFCP_STATUS_COMMON_RUNNING); in zfcp_ccw_activate()
51 zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED, in zfcp_ccw_activate()
53 zfcp_erp_wait(adapter); in zfcp_ccw_activate()
54 flush_work(&adapter->scan_work); in zfcp_ccw_activate()
56 zfcp_ccw_adapter_put(adapter); in zfcp_ccw_activate()
70 * @adapter: Adapter/Subchannel to check
72 int zfcp_ccw_priv_sch(struct zfcp_adapter *adapter) in zfcp_ccw_priv_sch() argument
74 return adapter->ccw_device->id.dev_model == ZFCP_MODEL_PRIV; in zfcp_ccw_priv_sch()
83 * work: To only allocate adapter resources for devices actually used,
95 * This function gets called by the common i/o layer and removes an adapter
97 * ports that belong to this adapter. And in addition all resources of this
98 * adapter will be freed too.
102 struct zfcp_adapter *adapter; in zfcp_ccw_remove() local
110 adapter = zfcp_ccw_adapter_by_cdev(cdev); in zfcp_ccw_remove()
111 if (!adapter) in zfcp_ccw_remove()
114 write_lock_irq(&adapter->port_list_lock); in zfcp_ccw_remove()
115 list_for_each_entry_safe(port, p, &adapter->port_list, list) { in zfcp_ccw_remove()
122 write_unlock_irq(&adapter->port_list_lock); in zfcp_ccw_remove()
123 zfcp_ccw_adapter_put(adapter); /* put from zfcp_ccw_adapter_by_cdev */ in zfcp_ccw_remove()
131 zfcp_adapter_unregister(adapter); in zfcp_ccw_remove()
139 * adapter into state online. The first call will allocate all
140 * adapter resources that will be retained until the device is removed
145 * adapter will be opened.
149 struct zfcp_adapter *adapter = zfcp_ccw_adapter_by_cdev(cdev); in zfcp_ccw_set_online() local
151 if (!adapter) { in zfcp_ccw_set_online()
152 adapter = zfcp_adapter_enqueue(cdev); in zfcp_ccw_set_online()
154 if (IS_ERR(adapter)) { in zfcp_ccw_set_online()
157 "FCP adapter failed\n"); in zfcp_ccw_set_online()
158 return PTR_ERR(adapter); in zfcp_ccw_set_online()
160 kref_get(&adapter->ref); in zfcp_ccw_set_online()
164 BUG_ON(!zfcp_reqlist_isempty(adapter->req_list)); in zfcp_ccw_set_online()
165 adapter->req_no = 0; in zfcp_ccw_set_online()
168 zfcp_ccw_adapter_put(adapter); in zfcp_ccw_set_online()
176 * This function gets called by the common i/o layer and sets an adapter
181 struct zfcp_adapter *adapter = zfcp_ccw_adapter_by_cdev(cdev); in zfcp_ccw_set_offline() local
183 if (!adapter) in zfcp_ccw_set_offline()
186 zfcp_erp_adapter_shutdown(adapter, 0, "ccsoff1"); in zfcp_ccw_set_offline()
187 zfcp_erp_wait(adapter); in zfcp_ccw_set_offline()
189 zfcp_ccw_adapter_put(adapter); in zfcp_ccw_set_offline()
196 * @event: indicates if adapter was detached or attached
198 * This function gets called by the common i/o layer if an adapter has gone
203 struct zfcp_adapter *adapter = zfcp_ccw_adapter_by_cdev(cdev); in zfcp_ccw_notify() local
205 if (!adapter) in zfcp_ccw_notify()
211 zfcp_erp_adapter_shutdown(adapter, 0, "ccnoti1"); in zfcp_ccw_notify()
216 zfcp_erp_adapter_shutdown(adapter, 0, "ccnoti2"); in zfcp_ccw_notify()
220 zfcp_erp_set_adapter_status(adapter, in zfcp_ccw_notify()
222 zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED, in zfcp_ccw_notify()
228 zfcp_erp_adapter_shutdown(adapter, 0, "ccnoti5"); in zfcp_ccw_notify()
232 zfcp_ccw_adapter_put(adapter); in zfcp_ccw_notify()
238 * @cdev: device for adapter to shutdown.
242 struct zfcp_adapter *adapter = zfcp_ccw_adapter_by_cdev(cdev); in zfcp_ccw_shutdown() local
244 if (!adapter) in zfcp_ccw_shutdown()
247 zfcp_erp_adapter_shutdown(adapter, 0, "ccshut1"); in zfcp_ccw_shutdown()
248 zfcp_erp_wait(adapter); in zfcp_ccw_shutdown()
249 zfcp_erp_thread_kill(adapter); in zfcp_ccw_shutdown()
251 zfcp_ccw_adapter_put(adapter); in zfcp_ccw_shutdown()