Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VPCI code cleanup/reorg #3334

Merged
merged 6 commits into from
Jun 27, 2019
Merged

VPCI code cleanup/reorg #3334

merged 6 commits into from
Jun 27, 2019

Commits on Jun 26, 2019

  1. HV: remove unused function find_pci_pdev

    find_pci_pdev is not used any more, remove it.
    
    Tracked-On: #3241
    Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
    Acked-by: Eddie Dong <eddie.dong@intel.com>
    donsheng committed Jun 26, 2019
    Configuration menu
    Copy the full SHA
    dd5e20b View commit details
    Browse the repository at this point in the history

Commits on Jun 27, 2019

  1. HV: for PCI cardbus device, its capability offset is at offset 0x14

    Add get_offset_of_caplist() function to return capability offset based on header type:
    For normal pci device and bridge, its capability offset is at offset 0x34
    For cardbus, its capability offset is at offset 0x14
    
    Tracked-On: #3241
    Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
    Reviewed-by: Eddie Dong <eddie.dong@intel.com>
    donsheng committed Jun 27, 2019
    Configuration menu
    Copy the full SHA
    7fb445a View commit details
    Browse the repository at this point in the history
  2. HV: add union pci_bar and is_64bit_high to struct pci_bar

    union pci_bar uses bit fields and follows the PCI bar spec definition to define the
    bar flags portion and base address, this is to keep the same hardware format for vbar
    register. The base/type of union pci_bar are still kept to minimize code changes
    in one patch, they will be removed in subsequent patches.
    
    define pci_pdev_get_bar_base() function to extract bar base address given a 32-bit raw
    bar value
    
    define a utility function pci_get_bar_type() to extract bar types
    from raw bar value to simply code, as this function will be used in multiple
    places later on: this function can be called on reg->value stored in struct
    pci_bar to derive bar type.
    
    Tracked-On: #3241
    Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
    Reviewed-by: Eddie Dong <eddie.dong@intel.com>
    donsheng committed Jun 27, 2019
    Configuration menu
    Copy the full SHA
    55b97b8 View commit details
    Browse the repository at this point in the history
  3. HV: add uint32_t nr_bars to struct struct pci_pdev to track # of bars

    nr_bars in struct pci_pdev is used to store the actual # of bars (
    6 for normal pci device and 2 for pci bridge), nr_bars will be used in subsequent
    patches
    
    Use uint32_t for bar related variables (bar index, etc) to unify the bar
    related code (no casting between uint32_t and uint8_t)
    
    Tracked-On: #3241
    Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
    Acked-by: Eddie Dong <eddie.dong@intel.com>
    donsheng committed Jun 27, 2019
    Configuration menu
    Copy the full SHA
    e05c093 View commit details
    Browse the repository at this point in the history
  4. HV: move bar access and alignment checking out of vdev_pt_write_vbar

    And put the checking in vdev_pt_write_cfg instead to have less nesting in
    vdev_pt_write_vbar to improve code readability.
    
    Rename function:
    vdev_pt_remap_generic_bar --> vdev_pt_remap_generic_mem_vbar
    
    vdev_pt_read_cfg's function declaration is merged into one line instead of 2
    lines
    
    Tracked-On: #3241
    Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
    Reviewed-by: Eddie Dong <eddie.dong@intel.com>
    donsheng committed Jun 27, 2019
    Configuration menu
    Copy the full SHA
    068b3a6 View commit details
    Browse the repository at this point in the history
  5. HV: add uint32_t nr_bars to struct pci_vdev

    Use nr_bars instead of PCI_BAR_COUNT to check bar access offset.
    As while normal pci device has max 6 bars, pci bridge only has 2 bars,
    so for pci normal pci device, pci cfg offsets 0x10-0x24 are for bar access,
    but for pci bridge, only 0x10-0x14 are for bar access (0x18-0x24 are
    for other accesses).
    
    Rename function:
     pci_bar_access --> is_bar_offset
    
    Tracked-On: #3241
    Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
    Acked-by: Eddie Dong <eddie.dong@intel.com>
    donsheng committed Jun 27, 2019
    Configuration menu
    Copy the full SHA
    2829191 View commit details
    Browse the repository at this point in the history