USB_抓包

tcpdump -i usbmon1 -w uvc_capture.pcap -c 1000

usb.src == "1.2.0" || usb.dst == "1.2.0"

  1. init bh->head.

static void init_giveback_urb_bh(struct giveback_urb_bh *bh)

{

spin_lock_init(&bh->lock);

INIT_LIST_HEAD(&bh->head);

tasklet_init(&bh->bh, usb_giveback_urb_bh, (unsigned long)bh);

}

  1. add urb_list 2 bh->head.

void usb_hcd_giveback_urb(struct usb_hcd *hcd, struct urb *urb, int status)

list_add_tail(&urb->urb_list, &bh->head);

  1. replace_ bh->head with local_list.

static void usb_giveback_urb_bh(unsigned long param)

list_replace_init(&bh->head, &local_list);

(gdb) bt

#0 mon_complete (ubus=0xffffffc0e7e7c800, urb=0xffffffc0e7150c00, status=0) at drivers/usb/mon/mon_main.c:151

#1 0xffffff8008857d20 in usbmon_urb_complete (status=<optimized out>, urb=<optimized out>, bus=<optimized out>) at ./include/linux/usb/hcd.h:736

#2 __usb_hcd_giveback_urb (urb=0xffffffc0e7150c00) at drivers/usb/core/hcd.c:1764

#3 0xffffff8008858a14 in usb_giveback_urb_bh (param=18446743802722372112) at drivers/usb/core/hcd.c:1818

#4 0xffffff80080b60e8 in tasklet_action_common (tl_head=0xffffffc0efeea7c0, softirq_nr=6, a=<optimized out>) at kernel/softirq.c:522

#5 0xffffff80080b61a4 in tasklet_action (a=<optimized out>) at kernel/softirq.c:540

#6 0xffffff8008081448 in __do_softirq () at kernel/softirq.c:292

/////////

int usb_hcd_submit_urb (struct urb *urb, gfp_t mem_flags)

rh_urb_enqueue(hcd, urb);

static int rh_call_control (struct usb_hcd *hcd, struct urb *urb)

usb_hcd_link_urb_to_ep(hcd, urb);

int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb)

list_add_tail(&urb->urb_list, &urb->ep->urb_list);

///////// decode

static void __usb_hcd_giveback_urb(struct urb *urb)

urb->complete(urb);

uvc_video_complete

uvc_video_decode_isoc

0x8C

10001100

0x8D

10001101

bit0翻转表示新的一帧开始

相关推荐
荣--1 小时前
一键部署不是为了省时间 —— 它是把"买来的 PaaS"变成"自己的平台"的拐点
运维·zabbix·工程化·一键部署·平台化·边界设计
江华森2 小时前
动手实战学 Docker — 从零到集群编排完全指南
运维
Avan_菜菜18 小时前
FRP 内网穿透完整实战:从 HTTP 映射到 HTTPS 自签代理
运维·nginx·https
Sokach10151 天前
Linux Shell 脚本从零到能用:一个新手的一天学习总结
linux
SelectDB2 天前
Litefuse 开源并推出单进程轻量模式,25 秒就能跑起来的 Agent 可观测与评估平台
运维·后端·自动化运维
AlfredZhao2 天前
Docker 容器时区不对,`timedatectl` 不存在怎么办?
linux·timezone
zzzzzz3103 天前
9K Star 炸裂开源!这个 C 语言写的代码知识图谱,把 Linux 内核索引压缩到了 3 分钟
linux·服务器·sql
XIAOHEZIcode3 天前
Linux系统鼠标偏移常见原因以及修复方案
linux·运维·游戏
用户0328472220704 天前
如何搭建本地yum源(上)
运维
A小辣椒5 天前
TShark:Wireshark CLI 功能
linux