• Home
  • Raw
  • Download

Lines Matching refs:i2400m

132 	struct i2400m *i2400m = wimax_dev_to_i2400m(wimax_dev);  in i2400m_op_msg_from_user()  local
133 struct device *dev = i2400m_dev(i2400m); in i2400m_op_msg_from_user()
137 "msg_len %zu genl_info %p)\n", wimax_dev, i2400m, in i2400m_op_msg_from_user()
139 ack_skb = i2400m_msg_to_dev(i2400m, msg_buf, msg_len); in i2400m_op_msg_from_user()
143 result = wimax_msg_send(&i2400m->wimax_dev, ack_skb); in i2400m_op_msg_from_user()
146 "genl_info %p) = %d\n", wimax_dev, i2400m, msg_buf, msg_len, in i2400m_op_msg_from_user()
181 struct i2400m *i2400m = wimax_dev_to_i2400m(wimax_dev); in i2400m_op_reset() local
182 struct device *dev = i2400m_dev(i2400m); in i2400m_op_reset()
189 mutex_lock(&i2400m->init_mutex); in i2400m_op_reset()
190 i2400m->reset_ctx = &ctx; in i2400m_op_reset()
191 mutex_unlock(&i2400m->init_mutex); in i2400m_op_reset()
192 result = i2400m_reset(i2400m, I2400M_RT_WARM); in i2400m_op_reset()
201 mutex_lock(&i2400m->init_mutex); in i2400m_op_reset()
202 i2400m->reset_ctx = NULL; in i2400m_op_reset()
203 mutex_unlock(&i2400m->init_mutex); in i2400m_op_reset()
218 int i2400m_check_mac_addr(struct i2400m *i2400m) in i2400m_check_mac_addr() argument
221 struct device *dev = i2400m_dev(i2400m); in i2400m_check_mac_addr()
224 struct net_device *net_dev = i2400m->wimax_dev.net_dev; in i2400m_check_mac_addr()
226 d_fnstart(3, dev, "(i2400m %p)\n", i2400m); in i2400m_check_mac_addr()
227 skb = i2400m_get_device_info(i2400m); in i2400m_check_mac_addr()
259 d_fnend(3, dev, "(i2400m %p) = %d\n", i2400m, result); in i2400m_check_mac_addr()
284 int __i2400m_dev_start(struct i2400m *i2400m, enum i2400m_bri flags) in __i2400m_dev_start() argument
287 struct wimax_dev *wimax_dev = &i2400m->wimax_dev; in __i2400m_dev_start()
289 struct device *dev = i2400m_dev(i2400m); in __i2400m_dev_start()
290 int times = i2400m->bus_bm_retries; in __i2400m_dev_start()
292 d_fnstart(3, dev, "(i2400m %p)\n", i2400m); in __i2400m_dev_start()
294 result = i2400m_dev_bootstrap(i2400m, flags); in __i2400m_dev_start()
299 result = i2400m_tx_setup(i2400m); in __i2400m_dev_start()
302 result = i2400m_rx_setup(i2400m); in __i2400m_dev_start()
305 i2400m->work_queue = create_singlethread_workqueue(wimax_dev->name); in __i2400m_dev_start()
306 if (i2400m->work_queue == NULL) { in __i2400m_dev_start()
311 if (i2400m->bus_dev_start) { in __i2400m_dev_start()
312 result = i2400m->bus_dev_start(i2400m); in __i2400m_dev_start()
316 i2400m->ready = 1; in __i2400m_dev_start()
319 queue_work(i2400m->work_queue, &i2400m->rx_report_ws); in __i2400m_dev_start()
320 result = i2400m_firmware_check(i2400m); /* fw versions ok? */ in __i2400m_dev_start()
324 result = i2400m_check_mac_addr(i2400m); in __i2400m_dev_start()
327 result = i2400m_dev_initialize(i2400m); in __i2400m_dev_start()
336 atomic_dec(&i2400m->error_recovery); in __i2400m_dev_start()
343 net_dev, i2400m, result); in __i2400m_dev_start()
349 i2400m->ready = 0; in __i2400m_dev_start()
351 flush_workqueue(i2400m->work_queue); in __i2400m_dev_start()
352 if (i2400m->bus_dev_stop) in __i2400m_dev_start()
353 i2400m->bus_dev_stop(i2400m); in __i2400m_dev_start()
355 destroy_workqueue(i2400m->work_queue); in __i2400m_dev_start()
357 i2400m_rx_release(i2400m); in __i2400m_dev_start()
359 i2400m_tx_release(i2400m); in __i2400m_dev_start()
367 net_dev, i2400m, result); in __i2400m_dev_start()
373 int i2400m_dev_start(struct i2400m *i2400m, enum i2400m_bri bm_flags) in i2400m_dev_start() argument
376 mutex_lock(&i2400m->init_mutex); /* Well, start the device */ in i2400m_dev_start()
377 if (i2400m->updown == 0) { in i2400m_dev_start()
378 result = __i2400m_dev_start(i2400m, bm_flags); in i2400m_dev_start()
380 i2400m->updown = 1; in i2400m_dev_start()
381 i2400m->alive = 1; in i2400m_dev_start()
385 mutex_unlock(&i2400m->init_mutex); in i2400m_dev_start()
402 void __i2400m_dev_stop(struct i2400m *i2400m) in __i2400m_dev_stop() argument
404 struct wimax_dev *wimax_dev = &i2400m->wimax_dev; in __i2400m_dev_stop()
405 struct device *dev = i2400m_dev(i2400m); in __i2400m_dev_stop()
407 d_fnstart(3, dev, "(i2400m %p)\n", i2400m); in __i2400m_dev_stop()
409 i2400m_msg_to_dev_cancel_wait(i2400m, -EL3RST); in __i2400m_dev_stop()
410 complete(&i2400m->msg_completion); in __i2400m_dev_stop()
411 i2400m_net_wake_stop(i2400m); in __i2400m_dev_stop()
412 i2400m_dev_shutdown(i2400m); in __i2400m_dev_stop()
417 i2400m->ready = 0; /* nobody can queue work anymore */ in __i2400m_dev_stop()
419 flush_workqueue(i2400m->work_queue); in __i2400m_dev_stop()
421 if (i2400m->bus_dev_stop) in __i2400m_dev_stop()
422 i2400m->bus_dev_stop(i2400m); in __i2400m_dev_stop()
423 destroy_workqueue(i2400m->work_queue); in __i2400m_dev_stop()
424 i2400m_rx_release(i2400m); in __i2400m_dev_stop()
425 i2400m_tx_release(i2400m); in __i2400m_dev_stop()
427 d_fnend(3, dev, "(i2400m %p) = 0\n", i2400m); in __i2400m_dev_stop()
437 void i2400m_dev_stop(struct i2400m *i2400m) in i2400m_dev_stop() argument
439 mutex_lock(&i2400m->init_mutex); in i2400m_dev_stop()
440 if (i2400m->updown) { in i2400m_dev_stop()
441 __i2400m_dev_stop(i2400m); in i2400m_dev_stop()
442 i2400m->updown = 0; in i2400m_dev_stop()
443 i2400m->alive = 0; in i2400m_dev_stop()
446 mutex_unlock(&i2400m->init_mutex); in i2400m_dev_stop()
468 struct i2400m *i2400m = in i2400m_pm_notifier() local
469 container_of(notifier, struct i2400m, pm_notifier); in i2400m_pm_notifier()
470 struct device *dev = i2400m_dev(i2400m); in i2400m_pm_notifier()
472 d_fnstart(3, dev, "(i2400m %p pm_event %lx)\n", i2400m, pm_event); in i2400m_pm_notifier()
476 i2400m_fw_cache(i2400m); in i2400m_pm_notifier()
483 i2400m_fw_uncache(i2400m); in i2400m_pm_notifier()
490 d_fnend(3, dev, "(i2400m %p pm_event %lx) = void\n", i2400m, pm_event); in i2400m_pm_notifier()
501 int i2400m_pre_reset(struct i2400m *i2400m) in i2400m_pre_reset() argument
503 struct device *dev = i2400m_dev(i2400m); in i2400m_pre_reset()
505 d_fnstart(3, dev, "(i2400m %p)\n", i2400m); in i2400m_pre_reset()
508 mutex_lock(&i2400m->init_mutex); in i2400m_pre_reset()
509 if (i2400m->updown) { in i2400m_pre_reset()
510 netif_tx_disable(i2400m->wimax_dev.net_dev); in i2400m_pre_reset()
511 __i2400m_dev_stop(i2400m); in i2400m_pre_reset()
515 mutex_unlock(&i2400m->init_mutex); in i2400m_pre_reset()
516 if (i2400m->bus_release) in i2400m_pre_reset()
517 i2400m->bus_release(i2400m); in i2400m_pre_reset()
518 d_fnend(3, dev, "(i2400m %p) = 0\n", i2400m); in i2400m_pre_reset()
532 int i2400m_post_reset(struct i2400m *i2400m) in i2400m_post_reset() argument
535 struct device *dev = i2400m_dev(i2400m); in i2400m_post_reset()
537 d_fnstart(3, dev, "(i2400m %p)\n", i2400m); in i2400m_post_reset()
539 if (i2400m->bus_setup) { in i2400m_post_reset()
540 result = i2400m->bus_setup(i2400m); in i2400m_post_reset()
547 mutex_lock(&i2400m->init_mutex); in i2400m_post_reset()
548 if (i2400m->updown) { in i2400m_post_reset()
550 i2400m, I2400M_BRI_SOFT | I2400M_BRI_MAC_REINIT); in i2400m_post_reset()
554 mutex_unlock(&i2400m->init_mutex); in i2400m_post_reset()
555 d_fnend(3, dev, "(i2400m %p) = %d\n", i2400m, result); in i2400m_post_reset()
559 if (i2400m->bus_release) in i2400m_post_reset()
560 i2400m->bus_release(i2400m); in i2400m_post_reset()
563 i2400m->updown = 0; in i2400m_post_reset()
565 mutex_unlock(&i2400m->init_mutex); in i2400m_post_reset()
567 d_fnend(3, dev, "(i2400m %p) = %d\n", i2400m, result); in i2400m_post_reset()
599 struct i2400m *i2400m = container_of(ws, struct i2400m, reset_ws); in __i2400m_dev_reset_handle() local
600 const char *reason = i2400m->reset_reason; in __i2400m_dev_reset_handle()
601 struct device *dev = i2400m_dev(i2400m); in __i2400m_dev_reset_handle()
602 struct i2400m_reset_ctx *ctx = i2400m->reset_ctx; in __i2400m_dev_reset_handle()
605 d_fnstart(3, dev, "(ws %p i2400m %p reason %s)\n", ws, i2400m, reason); in __i2400m_dev_reset_handle()
607 i2400m->boot_mode = 1; in __i2400m_dev_reset_handle()
611 if (mutex_trylock(&i2400m->init_mutex) == 0) { in __i2400m_dev_reset_handle()
616 i2400m_msg_to_dev_cancel_wait(i2400m, -EL3RST); in __i2400m_dev_reset_handle()
617 complete(&i2400m->msg_completion); in __i2400m_dev_reset_handle()
623 if (i2400m->updown) { in __i2400m_dev_reset_handle()
624 __i2400m_dev_stop(i2400m); in __i2400m_dev_reset_handle()
625 i2400m->updown = 0; in __i2400m_dev_reset_handle()
629 if (i2400m->alive) { in __i2400m_dev_reset_handle()
630 result = __i2400m_dev_start(i2400m, in __i2400m_dev_reset_handle()
636 if (atomic_read(&i2400m->bus_reset_retries) in __i2400m_dev_reset_handle()
645 if (i2400m->reset_ctx) { in __i2400m_dev_reset_handle()
649 mutex_unlock(&i2400m->init_mutex); in __i2400m_dev_reset_handle()
659 i2400m->boot_mode = 0; in __i2400m_dev_reset_handle()
662 atomic_inc(&i2400m->bus_reset_retries); in __i2400m_dev_reset_handle()
664 result = i2400m_reset(i2400m, I2400M_RT_BUS); in __i2400m_dev_reset_handle()
669 if (i2400m->alive) { in __i2400m_dev_reset_handle()
672 i2400m->updown = 1; in __i2400m_dev_reset_handle()
674 atomic_set(&i2400m->bus_reset_retries, 0); in __i2400m_dev_reset_handle()
679 ws, i2400m, reason); in __i2400m_dev_reset_handle()
695 int i2400m_dev_reset_handle(struct i2400m *i2400m, const char *reason) in i2400m_dev_reset_handle() argument
697 i2400m->reset_reason = reason; in i2400m_dev_reset_handle()
698 return schedule_work(&i2400m->reset_ws); in i2400m_dev_reset_handle()
711 struct i2400m *i2400m = container_of(ws, struct i2400m, recovery_ws); in __i2400m_error_recovery() local
713 i2400m_reset(i2400m, I2400M_RT_BUS); in __i2400m_error_recovery()
741 void i2400m_error_recovery(struct i2400m *i2400m) in i2400m_error_recovery() argument
743 if (atomic_add_return(1, &i2400m->error_recovery) == 1) in i2400m_error_recovery()
744 schedule_work(&i2400m->recovery_ws); in i2400m_error_recovery()
746 atomic_dec(&i2400m->error_recovery); in i2400m_error_recovery()
756 int i2400m_bm_buf_alloc(struct i2400m *i2400m) in i2400m_bm_buf_alloc() argument
761 i2400m->bm_cmd_buf = kzalloc(I2400M_BM_CMD_BUF_SIZE, GFP_KERNEL); in i2400m_bm_buf_alloc()
762 if (i2400m->bm_cmd_buf == NULL) in i2400m_bm_buf_alloc()
764 i2400m->bm_ack_buf = kzalloc(I2400M_BM_ACK_BUF_SIZE, GFP_KERNEL); in i2400m_bm_buf_alloc()
765 if (i2400m->bm_ack_buf == NULL) in i2400m_bm_buf_alloc()
770 kfree(i2400m->bm_cmd_buf); in i2400m_bm_buf_alloc()
780 void i2400m_bm_buf_free(struct i2400m *i2400m) in i2400m_bm_buf_free() argument
782 kfree(i2400m->bm_ack_buf); in i2400m_bm_buf_free()
783 kfree(i2400m->bm_cmd_buf); in i2400m_bm_buf_free()
792 void i2400m_init(struct i2400m *i2400m) in i2400m_init() argument
794 wimax_dev_init(&i2400m->wimax_dev); in i2400m_init()
796 i2400m->boot_mode = 1; in i2400m_init()
797 i2400m->rx_reorder = 1; in i2400m_init()
798 init_waitqueue_head(&i2400m->state_wq); in i2400m_init()
800 spin_lock_init(&i2400m->tx_lock); in i2400m_init()
801 i2400m->tx_pl_min = UINT_MAX; in i2400m_init()
802 i2400m->tx_size_min = UINT_MAX; in i2400m_init()
804 spin_lock_init(&i2400m->rx_lock); in i2400m_init()
805 i2400m->rx_pl_min = UINT_MAX; in i2400m_init()
806 i2400m->rx_size_min = UINT_MAX; in i2400m_init()
807 INIT_LIST_HEAD(&i2400m->rx_reports); in i2400m_init()
808 INIT_WORK(&i2400m->rx_report_ws, i2400m_report_hook_work); in i2400m_init()
810 mutex_init(&i2400m->msg_mutex); in i2400m_init()
811 init_completion(&i2400m->msg_completion); in i2400m_init()
813 mutex_init(&i2400m->init_mutex); in i2400m_init()
816 INIT_WORK(&i2400m->reset_ws, __i2400m_dev_reset_handle); in i2400m_init()
817 INIT_WORK(&i2400m->recovery_ws, __i2400m_error_recovery); in i2400m_init()
819 atomic_set(&i2400m->bus_reset_retries, 0); in i2400m_init()
821 i2400m->alive = 0; in i2400m_init()
825 atomic_set(&i2400m->error_recovery, 1); in i2400m_init()
830 int i2400m_reset(struct i2400m *i2400m, enum i2400m_reset_type rt) in i2400m_reset() argument
832 struct net_device *net_dev = i2400m->wimax_dev.net_dev; in i2400m_reset()
843 return i2400m->bus_reset(i2400m, rt); in i2400m_reset()
859 int i2400m_setup(struct i2400m *i2400m, enum i2400m_bri bm_flags) in i2400m_setup() argument
862 struct device *dev = i2400m_dev(i2400m); in i2400m_setup()
863 struct wimax_dev *wimax_dev = &i2400m->wimax_dev; in i2400m_setup()
864 struct net_device *net_dev = i2400m->wimax_dev.net_dev; in i2400m_setup()
866 d_fnstart(3, dev, "(i2400m %p)\n", i2400m); in i2400m_setup()
871 result = i2400m_bm_buf_alloc(i2400m); in i2400m_setup()
877 if (i2400m->bus_setup) { in i2400m_setup()
878 result = i2400m->bus_setup(i2400m); in i2400m_setup()
886 result = i2400m_bootrom_init(i2400m, bm_flags); in i2400m_setup()
892 result = i2400m_read_mac_addr(i2400m); in i2400m_setup()
895 eth_random_addr(i2400m->src_mac_addr); in i2400m_setup()
897 i2400m->pm_notifier.notifier_call = i2400m_pm_notifier; in i2400m_setup()
898 register_pm_notifier(&i2400m->pm_notifier); in i2400m_setup()
908 i2400m->wimax_dev.op_msg_from_user = i2400m_op_msg_from_user; in i2400m_setup()
909 i2400m->wimax_dev.op_rfkill_sw_toggle = i2400m_op_rfkill_sw_toggle; in i2400m_setup()
910 i2400m->wimax_dev.op_reset = i2400m_op_reset; in i2400m_setup()
912 result = wimax_dev_add(&i2400m->wimax_dev, net_dev); in i2400m_setup()
923 result = i2400m_debugfs_add(i2400m); in i2400m_setup()
929 result = i2400m_dev_start(i2400m, bm_flags); in i2400m_setup()
932 d_fnend(3, dev, "(i2400m %p) = %d\n", i2400m, result); in i2400m_setup()
936 i2400m_debugfs_rm(i2400m); in i2400m_setup()
938 sysfs_remove_group(&i2400m->wimax_dev.net_dev->dev.kobj, in i2400m_setup()
941 wimax_dev_rm(&i2400m->wimax_dev); in i2400m_setup()
945 unregister_pm_notifier(&i2400m->pm_notifier); in i2400m_setup()
948 if (i2400m->bus_release) in i2400m_setup()
949 i2400m->bus_release(i2400m); in i2400m_setup()
951 i2400m_bm_buf_free(i2400m); in i2400m_setup()
953 d_fnend(3, dev, "(i2400m %p) = %d\n", i2400m, result); in i2400m_setup()
964 void i2400m_release(struct i2400m *i2400m) in i2400m_release() argument
966 struct device *dev = i2400m_dev(i2400m); in i2400m_release()
968 d_fnstart(3, dev, "(i2400m %p)\n", i2400m); in i2400m_release()
969 netif_stop_queue(i2400m->wimax_dev.net_dev); in i2400m_release()
971 i2400m_dev_stop(i2400m); in i2400m_release()
973 cancel_work_sync(&i2400m->reset_ws); in i2400m_release()
974 cancel_work_sync(&i2400m->recovery_ws); in i2400m_release()
976 i2400m_debugfs_rm(i2400m); in i2400m_release()
977 sysfs_remove_group(&i2400m->wimax_dev.net_dev->dev.kobj, in i2400m_release()
979 wimax_dev_rm(&i2400m->wimax_dev); in i2400m_release()
980 unregister_netdev(i2400m->wimax_dev.net_dev); in i2400m_release()
981 unregister_pm_notifier(&i2400m->pm_notifier); in i2400m_release()
982 if (i2400m->bus_release) in i2400m_release()
983 i2400m->bus_release(i2400m); in i2400m_release()
984 i2400m_bm_buf_free(i2400m); in i2400m_release()
985 d_fnend(3, dev, "(i2400m %p) = void\n", i2400m); in i2400m_release()