Changeset ebb1489 in mainline for uspace/drv/bus/isa/isa.c


Ignore:
Timestamp:
2024-10-13T08:23:40Z (8 weeks ago)
Author:
GitHub <noreply@…>
Children:
0472cf17
Parents:
2a0c827c (diff), b3b79981 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
boba-buba <120932204+boba-buba@…> (2024-10-13 08:23:40)
git-committer:
GitHub <noreply@…> (2024-10-13 08:23:40)
Message:

Merge branch 'HelenOS:master' into topic/packet-capture

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/isa/isa.c

    r2a0c827c rebb1489  
    11/*
    2  * Copyright (c) 2018 Jiri Svoboda
     2 * Copyright (c) 2024 Jiri Svoboda
    33 * Copyright (c) 2010 Lenka Trochtova
    44 * Copyright (c) 2011 Jan Vesely
     
    7272#define EBUS_CHILD_FUN_CONF_PATH "/drv/isa/ebus.dev"
    7373
    74 #define ISA_MAX_HW_RES 5
     74#define ISA_MAX_HW_RES 6
    7575
    7676typedef struct {
    7777        fibril_mutex_t mutex;
     78        bool pci_isa_bridge;
    7879        uint16_t pci_vendor_id;
    7980        uint16_t pci_device_id;
     
    9293        hw_resource_list_t hw_resources;
    9394        link_t bus_link;
     95        isa_bus_t *bus;
    9496} isa_fun_t;
    9597
     
    204206}
    205207
     208static errno_t isa_fun_get_flags(ddf_fun_t *fnode, hw_res_flags_t *rflags)
     209{
     210        isa_fun_t *fun = isa_fun(fnode);
     211        hw_res_flags_t flags;
     212
     213        flags = 0;
     214        if (fun->bus->pci_isa_bridge)
     215                flags |= hwf_isa_bridge;
     216
     217        ddf_msg(LVL_NOTE, "isa_fun_get_flags: returning 0x%x", flags);
     218        *rflags = flags;
     219        return EOK;
     220}
     221
    206222static hw_res_ops_t isa_fun_hw_res_ops = {
    207223        .get_resource_list = isa_fun_get_resources,
     
    211227        .dma_channel_setup = isa_fun_setup_dma,
    212228        .dma_channel_remain = isa_fun_remain_dma,
     229        .get_flags = isa_fun_get_flags
    213230};
    214231
     
    264281        fibril_mutex_initialize(&fun->mutex);
    265282        fun->hw_resources.resources = fun->resources;
     283        fun->bus = isa;
    266284
    267285        fun->fnode = fnode;
     
    743761        if (rc != EOK) {
    744762                ddf_msg(LVL_NOTE, "Cannot read PCI config. Assuming ISA classic.");
     763                isa->pci_isa_bridge = false;
    745764                isa->pci_vendor_id = 0;
    746765                isa->pci_device_id = 0;
    747766                isa->pci_class = BASE_CLASS_BRIDGE;
    748767                isa->pci_subclass = SUB_CLASS_BRIDGE_ISA;
     768        } else {
     769                ddf_msg(LVL_NOTE, "ISA Bridge");
     770                isa->pci_isa_bridge = true;
    749771        }
    750772
Note: See TracChangeset for help on using the changeset viewer.