21 #include <linux/net.h>
49 out +=
sprintf(out,
"prt sta spd bus dev socket "
55 spin_lock(&vdev->
ud.lock);
56 out +=
sprintf(out,
"%03u %03u ", i, vdev->
ud.status);
59 out +=
sprintf(out,
"%03u %08x ",
61 out +=
sprintf(out,
"%16p ", vdev->
ud.tcp_socket);
62 out +=
sprintf(out,
"%s", dev_name(&vdev->
udev->dev));
65 out +=
sprintf(out,
"000 000 000 0000000000000000 0-0");
69 spin_unlock(&vdev->
ud.lock);
88 vdev = port_to_vdev(rhport);
90 spin_lock(&vdev->
ud.lock);
92 pr_err(
"not connected %d\n", vdev->
ud.status);
95 spin_unlock(&vdev->
ud.lock);
102 spin_unlock(&vdev->
ud.lock);
116 sscanf(buf,
"%u", &rhport);
119 if (rhport >= VHCI_NPORTS) {
120 dev_err(dev,
"invalid port %u\n", rhport);
124 err = vhci_port_disconnect(rhport);
138 if (rhport >= VHCI_NPORTS) {
139 pr_err(
"port %u\n", rhport);
151 pr_err(
"speed %d\n", speed);
170 const char *buf,
size_t count)
183 sscanf(buf,
"%u %u %u %u", &rhport, &sockfd, &
devid, &speed);
186 rhport, sockfd,
devid, speed);
189 if (valid_args(rhport, speed) < 0)
201 vdev = port_to_vdev(rhport);
202 spin_lock(&vdev->
ud.lock);
206 spin_unlock(&vdev->
ud.lock);
209 dev_err(dev,
"port %d already used\n", rhport);
213 dev_info(dev,
"rhport(%u) sockfd(%d) devid(%u) speed(%u)\n",
214 rhport, sockfd,
devid, speed);
218 vdev->
ud.tcp_socket = socket;
221 spin_unlock(&vdev->
ud.lock);
235 &dev_attr_status.attr,
236 &dev_attr_detach.attr,
237 &dev_attr_attach.attr,