blob: 523e50380a165f5d37df74ad9cb122aea7f2436f [file] [log] [blame]
// Copyright 2020 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package wifi
import (
func init() {
Register: func(srv *grpc.Server, s *testing.ServiceState) {
wifi.RegisterIwlwifiPCIRescanServer(srv, &IwlwifiPCIRescanService{})
// IwlwifiPCIRescanService implements tast.cros.wifi.IwlwifiPCIRescan gRPC service.
type IwlwifiPCIRescanService struct{}
// RemoveIfaceAndWaitForRecovery triggers iwlwifi-rescan rule by removing the WiFi device.
// iwlwifi-rescan will rescan PCI bus and bring the WiFi device back.
func (s *IwlwifiPCIRescanService) RemoveIfaceAndWaitForRecovery(ctx context.Context, _ *empty.Empty) (*empty.Empty, error) {
if err := iwlwifirescan.RemoveIfaceAndWaitForRecovery(ctx); err != nil {
return nil, err
return &empty.Empty{}, nil