<!--
{
  "availability" : [
    "DriverKit: -",
    "iOS: -",
    "iPadOS: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "DriverKit",
  "identifier" : "/documentation/DriverKit/IOReporter_IVars/getChannelIndex",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "DriverKit"
    ],
    "preciseIdentifier" : "c:@S@IOReporter_IVars@F@getChannelIndex#k#*I#"
  },
  "title" : "getChannelIndex"
}
-->

# getChannelIndex

```
virtual IOReturn getChannelIndex(uint64_t channel_id, int *channel_index);
```

## Parameters

`channel_id`

- ID of the channel

`channel_index`

- pointer to the returned element_index

## Return Value

appropriate IOReturn code

## Discussion

\abstract Returns the index of a channel from internal data structures
\discussion For efficiently and thread-safely reading channels

Locking: Caller must ensure that the reporter (data) lock is held.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)