Loading drivers/platform/msm/ipa/ipa_v3/ethernet/ipa_eth.c +35 −0 Original line number Original line Diff line number Diff line Loading @@ -1014,11 +1014,41 @@ static void ipa_eth_ipc_log_cleanup(void) } } } } static int ipa_eth_panic_save_device(struct ipa_eth_device *eth_dev) { ipa_eth_net_save_regs(eth_dev); ipa_eth_offload_save_regs(eth_dev); return 0; } static int ipa_eth_panic_notifier(struct notifier_block *nb, unsigned long event, void *ptr) { struct ipa_eth_device *eth_dev; mutex_lock(&ipa_eth_devices_lock); list_for_each_entry(eth_dev, &ipa_eth_devices, device_list) ipa_eth_panic_save_device(eth_dev); mutex_unlock(&ipa_eth_devices_lock); return NOTIFY_DONE; } static struct notifier_block ipa_eth_panic_nb = { .notifier_call = ipa_eth_panic_notifier, }; int ipa_eth_init(void) int ipa_eth_init(void) { { int rc; int rc; unsigned int wq_flags = WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_FREEZABLE; unsigned int wq_flags = WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_FREEZABLE; (void) atomic_notifier_chain_register( &panic_notifier_list, &ipa_eth_panic_nb); rc = ipa_eth_ipc_log_init(); rc = ipa_eth_ipc_log_init(); if (rc) { if (rc) { ipa_eth_err("Failed to initialize IPC logging"); ipa_eth_err("Failed to initialize IPC logging"); Loading Loading @@ -1087,6 +1117,8 @@ int ipa_eth_init(void) err_dbgfs: err_dbgfs: ipa_eth_ipc_log_cleanup(); ipa_eth_ipc_log_cleanup(); err_ipclog: err_ipclog: (void) atomic_notifier_chain_unregister( &panic_notifier_list, &ipa_eth_panic_nb); return rc; return rc; } } Loading @@ -1107,4 +1139,7 @@ void ipa_eth_exit(void) ipa_eth_debugfs_cleanup(); ipa_eth_debugfs_cleanup(); ipa_eth_ipc_log_cleanup(); ipa_eth_ipc_log_cleanup(); (void) atomic_notifier_chain_unregister( &panic_notifier_list, &ipa_eth_panic_nb); } } drivers/platform/msm/ipa/ipa_v3/ethernet/ipa_eth_i.h +4 −0 Original line number Original line Diff line number Diff line Loading @@ -146,9 +146,13 @@ int ipa_eth_offload_deinit(struct ipa_eth_device *eth_dev); int ipa_eth_offload_start(struct ipa_eth_device *eth_dev); int ipa_eth_offload_start(struct ipa_eth_device *eth_dev); int ipa_eth_offload_stop(struct ipa_eth_device *eth_dev); int ipa_eth_offload_stop(struct ipa_eth_device *eth_dev); int ipa_eth_offload_save_regs(struct ipa_eth_device *eth_dev); int ipa_eth_net_open_device(struct ipa_eth_device *eth_dev); int ipa_eth_net_open_device(struct ipa_eth_device *eth_dev); void ipa_eth_net_close_device(struct ipa_eth_device *eth_dev); void ipa_eth_net_close_device(struct ipa_eth_device *eth_dev); int ipa_eth_net_save_regs(struct ipa_eth_device *eth_dev); int ipa_eth_ep_init_headers(struct ipa_eth_device *eth_dev); int ipa_eth_ep_init_headers(struct ipa_eth_device *eth_dev); int ipa_eth_ep_register_interface(struct ipa_eth_device *eth_dev); int ipa_eth_ep_register_interface(struct ipa_eth_device *eth_dev); int ipa_eth_ep_unregister_interface(struct ipa_eth_device *eth_dev); int ipa_eth_ep_unregister_interface(struct ipa_eth_device *eth_dev); Loading drivers/platform/msm/ipa/ipa_v3/ethernet/ipa_eth_net.c +10 −0 Original line number Original line Diff line number Diff line Loading @@ -1058,3 +1058,13 @@ struct ipa_eth_resource *ipa_eth_net_ch_to_cb_mem( return cb_mem; return cb_mem; } } EXPORT_SYMBOL(ipa_eth_net_ch_to_cb_mem); EXPORT_SYMBOL(ipa_eth_net_ch_to_cb_mem); int ipa_eth_net_save_regs(struct ipa_eth_device *eth_dev) { struct ipa_eth_net_driver *nd = eth_dev->nd; if (nd && nd->ops->save_regs) return ipa_eth_nd_op(eth_dev, save_regs, eth_dev, NULL, NULL); return 0; } drivers/platform/msm/ipa/ipa_v3/ethernet/ipa_eth_offload.c +10 −0 Original line number Original line Diff line number Diff line Loading @@ -212,6 +212,16 @@ void ipa_eth_offload_unregister_driver(struct ipa_eth_offload_driver *od) mutex_unlock(&ipa_eth_offload_drivers_lock); mutex_unlock(&ipa_eth_offload_drivers_lock); } } int ipa_eth_offload_save_regs(struct ipa_eth_device *eth_dev) { struct ipa_eth_offload_driver *od = eth_dev->od; if (od && od->ops->save_regs) return eth_dev->od->ops->save_regs(eth_dev, NULL, NULL); return 0; } int ipa_eth_offload_modinit(struct dentry *dbgfs_root) int ipa_eth_offload_modinit(struct dentry *dbgfs_root) { { int rc; int rc; Loading include/linux/ipa_eth.h +24 −1 Original line number Original line Diff line number Diff line Loading @@ -38,9 +38,10 @@ * defined via struct ipa_eth_dma_allocator interface * defined via struct ipa_eth_dma_allocator interface * - probe() and remove() offload bus ops are replaced by pair() * - probe() and remove() offload bus ops are replaced by pair() * and unpair() callbacks respectively * and unpair() callbacks respectively * 3 - Added .save_regs() callback for network and offload drivers */ */ #define IPA_ETH_API_VER 2 #define IPA_ETH_API_VER 3 /** /** * enum ipa_eth_dev_features - Features supported by an ethernet device or * enum ipa_eth_dev_features - Features supported by an ethernet device or Loading Loading @@ -687,6 +688,17 @@ struct ipa_eth_net_ops { */ */ int (*transmit_skb)(struct ipa_eth_device *eth_dev, int (*transmit_skb)(struct ipa_eth_device *eth_dev, struct sk_buff *skb); struct sk_buff *skb); /** * .save_regs() - Save registers for debugging * @eth_dev: Offloaded device * @regs: if not NULL, write saved data address to the given pointer * @size: if not NULL, write the size of saved data to the given pointer * * Return: 0 on success, errno otherwise. */ int (*save_regs)(struct ipa_eth_device *eth_dev, void **regs, size_t *size); }; }; /** /** Loading Loading @@ -877,6 +889,17 @@ struct ipa_eth_offload_ops { * Return: 0 on success, negative errno otherwise * Return: 0 on success, negative errno otherwise */ */ int (*clear_stats)(struct ipa_eth_device *eth_dev); int (*clear_stats)(struct ipa_eth_device *eth_dev); /** * .save_regs() - Save registers for debugging * @eth_dev: Offloaded device * @regs: if not NULL, write saved data address to the given pointer * @size: if not NULL, write the size of saved data to the given pointer * * Return: 0 on success, errno otherwise. */ int (*save_regs)(struct ipa_eth_device *eth_dev, void **regs, size_t *size); }; }; /** /** Loading Loading
drivers/platform/msm/ipa/ipa_v3/ethernet/ipa_eth.c +35 −0 Original line number Original line Diff line number Diff line Loading @@ -1014,11 +1014,41 @@ static void ipa_eth_ipc_log_cleanup(void) } } } } static int ipa_eth_panic_save_device(struct ipa_eth_device *eth_dev) { ipa_eth_net_save_regs(eth_dev); ipa_eth_offload_save_regs(eth_dev); return 0; } static int ipa_eth_panic_notifier(struct notifier_block *nb, unsigned long event, void *ptr) { struct ipa_eth_device *eth_dev; mutex_lock(&ipa_eth_devices_lock); list_for_each_entry(eth_dev, &ipa_eth_devices, device_list) ipa_eth_panic_save_device(eth_dev); mutex_unlock(&ipa_eth_devices_lock); return NOTIFY_DONE; } static struct notifier_block ipa_eth_panic_nb = { .notifier_call = ipa_eth_panic_notifier, }; int ipa_eth_init(void) int ipa_eth_init(void) { { int rc; int rc; unsigned int wq_flags = WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_FREEZABLE; unsigned int wq_flags = WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_FREEZABLE; (void) atomic_notifier_chain_register( &panic_notifier_list, &ipa_eth_panic_nb); rc = ipa_eth_ipc_log_init(); rc = ipa_eth_ipc_log_init(); if (rc) { if (rc) { ipa_eth_err("Failed to initialize IPC logging"); ipa_eth_err("Failed to initialize IPC logging"); Loading Loading @@ -1087,6 +1117,8 @@ int ipa_eth_init(void) err_dbgfs: err_dbgfs: ipa_eth_ipc_log_cleanup(); ipa_eth_ipc_log_cleanup(); err_ipclog: err_ipclog: (void) atomic_notifier_chain_unregister( &panic_notifier_list, &ipa_eth_panic_nb); return rc; return rc; } } Loading @@ -1107,4 +1139,7 @@ void ipa_eth_exit(void) ipa_eth_debugfs_cleanup(); ipa_eth_debugfs_cleanup(); ipa_eth_ipc_log_cleanup(); ipa_eth_ipc_log_cleanup(); (void) atomic_notifier_chain_unregister( &panic_notifier_list, &ipa_eth_panic_nb); } }
drivers/platform/msm/ipa/ipa_v3/ethernet/ipa_eth_i.h +4 −0 Original line number Original line Diff line number Diff line Loading @@ -146,9 +146,13 @@ int ipa_eth_offload_deinit(struct ipa_eth_device *eth_dev); int ipa_eth_offload_start(struct ipa_eth_device *eth_dev); int ipa_eth_offload_start(struct ipa_eth_device *eth_dev); int ipa_eth_offload_stop(struct ipa_eth_device *eth_dev); int ipa_eth_offload_stop(struct ipa_eth_device *eth_dev); int ipa_eth_offload_save_regs(struct ipa_eth_device *eth_dev); int ipa_eth_net_open_device(struct ipa_eth_device *eth_dev); int ipa_eth_net_open_device(struct ipa_eth_device *eth_dev); void ipa_eth_net_close_device(struct ipa_eth_device *eth_dev); void ipa_eth_net_close_device(struct ipa_eth_device *eth_dev); int ipa_eth_net_save_regs(struct ipa_eth_device *eth_dev); int ipa_eth_ep_init_headers(struct ipa_eth_device *eth_dev); int ipa_eth_ep_init_headers(struct ipa_eth_device *eth_dev); int ipa_eth_ep_register_interface(struct ipa_eth_device *eth_dev); int ipa_eth_ep_register_interface(struct ipa_eth_device *eth_dev); int ipa_eth_ep_unregister_interface(struct ipa_eth_device *eth_dev); int ipa_eth_ep_unregister_interface(struct ipa_eth_device *eth_dev); Loading
drivers/platform/msm/ipa/ipa_v3/ethernet/ipa_eth_net.c +10 −0 Original line number Original line Diff line number Diff line Loading @@ -1058,3 +1058,13 @@ struct ipa_eth_resource *ipa_eth_net_ch_to_cb_mem( return cb_mem; return cb_mem; } } EXPORT_SYMBOL(ipa_eth_net_ch_to_cb_mem); EXPORT_SYMBOL(ipa_eth_net_ch_to_cb_mem); int ipa_eth_net_save_regs(struct ipa_eth_device *eth_dev) { struct ipa_eth_net_driver *nd = eth_dev->nd; if (nd && nd->ops->save_regs) return ipa_eth_nd_op(eth_dev, save_regs, eth_dev, NULL, NULL); return 0; }
drivers/platform/msm/ipa/ipa_v3/ethernet/ipa_eth_offload.c +10 −0 Original line number Original line Diff line number Diff line Loading @@ -212,6 +212,16 @@ void ipa_eth_offload_unregister_driver(struct ipa_eth_offload_driver *od) mutex_unlock(&ipa_eth_offload_drivers_lock); mutex_unlock(&ipa_eth_offload_drivers_lock); } } int ipa_eth_offload_save_regs(struct ipa_eth_device *eth_dev) { struct ipa_eth_offload_driver *od = eth_dev->od; if (od && od->ops->save_regs) return eth_dev->od->ops->save_regs(eth_dev, NULL, NULL); return 0; } int ipa_eth_offload_modinit(struct dentry *dbgfs_root) int ipa_eth_offload_modinit(struct dentry *dbgfs_root) { { int rc; int rc; Loading
include/linux/ipa_eth.h +24 −1 Original line number Original line Diff line number Diff line Loading @@ -38,9 +38,10 @@ * defined via struct ipa_eth_dma_allocator interface * defined via struct ipa_eth_dma_allocator interface * - probe() and remove() offload bus ops are replaced by pair() * - probe() and remove() offload bus ops are replaced by pair() * and unpair() callbacks respectively * and unpair() callbacks respectively * 3 - Added .save_regs() callback for network and offload drivers */ */ #define IPA_ETH_API_VER 2 #define IPA_ETH_API_VER 3 /** /** * enum ipa_eth_dev_features - Features supported by an ethernet device or * enum ipa_eth_dev_features - Features supported by an ethernet device or Loading Loading @@ -687,6 +688,17 @@ struct ipa_eth_net_ops { */ */ int (*transmit_skb)(struct ipa_eth_device *eth_dev, int (*transmit_skb)(struct ipa_eth_device *eth_dev, struct sk_buff *skb); struct sk_buff *skb); /** * .save_regs() - Save registers for debugging * @eth_dev: Offloaded device * @regs: if not NULL, write saved data address to the given pointer * @size: if not NULL, write the size of saved data to the given pointer * * Return: 0 on success, errno otherwise. */ int (*save_regs)(struct ipa_eth_device *eth_dev, void **regs, size_t *size); }; }; /** /** Loading Loading @@ -877,6 +889,17 @@ struct ipa_eth_offload_ops { * Return: 0 on success, negative errno otherwise * Return: 0 on success, negative errno otherwise */ */ int (*clear_stats)(struct ipa_eth_device *eth_dev); int (*clear_stats)(struct ipa_eth_device *eth_dev); /** * .save_regs() - Save registers for debugging * @eth_dev: Offloaded device * @regs: if not NULL, write saved data address to the given pointer * @size: if not NULL, write the size of saved data to the given pointer * * Return: 0 on success, errno otherwise. */ int (*save_regs)(struct ipa_eth_device *eth_dev, void **regs, size_t *size); }; }; /** /** Loading