Hardware Proxy Access Control Methods
更新时间: 2025/10/15
在Gitcode上查看源码

Hardware Proxy Access Control Method

1. Overview

The hardware proxy provides access control capabilities for hardware devices and links. In specific scenarios (such as component upgrade and maintenance), access can be temporarily disabled or restored to prevent errors caused by unstable status, such as dirty data reading and operation failures.

2. Component Access Control

2.1 Interface Definition

Method: SetAccessibilityPath: /bmc/kepler/Chip/DeviceType/DeviceInstanceParameters:

  • Status (Boolean):
    • true: Enables component access (DisableDuration is ignored).
    • false: Disables component access (requires DisableDuration to specify the duration).
  • DisableDuration (integer, unit: seconds):
    • Range: 1 ≤ DisableDuration ≤ 1800. An error is returned if the value is out of range.
    • Takes effect only when Status=false. Access is automatically restored after the duration ends.

2.2 Operation Logic

  • Disabling access:
    • All operations (scanning, block read, block write, bit read, bit write) are blocked during the disabling period.
    • Access can be restored early by calling SetAccessibility(Status=true) again.
  • Automatic restoration: The component access status is automatically reset to enabled after the disabling duration ends.

2.3 Examples

bash
# Enable component access.
busctl --user call bmc.kepler.hwproxy /bmc/kepler/Chip/Eeprom/Eeprom_3_10_01 bmc.kepler.Chip SetAccessibility a{ss}bq 0 true 1

# Disable component access for 60 seconds.
busctl --user call bmc.kepler.hwproxy /bmc/kepler/Chip/Eeprom/Eeprom_3_10_01 bmc.kepler.Chip SetAccessibility a{ss}bq 0 false 60

3.1 Interface Definition

Method: SetAccessibilityPath: /bmc/kepler/Bus/BusType/BusInstanceParameters:

  • Status (Boolean):
    • true: Enables link access.
    • false: Disables link access (requires DisableDuration to specify the duration).
  • DisableDuration (integer, unit: seconds):
    • Follows the same rules as the component access control parameter (range: 1s to 1800s).

3.2 Key Features

  • Status priority:
    • When a link is disabled, you cannot set the access status for components under that link.
  • Timeout restoration:
    • Access is automatically restored after the duration ends.
    • You can query the current link status using the AccessEnabled interface.
    • The Timeout parameter displays the remaining restoration time (refreshed every 10s).

3.3 Examples

bash
# Disable I2C bus access (for 30 seconds).
busctl --user call bmc.kepler.hwproxy /bmc/kepler/Bus/I2c/I2c_1 bmc.kepler.Bus SetAccessibility a{ss}bq 0 false 30

# Restore I2C bus access.
busctl --user call bmc.kepler.hwproxy /bmc/kepler/Bus/I2c/I2c_1 bmc.kepler.Bus SetAccessibility a{ss}bq 0 true 1

4. Precautions

  1. Parameter validation:
    • The interface returns an error if DisableDuration is outside the range of 1s to 1800s.
  2. Status conflicts:
    • When a link is disabled, the access control interfaces for all components under it cannot be called.
  3. Timeout mechanism:
    • The system automatically removes the restriction after the duration ends, requiring no additional operation.
  4. Command syntax:
    • a{ss}bq in the busctl command is a fixed parameter type declaration and must remain unchanged.

Note: You are advised to use link-level control to override component-level configurations for access restrictions with a higher priority.