#!/bin/sh

set -e

filename="$1"

[ -e "$filename" ] || {
    echo "USAGE: $0 path/to/ath_pci.ko" >&2
    exit 1
}

echo "# Listing generated by ath_hal_supported. Do not edit manually."

/sbin/modinfo -F alias "$filename" | sort | uniq | while read pattern; do
    case "$pattern" in
    pci:*|usb:*)
        echo "alias $pattern ath_hal"
        ;;
    esac
done
