def METHOD_NAME(device):
    """Given a device name, return a dictionary containing keys:
       size: size of device in bytes
       bus:  bus type (eg USB, IDE)
       bus_path: identifier of bus endpoint (eg 1:0:0)
       hwinfo: string containing vendor, model, rev and type information"""
    results = {}
    sys = os.path.join("/sys/block", device)
    device = os.path.join(sys, "device")
    try:
        results["size"] = int(read_whole_file(os.path.join(sys, "size"))[0]) * 512
    except:
        pass
    results["bus"] = "Unrecognised bus type"
    results["bus_path"] = ""
    try:
        device_path = os.readlink(device)
        if device_path.find("/usb") != -1:
            results["bus"] = "USB"
            results["bus_path"] = os.path.basename(device_path)
        elif device_path.find("/ide") != -1:
            results["bus"] = "IDE"
            results["bus_path"] = os.path.basename(device_path)
        elif os.readlink(os.path.join(device, "subsystem")).endswith("scsi"):
            results["bus"] = "SCSI"
            results["bus_path"] = os.path.basename(device_path)
        real_path = os.path.realpath(device)
        if "/usb" in real_path:
            results["usb_path"] = get_usb_node(real_path)
    except:
        pass
    # Work out the vendor/model/rev info
    results["hwinfo"] = ""
    for field, fmt in [("vendor", "%s"), ("model", "model %s"), ("rev", "rev %s"), ("type", "type %s")]:
        try:
            value = read_whole_file(os.path.join(device, field))[0].strip()
            value = fmt % value
            if results["hwinfo"] != "":
                results["hwinfo"] = results["hwinfo"] + " " + value
            else:
                results["hwinfo"] = value
        except:
            pass
    return results