From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gonglei <arei.gonglei@huawei.com>, Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PULL 15/19] usb: usb-uas QOMify
Date: Fri, 8 May 2015 13:45:49 +0200 [thread overview]
Message-ID: <1431085553-6055-16-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1431085553-6055-1-git-send-email-kraxel@redhat.com>
From: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/usb/dev-uas.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/hw/usb/dev-uas.c b/hw/usb/dev-uas.c
index 04fc515..38b26c5 100644
--- a/hw/usb/dev-uas.c
+++ b/hw/usb/dev-uas.c
@@ -127,6 +127,9 @@ struct UASDevice {
USBPacket *status3[UAS_MAX_STREAMS + 1];
};
+#define TYPE_USB_UAS "usb-uas"
+#define USB_UAS(obj) OBJECT_CHECK(UASDevice, (obj), TYPE_USB_UAS)
+
struct UASRequest {
uint16_t tag;
uint64_t lun;
@@ -626,7 +629,7 @@ static const struct SCSIBusInfo usb_uas_scsi_info = {
static void usb_uas_handle_reset(USBDevice *dev)
{
- UASDevice *uas = DO_UPCAST(UASDevice, dev, dev);
+ UASDevice *uas = USB_UAS(dev);
UASRequest *req, *nreq;
UASStatus *st, *nst;
@@ -655,7 +658,7 @@ static void usb_uas_handle_control(USBDevice *dev, USBPacket *p,
static void usb_uas_cancel_io(USBDevice *dev, USBPacket *p)
{
- UASDevice *uas = DO_UPCAST(UASDevice, dev, dev);
+ UASDevice *uas = USB_UAS(dev);
UASRequest *req, *nreq;
int i;
@@ -797,7 +800,7 @@ incorrect_lun:
static void usb_uas_handle_data(USBDevice *dev, USBPacket *p)
{
- UASDevice *uas = DO_UPCAST(UASDevice, dev, dev);
+ UASDevice *uas = USB_UAS(dev);
uas_iu iu;
UASStatus *st;
UASRequest *req;
@@ -888,14 +891,14 @@ static void usb_uas_handle_data(USBDevice *dev, USBPacket *p)
static void usb_uas_handle_destroy(USBDevice *dev)
{
- UASDevice *uas = DO_UPCAST(UASDevice, dev, dev);
+ UASDevice *uas = USB_UAS(dev);
qemu_bh_delete(uas->status_bh);
}
static void usb_uas_realize(USBDevice *dev, Error **errp)
{
- UASDevice *uas = DO_UPCAST(UASDevice, dev, dev);
+ UASDevice *uas = USB_UAS(dev);
usb_desc_create_serial(dev);
usb_desc_init(dev);
@@ -943,7 +946,7 @@ static void usb_uas_class_initfn(ObjectClass *klass, void *data)
}
static const TypeInfo uas_info = {
- .name = "usb-uas",
+ .name = TYPE_USB_UAS,
.parent = TYPE_USB_DEVICE,
.instance_size = sizeof(UASDevice),
.class_init = usb_uas_class_initfn,
--
1.8.3.1
next prev parent reply other threads:[~2015-05-08 11:46 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-08 11:45 [Qemu-devel] [PULL 00/19] usb: qomify, bugfixes for xhci & uhci Gerd Hoffmann
2015-05-08 11:45 ` [Qemu-devel] [PULL 01/19] usb: fix usb-net segfault Gerd Hoffmann
2015-05-08 11:45 ` [Qemu-devel] [PULL 02/19] xhci: set timer to retry xfers Gerd Hoffmann
2015-05-08 11:45 ` [Qemu-devel] [PULL 03/19] Revert "xhci: generate a Transfer Event for each Transfer TRB with the IOC bit set" Gerd Hoffmann
2015-05-08 11:45 ` [Qemu-devel] [PULL 04/19] xhci: fix events for setup trb Gerd Hoffmann
2015-05-08 11:45 ` [Qemu-devel] [PULL 05/19] uhci: QOMify Gerd Hoffmann
2015-05-08 11:45 ` [Qemu-devel] [PULL 06/19] usb: usb-audio QOMify Gerd Hoffmann
2015-05-08 11:45 ` [Qemu-devel] [PULL 07/19] usb: usb-bt QOMify Gerd Hoffmann
2015-05-08 11:45 ` [Qemu-devel] [PULL 08/19] usb: usb-hid QOMify Gerd Hoffmann
2015-05-08 11:45 ` [Qemu-devel] [PULL 09/19] usb: usb-hub QOMify Gerd Hoffmann
2015-05-08 11:45 ` [Qemu-devel] [PULL 10/19] usb: usb-mtp QOMify Gerd Hoffmann
2015-05-08 11:45 ` [Qemu-devel] [PULL 11/19] usb-mtp: fix segmentation fault Gerd Hoffmann
2015-05-08 11:45 ` [Qemu-devel] [PULL 12/19] usb: usb-net QOMify Gerd Hoffmann
2015-05-08 11:45 ` [Qemu-devel] [PULL 13/19] usb: usb-ccid QOMify Gerd Hoffmann
2015-05-08 11:45 ` [Qemu-devel] [PULL 14/19] usb: usb-storage QOMify Gerd Hoffmann
2015-05-08 11:45 ` Gerd Hoffmann [this message]
2015-05-08 11:45 ` [Qemu-devel] [PULL 16/19] usb: usb-wacom-tablet QOMify Gerd Hoffmann
2015-05-08 11:45 ` [Qemu-devel] [PULL 17/19] usb: usb-redir QOMify Gerd Hoffmann
2015-05-08 11:45 ` [Qemu-devel] [PULL 18/19] usb: usb-serial QOMify Gerd Hoffmann
2015-05-10 22:18 ` Samuel Thibault
2015-05-08 11:45 ` [Qemu-devel] [PULL 19/19] uhci: controller is halted after reset Gerd Hoffmann
2015-05-11 9:42 ` [Qemu-devel] [PULL 00/19] usb: qomify, bugfixes for xhci & uhci Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1431085553-6055-16-git-send-email-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=arei.gonglei@huawei.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).